diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index ee6f6171..815cdbee 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -14,7 +14,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go-version: [1.15.x, 1.14.x] + go-version: [1.16.x,1.15.x] os: [ubuntu-latest, macos-latest, windows-latest] name: Test ${{ matrix.os }} with Go ${{ matrix.go-version }} diff --git a/.golangci.yml b/.golangci.yml index 94badfc3..c1a69d9f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,19 +6,21 @@ run: timeout: 5m linters: + enable-all: false enable: - megacheck - govet - gocyclo - unused - gofmt - - golint + - revive - misspell - enable-all: false + - exportloopref + disable-all: false disable: - maligned - prealloc - disable-all: false + - scopelint presets: - bugs - unused diff --git a/README.adoc b/README.adoc index d033f752..2ba42394 100644 --- a/README.adoc +++ b/README.adoc @@ -76,11 +76,11 @@ Libasciidoc provides 2 functions to convert an Asciidoc content into HTML: 1. Converting an `io.Reader` into an HTML document: - Convert(r io.Reader, output io.Writer, config configuration.Configuration) (types.Metadata, error) + Convert(r io.Reader, output io.Writer, config *configuration.Configuration) (types.Metadata, error) 2. Converting a file (given its name) into an HTML document: - ConvertFile(output io.Writer, config configuration.Configuration) (types.Metadata, error) + ConvertFile(output io.Writer, config *configuration.Configuration) (types.Metadata, error) where the returned `types.Metadata` object contains the document's title which is not part of the generated HTML `` part, as well as the other attributes of the source document. diff --git a/cmd/libasciidoc/root_cmd.go b/cmd/libasciidoc/root_cmd.go index ef2560e1..f3eb5cd6 100644 --- a/cmd/libasciidoc/root_cmd.go +++ b/cmd/libasciidoc/root_cmd.go @@ -53,7 +53,6 @@ func NewRootCmd() *cobra.Command { out, close := getOut(cmd, sourcePath, outputName) if out != nil { defer close() //nolint errcheck - // path, _ := filepath.Abs(sourcePath) // log.Debugf("Starting to process file %v", path) config := configuration.NewConfiguration( configuration.WithFilename(sourcePath), @@ -119,8 +118,8 @@ func getOut(cmd *cobra.Command, sourcePath, outputName string) (io.Writer, close } // converts the `name`, `!name` and `name=value` into a map -func parseAttributes(attributes []string) map[string]string { - result := make(map[string]string, len(attributes)) +func parseAttributes(attributes []string) map[string]interface{} { + result := make(map[string]interface{}, len(attributes)) for _, attr := range attributes { data := strings.Split(attr, "=") if len(data) > 1 { diff --git a/cmd/libasciidoc/root_cmd_test.go b/cmd/libasciidoc/root_cmd_test.go index 87c1ea2f..6b39509f 100644 --- a/cmd/libasciidoc/root_cmd_test.go +++ b/cmd/libasciidoc/root_cmd_test.go @@ -49,7 +49,6 @@ var _ = Describe("root cmd", func() { // when err := root.Execute() // then - GinkgoT().Logf("command output: %v", buf.String()) Expect(err).To(HaveOccurred()) }) @@ -93,11 +92,10 @@ var _ = Describe("root cmd", func() { // when err := root.Execute() // then - GinkgoT().Logf("out: %v", buf.String()) Expect(err).ToNot(HaveOccurred()) Expect(buf.String()).ToNot(BeEmpty()) // console output also includes a warning message - Expect(buf.String()).To(Equal(`level=warning msg="unable to find attribute 'foo2'" + Expect(buf.String()).To(ContainSubstring(`level=warning msg="unable to find attribute 'foo2'"

bar1 and {foo2}

diff --git a/go.mod b/go.mod index b7e0cd82..1f3586fe 100644 --- a/go.mod +++ b/go.mod @@ -5,22 +5,24 @@ go 1.11 require ( github.com/alecthomas/chroma v0.7.1 github.com/davecgh/go-spew v1.1.1 - github.com/google/go-cmp v0.5.2 // indirect + github.com/google/go-cmp v0.5.5 github.com/kr/text v0.2.0 // indirect github.com/mattn/go-isatty v0.0.12 // indirect - github.com/mna/pigeon v1.0.1-0.20200224192238-18953b277063 + github.com/mna/pigeon v1.1.0 github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5 // indirect github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect - github.com/onsi/ginkgo v1.13.0 - github.com/onsi/gomega v1.10.1 + github.com/onsi/ginkgo v1.16.4 + github.com/onsi/gomega v1.13.0 github.com/pkg/errors v0.9.1 github.com/sergi/go-diff v1.0.0 github.com/sirupsen/logrus v1.7.0 github.com/sozorogami/gover v0.0.0-20171022184752-b58185e213c5 github.com/spf13/cobra v1.1.1 github.com/stretchr/testify v1.6.1 - golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634 // indirect - golang.org/x/tools v0.0.0-20201013201025-64a9e34f3752 // indirect gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect - gopkg.in/yaml.v2 v2.3.0 + gopkg.in/yaml.v2 v2.4.0 ) + +// include support for disabling unexported fields +// TODO: still needed? +replace github.com/davecgh/go-spew => github.com/flw-cn/go-spew v1.1.2-0.20200624141737-10fccbfd0b23 diff --git a/go.sum b/go.sum index dad7bb96..a6b5ad53 100644 --- a/go.sum +++ b/go.sum @@ -52,6 +52,8 @@ github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8 github.com/dlclark/regexp2 v1.1.6 h1:CqB4MjHw0MFCDj+PHHjiESmHX+N7t0tJzKvC6M97BRg= github.com/dlclark/regexp2 v1.1.6/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/flw-cn/go-spew v1.1.2-0.20200624141737-10fccbfd0b23 h1:hcH6hdfuN3oU94k8k6HYHuc1TBUpWEtZ9V/TtxmNlKM= +github.com/flw-cn/go-spew v1.1.2-0.20200624141737-10fccbfd0b23/go.mod h1:f5Lwu6V+lQV39V4TFEDGt+t0gOZunbo+MKa0nBOX5+U= github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= @@ -62,6 +64,8 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= @@ -81,14 +85,17 @@ github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:W github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -161,8 +168,8 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mna/pigeon v1.0.1-0.20200224192238-18953b277063 h1:V7s6vhIrNeOqocziAmRoVJh6gnPPx83ovlpT7Hf5shI= -github.com/mna/pigeon v1.0.1-0.20200224192238-18953b277063/go.mod h1:rkFeDZ0gc+YbnrXPw0q2RlI0QRuKBBPu67fgYIyGRNg= +github.com/mna/pigeon v1.1.0 h1:EjlvVbkGnNGemf8OrjeJX0nH8orujY/HkJgzJtd7kxc= +github.com/mna/pigeon v1.1.0/go.mod h1:rkFeDZ0gc+YbnrXPw0q2RlI0QRuKBBPu67fgYIyGRNg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5 h1:8Q0qkMVC/MmWkpIdlvZgcv2o2jrlF6zqVOh7W5YHdMA= @@ -172,14 +179,19 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWb github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.13.0 h1:M76yO2HkZASFjXL0HSoZJ1AYEmQxNJmY41Jx1zNUq1Y= -github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0= +github.com/onsi/ginkgo v1.16.2/go.mod h1:CObGmKUOKaSC0RjmoAK7tKyn4Azo5P2IWuoMnvwxz1E= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.13.0 h1:7lLHu94wT9Ij0o6EWWclhu0aOh32VxhkwEJvzuWPeak= +github.com/onsi/gomega v1.13.0/go.mod h1:lRk9szgn8TxENtWd0Tp4c3wjlRfMTMH27I+3Je41yGY= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= @@ -204,7 +216,6 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= @@ -238,6 +249,7 @@ github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= @@ -297,8 +309,9 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= -golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781 h1:DzZ89McO9/gWPsQXS/FVKAlG02ZjaQ6AlZRBimEYOd0= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -309,7 +322,7 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -335,14 +348,20 @@ golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634 h1:bNEHhJCnrwMKNMmOx3yAynp5vs5/gRy+XWFtZFu7NBM= -golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -364,8 +383,8 @@ golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtn golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20201013201025-64a9e34f3752 h1:2ntEwh02rqo2jSsrYmp4yKHHjh0CbXP3ZtSUetSB+q8= -golang.org/x/tools v0.0.0-20201013201025-64a9e34f3752/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e h1:4nW4NLDYnU28ojHaHO8OVxFHk/aQ33U01a9cjED+pzE= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -401,6 +420,9 @@ google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miE google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -417,10 +439,13 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/libasciidoc.go b/libasciidoc.go index 704794a3..61e65367 100644 --- a/libasciidoc.go +++ b/libasciidoc.go @@ -33,7 +33,7 @@ var ( // ConvertFile converts the content of the given filename into an output document. // The conversion result is written in the given writer `output`, whereas the document metadata (title, etc.) (or an error if a problem occurred) is returned // as the result of the function call. The output format is determined by config.Backend (HTML5 default). -func ConvertFile(output io.Writer, config configuration.Configuration) (types.Metadata, error) { +func ConvertFile(output io.Writer, config *configuration.Configuration) (types.Metadata, error) { file, err := os.Open(config.Filename) if err != nil { return types.Metadata{}, errors.Wrapf(err, "error opening %s", config.Filename) @@ -50,9 +50,9 @@ func ConvertFile(output io.Writer, config configuration.Configuration) (types.Me // Convert converts the content of the given reader `r` into a full output document, written in the given writer `output`. // Returns an error if a problem occurred. The default will be HTML5, but depends on the config.BackEnd value. -func Convert(r io.Reader, output io.Writer, config configuration.Configuration) (types.Metadata, error) { +func Convert(r io.Reader, output io.Writer, config *configuration.Configuration) (types.Metadata, error) { - var render func(*renderer.Context, types.Document, io.Writer) (types.Metadata, error) + var render func(*renderer.Context, *types.Document, io.Writer) (types.Metadata, error) switch config.BackEnd { case "html", "html5", "": render = html5.Render @@ -73,16 +73,22 @@ func Convert(r io.Reader, output io.Writer, config configuration.Configuration) return types.Metadata{}, err } // validate the document - problems, err := validator.Validate(&doc) + doctype := config.Attributes.GetAsStringWithDefault(types.AttrDocType, "article") + problems, err := validator.Validate(doc, doctype) if err != nil { return types.Metadata{}, err } - for _, problem := range problems { - switch problem.Severity { - case validator.Error: - log.Error(problem.Message) - case validator.Warning: - log.Warn(problem.Message) + if len(problems) > 0 { + // if any problem found, change the doctype to render the document as a regular article + log.Warnf("changing doctype to 'article' because problems were found in the document: %v", problems) + config.Attributes[types.AttrDocType] = "article" // switch to `article` rendering (in case it was a manpage with problems) + for _, problem := range problems { + switch problem.Severity { + case validator.Error: + log.Error(problem.Message) + case validator.Warning: + log.Warn(problem.Message) + } } } // render diff --git a/libasciidoc_bench_test.go b/libasciidoc_bench_test.go index 4dbc7784..f60c299b 100644 --- a/libasciidoc_bench_test.go +++ b/libasciidoc_bench_test.go @@ -1,16 +1,140 @@ package libasciidoc_test import ( + "strings" "testing" + "github.com/bytesparadise/libasciidoc" + "github.com/bytesparadise/libasciidoc/pkg/configuration" + "github.com/bytesparadise/libasciidoc/pkg/types" "github.com/bytesparadise/libasciidoc/testsupport" + + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) -func BenchmarkLibasciidoc(b *testing.B) { +// TODO: unexclude this bench func +func XBenchmarkRenderRealDocument(b *testing.B) { filename := "./test/bench/mocking.adoc" for i := 0; i < b.N; i++ { - _, err := testsupport.RenderHTML5Document(filename) + out := &strings.Builder{} + _, err := libasciidoc.ConvertFile(out, + configuration.NewConfiguration( + configuration.WithFilename(filename), + configuration.WithCSS("path/to/style.css"), + configuration.WithHeaderFooter(true))) + require.NoError(b, err) + } +} + +func BenchmarkParseBasicDocument(b *testing.B) { + content := `== Lorem Ipsum + +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, +sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. +At vero eos et accusam et justo duo dolores et ea rebum. +Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, +sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. +At vero eos et accusam et justo duo dolores et ea rebum. +Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.` + + for i := 0; i < b.N; i++ { + _, err := testsupport.ParseDocument(content) + require.NoError(b, err) + } +} + +func BenchmarkParseLongDocument(b *testing.B) { + content := strings.Builder{} + for i := 0; i < 50; i++ { + content.WriteString(`== Lorem Ipsum + +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, +sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. +At vero eos et accusam et justo duo dolores et ea rebum. +Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, +sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. +At vero eos et accusam et justo duo dolores et ea rebum. +Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. + +`) + } + for i := 0; i < b.N; i++ { + _, err := testsupport.ParseDocument(content.String()) require.NoError(b, err) } } + +func TestParseBasicDocument(t *testing.T) { + source := `== Lorem Ipsum + +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, +sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. +At vero eos et accusam et justo duo dolores et ea rebum. +Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, +sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. +At vero eos et accusam et justo duo dolores et ea rebum. +Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit *amet*.` + + title := []interface{}{ + &types.StringElement{ + Content: "Lorem Ipsum", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_lorem_ipsum", + }, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, +sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. +At vero eos et accusam et justo duo dolores et ea rebum. +Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, +sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. +At vero eos et accusam et justo duo dolores et ea rebum. +Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit `, + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "amet", + }, + }, + }, + &types.StringElement{ + Content: ".", + }, + }, + }, + }, + }, + }, + ElementReferences: types.ElementReferences{ + "_lorem_ipsum": title, + }, + } + result, err := testsupport.ParseDocument(source) + require.NoError(t, err) + assert.Equal(t, expected, result) + +} diff --git a/libasciidoc_test.go b/libasciidoc_test.go index 92d783ad..2d44270d 100644 --- a/libasciidoc_test.go +++ b/libasciidoc_test.go @@ -2,8 +2,10 @@ package libasciidoc_test import ( "os" + "strings" "time" + "github.com/bytesparadise/libasciidoc" "github.com/bytesparadise/libasciidoc/pkg/configuration" "github.com/bytesparadise/libasciidoc/pkg/types" . "github.com/bytesparadise/libasciidoc/testsupport" @@ -122,17 +124,17 @@ a paragraph` Title: "a document title", LastUpdated: lastUpdated.Format(configuration.LastUpdatedFormat), TableOfContents: types.TableOfContents{ - Sections: []types.ToCSection{ + Sections: []*types.ToCSection{ { ID: "_section_a", Level: 1, Title: "Section A", - Children: []types.ToCSection{ + Children: []*types.ToCSection{ { ID: "_section_a_a_a", Level: 3, Title: "Section A.a.a", - Children: []types.ToCSection{}, + Children: []*types.ToCSection{}, }, }, }, @@ -185,17 +187,17 @@ a paragraph with _italic content_` Title: "a document title", LastUpdated: lastUpdated.Format(configuration.LastUpdatedFormat), TableOfContents: types.TableOfContents{ - Sections: []types.ToCSection{ + Sections: []*types.ToCSection{ { ID: "_section_a", Level: 1, Title: "Section A", - Children: []types.ToCSection{ + Children: []*types.ToCSection{ { ID: "_section_a_a", Level: 2, Title: "Section A.a", - Children: []types.ToCSection{}, + Children: []*types.ToCSection{}, }, }, }, @@ -203,7 +205,7 @@ a paragraph with _italic content_` ID: "_section_b", Level: 1, Title: "Section B", - Children: []types.ToCSection{}, + Children: []*types.ToCSection{}, }, }, }, @@ -229,12 +231,12 @@ a paragraph with _italic content_` Title: "", LastUpdated: lastUpdated.Format(configuration.LastUpdatedFormat), TableOfContents: types.TableOfContents{ - Sections: []types.ToCSection{ + Sections: []*types.ToCSection{ { ID: "_grandchild_title", Level: 1, Title: "grandchild title", - Children: []types.ToCSection{}, + Children: []*types.ToCSection{}, }, }, }, @@ -275,7 +277,36 @@ Last updated {{.LastUpdated}} filename := "test/includes/chapter-a.adoc" stat, err := os.Stat(filename) Expect(err).NotTo(HaveOccurred()) - Expect(RenderHTML5Document(filename, configuration.WithCSS("path/to/style.css"), configuration.WithHeaderFooter(true))).To(MatchHTMLTemplate(expectedContent, stat.ModTime())) + out := &strings.Builder{} + _, err = libasciidoc.ConvertFile(out, + configuration.NewConfiguration( + configuration.WithFilename(filename), + configuration.WithCSS("path/to/style.css"), + configuration.WithHeaderFooter(true))) + Expect(err).NotTo(HaveOccurred()) + Expect(out.String()).To(MatchHTMLTemplate(expectedContent, stat.ModTime())) + }) + + It("should render with html5 backend without failure", func() { + out := &strings.Builder{} + _, err := libasciidoc.ConvertFile(out, + configuration.NewConfiguration( + configuration.WithFilename("test/article.adoc"), + configuration.WithBackEnd("html5"), + configuration.WithCSS("path/to/style.css"), + configuration.WithHeaderFooter(true))) + Expect(err).NotTo(HaveOccurred()) + }) + + It("should render with xhtml5 backend without failure", func() { + out := &strings.Builder{} + _, err := libasciidoc.ConvertFile(out, + configuration.NewConfiguration( + configuration.WithFilename("test/article.adoc"), + configuration.WithBackEnd("xhtml5"), + configuration.WithCSS("path/to/style.css"), + configuration.WithHeaderFooter(true))) + Expect(err).NotTo(HaveOccurred()) }) }) }) @@ -324,7 +355,15 @@ Free use of this software is granted under the terms of the MIT License.

` - Expect(RenderHTML(source, configuration.WithAttribute(types.AttrDocType, "manpage"))).To(Equal(expectedContent)) + out := &strings.Builder{} + _, err := libasciidoc.Convert( + strings.NewReader(source), + out, + configuration.NewConfiguration( + configuration.WithAttribute(types.AttrDocType, "manpage"), + )) + Expect(err).NotTo(HaveOccurred()) + Expect(out.String()).To(MatchHTML(expectedContent)) }) }) @@ -395,11 +434,18 @@ Last updated {{.LastUpdated}} ` - Expect(RenderHTML(source, - configuration.WithAttribute(types.AttrDocType, "manpage"), - configuration.WithLastUpdated(lastUpdated), - configuration.WithCSS("path/to/style.css"), - configuration.WithHeaderFooter(true))).To(MatchHTMLTemplate(expectedContent, lastUpdated)) + out := &strings.Builder{} + _, err := libasciidoc.Convert( + strings.NewReader(source), + out, + configuration.NewConfiguration( + configuration.WithAttribute(types.AttrDocType, "manpage"), + configuration.WithLastUpdated(lastUpdated), + configuration.WithCSS("path/to/style.css"), + configuration.WithHeaderFooter(true), + )) + Expect(err).NotTo(HaveOccurred()) + Expect(out.String()).To(MatchHTMLTemplate(expectedContent, lastUpdated)) }) It("should render invalid manpage as article", func() { @@ -475,11 +521,18 @@ Last updated {{.LastUpdated}} ` - Expect(RenderHTML(source, - configuration.WithAttribute(types.AttrDocType, "manpage"), - configuration.WithLastUpdated(lastUpdated), - configuration.WithCSS("path/to/style.css"), - configuration.WithHeaderFooter(true))).To(MatchHTMLTemplate(expectedContent, lastUpdated)) + out := &strings.Builder{} + _, err := libasciidoc.Convert( + strings.NewReader(source), + out, + configuration.NewConfiguration( + configuration.WithAttribute(types.AttrDocType, "manpage"), + configuration.WithLastUpdated(lastUpdated), + configuration.WithCSS("path/to/style.css"), + configuration.WithHeaderFooter(true), + )) + Expect(err).NotTo(HaveOccurred()) + Expect(out.String()).To(MatchHTMLTemplate(expectedContent, lastUpdated)) }) It("should render html", func() { @@ -512,13 +565,20 @@ Last updated {{.LastUpdated}} ` - Expect(Render(source, - configuration.WithBackEnd("html5"), - configuration.WithLastUpdated(lastUpdated), - configuration.WithHeaderFooter(true))).To(MatchHTMLTemplate(expectedContent, lastUpdated)) + out := &strings.Builder{} + _, err := libasciidoc.Convert( + strings.NewReader(source), + out, + configuration.NewConfiguration( + configuration.WithLastUpdated(lastUpdated), + configuration.WithBackEnd("html5"), + configuration.WithHeaderFooter(true), + )) + Expect(err).NotTo(HaveOccurred()) + Expect(out.String()).To(MatchHTMLTemplate(expectedContent, lastUpdated)) }) - It("should render xhtml", func() { + It("should render with xhtml5 backend", func() { source := `= Story Our story begins.` @@ -548,25 +608,35 @@ Last updated {{.LastUpdated}} ` - Expect(Render(source, - configuration.WithBackEnd("xhtml5"), - configuration.WithLastUpdated(lastUpdated), - configuration.WithHeaderFooter(true))).To(MatchHTMLTemplate(expectedContent, lastUpdated)) + out := &strings.Builder{} + _, err := libasciidoc.Convert( + strings.NewReader(source), + out, + configuration.NewConfiguration( + configuration.WithLastUpdated(lastUpdated), + configuration.WithBackEnd("xhtml5"), + configuration.WithHeaderFooter(true), + )) + Expect(err).NotTo(HaveOccurred()) + Expect(out.String()).To(MatchHTMLTemplate(expectedContent, lastUpdated)) }) It("should fail given bogus backend", func() { source := `= Story Our story begins.` - doc, err := Render(source, - configuration.WithBackEnd("wordperfect"), - configuration.WithLastUpdated(lastUpdated), - configuration.WithHeaderFooter(true)) - Expect(doc).To(BeEmpty()) + out := &strings.Builder{} + _, err := libasciidoc.Convert( + strings.NewReader(source), + out, + configuration.NewConfiguration( + configuration.WithBackEnd("wordperfect"), + configuration.WithLastUpdated(lastUpdated), + configuration.WithHeaderFooter(true), + )) Expect(err).To(MatchError("backend 'wordperfect' not supported")) }) - }) - }) + }) diff --git a/make/bench.mk b/make/bench.mk index 3861a710..932c82e3 100644 --- a/make/bench.mk +++ b/make/bench.mk @@ -1,7 +1,8 @@ .PHONY: bench ## run the top-level benchmarks -bench: generate-optimized +bench: clean generate-optimized @mkdir -p ./tmp/bench/reports + @go test github.com/bytesparadise/libasciidoc -run TestParseBasicDocument @go test -bench=. -benchmem -count=10 -run=XXX \ github.com/bytesparadise/libasciidoc \ | tee tmp/bench/reports/$(GIT_BRANCH_NAME)-$(GIT_COMMIT_ID_SHORT).bench @@ -13,9 +14,9 @@ bench-smoke: generate-optimized @go test -bench=. -benchmem -benchtime=1x -run=XXX \ github.com/bytesparadise/libasciidoc -.PHONY: bench-parser -## run the benchmarks on the parser -bench-parser: generate - @ginkgo -tags bench -focus "real-world doc-based benchmarks" -memprofile=./tmp/bench/bench.memory pkg/parser - @ginkgo -tags bench -focus "basic stats" pkg/parser +# .PHONY: bench-parser +# ## run the benchmarks on the parser +# bench-parser: generate +# @ginkgo -tags bench -focus "real-world doc-based benchmarks" -memprofile=./tmp/bench/bench.memory pkg/parser +# @ginkgo -tags bench -focus "basic stats" pkg/parser diff --git a/make/clean.mk b/make/clean.mk index b12f5953..7c5bb578 100644 --- a/make/clean.mk +++ b/make/clean.mk @@ -1,2 +1,2 @@ clean: - @rm pkg/parser/parser.go \ No newline at end of file + @-rm pkg/parser/parser.go \ No newline at end of file diff --git a/make/go.mk b/make/go.mk index 4363a0a0..aa1b7790 100644 --- a/make/go.mk +++ b/make/go.mk @@ -37,16 +37,28 @@ generate: install-pigeon @if [ "pkg/parser/parser.go" -ot "pkg/parser/parser.peg" ]; then \ echo "generating the parser..."; \ pigeon ./pkg/parser/parser.peg > ./pkg/parser/parser.go; \ + echo "done"; \ else \ echo "no need to regenerate the parser."; \ fi; +.PHONY: verify-parser +## verify that the parser was built with the latest version of pigeon, using the `optimize-grammar` option +verify-parser: prebuild-checks clean generate-optimized +ifneq ($(shell git diff --quiet pkg/parser/parser.go; echo $$?), 0) + @git diff pkg/parser/parser.go + $(error "pkg/parser/parser.go is uncommited or was generated with an older version of 'mna/pigeon' or without the '-optimize-parser' option enabled.") +else + @echo "generated parser is ok" +endif + .PHONY: generate-optimized ## generate the .go file based on the asciidoc grammar generate-optimized: install-pigeon @if [ "pkg/parser/parser.go" -ot "pkg/parser/parser.peg" ]; then \ echo "generating the parser (optimized)..."; \ go generate ./...; \ + echo "done"; \ else \ echo "no need to regenerate the parser."; \ fi; @@ -54,7 +66,7 @@ generate-optimized: install-pigeon .PHONY: build ## build the binary executable from CLI -build: prebuild-checks verify-parser generate-optimized +build: prebuild-checks clean generate-optimized $(eval BUILD_COMMIT:=$(shell git rev-parse --short HEAD)) $(eval BUILD_TAG:=$(shell git tag --contains $(BUILD_COMMIT))) $(eval BUILD_TIME:=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ')) @@ -68,33 +80,8 @@ build: prebuild-checks verify-parser generate-optimized PARSER_DIFF_STATUS := -.PHONY: verify-parser -## verify that the parser was built with the latest version of pigeon, using the `optimize-grammar` option -verify-parser: prebuild-checks -ifneq ($(shell git diff --quiet pkg/parser/parser.go; echo $$?), 0) - @git diff pkg/parser/parser.go - $(error "parser was generated with an older version of 'mna/pigeon' or without the '-optimize-parser' option enabled.") -else - @echo "generated parser is ok" -endif - .PHONY: install ## installs the binary executable in the $GOPATH/bin directory install: build @cp $(BINARY_PATH) $(GOPATH)/bin -.PHONY: quick-install -## installs the binary executable in the $GOPATH/bin directory without prior tools setup and parser generation -quick-install: - $(eval BUILD_COMMIT:=$(shell git rev-parse --short HEAD)) - $(eval BUILD_TAG:=$(shell git tag --contains $(BUILD_COMMIT))) - $(eval BUILD_TIME:=$(shell date -u '+%Y-%m-%dT%H:%M:%SZ')) - @echo "building $(BINARY_PATH) (commit:$(BUILD_COMMIT) / tag:$(BUILD_TAG) / time:$(BUILD_TIME))" - @go build -ldflags \ - " -X github.com/bytesparadise/libasciidoc.BuildCommit=$(BUILD_COMMIT)\ - -X github.com/bytesparadise/libasciidoc.BuildTag=$(BUILD_TAG) \ - -X github.com/bytesparadise/libasciidoc.BuildTime=$(BUILD_TIME)" \ - -o $(BINARY_PATH) \ - cmd/libasciidoc/*.go - @cp $(BINARY_PATH) $(GOPATH)/bin - diff --git a/make/lint.mk b/make/lint.mk index 86c8c4b0..0f8a4d4b 100644 --- a/make/lint.mk +++ b/make/lint.mk @@ -6,4 +6,4 @@ install-golangci-lint: .PHONY: lint ## run golangci-lint against project lint: install-golangci-lint - @$(shell go env GOPATH)/bin/golangci-lint run -c .golangci.yml ./... + @$(shell go env GOPATH)/bin/golangci-lint run -v -c .golangci.yml ./... diff --git a/make/test.mk b/make/test.mk index 7f6b24ff..38b09a56 100644 --- a/make/test.mk +++ b/make/test.mk @@ -10,7 +10,7 @@ install-gover: .PHONY: test ## run all tests excluding fixtures and vendored packages -test: generate-optimized install-ginkgo +test: clean generate-optimized install-ginkgo @ginkgo -r --randomizeAllSpecs --randomizeSuites --failOnPending --trace --race --compilers=0 COVERPKGS := $(shell go list ./... | grep -v vendor | paste -sd "," -) @@ -25,4 +25,4 @@ test-with-coverage: generate-optimized install-ginkgo install-gover .PHONY: test-fixtures ## run all fixtures tests test-fixtures: generate-optimized - @ginkgo -r --randomizeAllSpecs --randomizeSuites --failOnPending --trace --race --compilers=2 -tags=fixtures --focus=fixtures + @ginkgo -r --randomizeAllSpecs --randomizeSuites --failOnPending --trace --race --compilers=0 -tags=fixtures --focus=fixtures diff --git a/pkg/configuration/configuration.go b/pkg/configuration/configuration.go index 4c10c3d8..7cc7e054 100644 --- a/pkg/configuration/configuration.go +++ b/pkg/configuration/configuration.go @@ -2,25 +2,28 @@ package configuration import ( "time" + + "github.com/bytesparadise/libasciidoc/pkg/types" + log "github.com/sirupsen/logrus" ) // NewConfiguration returns a new configuration -func NewConfiguration(settings ...Setting) Configuration { - config := Configuration{ - AttributeOverrides: map[string]string{}, - Macros: map[string]MacroTemplate{}, +func NewConfiguration(settings ...Setting) *Configuration { + config := &Configuration{ + Attributes: map[string]interface{}{}, + Macros: map[string]MacroTemplate{}, } for _, set := range settings { - set(&config) + set(config) } return config } // Configuration the configuration used when rendering a document type Configuration struct { - Filename string - AttributeOverrides map[string]string - LastUpdated time.Time + Filename string // TODO: move out of Configuration? + Attributes types.Attributes + LastUpdated time.Time // WrapInHTMLBodyElement flag to include the content in an html>body element WrapInHTMLBodyElement bool CSS string @@ -36,6 +39,13 @@ const ( // Setting a setting to customize the configuration used during parsing and rendering of a document type Setting func(config *Configuration) +// WithFigureCaption function to set the `fogure-caption` attribute +func WithFigureCaption(caption string) Setting { + return func(config *Configuration) { + config.Attributes[types.AttrFigureCaption] = caption + } +} + // WithLastUpdated function to set the `last updated` option in the renderer context (default is `time.Now()`) func WithLastUpdated(value time.Time) Setting { return func(config *Configuration) { @@ -44,16 +54,16 @@ func WithLastUpdated(value time.Time) Setting { } // WithAttributes function to set the `attribute overrides` -func WithAttributes(attrs map[string]string) Setting { +func WithAttributes(attrs map[string]interface{}) Setting { return func(config *Configuration) { - config.AttributeOverrides = attrs + config.Attributes = attrs } } // WithAttribute function to set an attribute as if it was passed as an argument in the CLI func WithAttribute(key, value string) Setting { return func(config *Configuration) { - config.AttributeOverrides[key] = value + config.Attributes[key] = value } } @@ -88,6 +98,7 @@ func WithFilename(filename string) Setting { // WithMacroTemplate defines the given template to a user macro with the given name func WithMacroTemplate(name string, t MacroTemplate) Setting { return func(config *Configuration) { + log.Debugf("registering user macro '%s'", name) config.Macros[name] = t } } diff --git a/pkg/parser/attribute_substitution_test.go b/pkg/parser/attribute_substitution_test.go new file mode 100644 index 00000000..35e4a129 --- /dev/null +++ b/pkg/parser/attribute_substitution_test.go @@ -0,0 +1,163 @@ +package parser_test + +import ( + "github.com/bytesparadise/libasciidoc/pkg/types" + . "github.com/bytesparadise/libasciidoc/testsupport" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("attribute substitutions", func() { + + Context("in final documents", func() { + + It("paragraph with attribute substitution", func() { + source := `:author: Xavier + +a paragraph written by {author}.` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "author": "Xavier", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "author", + Value: "Xavier", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph written by Xavier.", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("paragraph with attribute resets", func() { + source := `:author: Xavier + +:!author1: +:author2!: +a paragraph written by {author}.` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "author": "Xavier", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "author", + Value: "Xavier", + }, + &types.AttributeReset{ + Name: "author1", + }, + &types.AttributeReset{ + Name: "author2", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph written by Xavier.", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("header with 2 authors, revision and attributes", func() { + source := `= Document Title +John Foo Doe ; Jane the_Doe +v1.0, March 29, 2020: Updated revision +:toc: +:keywords: documentation, team, obstacles, journey, victory + +This journey continues` + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "Document Title"}, + }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + MiddleName: "Foo", + LastName: "Doe", + }, + Email: "johndoe@example.com", + }, + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "Jane", + LastName: "the Doe", + }, + Email: "jane@example.com", + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + Revdate: "March 29, 2020", + Revremark: "Updated revision", + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrTableOfContents, + }, + &types.AttributeDeclaration{ + Name: "keywords", + Value: "documentation, team, obstacles, journey, victory", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "This journey continues", + }, + }, + }, + }, + TableOfContents: &types.TableOfContents{}, // TODO: should we include a ToC when it's empty? + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("paragraph with attribute substitution from front-matter", func() { + source := `--- +author: Xavier +--- + +a paragraph written by {author}.` + expected := &types.Document{ + Elements: []interface{}{ + &types.FrontMatter{ + Attributes: types.Attributes{ + "author": "Xavier", + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph written by Xavier.", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) +}) diff --git a/pkg/parser/attributes_test.go b/pkg/parser/attributes_test.go index 5aa5e8e2..a484d0d5 100644 --- a/pkg/parser/attributes_test.go +++ b/pkg/parser/attributes_test.go @@ -16,289 +16,305 @@ import ( var _ = Describe("attributes", func() { // We test inline image attributes first. - Context("inline attributes", func() { + Context("inline", func() { It("block image with empty alt", func() { - source := "image::foo.png[]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "foo.png"}, + source := `image::foo.png[]` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ImageBlock{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{Content: "foo.png"}, + }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) It("block image with empty alt and extra whitespace", func() { - source := "image::foo.png[ ]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "foo.png"}, + source := `image::foo.png[ ]` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ImageBlock{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{Content: "foo.png"}, + }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) It("block image with empty positional parameters", func() { - source := "image::foo.png[ , , ]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "foo.png"}, + source := `image::foo.png[ , , ]` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ImageBlock{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{Content: "foo.png"}, + }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) It("block image with empty first parameter, non-empty width", func() { - source := "image::foo.png[ , 200, ]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrWidth: "200", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "foo.png"}, + source := `image::foo.png[ , 200, ]` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrWidth: "200", + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{Content: "foo.png"}, + }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) It("block image with double quoted alt", func() { - source := "image::foo.png[\"Quoted, Here\"]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: `Quoted, Here`, - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "foo.png"}, + source := `image::foo.png["Quoted, Here"]` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: `Quoted, Here`, + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{Content: "foo.png"}, + }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) - It("block image with double quoted alt and embedded quotes", func() { + It("block image with double quoted alt and escaped double quotes", func() { source := `image::foo.png["The Foo\"Bar\" here"]` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: `The Foo"Bar" here`, - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "foo.png"}, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: `The Foo"Bar" here`, + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{Content: "foo.png"}, + }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) - It("block image alt and named pair", func() { - source := `image::foo.png["Quoted, Here", height=100]` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: `Quoted, Here`, - types.AttrHeight: "100", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "foo.png"}, + It("block image with single quoted alt and escaped single quotes", func() { + source := `image::foo.png['The Foo\'Bar\' here']` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: `The Foo'Bar' here`, + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{Content: "foo.png"}, + }, }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) - It("block image alt, width, height, and named pair", func() { - source := "image::foo.png[\"Quoted, Here\", 1, 2, height=100]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: `Quoted, Here`, - types.AttrHeight: "100", // last one wins - types.AttrWidth: "1", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "foo.png"}, + It("block image with double quoted alt and standalone backslash", func() { + source := `image::foo.png["The Foo\Bar here"]` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: `The Foo\Bar here`, + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{Content: "foo.png"}, + }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) - It("block image alt, width, height, and named pair (spacing)", func() { - source := "image::foo.png[\"Quoted, Here\", 1, 2, height=100, test1=123 ,test2 = second test ]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: `Quoted, Here`, - types.AttrHeight: "100", // last one wins - types.AttrWidth: "1", - "test1": "123", - "test2": "second test", // shows trailing pad removed - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "foo.png"}, + It("block image with single quoted alt and standalone backslash", func() { + source := `image::foo.png['The Foo\Bar here']` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: `The Foo\Bar here`, + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{Content: "foo.png"}, + }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) - It("block image alt, width, height, and named pair embedded quote", func() { - source := "image::foo.png[\"Quoted, Here\", 1, 2, height=100, test1=123 ,test2 = second \"test\" ]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: `Quoted, Here`, - types.AttrHeight: "100", // last one wins - types.AttrWidth: "1", - "test1": "123", - "test2": `second "test"`, // shows trailing pad removed - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "foo.png"}, + It("block image alt and named pair", func() { + source := `image::foo.png["Quoted, Here", height=100]` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: `Quoted, Here`, + types.AttrHeight: "100", + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{Content: "foo.png"}, + }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + result, err := ParseDocumentFragments(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDocumentFragmentGroups(expected)) }) - }) - - Context("attributes with substitutions", func() { - - It("should substitute an attribute in another attribute", func() { - source := `:def: foo -:abc: {def}bar -{abc}` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "def": "foo", - "abc": "foobar", // resolved - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "def", - Value: "foo", - }, - types.AttributeDeclaration{ - Name: "abc", - Value: "foobar", // resolved - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foobar", + It("block image alt, width, height, and named pair", func() { + source := `image::foo.png["Quoted, Here", 1, 2, height=100]` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: `Quoted, Here`, + types.AttrHeight: "100", // last one wins + types.AttrWidth: "1", + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{Content: "foo.png"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) - It("should not substitute an attribute in another attribute when not defined", func() { - source := `:abc: {def}bar - -{abc}` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "abc": "{def}bar", // unresolved - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "abc", - Value: "{def}bar", // unresolved + It("block image alt, width, height, and named pair (spacing)", func() { + source := `image::foo.png["Quoted, Here", 1, 2, height=100, test1=123 ,test2 = second test ]` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: `Quoted, Here`, + types.AttrHeight: "100", // last one wins + types.AttrWidth: "1", + "test1": "123", + "test2": "second test", // shows trailing pad removed + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{Content: "foo.png"}, + }, + }, + }, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "{def}bar", + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + }) + + It("block image alt, width, height, and named pair embedded quote", func() { + source := "image::foo.png[\"Quoted, Here\", 1, 2, height=100, test1=123 ,test2 = second \"test\" ]" + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: `Quoted, Here`, + types.AttrHeight: "100", // last one wins + types.AttrWidth: "1", + "test1": "123", + "test2": `second "test"`, // shows trailing pad removed + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{Content: "foo.png"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) + }) - Context("invalid syntax", func() { + Context("invalid syntax", func() { - // no space should be allowed at the beginning of inline attributes, - // (to be consistent with block attributes) + // no space should be allowed at the beginning of inline attributes, + // (to be consistent with block attributes) - It("block image with double quoted alt extra whitespace", func() { - source := `image::foo.png[ "This \Backslash 2Spaced End Space " ]` - expected := types.DraftDocument{ + It("block image with double quoted alt extra whitespace", func() { + source := `image::foo.png[ "This \Backslash 2Spaced End Space " ]` + expected := []types.DocumentFragment{ + { Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: `image::foo.png[ "This \Backslash 2Spaced End Space " ]`, - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine(`image::foo.png[ "This \Backslash 2Spaced End Space " ]`), }, }, }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) }) }) @@ -322,16 +338,16 @@ var _ = DescribeTable("valid block attributes", `attr1`: `cookie`, }, ), - Entry(`[attr1=cookie,foo2='bar2']`, `[attr1=cookie,foo2='bar2']`, + Entry(`[attr1=cookie,attr2='pasta']`, `[attr1=cookie,attr2='pasta']`, types.Attributes{ `attr1`: `cookie`, - `foo2`: `bar2`, + `attr2`: `pasta`, }, ), - Entry(`[attr1=cookie,foo2=bar2]`, `[attr1=cookie,foo2="bar2"]`, + Entry(`[attr1=cookie,attr2=pasta]`, `[attr1=cookie,attr2="pasta"]`, types.Attributes{ `attr1`: `cookie`, - `foo2`: `bar2`, + `attr2`: `pasta`, }, ), @@ -505,11 +521,6 @@ var _ = DescribeTable("valid block attributes", types.AttrPositional2: `go.not_a_role`, }, ), - Entry("multiple roles", "[.role1]\n[.role2]", - types.Attributes{ - types.AttrRoles: []interface{}{`role1`, `role2`}, - }, - ), // option shorthand Entry(`[%hardbreaks]`, `[%hardbreaks]`, @@ -627,76 +638,22 @@ var _ = DescribeTable("valid inline attributes", // unquoted positional attributes with quoted text value Entry(`[*cookie*,_chocolate_]`, `[*cookie*,_chocolate_]`, types.Attributes{ - types.AttrPositional1: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "cookie", - }, - }, - }, - }, - types.AttrPositional2: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "chocolate", - }, - }, - }, - }, + types.AttrPositional1: "*cookie*", // with the `InlineAttributes` rule, values are returned as-is by the parser + types.AttrPositional2: "_chocolate_", }, ), // single-quoted positional attributes with quoted text value Entry(`[*cookie*,_chocolate_]`, `[*cookie*,_chocolate_]`, types.Attributes{ - types.AttrPositional1: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "cookie", - }, - }, - }, - }, - types.AttrPositional2: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "chocolate", - }, - }, - }, - }, + types.AttrPositional1: "*cookie*", // with the `InlineAttributes` rule, values are returned as-is by the parser + types.AttrPositional2: "_chocolate_", }, ), // double-quoted positional attributes with quoted text value Entry(`["*cookie*","_chocolate_"]`, `["*cookie*","_chocolate_"]`, types.Attributes{ - types.AttrPositional1: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "cookie", - }, - }, - }, - }, - types.AttrPositional2: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "chocolate", - }, - }, - }, - }, + types.AttrPositional1: "*cookie*", // with the `InlineAttributes` rule, values are returned as-is by the parser + types.AttrPositional2: "_chocolate_", }, ), ) diff --git a/pkg/parser/bench_test.go b/pkg/parser/bench_test.go index 6451ad73..fb0241fe 100644 --- a/pkg/parser/bench_test.go +++ b/pkg/parser/bench_test.go @@ -16,7 +16,7 @@ import ( ) const ( - doc1line = `= Lorem Ipsum + doc1Paragraph = `= Lorem Ipsum Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, @@ -29,7 +29,7 @@ sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.` - doc10lines = `=== foo + doc10Sections = `=== foo bar === foo @@ -70,8 +70,8 @@ var _ = DescribeTable("basic stats", result, _ := json.MarshalIndent(stats.ChoiceAltCnt, " ", " ") fmt.Printf("ChoiceAltCnt: \n%s\n", result) }, - Entry("parse a single line file", "1-line doc", doc1line), - Entry("parse a 10-line file", "10-lines doc", doc10lines), + Entry("parse a single line file", "1-line doc", doc1Paragraph), + Entry("parse a 10-line file", "10-lines doc", doc10Sections), ) var _ = Describe("real-world doc-based benchmarks", func() { diff --git a/pkg/parser/blank_line_test.go b/pkg/parser/blank_line_test.go index 9f22d4ea..d0a60579 100644 --- a/pkg/parser/blank_line_test.go +++ b/pkg/parser/blank_line_test.go @@ -10,36 +10,38 @@ import ( var _ = Describe("blank lines", func() { - Context("draft documents", func() { + Context("in raw documents", func() { It("blank line between 2 paragraphs", func() { source := `first paragraph second paragraph` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first paragraph", - }, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("first paragraph"), }, }, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "second paragraph", - }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("second paragraph"), }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) It("blank line with spaces and tabs between 2 paragraphs and after second paragraph", func() { @@ -49,69 +51,78 @@ second paragraph` second paragraph ` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first paragraph", - }, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("first paragraph"), }, }, }, - types.BlankLine{}, - types.BlankLine{}, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "second paragraph", - }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("second paragraph"), }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) It("blank line with attributes", func() { source := `.ignored ` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.BlankLine{}, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + // types.Attributes{ + // types.AttrTitle: "ignored", + // }, + &types.BlankLine{}, + }, }, } - result, err := ParseDraftDocument(source) // , parser.Debug(true)) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) }) }) - Context("final documents", func() { + Context("in final documents", func() { It("blank line between 2 paragraphs", func() { source := `first paragraph second paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "first paragraph"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "first paragraph"}, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "second paragraph"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "second paragraph"}, }, }, }, @@ -125,20 +136,16 @@ second paragraph` second paragraph ` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "first paragraph"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "first paragraph"}, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "second paragraph"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "second paragraph"}, }, }, }, diff --git a/pkg/parser/check_list_test.go b/pkg/parser/check_list_test.go index 2b1bf419..196f6386 100644 --- a/pkg/parser/check_list_test.go +++ b/pkg/parser/check_list_test.go @@ -10,7 +10,7 @@ import ( var _ = Describe("checked lists", func() { - Context("final documents", func() { + Context("in final documents", func() { It("with title and dashes", func() { source := `.Checklist @@ -18,81 +18,73 @@ var _ = Describe("checked lists", func() { - [x] also checked - [ ] not checked - normal list item` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ + &types.List{ + Kind: types.UnorderedListKind, Attributes: types.Attributes{ types.AttrTitle: "Checklist", }, - Items: []types.UnorderedListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.Dash, CheckStyle: types.Checked, Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrCheckStyle: types.Checked, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "checked", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "checked", }, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.Dash, CheckStyle: types.Checked, Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrCheckStyle: types.Checked, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "also checked", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "also checked", }, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.Dash, CheckStyle: types.Unchecked, Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrCheckStyle: types.Unchecked, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "not checked", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "not checked", }, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.Dash, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "normal list item", - }, + &types.Paragraph{ + // Attributes: types.Attributes{ + // types.AttrCheckStyle: types.NoCheck, + // }, + Elements: []interface{}{ + &types.StringElement{ + Content: "normal list item", }, }, }, @@ -111,81 +103,75 @@ var _ = Describe("checked lists", func() { * [x] also checked * [ ] not checked * normal list item` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ + &types.List{ + Kind: types.UnorderedListKind, Attributes: types.Attributes{ - types.AttrOptions: []interface{}{types.AttrInteractive}, + types.AttrOptions: []interface{}{ + types.AttrInteractive, + }, }, - Items: []types.UnorderedListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.CheckedInteractive, Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrCheckStyle: types.CheckedInteractive, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "checked", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "checked", }, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.CheckedInteractive, Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrCheckStyle: types.CheckedInteractive, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "also checked", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "also checked", }, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.UncheckedInteractive, Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrCheckStyle: types.UncheckedInteractive, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "not checked", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "not checked", }, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "normal list item", - }, + &types.Paragraph{ + // Attributes: types.Attributes{ + // types.AttrCheckStyle: types.NoCheck, + // }, + Elements: []interface{}{ + &types.StringElement{ + Content: "normal list item", }, }, }, @@ -205,82 +191,75 @@ var _ = Describe("checked lists", func() { ** [x] also checked ** [ ] not checked * normal list item` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ + &types.List{ + Kind: types.UnorderedListKind, Attributes: types.Attributes{ types.AttrTitle: "Checklist", }, - Items: []types.UnorderedListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.Unchecked, Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrCheckStyle: types.Unchecked, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "parent not checked", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "parent not checked", }, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.Checked, Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrCheckStyle: types.Checked, }, - Lines: [][]interface{}{ - {types.StringElement{ + Elements: []interface{}{ + &types.StringElement{ Content: "checked", }, - }, }, }, }, }, - { - Level: 2, + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.Checked, Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrCheckStyle: types.Checked, }, - Lines: [][]interface{}{ - {types.StringElement{ + Elements: []interface{}{ + &types.StringElement{ Content: "also checked", }, - }, }, }, }, }, - { - Level: 2, + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.Unchecked, Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrCheckStyle: types.Unchecked, }, - Lines: [][]interface{}{ - {types.StringElement{ + Elements: []interface{}{ + &types.StringElement{ Content: "not checked", }, - }, }, }, }, @@ -289,17 +268,17 @@ var _ = Describe("checked lists", func() { }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "normal list item", - }, + &types.Paragraph{ + // Attributes: types.Attributes{ + // types.AttrCheckStyle: types.NoCheck, + // }, + Elements: []interface{}{ + &types.StringElement{ + Content: "normal list item", }, }, }, @@ -318,59 +297,58 @@ var _ = Describe("checked lists", func() { ** a normal list item ** another normal list item * normal list item` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ + &types.List{ + Kind: types.UnorderedListKind, Attributes: types.Attributes{ types.AttrTitle: "Checklist", }, - Items: []types.UnorderedListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.Unchecked, Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrCheckStyle: types.Unchecked, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "parent not checked", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "parent not checked", }, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a normal list item", - }, + &types.Paragraph{ + // Attributes: types.Attributes{ + // types.AttrCheckStyle: types.NoCheck, + // }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a normal list item", }, }, }, }, }, - { - Level: 2, + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "another normal list item", - }, + &types.Paragraph{ + // Attributes: types.Attributes{ + // types.AttrCheckStyle: types.NoCheck, + // }, + Elements: []interface{}{ + &types.StringElement{ + Content: "another normal list item", }, }, }, @@ -380,17 +358,17 @@ var _ = Describe("checked lists", func() { }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "normal list item", - }, + &types.Paragraph{ + // Attributes: types.Attributes{ + // types.AttrCheckStyle: types.NoCheck, + // }, + Elements: []interface{}{ + &types.StringElement{ + Content: "normal list item", }, }, }, diff --git a/pkg/parser/comment_test.go b/pkg/parser/comment_test.go index e9098b87..ce9861b3 100644 --- a/pkg/parser/comment_test.go +++ b/pkg/parser/comment_test.go @@ -10,258 +10,28 @@ import ( var _ = Describe("comments", func() { - Context("draft documents", func() { + Context("in final documents", func() { Context("single line comments", func() { - It("single line comment alone", func() { + It("alone", func() { source := `// A single-line comment.` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.SingleLineComment{ - Content: " A single-line comment.", - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("single line comment at end of line", func() { - source := `foo // A single-line comment.` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo // A single-line comment.", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("single line comment within a paragraph", func() { - source := `a first line -// A single-line comment. -another line // not a comment` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a first line", - }, - }, - { - types.SingleLineComment{ - Content: " A single-line comment.", - }, - }, - { - types.StringElement{ - Content: "another line // not a comment", - }, - }, - }, - }, - }, - } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) - }) - - Context("invalid", func() { - - It("single line comment with prefixing spaces alone", func() { - source := ` // A single-line comment.` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LiteralBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Literal, - types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: " // A single-line comment.", - }, - }, - }, - }, - }, - } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) - }) - - It("single line comment with prefixing tabs alone", func() { - source := "\t\t// A single-line comment." - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LiteralBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Literal, - types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "\t\t// A single-line comment.", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("single line comment within a paragraph with tab", func() { - source := `a first line - // A single-line comment. -another line` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a first line", - }, - }, - { - types.StringElement{ - Content: "\t// A single-line comment.", - }, - }, - { - types.StringElement{ - Content: "another line", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("comment blocks", func() { - - It("comment block alone", func() { - source := `//// -a *comment* block -with multiple lines -////` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.CommentBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a *comment* block", - }, - }, - { - types.StringElement{ - Content: "with multiple lines", - }, - }, - }, - }, - }, - } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) - }) - - It("comment block with paragraphs around", func() { - source := `a first paragraph - -//// -a *comment* block -with multiple lines -//// -a second paragraph` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a first paragraph", - }, - }, - }, - }, - types.BlankLine{}, // blankline is required between a paragraph and the next block - types.CommentBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a *comment* block", - }, - }, - { - types.StringElement{ - Content: "with multiple lines", - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a second paragraph", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("final documents", func() { - - Context("single line comments", func() { - - It("single line comment alone", func() { - source := `// A single-line comment.` - expected := types.Document{ - Elements: []interface{}{}, - } + expected := &types.Document{} Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("single line comment with prefixing spaces alone", func() { + It("with prefixing spaces alone", func() { source := ` // A single-line comment.` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LiteralBlock{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Literal, types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: " // A single-line comment.", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: " // A single-line comment.", }, }, }, @@ -270,20 +40,18 @@ a second paragraph` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("single line comment with prefixing tabs alone", func() { + It("with prefixing tabs alone", func() { source := "\t\t// A single-line comment." - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LiteralBlock{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Literal, types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "\t\t// A single-line comment.", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "\t\t// A single-line comment.", }, }, }, @@ -292,14 +60,14 @@ a second paragraph` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("single line comment at end of line", func() { + It("at end of line", func() { source := `foo // A single-line comment.` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo // A single-line comment."}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "foo // A single-line comment.", }, }, }, @@ -308,19 +76,19 @@ a second paragraph` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("single line comment within a paragraph", func() { + It("within a paragraph", func() { source := `a first line // A single-line comment. another line` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first line"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a first line", }, - { - types.StringElement{Content: "another line"}, + &types.StringElement{ + Content: "\nanother line", }, }, }, @@ -331,22 +99,16 @@ another line` Context("invalid", func() { - It("single line comment within a paragraph with tab", func() { + It("within a paragraph with tab", func() { source := `a first line - // A single-line comment. + // not a comment. another line` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first line"}, - }, - { - types.StringElement{Content: "\t// A single-line comment."}, - }, - { - types.StringElement{Content: "another line"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a first line\n\t// not a comment.\nanother line", }, }, }, @@ -359,18 +121,16 @@ another line` Context("comment blocks", func() { - It("comment block alone", func() { + It("alone", func() { source := `//// a *comment* block with multiple lines ////` - expected := types.Document{ - Elements: []interface{}{}, - } + expected := &types.Document{} Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("comment block with paragraphs around", func() { + It("with paragraphs around", func() { source := `a first paragraph //// @@ -378,19 +138,19 @@ a *comment* block with multiple lines //// a second paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first paragraph"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a first paragraph", }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second paragraph"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a second paragraph", }, }, }, @@ -411,33 +171,33 @@ with multiple lines //// a second paragraph` section1Title := []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "section 1", }, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ "_section_1": section1Title, }, Elements: []interface{}{ - types.Section{ + &types.Section{ Attributes: types.Attributes{ types.AttrID: "_section_1", }, Level: 1, Title: section1Title, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first paragraph"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a first paragraph", }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second paragraph"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a second paragraph", }, }, }, @@ -461,49 +221,42 @@ with multiple lines a first paragraph a second paragraph` - section0Title := []interface{}{ - types.StringElement{ + headerTitle := []interface{}{ + &types.StringElement{ Content: "section 0", }, } section1Title := []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "section 1", }, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "_section_0": section0Title, "_section_1": section1Title, }, Elements: []interface{}{ - types.Section{ + &types.DocumentHeader{ + Title: headerTitle, + }, + &types.Section{ Attributes: types.Attributes{ - types.AttrID: "_section_0", + types.AttrID: "_section_1", }, - Level: 0, - Title: section0Title, + Level: 1, + Title: section1Title, Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_1", - }, - Level: 1, - Title: section1Title, + &types.Paragraph{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first paragraph"}, - }, - }, + &types.StringElement{ + Content: "a first paragraph", }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second paragraph"}, - }, - }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a second paragraph", }, }, }, diff --git a/pkg/parser/context.go b/pkg/parser/context.go new file mode 100644 index 00000000..7b0cf69f --- /dev/null +++ b/pkg/parser/context.go @@ -0,0 +1,159 @@ +package parser + +import ( + "sync" + + "github.com/bytesparadise/libasciidoc/pkg/configuration" + "github.com/bytesparadise/libasciidoc/pkg/types" + "github.com/davecgh/go-spew/spew" + log "github.com/sirupsen/logrus" +) + +type ParseContext struct { + filename string + Opts []Option + levelOffsets levelOffsets + attributes *contextAttributes + userMacros map[string]configuration.MacroTemplate + counters map[string]interface{} +} + +func NewParseContext(config *configuration.Configuration, opts ...Option) *ParseContext { + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("new parser context with attributes: %s", spew.Sdump(config.Attributes)) + } + opts = append(opts, GlobalStore(frontMatterKey, true)) + opts = append(opts, GlobalStore(documentHeaderKey, true)) + opts = append(opts, GlobalStore(substitutionKey, newNormalSubstitution())) + opts = append(opts, GlobalStore(usermacrosKey, config.Macros)) + return &ParseContext{ + filename: config.Filename, + Opts: opts, + levelOffsets: []*levelOffset{}, + attributes: newContextAttributes(config.Attributes), + userMacros: config.Macros, + counters: map[string]interface{}{}, + } +} + +func (c *ParseContext) Clone() *ParseContext { + opts := make([]Option, len(c.Opts)) + copy(opts, c.Opts) + attributes := c.attributes.clone() + return &ParseContext{ + filename: c.filename, + Opts: opts, + levelOffsets: c.levelOffsets.clone(), + attributes: attributes, + userMacros: c.userMacros, + counters: c.counters, + } +} + +func (c *ParseContext) WithinDelimitedBlock(b *types.DelimitedBlock) *ParseContext { + clone := c.Clone() + switch b.Kind { + case types.Example, types.Quote, types.Sidebar: + clone.Opts = append(c.Opts, Entrypoint("DocumentFragment"), GlobalStore(delimitedBlockScopeKey, b.Kind)) + case types.Fenced, types.Listing, types.Literal, types.Verse: + clone.Opts = append(c.Opts, Entrypoint("DocumentFragmentWithinVerbatimBlock"), GlobalStore(delimitedBlockScopeKey, b.Kind)) + default: + // TODO: do we need to parse the content of Passthrough and Comments? + clone.Opts = append(c.Opts, Entrypoint("DocumentFragmentWithinVerbatimBlock"), GlobalStore(delimitedBlockScopeKey, b.Kind)) + } + return clone +} + +type contextAttributes struct { + immutableAttributes types.Attributes + attributes types.Attributes + mutex *sync.RWMutex +} + +func newContextAttributes(attrs types.Attributes) *contextAttributes { + return &contextAttributes{ + immutableAttributes: attrs, + attributes: types.Attributes{}, + mutex: &sync.RWMutex{}, + } +} + +func (a *contextAttributes) clone() *contextAttributes { + a.mutex.Lock() + defer a.mutex.Unlock() + return &contextAttributes{ + mutex: &sync.RWMutex{}, + immutableAttributes: a.immutableAttributes.Clone(), + attributes: a.attributes.Clone(), + } +} + +func (a *contextAttributes) has(k string) bool { + _, found := a.immutableAttributes[k] + if found { + return true + } + _, found = a.attributes[k] + return found +} + +func (a *contextAttributes) get(k string) interface{} { + value, found := a.immutableAttributes[k] + if found { + return value + } + return a.attributes[k] +} + +func (a *contextAttributes) allAttributes() map[string]interface{} { + result := make(map[string]interface{}, len(a.attributes)+len(a.immutableAttributes)) + for k, v := range a.attributes { + result[k] = v + } + // imautables attributes should not be overridden, hence adding them after + for k, v := range a.immutableAttributes { + result[k] = v + } + return result +} + +func (a *contextAttributes) getAsString(k string) (string, bool, error) { + if a.immutableAttributes.Has(k) { + return a.immutableAttributes.GetAsString(k) + } + return a.attributes.GetAsString(k) +} + +func (a *contextAttributes) getAsStringWithDefault(k string, defaultValue string) string { + if a.immutableAttributes.Has(k) { + return a.immutableAttributes.GetAsStringWithDefault(k, defaultValue) + } + return a.attributes.GetAsStringWithDefault(k, defaultValue) +} + +func (a *contextAttributes) getAsIntWithDefault(k string, defaultValue int) int { + if a.immutableAttributes.Has(k) { + return a.immutableAttributes.GetAsIntWithDefault(k, defaultValue) + } + return a.attributes.GetAsIntWithDefault(k, defaultValue) +} + +func (a *contextAttributes) set(k string, v interface{}) { + a.mutex.RLock() + defer a.mutex.RUnlock() + a.attributes[k] = v +} + +func (a *contextAttributes) unset(k string) { + a.mutex.RLock() + defer a.mutex.RUnlock() + delete(a.attributes, k) +} + +func (a *contextAttributes) setAll(attrs map[string]interface{}) { + a.mutex.RLock() + defer a.mutex.RUnlock() + for k, v := range attrs { + a.attributes[k] = v + } +} diff --git a/pkg/parser/cross_reference_test.go b/pkg/parser/cross_reference_test.go index 84f53502..9017f030 100644 --- a/pkg/parser/cross_reference_test.go +++ b/pkg/parser/cross_reference_test.go @@ -10,7 +10,7 @@ import ( var _ = Describe("cross references", func() { - Context("final documents", func() { + Context("in final documents", func() { Context("internal references", func() { @@ -19,39 +19,34 @@ var _ = Describe("cross references", func() { == a title with some content linked to <>!` - expected := types.Document{ + title := []interface{}{ + &types.StringElement{ + Content: "a title", + }, + } + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "thetitle": []interface{}{ - types.StringElement{ - Content: "a title", - }, - }, + "thetitle": title, }, Elements: []interface{}{ - types.Section{ + &types.Section{ Level: 1, Attributes: types.Attributes{ types.AttrID: "thetitle", types.AttrCustomID: true, }, - Title: []interface{}{ - types.StringElement{ - Content: "a title", - }, - }, + Title: title, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "with some content linked to ", - }, - types.InternalCrossReference{ - ID: "thetitle", - }, - types.StringElement{ - Content: "!", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "with some content linked to ", + }, + &types.InternalCrossReference{ + ID: "thetitle", + }, + &types.StringElement{ + Content: "!", }, }, }, @@ -67,46 +62,41 @@ with some content linked to <>!` == a title with some content linked to <>!` - expected := types.Document{ - ElementReferences: types.ElementReferences{ - "thetitle": []interface{}{ - types.StringElement{ - Content: "a title", - }, - }, + title := []interface{}{ + &types.StringElement{ + Content: "a title", }, + } + expected := &types.Document{ Elements: []interface{}{ - types.Section{ + &types.Section{ Level: 1, Attributes: types.Attributes{ types.AttrID: "thetitle", types.AttrCustomID: true, }, - Title: []interface{}{ - types.StringElement{ - Content: "a title", - }, - }, + Title: title, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "with some content linked to ", - }, - types.InternalCrossReference{ - ID: "thetitle", - Label: "a label to the title", - }, - types.StringElement{ - Content: "!", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "with some content linked to ", + }, + &types.InternalCrossReference{ + ID: "thetitle", + Label: "a label to the title", + }, + &types.StringElement{ + Content: "!", }, }, }, }, }, }, + ElementReferences: types.ElementReferences{ + "thetitle": title, + }, } Expect(ParseDocument(source)).To(MatchDocument(expected)) }) @@ -116,36 +106,36 @@ with some content linked to <>!` It("external cross reference to other doc with plain text location and rich label", func() { source := `some content linked to xref:another-doc.adoc[*another doc*]!` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some content linked to ", - }, - types.ExternalCrossReference{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "another-doc.adoc", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "some content linked to ", + }, + &types.ExternalCrossReference{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "another-doc.adoc", }, }, - Label: []interface{}{ - types.QuotedText{ + }, + Attributes: types.Attributes{ + types.AttrXRefLabel: []interface{}{ + &types.QuotedText{ Kind: types.SingleQuoteBold, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "another doc", }, }, }, }, }, - types.StringElement{ - Content: "!", - }, + }, + &types.StringElement{ + Content: "!", }, }, }, @@ -156,28 +146,31 @@ with some content linked to <>!` It("external cross reference to other doc with document attribute in location", func() { source := `some content linked to xref:{foo}.adoc[another doc]!` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some content linked to ", - }, - types.ExternalCrossReference{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "{foo}.adoc", // attribute substitution failed for `{foo}` - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "some content linked to ", + }, + &types.ExternalCrossReference{ + Location: &types.Location{ + Path: []interface{}{ + &types.AttributeSubstitution{ // attribute substitution failed for `{foo}` during parsing + Name: "foo", + }, + &types.StringElement{ + Content: ".adoc", }, }, - Label: "another doc", }, - types.StringElement{ - Content: "!", + Attributes: types.Attributes{ + types.AttrXRefLabel: "another doc", }, }, + &types.StringElement{ + Content: "!", + }, }, }, }, @@ -190,30 +183,35 @@ with some content linked to <>!` :foo: another-doc.adoc some content linked to xref:{foo}[another_doc()]!` - expected := types.Document{ - Attributes: types.Attributes{ - "foo": "another-doc.adoc", - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "foo": "another-doc.adoc", + // }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{ + &types.AttributeDeclaration{ + Name: "foo", + Value: "another-doc.adoc", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "some content linked to ", }, - types.ExternalCrossReference{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "another-doc.adoc", - }, + &types.ExternalCrossReference{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "another-doc.adoc", }, }, - Label: "another_doc()", }, - types.StringElement{ - Content: "!", + Attributes: types.Attributes{ + types.AttrXRefLabel: "another_doc()", }, }, + &types.StringElement{ + Content: "!", + }, }, }, }, diff --git a/pkg/parser/delimited_block_admonition_test.go b/pkg/parser/delimited_block_admonition_test.go index 863b84e6..aa42d25e 100644 --- a/pkg/parser/delimited_block_admonition_test.go +++ b/pkg/parser/delimited_block_admonition_test.go @@ -3,35 +3,33 @@ package parser_test import ( "github.com/bytesparadise/libasciidoc/pkg/types" . "github.com/bytesparadise/libasciidoc/testsupport" - . "github.com/onsi/ginkgo" //nolint golint . "github.com/onsi/gomega" //nolint golint ) var _ = Describe("admonition blocks", func() { - Context("draft documents", func() { + Context("in final documents", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("example block as admonition", func() { source := `[NOTE] ==== -foo +cookie ====` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ExampleBlock{ + &types.DelimitedBlock{ + Kind: types.Example, Attributes: types.Attributes{ types.AttrStyle: types.Note, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie", }, }, }, @@ -39,108 +37,113 @@ foo }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - - It("as admonition", func() { + It("example block as admonition with multiple lines", func() { source := `[NOTE] ----- +==== multiple paragraphs ----- +==== ` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ListingBlock{ + &types.DelimitedBlock{ + Kind: types.Example, Attributes: types.Attributes{ types.AttrStyle: types.Note, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "multiple", + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "multiple", + }, }, }, - {}, - { - types.StringElement{ - Content: "paragraphs", + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "paragraphs", + }, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) - }) - - Context("final documents", func() { - Context("delimited blocks", func() { + Context("as paragraph", func() { - It("example block as admonition", func() { - source := `[NOTE] -==== -foo -====` - expected := types.Document{ + It("basic admonition", func() { + source := `[CAUTION] +this is an admonition paragraph.` + expected := &types.Document{ Elements: []interface{}{ - types.ExampleBlock{ + &types.Paragraph{ Attributes: types.Attributes{ - types.AttrStyle: types.Note, + types.AttrStyle: types.Caution, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, - }, - }, + &types.StringElement{ + Content: "this is an admonition paragraph.", }, }, }, }, } Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }) - It("example block as admonition with multiple lines", func() { - source := `[NOTE] -==== -multiple + Context("mixed", func() { -paragraphs -==== -` - expected := types.Document{ + It("admonition paragraph and admonition block with multiple elements", func() { + source := `[CAUTION] +this is an admonition paragraph. + + +[NOTE] +.Title +==== +This is an admonition block + +with another paragraph +====` + expected := &types.Document{ Elements: []interface{}{ - types.ExampleBlock{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrStyle: types.Caution, + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "this is an admonition paragraph.", + }, + }, + }, + &types.DelimitedBlock{ + Kind: types.Example, Attributes: types.Attributes{ types.AttrStyle: types.Note, + types.AttrTitle: "Title", }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "multiple", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "This is an admonition block", }, }, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "paragraphs", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "with another paragraph", }, }, }, diff --git a/pkg/parser/delimited_block_example_test.go b/pkg/parser/delimited_block_example_test.go index 43229ad3..928f8c4d 100644 --- a/pkg/parser/delimited_block_example_test.go +++ b/pkg/parser/delimited_block_example_test.go @@ -1,6 +1,8 @@ package parser_test import ( + "strings" + "github.com/bytesparadise/libasciidoc/pkg/types" . "github.com/bytesparadise/libasciidoc/testsupport" @@ -10,35 +12,34 @@ import ( var _ = Describe("example blocks", func() { - Context("draft documents", func() { + Context("in final documents", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("with single rich line", func() { source := `==== some *example* content ====` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ExampleBlock{ + &types.DelimitedBlock{ + Kind: types.Example, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "example", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "some ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "example", }, }, - types.StringElement{ - Content: " content", - }, + }, + &types.StringElement{ + Content: " content", }, }, }, @@ -46,84 +47,66 @@ some *example* content }, }, } - - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with single line starting with a dot", func() { source := `==== .foo ====` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ExampleBlock{ - Elements: []interface{}{ - types.StandaloneAttributes{ - types.AttrTitle: "foo", - }, - }, + &types.DelimitedBlock{ + Kind: types.Example, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("with rich lines", func() { + It("with multiple lines", func() { source := `==== .foo -some listing *bold code* -with _italic content_ +some listing code +with *bold content* * and a list item ====` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ExampleBlock{ + &types.DelimitedBlock{ + Kind: types.Example, Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrTitle: "foo", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some listing ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "bold code", - }, - }, - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "some listing code\nwith ", }, - { - types.StringElement{ - Content: "with ", - }, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "italic content", - }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "bold content", }, }, }, }, }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "and a list item", + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "and a list item", + }, }, }, }, @@ -134,22 +117,21 @@ with _italic content_ }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with unclosed delimiter", func() { source := `==== -End of doc here` - expected := types.DraftDocument{ +End of file here` + expected := &types.Document{ Elements: []interface{}{ - types.ExampleBlock{ + &types.DelimitedBlock{ + Kind: types.Example, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "End of doc here", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "End of file here", }, }, }, @@ -157,7 +139,7 @@ End of doc here` }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with title", func() { @@ -165,19 +147,18 @@ End of doc here` ==== foo ====` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ExampleBlock{ + &types.DelimitedBlock{ + Kind: types.Example, Attributes: types.Attributes{ types.AttrTitle: "example block title", }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "foo", }, }, }, @@ -185,294 +166,684 @@ foo }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("with caption", func() { - source := `[caption="a caption "] -==== -foo -====` - expected := types.DraftDocument{ + It("with starting delimiter only", func() { + source := `====` + expected := &types.Document{ Elements: []interface{}{ - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrCaption: "a caption ", // trailing space is retained - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, - }, - }, - }, - }, + &types.DelimitedBlock{ + Kind: types.Example, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("example block starting delimiter only", func() { - source := `====` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ExampleBlock{}, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) + Context("with custom substitutions", func() { - Context("paragraph blocks", func() { + // in normal blocks, the substiution should be defined and applied on the elements + // within the blocks + // TODO: include character replacement (eg: `(C)`) + source := `:github-url: https://github.com + +==== +[subs="$SUBS"] +a link to https://example.com[] <1> +and on the + +*next* lines with a link to {github-url}[] - It("with single rich line", func() { - source := `[example] -some *example* content` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Example, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "example", +==== +` + Context("explicit substitutions", func() { + + It("should apply the default substitution", func() { + s := strings.ReplaceAll(source, "[subs=\"$SUBS\"]\n", "") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Example, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", + }, + }, + }, + }, + &types.StringElement{ + Content: " ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "1", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "more text", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the", + }, + &types.LineBreak{}, + &types.StringElement{ + Content: "\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", + }, + }, + }, + &types.StringElement{ + Content: " lines with a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, + }, + }, }, }, }, - types.StringElement{ - Content: " content", - }, }, }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("final documents", func() { + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - Context("delimited blocks", func() { + It("should apply the 'normal' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "normal") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Example, + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "normal", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", + }, + }, + }, + }, + &types.StringElement{ + Content: " ", + }, + &types.SpecialCharacter{ // callout is not detected with the `normal` susbtitution + Name: "<", + }, + &types.StringElement{ + Content: "1", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "more text", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the", + }, + &types.LineBreak{}, + &types.StringElement{ + Content: "\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", + }, + }, + }, + &types.StringElement{ + Content: " lines with a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - It("with single rich line", func() { - source := `==== -some *example* content -====` - expected := types.Document{ - Elements: []interface{}{ - types.ExampleBlock{ + It("should apply the 'quotes' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "quotes") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Example, + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "quotes", }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "example", + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the +\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", + }, }, }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]", + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the 'macros' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "macros") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Example, + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "macros", }, - types.StringElement{ - Content: " content", + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", + }, + }, + }, + }, + &types.StringElement{ + Content: " <1>\nand on the +\n*next* lines with a link to {github-url}[]", + }, }, }, }, }, }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - It("with single line starting with a dot", func() { - source := `==== -.foo -====` - expected := types.Document{ - Elements: []interface{}{ - types.ExampleBlock{ - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + It("should apply the 'attributes' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "attributes") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Example, + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "attributes", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the +\n*next* lines with a link to https://github.com[]", + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - It("with multiple lines", func() { - source := `==== -.foo -some listing code -with *bold content* + It("should apply the 'attributes,macros' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "attributes,macros") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Example, + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "attributes,macros", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", + }, + }, + }, + }, + &types.StringElement{ + Content: " <1>\nand on the +\n*next* lines with a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) -* and a list item -====` - expected := types.Document{ - Elements: []interface{}{ - types.ExampleBlock{ + It("should apply the 'specialchars' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "specialchars") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrTitle: "foo", + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Example, + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "specialchars", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "1", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "more text", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the +\n*next* lines with a link to {github-url}[]", + }, + }, + }, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some listing code", + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the 'replacements' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "replacements") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Example, + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "replacements", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the +\n*next* lines with a link to {github-url}[]", + }, }, }, - { - types.StringElement{ - Content: "with ", + }, + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the 'post_replacements' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "post_replacements") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Example, + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "post_replacements", }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "bold content", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the", + }, + &types.LineBreak{}, + &types.StringElement{ + Content: "\n*next* lines with a link to {github-url}[]", }, }, }, }, }, - types.BlankLine{}, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the 'quotes,macros' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "quotes,macros") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Example, + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "quotes,macros", + }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "and a list item", + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, }, + &types.StringElement{ + Content: " <1>\nand on the +\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", + }, + }, + }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]", + }, }, }, }, }, }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - It("with unclosed delimiter", func() { - source := `==== -End of file here` - expected := types.Document{ - Elements: []interface{}{ - types.ExampleBlock{ + It("should apply the 'macros,quotes' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "macros,quotes") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "End of file here", + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Example, + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "macros,quotes", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", + }, + }, + }, + }, + &types.StringElement{ + Content: " <1>\nand on the +\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", + }, + }, + }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]", + }, }, }, }, }, }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - It("with title", func() { - source := `.example block title -==== -foo -====` - expected := types.Document{ - Elements: []interface{}{ - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrTitle: "example block title", - }, + It("should apply the 'none' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "none") // the `none` substitution applies to the *content of the elements* with the example block + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Example, + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "none", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the +\n*next* lines with a link to {github-url}[]", + }, }, }, }, }, }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + }) - It("example block starting delimiter only", func() { - source := `====` - expected := types.Document{ - Elements: []interface{}{ - types.ExampleBlock{ - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + }) - Context("paragraph blocks", func() { + Context("as paragraph blocks", func() { It("with single rich line", func() { source := `[example] some *example* content` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Example, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "example", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "some ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "example", }, }, - types.StringElement{ - Content: " content", - }, + }, + &types.StringElement{ + Content: " content", }, }, }, diff --git a/pkg/parser/delimited_block_fenced_test.go b/pkg/parser/delimited_block_fenced_test.go index 3dde930a..a5035a8d 100644 --- a/pkg/parser/delimited_block_fenced_test.go +++ b/pkg/parser/delimited_block_fenced_test.go @@ -10,527 +10,180 @@ import ( var _ = Describe("fenced blocks", func() { - Context("draft documents", func() { + Context("in final documents", func() { - Context("delimited blocks", func() { - - It("with single line", func() { - content := "some fenced code" - source := "```\n" + content + "\n" + "```" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: content, - }, - }, - }, - }, - }, - } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) - }) - - It("with special characters line", func() { - source := "```\n\n" + "```" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "some fenced code", - }, - types.SpecialCharacter{ - Name: ">", - }, - }, - }, - }, - }, - } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) - }) - - It("with no line", func() { - source := "```\n```" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - {}, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with multiple lines alone", func() { - source := "```\nsome fenced code\nwith an empty line\n\nin the middle\n```" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some fenced code", - }, - }, - { - types.StringElement{ - Content: "with an empty line", - }, - }, - {}, - { - types.StringElement{ - Content: "in the middle", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with multiple lines then a paragraph", func() { - source := "```\nsome fenced code\nwith an empty line\n\nin the middle\n```\nthen a normal paragraph." - expected := types.DraftDocument{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some fenced code", - }, - }, - { - types.StringElement{ - Content: "with an empty line", - }, - }, - {}, // empty line - { - types.StringElement{ - Content: "in the middle", - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "then a normal paragraph.", - }, - }, - }, - }, - }, - } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) - }) - - It("after a paragraph", func() { - content := "some fenced code" - source := "a paragraph.\n\n```\n" + content + "\n" + "```\n" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph.", - }, - }, - }, - }, - types.BlankLine{}, - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: content, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with unclosed delimiter", func() { - source := "```\nEnd of file here" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "End of file here", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with external link inside - without attributes", func() { - source := "```" + "\n" + - "a https://example.com\n" + - "and more text on the\n" + - "next lines\n" + - "```" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a https://example.com", - }, - }, - { - types.StringElement{ - Content: "and more text on the", - }, - }, - { - types.StringElement{ - Content: "next lines", - }, - }, + It("with single line", func() { + content := "some fenced code" + source := "```\n" + content + "\n" + "```" + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Fenced, + Elements: []interface{}{ + &types.StringElement{ + Content: content, }, }, }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with external link inside - with attributes", func() { - source := "```" + "\n" + - "a https://example.com[]" + "\n" + - "and more text on the" + "\n" + - "next lines" + "\n" + - "```" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a https://example.com[]", - }, - }, - { - types.StringElement{ - Content: "and more text on the", - }, - }, - { - types.StringElement{ - Content: "next lines", - }, - }, - }, - }, + It("with no line", func() { + source := "```\n```" + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Fenced, }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with unrendered list", func() { - source := "```\n" + - "* some \n" + - "* listing \n" + - "* content \n```" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "* some ", - }, - }, - { - types.StringElement{ - Content: "* listing ", - }, - }, - { - types.StringElement{ - Content: "* content ", - }, - }, + It("with multiple lines alone", func() { + source := "```\nsome fenced code\nwith an empty line\n\nin the middle\n```" + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Fenced, + Elements: []interface{}{ + &types.StringElement{ + Content: "some fenced code\nwith an empty line\n\nin the middle", }, }, }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - }) - - Context("final documents", func() { - Context("delimited blocks", func() { - - It("with single line", func() { - content := "some fenced code" - source := "```\n" + content + "\n" + "```" - expected := types.Document{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: content, - }, - }, + It("with multiple lines then a paragraph", func() { + source := "```\nsome fenced code\nwith an empty line\n\nin the middle\n```\nthen a normal paragraph." + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Fenced, + Elements: []interface{}{ + &types.StringElement{ + Content: "some fenced code\nwith an empty line\n\nin the middle", }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("with no line", func() { - source := "```\n```" - expected := types.Document{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - {}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "then a normal paragraph."}, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with multiple lines alone", func() { - source := "```\nsome fenced code\nwith an empty line\n\nin the middle\n```" - expected := types.Document{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some fenced code", - }, - }, - { - types.StringElement{ - Content: "with an empty line", - }, - }, - {}, - { - types.StringElement{ - Content: "in the middle", - }, - }, + It("after a paragraph", func() { + content := "some fenced code" + source := "a paragraph.\n\n```\n" + content + "\n" + "```\n" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph.", }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("with multiple lines then a paragraph", func() { - source := "```\nsome fenced code\nwith an empty line\n\nin the middle\n```\nthen a normal paragraph." - expected := types.Document{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some fenced code", - }, - }, - { - types.StringElement{ - Content: "with an empty line", - }, - }, - {}, - { - types.StringElement{ - Content: "in the middle", - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "then a normal paragraph."}, - }, + &types.DelimitedBlock{ + Kind: types.Fenced, + Elements: []interface{}{ + &types.StringElement{ + Content: content, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("after a paragraph", func() { - content := "some fenced code" - source := "a paragraph.\n\n```\n" + content + "\n" + "```\n" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph.", - }, - }, - }, - }, - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: content, - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with unclosed delimiter", func() { - source := "```\nEnd of file here" - expected := types.Document{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "End of file here", - }, - }, + It("with unclosed delimiter", func() { + source := "```\nEnd of file here" + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Fenced, + Elements: []interface{}{ + &types.StringElement{ + Content: "End of file here", }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with external link inside - without attributes", func() { - source := "```\n" + - "a https://example.com\n" + - "and more text on the\n" + - "next lines\n" + - "```" - expected := types.Document{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a https://example.com", - }, - }, - { - types.StringElement{ - Content: "and more text on the", - }, - }, - { - types.StringElement{ - Content: "next lines", - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + It("with external link inside - without attributes", func() { + source := "```\n" + + "a https://example.com\n" + + "and more text on the\n" + + "next lines\n" + + "```" + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Fenced, + Elements: []interface{}{ + &types.StringElement{ + Content: "a https://example.com\nand more text on the\nnext lines", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with external link inside - with attributes", func() { - source := "```" + "\n" + - "a https://example.com[]" + "\n" + - "and more text on the" + "\n" + - "next lines" + "\n" + - "```" - expected := types.Document{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a https://example.com[]", - }, - }, - { - types.StringElement{ - Content: "and more text on the", - }, - }, - { - types.StringElement{ - Content: "next lines", - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + It("with external link inside - with attributes", func() { + source := "```" + "\n" + + "a https://example.com[]" + "\n" + + "and more text on the" + "\n" + + "next lines" + "\n" + + "```" + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Fenced, + Elements: []interface{}{ + &types.StringElement{ + Content: "a https://example.com[]\nand more text on the\nnext lines", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with unrendered list", func() { - source := "```\n" + - "* some \n" + - "* listing \n" + - "* content \n```" - expected := types.Document{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "* some ", - }, - }, - { - types.StringElement{ - Content: "* listing ", - }, - }, - { - types.StringElement{ - Content: "* content ", - }, - }, + It("with unrendered list", func() { + source := "```\n" + + "* some \n" + + "* listing \n" + + "* content \n```" + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Fenced, + Elements: []interface{}{ + &types.StringElement{ + Content: "* some\n* listing\n* content", // suffix spaces are trimmed }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) }) diff --git a/pkg/parser/delimited_block_listing_test.go b/pkg/parser/delimited_block_listing_test.go index d8a6f3d3..4dd1788a 100644 --- a/pkg/parser/delimited_block_listing_test.go +++ b/pkg/parser/delimited_block_listing_test.go @@ -1,6 +1,8 @@ package parser_test import ( + "strings" + "github.com/bytesparadise/libasciidoc/pkg/types" . "github.com/bytesparadise/libasciidoc/testsupport" @@ -10,43 +12,40 @@ import ( var _ = Describe("listing blocks", func() { - Context("draft documents", func() { + Context("in final documents", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("with single rich line", func() { source := `---- some *listing* code ----` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some *listing* code", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "some *listing* code", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with no line", func() { source := `---- ----` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - {}, - }, + &types.DelimitedBlock{ + Kind: types.Listing, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with multiple lines alone", func() { @@ -56,31 +55,19 @@ with an empty line in the middle ----` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some listing code", - }, - }, - { - types.StringElement{ - Content: "with an empty line", - }, - }, - {}, - { - types.StringElement{ - Content: "in the middle", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "some listing code\nwith an empty line\n\nin the middle", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with unrendered list", func() { @@ -89,30 +76,19 @@ in the middle * listing * content ----` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "* some ", - }, - }, - { - types.StringElement{ - Content: "* listing ", - }, - }, - { - types.StringElement{ - Content: "* content", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "* some\n* listing\n* content", // suffix spaces are trimmed }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with multiple lines then a paragraph", func() { @@ -123,129 +99,102 @@ with an empty line in the middle ---- then a normal paragraph.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some listing code", - }, - }, - { - types.StringElement{ - Content: "with an empty line", - }, - }, - {}, - { - types.StringElement{ - Content: "in the middle", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "some listing code\nwith an empty line\n\nin the middle", }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "then a normal paragraph.", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "then a normal paragraph."}, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("after a paragraph", func() { source := `a paragraph. - + ---- some listing code ----` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph.", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph.", }, }, }, - types.BlankLine{}, // blankline is required between paragraph and the next block - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some listing code", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "some listing code", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with unclosed delimiter", func() { source := `---- End of file here.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "End of file here.", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "End of file here.", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with single callout", func() { source := `---- - <1> +import <1> ---- <1> an import` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "import", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " ", - }, - types.Callout{ - Ref: 1, - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "import ", + }, + &types.Callout{ + Ref: 1, }, }, }, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "an import", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "an import", + }, }, }, }, @@ -254,7 +203,7 @@ End of file here.` }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with multiple callouts on different lines", func() { @@ -265,51 +214,48 @@ func foo() {} <2> ---- <1> an import <2> a func` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "import ", - }, - types.Callout{ - Ref: 1, - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "import ", }, - {}, - { - types.StringElement{ - Content: "func foo() {} ", - }, - types.Callout{ - Ref: 2, - }, + &types.Callout{ + Ref: 1, + }, + &types.StringElement{ + Content: "\n\nfunc foo() {} ", + }, + &types.Callout{ + Ref: 2, }, }, }, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "an import", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "an import", + }, }, }, }, }, - }, - }, - types.CalloutListItem{ - Ref: 2, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a func", + &types.CalloutListElement{ + Ref: 2, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a func", + }, }, }, }, @@ -318,7 +264,7 @@ func foo() {} <2> }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with multiple callouts on same line", func() { @@ -331,85 +277,78 @@ func foo() {} <4> <2> a single import <3> a single basic import <4> a func` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "import ", - }, - types.Callout{ - Ref: 1, - }, - types.Callout{ - Ref: 2, - }, - types.Callout{ - Ref: 3, - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "import ", }, - {}, - { - types.StringElement{ - Content: "func foo() {} ", - }, - types.Callout{ - Ref: 4, - }, + &types.Callout{ + Ref: 1, + }, + &types.Callout{ + Ref: 2, + }, + &types.Callout{ + Ref: 3, + }, + &types.StringElement{ + Content: "\n\nfunc foo() {} ", + }, + &types.Callout{ + Ref: 4, }, }, }, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "an import", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "an import", + }, }, }, }, }, - }, - }, - types.CalloutListItem{ - Ref: 2, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a single import", + &types.CalloutListElement{ + Ref: 2, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a single import", + }, }, }, }, }, - }, - }, - types.CalloutListItem{ - Ref: 3, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a single basic import", + &types.CalloutListElement{ + Ref: 3, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a single basic import", + }, }, }, }, }, - }, - }, - types.CalloutListItem{ - Ref: 4, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a func", + &types.CalloutListElement{ + Ref: 4, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a func", + }, }, }, }, @@ -418,7 +357,7 @@ func foo() {} <4> }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with invalid callout", func() { @@ -426,378 +365,823 @@ func foo() {} <4> import ---- an import` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "import ", + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "import ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "a", + }, + &types.SpecialCharacter{ + Name: ">", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "a", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " an import", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + Context("with custom substitutions", func() { + + // testing custom substitutions on listing blocks only, as + // other verbatim blocks (fenced, literal, source, passthrough) + // share the same implementation + + source := `:github-url: https://github.com + +[subs="$SUBS"] +---- +a link to https://example.com[] <1> +and on the + +*next* lines with a link to {github-url}[] + +* not a list item +---- +` + It("should apply the default substitution", func() { + s := strings.ReplaceAll(source, "[subs=\"$SUBS\"]\n", "") // remove the 'subs' attribute + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] ", }, - types.SpecialCharacter{ + &types.Callout{ + Ref: 1, + }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ Name: "<", }, - types.StringElement{ - Content: "a", + &types.StringElement{ + Content: "more text", }, - types.SpecialCharacter{ + &types.SpecialCharacter{ Name: ">", }, + &types.StringElement{ + Content: " on the +\n*next* lines with a link to {github-url}[]\n\n* not a list item", + }, }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.SpecialCharacter{ + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the 'normal' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "normal") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "normal", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", + }, + }, + }, + }, + &types.StringElement{ + Content: " ", + }, + &types.SpecialCharacter{ // callout is not detected with the `normal` susbtitution + Name: "<", + }, + &types.StringElement{ + Content: "1", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ Name: "<", }, - types.StringElement{ - Content: "a", + &types.StringElement{ + Content: "more text", }, - types.SpecialCharacter{ + &types.SpecialCharacter{ Name: ">", }, - types.StringElement{ - Content: " an import", + &types.StringElement{ + Content: " on the", + }, + &types.LineBreak{}, + &types.StringElement{ + Content: "\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", + }, + }, + }, + &types.StringElement{ + Content: " lines with a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, + }, + }, + &types.StringElement{ + Content: "\n\n* not a list item", }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - }) - - Context("paragraph blocks", func() { - - It("with single rich line", func() { - source := `[listing] -some *listing* content` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Listing, + It("should apply the 'quotes' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "quotes") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some *listing* content", // no quote substitution + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "quotes", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the +\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", + }, + }, + }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]\n\n* not a list item", }, }, }, }, - }, - } - - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("final documents", func() { + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - Context("delimited blocks", func() { - - It("with single rich line", func() { - source := `---- -some *listing* code -----` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some *listing* code", + It("should apply the 'macros' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "macros") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "macros", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", + }, + }, + }, + }, + &types.StringElement{ + Content: " <1>\nand on the +\n*next* lines with a link to {github-url}[]\n\n* not a list item", }, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - It("with no line", func() { - source := `---- -----` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - {}, + It("should apply the 'attributes' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "attributes") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("with multiple lines alone", func() { - source := `---- -some listing code -with an empty line - -in the middle -----` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some listing code", - }, - }, - { - types.StringElement{ - Content: "with an empty line", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "attributes", }, - {}, - { - types.StringElement{ - Content: "in the middle", + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the +\n*next* lines with a link to https://github.com[]\n\n* not a list item", }, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - It("with unrendered list", func() { - source := `---- -* some -* listing -* content -----` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "* some ", - }, + It("should apply the 'attributes,macros' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "attributes,macros") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "attributes,macros", }, - { - types.StringElement{ - Content: "* listing ", + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", + }, + }, + }, }, - }, - { - types.StringElement{ - Content: "* content", + &types.StringElement{ + Content: " <1>\nand on the +\n*next* lines with a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, + }, + }, + &types.StringElement{ + Content: "\n\n* not a list item", }, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - It("with multiple lines then a paragraph", func() { - source := `---- -some listing code -with an empty line - -in the middle ----- -then a normal paragraph.` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some listing code", - }, + It("should apply the 'specialchars' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "specialchars") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "specialchars", }, - { - types.StringElement{ - Content: "with an empty line", + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] ", }, - }, - {}, - { - types.StringElement{ - Content: "in the middle", + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "1", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "more text", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the +\n*next* lines with a link to {github-url}[]\n\n* not a list item", }, }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "then a normal paragraph."}, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the 'replacements' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "replacements") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "replacements", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the +\n*next* lines with a link to {github-url}[]\n\n* not a list item", + }, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - It("after a paragraph", func() { - source := `a paragraph. - ----- -some listing code -----` - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph.", + It("should apply the 'post_replacements' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "post_replacements") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "post_replacements", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the", + }, + &types.LineBreak{}, + &types.StringElement{ + Content: "\n*next* lines with a link to {github-url}[]\n\n* not a list item", }, }, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some listing code", + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the 'quotes,macros' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "quotes,macros") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "quotes,macros", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", + }, + }, + }, + }, + &types.StringElement{ + Content: " <1>\nand on the +\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", + }, + }, + }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]\n\n* not a list item", }, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - It("with unclosed delimiter", func() { - source := `---- -End of file here.` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "End of file here.", + It("should apply the 'macros,quotes' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "macros,quotes") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "macros,quotes", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", + }, + }, + }, + }, + &types.StringElement{ + Content: " <1>\nand on the +\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", + }, + }, + }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]\n\n* not a list item", }, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - It("with single callout", func() { - source := `---- -import <1> ----- -<1> an import` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "import ", - }, - types.Callout{ - Ref: 1, + It("should apply the 'none' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "none") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "none", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the +\n*next* lines with a link to {github-url}[]\n\n* not a list item", }, }, }, }, - types.CalloutList{ - Items: []types.CalloutListItem{ - { - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "an import", - }, - }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the 'quotes+' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "quotes+") // same as `quotes,"default"` + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "quotes+", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] ", + }, + &types.Callout{ + Ref: 1, + }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "more text", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the +\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", }, }, }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]\n\n* not a list item", + }, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("with multiple callouts on different lines", func() { - source := `---- -import <1> + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) -func foo() {} <2> ----- -<1> an import -<2> a func` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "import ", + It("should apply the '-callouts' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "-callouts") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "-callouts", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] ", }, - types.Callout{ - Ref: 1, + &types.SpecialCharacter{ + Name: "<", }, - }, - {}, - { - types.StringElement{ - Content: "func foo() {} ", + &types.StringElement{ + Content: "1", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: "\nand ", }, - types.Callout{ - Ref: 2, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "more text", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the +\n*next* lines with a link to {github-url}[]\n\n* not a list item", }, }, }, }, - types.CalloutList{ - Items: []types.CalloutListItem{ - { - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "an import", - }, - }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the '+quotes' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "+quotes") // default + quotes + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "+quotes", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] ", + }, + &types.Callout{ + Ref: 1, + }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "more text", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the +\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", }, }, }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]\n\n* not a list item", + }, }, - { - Ref: 2, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a func", - }, - }, - }, - }, + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the '-quotes' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "-quotes") // default - quotes + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "-quotes", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] ", + }, + &types.Callout{ + Ref: 1, }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "more text", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the +\n*next* lines with a link to {github-url}[]\n\n* not a list item", + }, + }, + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should fail when substitution is unknown", func() { + s := strings.ReplaceAll(source, "$SUBS", "unknown") + _, err := ParseDocument(s) + Expect(err).To(HaveOccurred()) + }) + }) + }) + + Context("as paragraph blocks", func() { + + It("with single rich line", func() { + source := `[listing] +some *listing* content` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrStyle: types.Listing, + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "some *listing* content", // no quote substitution }, }, }, @@ -806,97 +1190,121 @@ func foo() {} <2> Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("with multiple callouts on same line", func() { - source := `---- -import <1> <2><3> + Context("with custom substitutions", func() { + source := `:github-url: https://github.com + +[listing] +[subs="$SUBS"] +a link to https://example.com[] <1> +and on the + +*next* lines with a link to {github-url}[] -func foo() {} <4> ----- -<1> an import -<2> a single import -<3> a single basic import -<4> a func` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "import ", +<1> a callout` + + It("should apply the default substitution", func() { + s := strings.ReplaceAll(source, "[subs=\"$SUBS\"]\n", "") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrStyle: types.Listing, + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] ", }, - types.Callout{ + &types.Callout{ Ref: 1, }, - types.Callout{ - Ref: 2, + &types.StringElement{ + Content: "\nand ", }, - types.Callout{ - Ref: 3, + &types.SpecialCharacter{ + Name: "<", }, - }, - {}, - { - types.StringElement{ - Content: "func foo() {} ", + &types.StringElement{ + Content: "more text", }, - types.Callout{ - Ref: 4, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the +\n*next* lines with a link to {github-url}[]", }, }, }, - }, - types.CalloutList{ - Items: []types.CalloutListItem{ - { - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "an import", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", }, }, }, }, }, }, - { - Ref: 2, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a single import", - }, - }, - }, - }, - }, + }, + }, + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) + + It("should apply the 'quotes' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "quotes") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrStyle: types.Listing, + types.AttrSubstitutions: "quotes", }, - { - Ref: 3, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a single basic import", - }, - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the +\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", }, }, }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]", + }, }, - { - Ref: 4, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a func", + }, + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", }, }, }, @@ -905,88 +1313,140 @@ func foo() {} <4> }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - It("with invalid callout", func() { - source := `---- -import ----- - an import` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "import ", + It("should apply the '+quotes' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "+quotes") // ie, default + quotes + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrStyle: types.Listing, + types.AttrSubstitutions: "+quotes", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] ", }, - types.SpecialCharacter{ + &types.Callout{ + Ref: 1, + }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ Name: "<", }, - types.StringElement{ - Content: "a", + &types.StringElement{ + Content: "more text", }, - types.SpecialCharacter{ + &types.SpecialCharacter{ Name: ">", }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.SpecialCharacter{ - Name: "<", + &types.StringElement{ + Content: " on the +\n", }, - types.StringElement{ - Content: "a", + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", + }, + }, }, - types.SpecialCharacter{ - Name: ">", + &types.StringElement{ + Content: " lines with a link to {github-url}[]", }, - types.StringElement{ - Content: " an import", + }, + }, + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, + }, + }, + }, }, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - }) - - Context("paragraph blocks", func() { + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) - It("with single rich line", func() { - source := `[listing] -some *listing* content` - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Listing, + It("should apply the 'macros,+quotes,-quotes' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "macros,+quotes,-quotes") + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some *listing* content", // no quote substitution + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrStyle: types.Listing, + types.AttrSubstitutions: "macros,+quotes,-quotes", // ie, "macros" only + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", + }, + }, + }, + }, + &types.StringElement{ + Content: " <1>\nand on the +\n*next* lines with a link to {github-url}[]", + }, + }, + }, + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, + }, + }, + }, }, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + } + Expect(ParseDocument(s)).To(MatchDocument(expected)) + }) }) }) }) - - Context("with custom substitutions", func() { - - }) - }) diff --git a/pkg/parser/delimited_block_literal_test.go b/pkg/parser/delimited_block_literal_test.go index 281f8685..c1c5c80c 100644 --- a/pkg/parser/delimited_block_literal_test.go +++ b/pkg/parser/delimited_block_literal_test.go @@ -10,66 +10,73 @@ import ( var _ = Describe("literal blocks", func() { - Context("draft documents", func() { + Context("in final documents", func() { - Context("literal blocks with spaces indentation", func() { + Context("with space indentation", func() { - It("literal block from 1-line paragraph with single space", func() { + It("from 1-line paragraph with single space", func() { source := ` some literal content` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.LiteralBlock{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Literal, types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: " some literal content", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: " some literal content", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("literal block from paragraph with single space on first line", func() { + It("from paragraph with single space on first line", func() { source := ` some literal content on 3 lines.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.LiteralBlock{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Literal, types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: " some literal content", - }, - }, - { - types.StringElement{ - Content: "on 3", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: " some literal content\non 3\nlines.", }, - { - types.StringElement{ - Content: "lines.", - }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("from paragraph with single space on all lines", func() { + // spaces at heading of lines are preserved during rendering + source := ` some literal content + on 3 + lines.` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrStyle: types.Literal, + types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, + }, + Elements: []interface{}{ + &types.StringElement{ + Content: " some literal content\n on 3\n lines.", }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("mixing literal block with attributes followed by a paragraph ", func() { @@ -78,142 +85,125 @@ lines.` some literal content a normal paragraph.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.LiteralBlock{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Literal, types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, types.AttrID: "ID", - // types.AttrCustomID: true, - types.AttrTitle: "title", + types.AttrTitle: "title", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: " some literal content", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: " some literal content", }, }, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a normal paragraph."}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a normal paragraph.", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) - Context("literal blocks with block delimiter", func() { + Context("with block delimiter", func() { - It("literal block with empty blank line", func() { + It("with empty blank line around content", func() { source := `.... some content + ....` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.LiteralBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Literal, - types.AttrLiteralBlockType: types.LiteralBlockWithDelimiter, - }, - Lines: [][]interface{}{ - {}, - { - types.StringElement{ - Content: "some content", - }, + &types.DelimitedBlock{ + Kind: types.Literal, + Elements: []interface{}{ + &types.StringElement{ + Content: "some content", // empty lines are discarded }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("literal block with delimited and attributes followed by 1-line paragraph", func() { + It("with delimited and attributes followed by 1-line paragraph", func() { source := `[#ID] .title .... -some literal content + some literal + content .... a normal paragraph.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.LiteralBlock{ + &types.DelimitedBlock{ + Kind: types.Literal, Attributes: types.Attributes{ - types.AttrStyle: types.Literal, - types.AttrLiteralBlockType: types.LiteralBlockWithDelimiter, - types.AttrID: "ID", - // types.AttrCustomID: true, + types.AttrID: "ID", types.AttrTitle: "title", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some literal content", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: " some literal\n content", // heading spaces are preserved }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a normal paragraph."}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a normal paragraph.", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) - Context("literal blocks with attribute", func() { + Context("with attribute", func() { - It("literal block from 1-line paragraph with attribute", func() { + It("from 1-line paragraph with attribute", func() { source := `[literal] some literal content a normal paragraph.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.LiteralBlock{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Literal, types.AttrLiteralBlockType: types.LiteralBlockWithAttribute, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some literal content", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "some literal content", }, }, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a normal paragraph."}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a normal paragraph.", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("literal block from 2-lines paragraph with attribute", func() { + It("from 2-lines paragraph with attribute", func() { source := `[#ID] [literal] .title @@ -221,42 +211,31 @@ some literal content on two lines. a normal paragraph.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.LiteralBlock{ + &types.Paragraph{ Attributes: types.Attributes{ - types.AttrStyle: types.Literal, - types.AttrID: "ID", - // types.AttrCustomID: true, + types.AttrStyle: types.Literal, + types.AttrID: "ID", types.AttrTitle: "title", types.AttrLiteralBlockType: types.LiteralBlockWithAttribute, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some literal content", - }, - }, - { - types.StringElement{ - Content: "on two lines.", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "some literal content\non two lines.", }, }, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a normal paragraph."}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a normal paragraph.", }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) @@ -277,69 +256,52 @@ and on the + <1> a callout ` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.LiteralBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Literal, - types.AttrLiteralBlockType: types.LiteralBlockWithDelimiter, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] ", - }, - types.Callout{ - Ref: 1, - }, + &types.DelimitedBlock{ + Kind: types.Literal, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] ", }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the +", - }, + &types.Callout{ + Ref: 1, }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, + &types.StringElement{ + Content: "\nand ", }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "more text", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the +\n*next* lines with a link to {github-url}[]\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -348,7 +310,7 @@ and on the + }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("should apply the 'normal' substitution on block with delimiter", func() { source := `:github-url: https://github.com @@ -364,108 +326,102 @@ and on the + <1> a callout ` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.LiteralBlock{ + &types.DelimitedBlock{ + Kind: types.Literal, Attributes: types.Attributes{ - types.AttrStyle: types.Literal, - types.AttrLiteralBlockType: types.LiteralBlockWithDelimiter, - types.AttrSubstitutions: "normal", + types.AttrSubstitutions: "normal", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, - types.StringElement{ - Content: " ", - }, - types.SpecialCharacter{ // callout is not detected with the `normal` susbtitution - Name: "<", - }, - types.StringElement{ - Content: "1", - }, - types.SpecialCharacter{ - Name: ">", - }, }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the", - }, - types.LineBreak{}, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, + &types.StringElement{ + Content: " ", + }, + &types.SpecialCharacter{ // callout is not detected with the `normal` susbtitution + Name: "<", + }, + &types.StringElement{ + Content: "1", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "more text", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the", + }, + &types.LineBreak{}, + &types.StringElement{ + Content: "\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", }, }, - types.StringElement{ - Content: " lines with a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, + }, + &types.StringElement{ + Content: " lines with a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", }, }, }, }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + &types.StringElement{ + Content: "\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -474,7 +430,7 @@ and on the + }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("should apply the 'quotes,macros' substitution on block with delimiter", func() { @@ -491,76 +447,61 @@ and on the + <1> a callout ` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.LiteralBlock{ + &types.DelimitedBlock{ + Kind: types.Literal, Attributes: types.Attributes{ - types.AttrStyle: types.Literal, - types.AttrLiteralBlockType: types.LiteralBlockWithDelimiter, - types.AttrSubstitutions: "quotes,macros", + types.AttrSubstitutions: "quotes,macros", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, - types.StringElement{ - Content: " <1>", - }, }, - { - types.StringElement{ - Content: "and on the +", - }, + &types.StringElement{ + Content: " <1>\nand on the +\n", }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", }, }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -569,7 +510,7 @@ and on the + }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("should apply the 'quotes,macros' substitution on block with spaces", func() { @@ -582,73 +523,62 @@ and on the + <1> a callout ` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.LiteralBlock{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Literal, types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, types.AttrSubstitutions: "quotes,macros", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: " a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: " a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, - types.StringElement{ - Content: " <1> ", - }, }, - { - types.StringElement{ - Content: " and on the +", - }, + &types.StringElement{ + Content: " <1>\n and on the +\n ", }, - { - types.StringElement{ - Content: " ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", }, }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, + }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -657,10 +587,10 @@ and on the + }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("should apply the 'quotes,macros' substitution on block with attribute", func() { + It("should apply the 'quotes,macros' substitution on paragraph with attribute", func() { source := `:github-url: https://github.com [subs="quotes,macros"] @@ -671,70 +601,62 @@ and on the + <1> a callout ` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.LiteralBlock{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Literal, types.AttrLiteralBlockType: types.LiteralBlockWithAttribute, types.AttrSubstitutions: "quotes,macros", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, - types.StringElement{ - Content: " <1>", - }, }, - { - types.StringElement{ - Content: "and on the +", - }, + &types.StringElement{ + Content: " <1>\nand on the +\n", }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", }, }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, + }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -743,7 +665,7 @@ and on the + }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) }) diff --git a/pkg/parser/delimited_block_markdown_quote_test.go b/pkg/parser/delimited_block_markdown_quote_test.go index 0dfb756a..23b0d930 100644 --- a/pkg/parser/delimited_block_markdown_quote_test.go +++ b/pkg/parser/delimited_block_markdown_quote_test.go @@ -10,342 +10,136 @@ import ( var _ = Describe("markdown-style quote blocks", func() { - Context("draft documents", func() { + Context("in final documents", func() { - Context("delimited blocks", func() { - - It("with single marker without author", func() { - source := `> some text -on *multiple lines* -with a link to https://example.com[]` - - expected := types.DraftDocument{ - Elements: []interface{}{ - types.MarkdownQuoteBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some text", - }, - }, - { - types.StringElement{ - Content: "on ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "multiple lines", - }, - }, - }, - }, - { - types.StringElement{ - Content: "with a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - }, - }, - }, - }, - } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) - }) - - It("with marker on each line without author", func() { - source := `> some text -> on *multiple lines*` - - expected := types.DraftDocument{ - Elements: []interface{}{ - types.MarkdownQuoteBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some text", - }, - }, - { - types.StringElement{ - Content: "on ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "multiple lines", - }, - }, - }, - }, - }, - }, - }, - } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) - }) + It("with single marker without author", func() { + source := `> some text +on *multiple lines*` - It("with marker on each line with author only", func() { - source := `> some text -> on *multiple lines* -> -- John Doe` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.MarkdownQuoteBlock{ - Attributes: types.Attributes{ - types.AttrQuoteAuthor: "John Doe", + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.MarkdownQuote, + Elements: []interface{}{ + &types.StringElement{ + Content: "some text\non ", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some text", - }, - }, - { - types.StringElement{ - Content: "on ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "multiple lines", - }, - }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "multiple lines", }, }, }, }, }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with marker on each line with author and title", func() { - source := `.title -> some text -> on *multiple lines* -> -- John Doe` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.MarkdownQuoteBlock{ - Attributes: types.Attributes{ - types.AttrTitle: "title", - types.AttrQuoteAuthor: "John Doe", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some text", - }, - }, - { - types.StringElement{ - Content: "on ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "multiple lines", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with with author only", func() { - source := `> -- John Doe` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.MarkdownQuoteBlock{ - Attributes: types.Attributes{ - types.AttrQuoteAuthor: "John Doe", - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - }) - - Context("final documents", func() { - - Context("delimited blocks", func() { - - It("with single marker without author", func() { - source := `> some text -on *multiple lines*` - - expected := types.Document{ - Elements: []interface{}{ - types.MarkdownQuoteBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some text", - }, - }, - { - types.StringElement{ - Content: "on ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "multiple lines", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - It("with marker on each line without author", func() { - source := `> some text + It("with marker on each line without author", func() { + source := `> some text > on *multiple lines*` - expected := types.Document{ - Elements: []interface{}{ - types.MarkdownQuoteBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some text", - }, - }, - { - types.StringElement{ - Content: "on ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "multiple lines", - }, - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.MarkdownQuote, + Elements: []interface{}{ + &types.StringElement{ + Content: "some text\non ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "multiple lines", }, }, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with marker on each line with author only", func() { - source := `> some text + It("with marker on each line with author only", func() { + source := `> some text > on *multiple lines* > -- John Doe` - expected := types.Document{ - Elements: []interface{}{ - types.MarkdownQuoteBlock{ - Attributes: types.Attributes{ - types.AttrQuoteAuthor: "John Doe", + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.MarkdownQuote, + Attributes: types.Attributes{ + types.AttrQuoteAuthor: "John Doe", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "some text\non ", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some text", - }, - }, - { - types.StringElement{ - Content: "on ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "multiple lines", - }, - }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "multiple lines", }, }, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with marker on each line with author and title", func() { - source := `.title + It("with marker on each line with author and title", func() { + source := `.title > some text > on *multiple lines* > -- John Doe` - expected := types.Document{ - Elements: []interface{}{ - types.MarkdownQuoteBlock{ - Attributes: types.Attributes{ - types.AttrTitle: "title", - types.AttrQuoteAuthor: "John Doe", + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.MarkdownQuote, + Attributes: types.Attributes{ + types.AttrTitle: "title", + types.AttrQuoteAuthor: "John Doe", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "some text\non ", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some text", - }, - }, - { - types.StringElement{ - Content: "on ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "multiple lines", - }, - }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "multiple lines", }, }, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with with author only", func() { - source := `> -- John Doe` - expected := types.Document{ - Elements: []interface{}{ - types.MarkdownQuoteBlock{ - Attributes: types.Attributes{ - types.AttrQuoteAuthor: "John Doe", - }, + It("with with author only", func() { + source := `> -- John Doe` + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.MarkdownQuote, + Attributes: types.Attributes{ + types.AttrQuoteAuthor: "John Doe", }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) }) diff --git a/pkg/parser/delimited_block_passthrough_test.go b/pkg/parser/delimited_block_passthrough_test.go index 38c8e528..5e15705d 100644 --- a/pkg/parser/delimited_block_passthrough_test.go +++ b/pkg/parser/delimited_block_passthrough_test.go @@ -10,9 +10,54 @@ import ( var _ = Describe("passthrough blocks", func() { - Context("draft documents", func() { + Context("in raw documents", func() { - Context("delimited blocks", func() { + Context("paragraph with attribute", func() { + + It("2-line paragraph followed by another paragraph", func() { + source := `[pass] +_foo_ +*bar* + +another paragraph` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrStyle: "pass", + }, + Elements: []interface{}{ + types.RawLine("_foo_"), + types.RawLine("*bar*"), + }, + }, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("another paragraph"), + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragmentGroups(expected)) + }) + }) + + }) + + Context("in final documents", func() { + + Context("as delimited blocks", func() { It("with title", func() { source := `.a title @@ -21,29 +66,24 @@ _foo_ *bar* ++++` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.PassthroughBlock{ + &types.DelimitedBlock{ + Kind: types.Passthrough, Attributes: types.Attributes{ types.AttrTitle: "a title", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "_foo_", - }, - }, - {}, - { - types.StringElement{ - Content: "*bar*", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "_foo_\n\n*bar*", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + result, err := ParseDocument(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDocument(expected)) }) It("with special characters", func() { @@ -52,170 +92,57 @@ _foo_ ++++` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.PassthroughBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "", - }, - }, - {}, - { - types.StringElement{ - Content: "", - }, + &types.DelimitedBlock{ + Kind: types.Passthrough, + Elements: []interface{}{ + &types.StringElement{ + Content: "\n\n", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with inline link", func() { source := `++++ http://example.com[] ++++` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.PassthroughBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "http://example.com[]", - }, + &types.DelimitedBlock{ + Kind: types.Passthrough, + Elements: []interface{}{ + &types.StringElement{ + Content: "http://example.com[]", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with inline pass", func() { source := `++++ pass:[foo] ++++` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.PassthroughBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "pass:[foo]", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with quoted text", func() { - source := `++++ -*foo* -++++` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.PassthroughBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "*foo*", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("paragraph with attribute", func() { - - It("2-line paragraph followed by another paragraph", func() { - source := `[pass] -_foo_ -*bar* - -another paragraph` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.PassthroughBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Passthrough, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "_foo_", - }, - }, - { - types.StringElement{ - Content: "*bar*", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "another paragraph", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - }) - - Context("final documents", func() { - - Context("delimited blocks", func() { - - It("with title", func() { - source := `.a title -++++ -_foo_ - -*bar* -++++` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.PassthroughBlock{ - Attributes: types.Attributes{ - types.AttrTitle: "a title", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "_foo_", - }, - }, - {}, - { - types.StringElement{ - Content: "*bar*", - }, + &types.DelimitedBlock{ + Kind: types.Passthrough, + Elements: []interface{}{ + &types.StringElement{ + Content: "pass:[foo]", }, }, }, }, } - result, err := ParseDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) @@ -227,31 +154,22 @@ _foo_ *bar* another paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.PassthroughBlock{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Passthrough, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "_foo_", - }, - }, - { - types.StringElement{ - Content: "*bar*", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "_foo_\n*bar*", }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "another paragraph", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "another paragraph", }, }, }, diff --git a/pkg/parser/delimited_block_quote_test.go b/pkg/parser/delimited_block_quote_test.go index 28ca31b8..9878eda9 100644 --- a/pkg/parser/delimited_block_quote_test.go +++ b/pkg/parser/delimited_block_quote_test.go @@ -10,312 +10,40 @@ import ( var _ = Describe("quote blocks", func() { - Context("draft documents", func() { + Context("in final documents", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { - It("single-line quote block with author and title", func() { + It("with single-line content and author and title attributes", func() { source := `[quote, john doe, quote title] ____ some *quote* content ____` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.QuoteBlock{ + &types.DelimitedBlock{ + Kind: types.Quote, Attributes: types.Attributes{ types.AttrStyle: types.Quote, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "quote title", }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "quote", - }, - }, - }, - types.StringElement{ - Content: " content", - }, - }, - }, - }, - }, - }, - }, - } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) - }) - - It("multi-line quote with author only", func() { - source := `[quote, john doe, ] -____ -- some -- quote -- content -____ -` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.QuoteBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Quote, - types.AttrQuoteAuthor: "john doe", - }, - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, + &types.Paragraph{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "quote ", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content ", - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("single-line quote with title only", func() { - source := `[quote, ,quote title] -____ -some quote content -____ -` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.QuoteBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Quote, - types.AttrQuoteTitle: "quote title", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some quote content ", - }, + &types.StringElement{ + Content: "some ", }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("multi-line quote with rendered list and without author and title", func() { - source := `[quote] -____ -* some - - -* quote - - -* content -____` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.QuoteBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Quote, - }, - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some", - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "quote ", - }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "quote", }, }, }, - }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("empty quote without author and title", func() { - source := `[quote] -____ -____` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.QuoteBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Quote, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unclosed quote without author and title", func() { - source := `[quote] -____ -foo -` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.QuoteBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Quote, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("final documents", func() { - - Context("delimited blocks", func() { - - It("single-line quote block with author and title", func() { - source := `[quote, john doe, quote title] -____ -some *quote* content -____` - expected := types.Document{ - Elements: []interface{}{ - types.QuoteBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Quote, - types.AttrQuoteAuthor: "john doe", - types.AttrQuoteTitle: "quote title", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "quote", - }, - }, - }, - types.StringElement{ - Content: " content", - }, + &types.StringElement{ + Content: " content", }, }, }, @@ -326,7 +54,7 @@ ____` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("multi-line quote with author only", func() { + It("with multi-line content and author attribute", func() { source := `[quote, john doe, ] ____ - some @@ -334,59 +62,53 @@ ____ - content ____ ` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.QuoteBlock{ + &types.DelimitedBlock{ + Kind: types.Quote, Attributes: types.Attributes{ types.AttrStyle: types.Quote, types.AttrQuoteAuthor: "john doe", }, Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + // suffix spaces are trimmed on each line + &types.UnorderedListElement{ BulletStyle: types.Dash, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "some", }, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.Dash, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "quote ", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "quote", }, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.Dash, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content ", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", }, }, }, @@ -401,26 +123,26 @@ ____ Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("single-line quote with title only", func() { + It("with single-line content with title attribute", func() { source := `[quote, ,quote title] ____ some quote content ____ ` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.QuoteBlock{ + &types.DelimitedBlock{ + Kind: types.Quote, Attributes: types.Attributes{ types.AttrStyle: types.Quote, types.AttrQuoteTitle: "quote title", }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some quote content ", - }, + // suffix spaces are trimmed on each line + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "some quote content", }, }, }, @@ -436,13 +158,13 @@ ____ ____ .foo ____` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.QuoteBlock{ + &types.DelimitedBlock{ + Kind: types.Quote, Attributes: types.Attributes{ types.AttrStyle: types.Quote, }, - Elements: []interface{}{}, }, }, } @@ -456,30 +178,30 @@ ____` ____ * some ---- -* quote +* listing ---- * content ____` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.QuoteBlock{ + &types.DelimitedBlock{ + Kind: types.Quote, Attributes: types.Attributes{ types.AttrStyle: types.Quote, }, Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + // suffix spaces are trimmed on each line + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "some", }, }, }, @@ -487,28 +209,25 @@ ____` }, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "* quote ", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "* listing", }, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", }, }, }, @@ -534,58 +253,52 @@ ____ * content ____` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.QuoteBlock{ + &types.DelimitedBlock{ + Kind: types.Quote, Attributes: types.Attributes{ types.AttrStyle: types.Quote, }, Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + // suffix spaces are trimmed on each line + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "some", }, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "quote ", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "quote", }, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", }, }, }, @@ -604,13 +317,13 @@ ____` source := `[quote] ____ ____` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.QuoteBlock{ + &types.DelimitedBlock{ + Kind: types.Quote, Attributes: types.Attributes{ types.AttrStyle: types.Quote, }, - Elements: []interface{}{}, }, }, } @@ -622,19 +335,18 @@ ____` ____ foo ` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.QuoteBlock{ + &types.DelimitedBlock{ + Kind: types.Quote, Attributes: types.Attributes{ types.AttrStyle: types.Quote, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "foo", }, }, }, diff --git a/pkg/parser/delimited_block_sidebar_test.go b/pkg/parser/delimited_block_sidebar_test.go index 668f7105..8ffeeca7 100644 --- a/pkg/parser/delimited_block_sidebar_test.go +++ b/pkg/parser/delimited_block_sidebar_test.go @@ -10,324 +10,144 @@ import ( var _ = Describe("sidebar blocks", func() { - Context("draft documents", func() { + Context("in final documents", func() { - Context("delimited blocks", func() { - - It("with rich content", func() { - source := `**** -some *bold* content + It("with rich content", func() { + source := `**** +some *verse* content ****` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.SidebarBlock{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "bold", - }, - }, - }, - types.StringElement{ - Content: " content", - }, - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Sidebar, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "some ", }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with title, paragraph and example block", func() { - source := `.a title -**** -some *bold* content - -==== -foo -bar -==== -****` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.SidebarBlock{ - Attributes: types.Attributes{ - types.AttrTitle: "a title", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "bold", - }, - }, - }, - types.StringElement{ - Content: " content", + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "verse", }, }, }, - }, - types.BlankLine{}, - types.ExampleBlock{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, - }, - { - types.StringElement{ - Content: "bar", - }, - }, - }, - }, + &types.StringElement{ + Content: " content", }, }, }, }, }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with title, paragraph and source block", func() { - source := `.a title + It("with title, paragraph and sourcecode block", func() { + source := `.a title **** -some *bold* content +some *verse* content ---- foo bar ---- ****` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.SidebarBlock{ - Attributes: types.Attributes{ - types.AttrTitle: "a title", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "bold", - }, - }, - }, - types.StringElement{ - Content: " content", - }, - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Sidebar, + Attributes: types.Attributes{ + types.AttrTitle: "a title", + }, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "some ", }, - }, - types.BlankLine{}, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, - }, - { - types.StringElement{ - Content: "bar", + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "verse", }, }, }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("final documents", func() { - - Context("delimited blocks", func() { - - It("with rich content", func() { - source := `**** -some *verse* content -****` - expected := types.Document{ - Elements: []interface{}{ - types.SidebarBlock{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "verse", - }, - }, - }, - types.StringElement{ - Content: " content", - }, - }, + &types.StringElement{ + Content: " content", }, }, }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("with title, paragraph and sourcecode block", func() { - source := `.a title -**** -some *verse* content - ----- -foo -bar ----- -****` - expected := types.Document{ - Elements: []interface{}{ - types.SidebarBlock{ - Attributes: types.Attributes{ - types.AttrTitle: "a title", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "verse", - }, - }, - }, - types.StringElement{ - Content: " content", - }, - }, - }, - }, - types.BlankLine{}, // blankline is required between paragraph and the next block - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, - }, - { - types.StringElement{ - Content: "bar", - }, - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "foo\nbar", }, }, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with single line starting with a dot", func() { - source := ` + It("with single line starting with a dot", func() { + source := ` **** .foo ****` - expected := types.Document{ - Elements: []interface{}{ - types.SidebarBlock{ - Elements: []interface{}{}, - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Sidebar, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - }) - Context("final documents", func() { - Context("sidebar blocks", func() { - - It("with paragraph", func() { - source := `**** + It("with paragraph", func() { + source := `**** some *verse* content ****` - expected := types.Document{ - Elements: []interface{}{ - types.SidebarBlock{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "verse", - }, - }, - }, - types.StringElement{ - Content: " content", + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Sidebar, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "some ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "verse", }, }, }, + &types.StringElement{ + Content: " content", + }, }, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with title, paragraph and sourcecode block", func() { - source := `.a title + It("with title, paragraph and sourcecode block", func() { + source := `.a title **** some *verse* content @@ -336,70 +156,60 @@ foo bar ---- ****` - expected := types.Document{ - Elements: []interface{}{ - types.SidebarBlock{ - Attributes: types.Attributes{ - types.AttrTitle: "a title", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "verse", - }, - }, - }, - types.StringElement{ - Content: " content", + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Sidebar, + Attributes: types.Attributes{ + types.AttrTitle: "a title", + }, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "some ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "verse", }, }, }, + &types.StringElement{ + Content: " content", + }, }, - types.BlankLine{}, // blankline is required between paragraph and the next block - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, - }, - { - types.StringElement{ - Content: "bar", - }, - }, + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "foo\nbar", }, }, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with single line starting with a dot", func() { - source := ` + It("with single line starting with a dot", func() { + source := ` **** .foo ****` - expected := types.Document{ - Elements: []interface{}{ - types.SidebarBlock{ - Elements: []interface{}{}, - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Sidebar, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) }) diff --git a/pkg/parser/delimited_block_source_test.go b/pkg/parser/delimited_block_source_test.go index 2264cd7d..3ed33eae 100644 --- a/pkg/parser/delimited_block_source_test.go +++ b/pkg/parser/delimited_block_source_test.go @@ -10,238 +10,42 @@ import ( var _ = Describe("source blocks", func() { - Context("draft documents", func() { + Context("in final documents", func() { - Context("delimited blocks", func() { - sourceCode := [][]interface{}{ - { - types.StringElement{ - Content: "package foo", - }, - }, - {}, - { - types.StringElement{ - Content: "// Foo", - }, - }, - { - types.StringElement{ - Content: "type Foo struct{", - }, - }, - { - types.StringElement{ - Content: " Bar string", - }, - }, - { - types.StringElement{ - Content: "}", - }, - }, - } - - It("with source attribute only", func() { - source := `[source] ----- -package foo - -// Foo -type Foo struct{ - Bar string -} -----` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Source, - }, - Lines: sourceCode, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with source attribute and comma", func() { - source := `[source,] ----- -package foo - -// Foo -type Foo struct{ - Bar string -} -----` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Source, - }, - Lines: sourceCode, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with title, source and language attributes", func() { - source := `[source,go] -.foo.go ----- -package foo - -// Foo -type Foo struct{ - Bar string -} -----` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Source, - types.AttrLanguage: "go", - types.AttrTitle: "foo.go", - }, - Lines: sourceCode, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with id, title, source and language and other attributes", func() { - source := `[#id-for-source-block] -[source,go,linenums] -.foo.go + It("with source attribute only", func() { + source := `[source] ---- -package foo +require 'sinatra' -// Foo -type Foo struct{ - Bar string -} +get '/hi' do + "Hello World!" +end ----` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Source, - types.AttrLanguage: "go", - types.AttrID: "id-for-source-block", - types.AttrTitle: "foo.go", - types.AttrLineNums: true, - }, - Lines: sourceCode, + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrStyle: types.Source, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with callout and admonition block afterwards", func() { - source := `[source] ----- -const cookies = "cookies" <1> ----- -<1> a constant - -[NOTE] -==== -a note -====` - - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Source, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: `const cookies = "cookies" `, - }, - types.Callout{ - Ref: 1, - }, - }, - }, - }, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a constant", - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Note, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a note", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + Elements: []interface{}{ + &types.StringElement{ + Content: `require 'sinatra' - It("with nowrap option", func() { - source := `[source%nowrap,go] ----- -const Cookie = "cookie" -----` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Source, - types.AttrOptions: []interface{}{"nowrap"}, - types.AttrLanguage: "go", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: `const Cookie = "cookie"`, - }, - }, +get '/hi' do + "Hello World!" +end`, }, }, }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - }) - - Context("final documents", func() { - - Context("delimited block", func() { - It("with source attribute only", func() { - source := `[source] + It("with title, source and languages attributes", func() { + source := `[source,ruby] +.Source block title ---- require 'sinatra' @@ -249,91 +53,33 @@ get '/hi' do "Hello World!" end ----` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Source, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "require 'sinatra'", - }, - }, - {}, - { - types.StringElement{ - Content: "get '/hi' do", - }, - }, - { - types.StringElement{ - Content: " \"Hello World!\"", - }, - }, - { - types.StringElement{ - Content: "end", - }, - }, - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrStyle: types.Source, + types.AttrLanguage: "ruby", + types.AttrTitle: "Source block title", }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("with title, source and languages attributes", func() { - source := `[source,ruby] -.Source block title ----- -require 'sinatra' + Elements: []interface{}{ + &types.StringElement{ + Content: `require 'sinatra' get '/hi' do "Hello World!" -end -----` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Source, - types.AttrLanguage: "ruby", - types.AttrTitle: "Source block title", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "require 'sinatra'", - }, - }, - {}, - { - types.StringElement{ - Content: "get '/hi' do", - }, - }, - { - types.StringElement{ - Content: " \"Hello World!\"", - }, - }, - { - types.StringElement{ - Content: "end", - }, - }, +end`, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with id, title, source and languages attributes", func() { - source := `[#id-for-source-block] -[source,ruby] + It("with id, title, source, languages and linenums attributes", func() { + source := `[#id-for-source-block] +[source,ruby,linenums] .app.rb ---- require 'sinatra' @@ -342,46 +88,34 @@ get '/hi' do "Hello World!" end ----` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Source, - types.AttrLanguage: "ruby", - types.AttrID: "id-for-source-block", - types.AttrTitle: "app.rb", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "require 'sinatra'", - }, - }, - {}, - { - types.StringElement{ - Content: "get '/hi' do", - }, - }, - { - types.StringElement{ - Content: " \"Hello World!\"", - }, - }, - { - types.StringElement{ - Content: "end", - }, - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrStyle: types.Source, + types.AttrLanguage: "ruby", + types.AttrID: "id-for-source-block", + types.AttrTitle: "app.rb", + types.AttrLineNums: true, + }, + Elements: []interface{}{ + &types.StringElement{ + Content: `require 'sinatra' + +get '/hi' do + "Hello World!" +end`, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("with callout and admonition block afterwards", func() { - source := `[source] + It("with callout and admonition block afterwards", func() { + source := `[source] ---- const cookies = "cookies" <1> ---- @@ -392,61 +126,57 @@ const cookies = "cookies" <1> a note ====` - expected := types.Document{ - Elements: []interface{}{ - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Source, + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrStyle: types.Source, + }, + Elements: []interface{}{ + &types.StringElement{ + Content: `const cookies = "cookies" `, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: `const cookies = "cookies" `, - }, - types.Callout{ - Ref: 1, - }, - }, + &types.Callout{ + Ref: 1, }, }, - types.CalloutList{ - Items: []types.CalloutListItem{ - { - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a constant", - }, - }, + }, + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a constant", }, }, }, }, }, }, - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Note, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a note", - }, - }, + }, + &types.DelimitedBlock{ + Kind: types.Example, + Attributes: types.Attributes{ + types.AttrStyle: types.Note, + }, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a note", }, }, }, }, }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) }) diff --git a/pkg/parser/delimited_block_verse_test.go b/pkg/parser/delimited_block_verse_test.go index 7f886e71..412515a8 100644 --- a/pkg/parser/delimited_block_verse_test.go +++ b/pkg/parser/delimited_block_verse_test.go @@ -12,47 +12,82 @@ import ( var _ = Describe("verse blocks", func() { - Context("draft documents", func() { + Context("in final documents", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("single line verse with author and title", func() { source := `[verse, john doe, verse title] ____ some *verse* content ____` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "verse", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "some ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "verse", }, }, - types.StringElement{ - Content: " content", + }, + &types.StringElement{ + Content: " content", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("single line verse with author and title and empty lines around", func() { + source := `[verse, john doe, verse title] +____ + +some *verse* content + +____` + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Verse, + Attributes: types.Attributes{ + types.AttrStyle: types.Verse, + types.AttrQuoteAuthor: "john doe", + types.AttrQuoteTitle: "verse title", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "some ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "verse", + }, }, }, + &types.StringElement{ + Content: " content", // without trailing `\n` for the empty line afterwards + }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("multi-line verse with unrendered list and author only", func() { @@ -63,34 +98,23 @@ ____ - content ____ ` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "- some ", - }, - }, - { - types.StringElement{ - Content: "- verse ", - }, - }, - { - types.StringElement{ - Content: "- content ", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "- some\n- verse\n- content", // suffix spaces are trimmed }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("multi-line verse with title only", func() { @@ -99,24 +123,24 @@ ____ some verse content ____ ` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteTitle: "verse title", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some verse content ", - }, + Elements: []interface{}{ + &types.StringElement{ + // suffix spaces are trimmed + Content: "some verse content", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("multi-line verse with unrendered lists and block without author and title", func() { @@ -128,43 +152,23 @@ ____ ---- * content ____` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "* some", - }, - }, - { - types.StringElement{ - Content: "----", - }, - }, - { - types.StringElement{ - Content: "* verse ", - }, - }, - { - types.StringElement{ - Content: "----", - }, - }, - { - types.StringElement{ - Content: "* content", - }, + Elements: []interface{}{ + &types.StringElement{ + // suffix spaces are trimmed on each line + Content: "* some\n----\n* verse\n----\n* content", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("multi-line verse with unrendered list without author and title", func() { @@ -175,49 +179,39 @@ ____ * bar ____` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "* foo", - }, - }, - {}, - {}, - { - types.StringElement{ - Content: "\t* bar", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "* foo\n\n\n\t* bar", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("empty verse without author and title", func() { source := `[verse] ____ ____` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, }, - Lines: [][]interface{}{ - {}, - }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("unclosed verse without author and title", func() { @@ -225,23 +219,22 @@ ____` ____ foo ` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "foo", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) Context("with custom substitutions", func() { @@ -263,108 +256,104 @@ ____ It("should apply the default substitution", func() { s := strings.ReplaceAll(source, "[subs=\"$SUBS\"]\n", "") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, - types.StringElement{ - Content: " ", - }, - types.SpecialCharacter{ // callout is not detected with the `normal` susbtitution - Name: "<", - }, - types.StringElement{ - Content: "1", - }, - types.SpecialCharacter{ - Name: ">", - }, }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the", - }, - types.LineBreak{}, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, + &types.StringElement{ + Content: " ", + }, + &types.SpecialCharacter{ // callout is not detected with the `normal` susbtitution + Name: "<", + }, + &types.StringElement{ + Content: "1", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "more text", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the", + }, + &types.LineBreak{}, + &types.StringElement{ + Content: "\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", }, }, - types.StringElement{ - Content: " lines with a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, + }, + &types.StringElement{ + Content: " lines with a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", }, }, }, }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + &types.StringElement{ + Content: "\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -373,114 +362,110 @@ ____ }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) It("should apply the 'normal' substitution", func() { s := strings.ReplaceAll(source, "$SUBS", "normal") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", types.AttrSubstitutions: "normal", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, - types.StringElement{ - Content: " ", - }, - types.SpecialCharacter{ // callout is not detected with the `normal` susbtitution - Name: "<", - }, - types.StringElement{ - Content: "1", - }, - types.SpecialCharacter{ - Name: ">", - }, }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the", - }, - types.LineBreak{}, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, + &types.StringElement{ + Content: " ", + }, + &types.SpecialCharacter{ // callout is not detected with the `normal` susbtitution + Name: "<", + }, + &types.StringElement{ + Content: "1", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "more text", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the", + }, + &types.LineBreak{}, + &types.StringElement{ + Content: "\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", }, }, - types.StringElement{ - Content: " lines with a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, + }, + &types.StringElement{ + Content: " lines with a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", }, }, }, }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + &types.StringElement{ + Content: "\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -489,69 +474,56 @@ ____ }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) It("should apply the 'quotes' substitution", func() { s := strings.ReplaceAll(source, "$SUBS", "quotes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", types.AttrSubstitutions: "quotes", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the +\n", }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", }, }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -560,74 +532,58 @@ ____ }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) It("should apply the 'macros' substitution", func() { s := strings.ReplaceAll(source, "$SUBS", "macros") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", types.AttrSubstitutions: "macros", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, - types.StringElement{ - Content: " <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + &types.StringElement{ + Content: " <1>\nand on the +\n*next* lines with a link to {github-url}[]\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -636,61 +592,45 @@ ____ }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) It("should apply the 'attributes' substitution", func() { s := strings.ReplaceAll(source, "$SUBS", "attributes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", types.AttrSubstitutions: "attributes", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to https://github.com[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the +\n*next* lines with a link to https://github.com[]\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -699,84 +639,71 @@ ____ }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) It("should apply the 'attributes,macros' substitution", func() { s := strings.ReplaceAll(source, "$SUBS", "attributes,macros") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", types.AttrSubstitutions: "attributes,macros", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, - types.StringElement{ - Content: " <1>", - }, }, - { - types.StringElement{ - Content: "and on the +", - }, + &types.StringElement{ + Content: " <1>\nand on the +\n*next* lines with a link to ", }, - { - types.StringElement{ - Content: "*next* lines with a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", }, }, }, }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + &types.StringElement{ + Content: "\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -785,82 +712,69 @@ ____ }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) It("should apply the 'specialchars' substitution", func() { s := strings.ReplaceAll(source, "$SUBS", "specialchars") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", types.AttrSubstitutions: "specialchars", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "1", - }, - types.SpecialCharacter{ - Name: ">", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] ", }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the +", - }, + &types.SpecialCharacter{ + Name: "<", }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, + &types.StringElement{ + Content: "1", }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: "\nand ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "more text", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: " on the +\n*next* lines with a link to {github-url}[]\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -869,61 +783,45 @@ ____ }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) It("should apply the 'replacements' substitution", func() { s := strings.ReplaceAll(source, "$SUBS", "replacements") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", types.AttrSubstitutions: "replacements", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the +\n*next* lines with a link to {github-url}[]\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -932,62 +830,49 @@ ____ }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) It("should apply the 'post_replacements' substitution", func() { s := strings.ReplaceAll(source, "$SUBS", "post_replacements") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", types.AttrSubstitutions: "post_replacements", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the", - }, - types.LineBreak{}, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the", }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + &types.LineBreak{}, + &types.StringElement{ + Content: "\n*next* lines with a link to {github-url}[]\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -996,82 +881,71 @@ ____ }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + doc, err := ParseDocument(s) + Expect(err).NotTo(HaveOccurred()) + Expect(doc).To(MatchDocument(expected)) }) It("should apply the 'quotes,macros' substitution", func() { s := strings.ReplaceAll(source, "$SUBS", "quotes,macros") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", types.AttrSubstitutions: "quotes,macros", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, - types.StringElement{ - Content: " <1>", - }, }, - { - types.StringElement{ - Content: "and on the +", - }, + &types.StringElement{ + Content: " <1>\nand on the +\n", }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", }, }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -1080,82 +954,69 @@ ____ }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) It("should apply the 'macros,quotes' substitution", func() { s := strings.ReplaceAll(source, "$SUBS", "macros,quotes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", types.AttrSubstitutions: "macros,quotes", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, - types.StringElement{ - Content: " <1>", - }, }, - { - types.StringElement{ - Content: "and on the +", - }, + &types.StringElement{ + Content: " <1>\nand on the +\n", }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "next", }, }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + &types.StringElement{ + Content: " lines with a link to {github-url}[]\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -1164,61 +1025,45 @@ ____ }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) It("should apply the 'none' substitution", func() { s := strings.ReplaceAll(source, "$SUBS", "none") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + //Attributes: types.Attributes{ + // "github-url": "https://github.com", + //}, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.VerseBlock{ + &types.DelimitedBlock{ + Kind: types.Verse, Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", types.AttrSubstitutions: "none", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to https://example.com[] <1>\nand on the +\n*next* lines with a link to {github-url}[]\n\n* not a list item", }, }, }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, }, }, }, @@ -1227,241 +1072,10 @@ ____ }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) }) - }) - }) - Context("final documents", func() { - - Context("delimited blocks", func() { - - It("single line verse with author and title", func() { - source := `[verse, john doe, verse title] -____ -some *verse* content -____` - expected := types.Document{ - Elements: []interface{}{ - types.VerseBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Verse, - types.AttrQuoteAuthor: "john doe", - types.AttrQuoteTitle: "verse title", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "verse", - }, - }, - }, - types.StringElement{ - Content: " content", - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("multi-line verse with unrendered list and author only", func() { - source := `[verse, john doe, ] -____ -- some -- verse -- content -____ -` - expected := types.Document{ - Elements: []interface{}{ - types.VerseBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Verse, - types.AttrQuoteAuthor: "john doe", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "- some ", - }, - }, - { - types.StringElement{ - Content: "- verse ", - }, - }, - { - types.StringElement{ - Content: "- content ", - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("multi-line verse with title only", func() { - source := `[verse, ,verse title] -____ -some verse content -____ -` - expected := types.Document{ - Elements: []interface{}{ - types.VerseBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Verse, - types.AttrQuoteTitle: "verse title", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some verse content ", - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("multi-line verse with unrendered lists and block without author and title", func() { - source := `[verse] -____ -* some ----- -* verse ----- -* content -____` - expected := types.Document{ - Elements: []interface{}{ - types.VerseBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Verse, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "* some", - }, - }, - { - types.StringElement{ - Content: "----", - }, - }, - { - types.StringElement{ - Content: "* verse ", - }, - }, - { - types.StringElement{ - Content: "----", - }, - }, - { - types.StringElement{ - Content: "* content", - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("multi-line verse with unrendered list without author and title", func() { - source := `[verse] -____ -* foo - - - * bar -____` - expected := types.Document{ - Elements: []interface{}{ - types.VerseBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Verse, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "* foo", - }, - }, - {}, - {}, - { - types.StringElement{ - Content: "\t* bar", - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("empty verse without author and title", func() { - source := `[verse] -____ -____` - expected := types.Document{ - Elements: []interface{}{ - types.VerseBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Verse, - }, - Lines: [][]interface{}{ - {}, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("unclosed verse without author and title", func() { - source := `[verse] -____ -foo -` - expected := types.Document{ - Elements: []interface{}{ - types.VerseBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Verse, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) }) }) diff --git a/pkg/parser/document_attributes_test.go b/pkg/parser/document_attributes_test.go deleted file mode 100644 index 83fd4b20..00000000 --- a/pkg/parser/document_attributes_test.go +++ /dev/null @@ -1,1381 +0,0 @@ -package parser_test - -import ( - "github.com/bytesparadise/libasciidoc/pkg/configuration" - "github.com/bytesparadise/libasciidoc/pkg/types" - . "github.com/bytesparadise/libasciidoc/testsupport" - - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint -) - -var _ = Describe("document attributes", func() { - - Context("valid attributes", func() { - - It("header alone", func() { - source := `= Document Title - -This journey continues.` - - title := []interface{}{ - types.StringElement{Content: "Document Title"}, - } - expected := types.Document{ - ElementReferences: types.ElementReferences{ - "_document_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_document_title", - }, - Title: title, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "This journey continues."}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - Context("document authors", func() { - - Context("single author", func() { - - It("all author data with extra spaces", func() { - source := `= title -John Foo Doe ` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Foo Doe", - Email: "johndoe@example.com", - }, - }, - "firstname": "John", - "middlename": "Foo", - "lastname": "Doe", - "author": "John Foo Doe", - "authorinitials": "JFD", - "email": "johndoe@example.com", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("lastname with underscores", func() { - source := `= title -Jane the_Doe ` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "Jane the Doe", - Email: "jane@example.com", - }, - }, - "firstname": "Jane", - "lastname": "the Doe", - "author": "Jane the Doe", - "authorinitials": "Jt", - "email": "jane@example.com", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("with middlename and composed lastname", func() { - source := `= title -Jane Foo the Doe ` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "Jane Foo the Doe", - Email: "jane@example.com", - }, - }, - "firstname": "Jane", - "middlename": "Foo", - "lastname": "the Doe", - "author": "Jane Foo the Doe", - "authorinitials": "JFt", - "email": "jane@example.com", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("firstname and lastname only", func() { - source := `= title -John Doe` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("firstname only", func() { - source := `= title -Doe` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "Doe", - }, - }, - "firstname": "Doe", - "author": "Doe", - "authorinitials": "D", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("alternate author input", func() { - source := `= title -:author: John Foo Doe` // `:"email":` is processed as a regular attribute - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Foo Doe", - }, - }, - "firstname": "John", - "middlename": "Foo", - "lastname": "Doe", - "author": "John Foo Doe", - "authorinitials": "JFD", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - }) - - Context("multiple authors", func() { - - It("2 authors", func() { - source := `= title -John Foo Doe ; Jane the_Doe ` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Foo Doe", - Email: "johndoe@example.com", - }, - { - FullName: "Jane the Doe", - Email: "jane@example.com", - }, - }, - "firstname": "John", - "middlename": "Foo", - "lastname": "Doe", - "author": "John Foo Doe", - "authorinitials": "JFD", - "email": "johndoe@example.com", - "firstname_2": "Jane", - "lastname_2": "the Doe", - "author_2": "Jane the Doe", - "authorinitials_2": "Jt", - "email_2": "jane@example.com", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - }) - - Context("authors and comments", func() { - - It("authors commented out", func() { - source := `= title - // John Foo Doe ; Jane the_Doe ` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("authors after a single comment line", func() { - source := `= title - // a comment - John Foo Doe ; Jane the_Doe ` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Foo Doe", - Email: "johndoe@example.com", - }, - { - FullName: "Jane the Doe", - Email: "jane@example.com", - }, - }, - "firstname": "John", - "middlename": "Foo", - "lastname": "Doe", - "author": "John Foo Doe", - "authorinitials": "JFD", - "email": "johndoe@example.com", - "firstname_2": "Jane", - "lastname_2": "the Doe", - "author_2": "Jane the Doe", - "authorinitials_2": "Jt", - "email_2": "jane@example.com", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("authors after a comment block", func() { - source := `= title -//// -a comment -//// -John Foo Doe ; Jane the_Doe ` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Foo Doe", - Email: "johndoe@example.com", - }, - { - FullName: "Jane the Doe", - Email: "jane@example.com", - }, - }, - "firstname": "John", - "middlename": "Foo", - "lastname": "Doe", - "author": "John Foo Doe", - "authorinitials": "JFD", - "email": "johndoe@example.com", - "firstname_2": "Jane", - "lastname_2": "the Doe", - "author_2": "Jane the Doe", - "authorinitials_2": "Jt", - "email_2": "jane@example.com", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - }) - }) - - Context("document revisions", func() { - - It("full document revision", func() { - source := `= title - John Doe - v1.0, March 29, 2020: Updated revision` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - types.AttrRevision: types.DocumentRevision{ - Revnumber: "1.0", - Revdate: "March 29, 2020", - Revremark: "Updated revision", - }, - "revnumber": "1.0", - "revdate": "March 29, 2020", - "revremark": "Updated revision", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("full document revision with a comment before author", func() { - source := `= title - // a comment - John Doe - v1.0, March 29, 2020: Updated revision` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - types.AttrRevision: types.DocumentRevision{ - Revnumber: "1.0", - Revdate: "March 29, 2020", - Revremark: "Updated revision", - }, - "revnumber": "1.0", - "revdate": "March 29, 2020", - "revremark": "Updated revision", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("full document revision with a comment before revision", func() { - source := `= title - John Doe - // a comment - v1.0, March 29, 2020: Updated revision` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - types.AttrRevision: types.DocumentRevision{ - Revnumber: "1.0", - Revdate: "March 29, 2020", - Revremark: "Updated revision", - }, - "revnumber": "1.0", - "revdate": "March 29, 2020", - "revremark": "Updated revision", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("revision with revnumber and revdate only", func() { - source := `= title - John Doe - v1.0, March 29, 2020` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - types.AttrRevision: types.DocumentRevision{ - Revnumber: "1.0", - Revdate: "March 29, 2020", - }, - "revnumber": "1.0", - "revdate": "March 29, 2020", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("revision with revnumber and revdate - with colon separator", func() { - source := `= title - John Doe - 1.0, March 29, 2020:` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - types.AttrRevision: types.DocumentRevision{ - Revnumber: "1.0", - Revdate: "March 29, 2020", - }, - "revnumber": "1.0", - "revdate": "March 29, 2020", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - It("revision with revnumber only - comma suffix", func() { - source := `= title - John Doe - 1.0,` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - types.AttrRevision: types.DocumentRevision{ - Revnumber: "1.0", - }, - "revnumber": "1.0", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("revision with revdate as number - spaces and no prefix no suffix", func() { - source := `= title - John Doe - 1.0` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - types.AttrRevision: types.DocumentRevision{ - Revdate: "1.0", - }, - "revdate": "1.0", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("revision with revdate as alphanum - spaces and no prefix no suffix", func() { - source := `= title - John Doe - 1.0a` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - types.AttrRevision: types.DocumentRevision{ - Revdate: "1.0a", - }, - "revdate": "1.0a", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("revision with revnumber only", func() { - source := `= title - John Doe - v1.0:` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - types.AttrRevision: types.DocumentRevision{ - Revnumber: "1.0", - }, - "revnumber": "1.0", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("revision with spaces and capital revnumber ", func() { - source := `= title - John Doe - V1.0:` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - types.AttrRevision: types.DocumentRevision{ - Revnumber: "1.0", - }, - "revnumber": "1.0", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("revision only - with comma separator", func() { - source := `= title - John Doe - v1.0,` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - types.AttrRevision: types.DocumentRevision{ - Revnumber: "1.0", - }, - "revnumber": "1.0", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("revision with revnumber plus comma and colon separators", func() { - source := `= title - John Doe - v1.0,:` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - types.AttrRevision: types.DocumentRevision{ - Revnumber: "1.0", - }, - "revnumber": "1.0", - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("revision with revnumber and empty revremark", func() { - source := `= title -John Doe -v1.0:` - title := []interface{}{ - types.StringElement{ - Content: "title", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Doe", - }, - }, - "firstname": "John", - "lastname": "Doe", - "author": "John Doe", - "authorinitials": "JD", - types.AttrRevision: types.DocumentRevision{ - Revnumber: "1.0", - }, - "revnumber": "1.0", - // "revremark": "", // found but is empty - }, - ElementReferences: types.ElementReferences{ - "_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_title", - }, - Title: title, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - }) - - Context("document header attributes", func() { - - It("valid attribute names", func() { - source := `:a: -:author: Xavier -:_author: Xavier -:Author: Xavier -:0Author: Xavier -:Auth0r: Xavier` - expected := types.Document{ - Attributes: types.Attributes{ - "a": nil, - "author": "Xavier", - "_author": "Xavier", - "Author": "Xavier", - "0Author": "Xavier", - "Auth0r": "Xavier", - }, - Elements: []interface{}{}, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("attributes and paragraph without blank line in-between", func() { - source := `:toc: -:date: 2017-01-01 -:author: Xavier -:hardbreaks: -a paragraph` - expected := types.Document{ - Attributes: types.Attributes{ - "toc": nil, - "date": "2017-01-01", - "author": "Xavier", - types.DocumentAttrHardBreaks: nil, - }, - Elements: []interface{}{ - types.TableOfContentsPlaceHolder{}, - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{Content: "a paragraph"}}, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("contiguous attributes and paragraph with blank line in-between", func() { - source := `:toc: -:date: 2017-01-01 -:author: Xavier - -a paragraph` - expected := types.Document{ - Attributes: types.Attributes{ - "toc": nil, - "date": "2017-01-01", - "author": "Xavier", - }, - Elements: []interface{}{ - types.TableOfContentsPlaceHolder{}, - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{Content: "a paragraph"}}, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("splitted attributes and paragraph with blank line in-between", func() { - source := `:toc: -:date: 2017-01-01 - -:author: Xavier - -:hardbreaks: - -a paragraph` - expected := types.Document{ - Attributes: types.Attributes{ - "toc": nil, - "date": "2017-01-01", - "author": "Xavier", - "hardbreaks": nil, - }, - Elements: []interface{}{ - types.TableOfContentsPlaceHolder{}, - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{Content: "a paragraph"}}, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("no header and attributes in body", func() { - source := `a paragraph - -:toc: -:date: 2017-01-01 -:author: Xavier` - expected := types.Document{ - Attributes: types.Attributes{ - "toc": nil, - "date": "2017-01-01", - "author": "Xavier", - }, - Elements: []interface{}{ - types.TableOfContentsPlaceHolder{}, - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{Content: "a paragraph"}}, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - }) - - Context("document attribute substitutions", func() { - - It("paragraph with attribute substitution", func() { - source := `:author: Xavier - -a paragraph written by {author}.` - expected := types.Document{ - Attributes: types.Attributes{ - "author": "Xavier", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{Content: "a paragraph written by Xavier."}}, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("paragraph with attribute resets", func() { - source := `:author: Xavier - -:!author1: -:author2!: -a paragraph written by {author}.` - expected := types.Document{ - Attributes: types.Attributes{ - "author": "Xavier", - "author1": nil, - "author2": nil, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{Content: "a paragraph written by Xavier."}}, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("header with 2 authors, revision and attributes", func() { - source := `= Document Title -John Foo Doe ; Jane the_Doe -v1.0, March 29, 2020: Updated revision -:toc: -:keywords: documentation, team, obstacles, journey, victory - -This journey continues` - title := []interface{}{ - types.StringElement{Content: "Document Title"}, - } - expected := types.Document{ - Attributes: types.Attributes{ - "toc": nil, - "keywords": "documentation, team, obstacles, journey, victory", - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "John Foo Doe", - Email: "johndoe@example.com", - }, - { - FullName: "Jane the Doe", - Email: "jane@example.com", - }, - }, - "firstname": "John", - "middlename": "Foo", - "lastname": "Doe", - "author": "John Foo Doe", - "authorinitials": "JFD", - "email": "johndoe@example.com", - "firstname_2": "Jane", - "lastname_2": "the Doe", - "author_2": "Jane the Doe", - "authorinitials_2": "Jt", - "email_2": "jane@example.com", - types.AttrRevision: types.DocumentRevision{ - Revnumber: "1.0", - Revdate: "March 29, 2020", - Revremark: "Updated revision", - }, - "revnumber": "1.0", - "revdate": "March 29, 2020", - "revremark": "Updated revision", - }, - ElementReferences: types.ElementReferences{ - "_document_title": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_document_title", - }, - Title: title, - Elements: []interface{}{ - types.TableOfContentsPlaceHolder{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "This journey continues"}, - }, - }, - }, - }, - }, - }, - } - result, err := ParseDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDocument(expected)) - }) - - It("paragraph with attribute substitution from front-matter", func() { - source := `--- -author: Xavier ---- - -a paragraph written by {author}.` - expected := types.Document{ - Attributes: types.Attributes{ - "author": "Xavier", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{Content: "a paragraph written by Xavier."}}, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - }) - - }) - - Context("invalid attributes", func() { - - It("paragraph without blank line before attribute declarations", func() { - source := `a paragraph -:toc: -:date: 2017-01-01 -:author: Xavier` - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - { - types.StringElement{Content: ":toc:"}, - }, - { - types.StringElement{Content: ":date: 2017-01-01"}, - }, - { - types.StringElement{Content: ":author: Xavier"}, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("invalid attribute names", func() { - source := `:@date: 2017-01-01 -:{author}: Xavier` - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: ":@date: 2017-01-01"}, - }, - { - types.StringElement{Content: ":{author}: Xavier"}, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - }) - - Context("with overrides", func() { - - It("custom icon attribute", func() { - // given - attrs := map[string]string{ - "icons": "font", - "source-highlighter": "pygments", - } - source := `{icons}` - expected := types.Document{ - Attributes: types.Attributes{ - "icons": "font", - "source-highlighter": "pygments", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "font"}, - }, - }, - }, - }, - } - Expect(ParseDocument(source, configuration.WithAttributes(attrs))).To(Equal(expected)) - }) - }) -}) diff --git a/pkg/parser/document_fragment_processing_test.go b/pkg/parser/document_fragment_processing_test.go new file mode 100644 index 00000000..65d59583 --- /dev/null +++ b/pkg/parser/document_fragment_processing_test.go @@ -0,0 +1,262 @@ +package parser_test + +import ( + "github.com/bytesparadise/libasciidoc/pkg/configuration" + "github.com/bytesparadise/libasciidoc/pkg/types" + . "github.com/bytesparadise/libasciidoc/testsupport" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("document processing", func() { + + Context("article docs", func() { + + It("should retain attributes passed in configuration", func() { + source := `[source] +---- +foo +----` + expected := &types.Document{ + // Attributes: types.Attributes{ + // types.AttrSyntaxHighlighter: "pygments", + // }, + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrStyle: types.Source, + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "foo", + }, + }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithAttributes(map[string]interface{}{ + types.AttrSyntaxHighlighter: "pygments", + }))).To(MatchDocument(expected)) + }) + + It("should include toc and preamble", func() { + source := `= A title +:toc: + +Preamble comes here + +== Section A + +=== Section A.a + +== Section B + +== Section C` + titleSectionA := []interface{}{ + &types.StringElement{ + Content: "Section A", + }, + } + titleSectionAa := []interface{}{ + &types.StringElement{ + Content: "Section A.a", + }, + } + titleSectionB := []interface{}{ + &types.StringElement{ + Content: "Section B", + }, + } + titleSectionC := []interface{}{ + &types.StringElement{ + Content: "Section C", + }, + } + expected := &types.Document{ + // Attributes: types.Attributes{ + // types.AttrTableOfContents: nil, + // }, + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "A title", + }, + }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "toc", + }, + }, + }, + &types.Preamble{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Preamble comes here", + }, + }, + }, + }, + }, + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_section_a", + }, + Title: titleSectionA, + Elements: []interface{}{ + &types.Section{ + Level: 2, + Attributes: types.Attributes{ + types.AttrID: "_section_a_a", + }, + Title: titleSectionAa, + }, + }, + }, + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_section_b", + }, + Title: titleSectionB, + }, + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_section_c", + }, + Title: titleSectionC, + }, + }, + ElementReferences: types.ElementReferences{ + "_section_a": titleSectionA, + "_section_a_a": titleSectionAa, + "_section_b": titleSectionB, + "_section_c": titleSectionC, + }, + TableOfContents: &types.TableOfContents{ + Sections: []*types.ToCSection{ + { + ID: "_section_a", + Level: 1, + Title: "Section A", + Children: []*types.ToCSection{ + { + ID: "_section_a_a", + Level: 2, + Title: "Section A.a", + }, + }, + }, + { + ID: "_section_b", + Level: 1, + Title: "Section B", + }, + { + ID: "_section_c", + Level: 1, + Title: "Section C", + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) + + Context("manpage docs", func() { + + It("manpage without preamble", func() { + source := `= eve(1) +Andrew Stanton +v1.0.0 + +== Name + +eve - analyzes an image to determine if it's a picture of a life form + +== Synopsis +` + nameSectionTitle := []interface{}{ + &types.StringElement{ + Content: "Name", + }, + } + synopisSectionTitle := []interface{}{ + &types.StringElement{ + Content: "Synopsis", + }, + } + + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "eve(1)", + }, + }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "Andrew", + LastName: "Stanton", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0.0", + }, + }, + }, + }, + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_name", + }, + Title: nameSectionTitle, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "eve - analyzes an image to determine if it\u2019s a picture of a life form", + }, + }, + }, + }, + }, + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_synopsis", + }, + Title: synopisSectionTitle, + }, + }, + ElementReferences: types.ElementReferences{ + "_name": nameSectionTitle, + "_synopsis": synopisSectionTitle, + }, + } + Expect(ParseDocument(source, + configuration.WithAttributes(map[string]interface{}{ + types.AttrDocType: "manpage", + }, + ))).To(MatchDocument(expected)) + }) + + }) +}) diff --git a/pkg/parser/document_header_test.go b/pkg/parser/document_header_test.go new file mode 100644 index 00000000..90ac522a --- /dev/null +++ b/pkg/parser/document_header_test.go @@ -0,0 +1,1258 @@ +package parser_test + +import ( + "github.com/bytesparadise/libasciidoc/pkg/configuration" + "github.com/bytesparadise/libasciidoc/pkg/types" + . "github.com/bytesparadise/libasciidoc/testsupport" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("headers", func() { + + Context("in final documents", func() { + + Context("valid cases", func() { + + It("header alone", func() { + source := `= Title + +This journey continues.` + + Title := []interface{}{ + &types.StringElement{Content: "Title"}, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "This journey continues."}, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("header with attributes", func() { + source := `[.role1#anchor.role2] += Title + +This journey continues.` + + Title := []interface{}{ + &types.StringElement{Content: "Title"}, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Attributes: types.Attributes{ + types.AttrRoles: []interface{}{"role1", "role2"}, + types.AttrID: "anchor", + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "This journey continues."}, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("header with attribute declarations and resets", func() { + source := `= A Title +:author: Xavier +:version-label!: +` + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "A Title", + }, + }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "authors", + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "Xavier", + }, + }, + }, + }, + &types.AttributeReset{ + Name: "version-label", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + Context("with authors", func() { + + Context("single author", func() { + + It("all author data with extra spaces", func() { + source := `= Title +John Foo Doe ` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + MiddleName: "Foo", + LastName: "Doe", + }, + Email: "johndoe@example.com", + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("lastname with underscores", func() { + source := `= Title +Jane the_Doe ` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "Jane", + LastName: "the Doe", + }, + Email: "jane@example.com", + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("with middlename and composed lastname", func() { + source := `= Title +Jane Foo the Doe ` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "Jane", + MiddleName: "Foo", + LastName: "the Doe", + }, + Email: "jane@example.com", + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("firstname and lastname only", func() { + source := `= Title +John Doe` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("firstname only", func() { + source := `= Title +Doe` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "Doe", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("alternate author input", func() { + source := `= Title +:author: John Foo Doe` // `:"email":` is processed as a regular attribute + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + MiddleName: "Foo", + LastName: "Doe", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) + + Context("multiple authors", func() { + + It("2 authors", func() { + source := `= Title +John Foo Doe ; Jane the_Doe ` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + MiddleName: "Foo", + LastName: "Doe", + }, + Email: "johndoe@example.com", + }, + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "Jane", + LastName: "the Doe", + }, + Email: "jane@example.com", + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) + + Context("authors and comments", func() { + + It("authors commented out", func() { + source := `= Title +// John Foo Doe ; Jane the_Doe ` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("authors after a single comment line", func() { + source := `= Title +// a comment +John Foo Doe ; Jane the_Doe ` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + MiddleName: "Foo", + LastName: "Doe", + }, + Email: "johndoe@example.com", + }, + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "Jane", + LastName: "the Doe", + }, + Email: "jane@example.com", + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("authors after a comment block", func() { + source := `= Title +//// +a comment +//// +John Foo Doe ; Jane the_Doe ` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + MiddleName: "Foo", + LastName: "Doe", + }, + Email: "johndoe@example.com", + }, + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "Jane", + LastName: "the Doe", + }, + Email: "jane@example.com", + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) + }) + + Context("with revisions", func() { + + It("full document revision without any comment", func() { + source := `= Title +John Doe +v1.0, March 29, 2020: Updated revision` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + Revdate: "March 29, 2020", + Revremark: "Updated revision", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("full document revision with various comments", func() { + source := `= Title +// a single-line comment +John Doe +//// +a comment block + +with an empty line +//// +v1.0, March 29, 2020: Updated revision +//// +another comment block + +with another empty line +//// +` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + Revdate: "March 29, 2020", + Revremark: "Updated revision", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("full document revision with a comment before author", func() { + source := `= Title +// a comment +John Doe +v1.0, March 29, 2020: Updated revision` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + Revdate: "March 29, 2020", + Revremark: "Updated revision", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("full document revision with a singleline comment before revision", func() { + source := `= Title +John Doe +// a comment +v1.0, March 29, 2020: Updated revision` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + Revdate: "March 29, 2020", + Revremark: "Updated revision", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("revision with revnumber and revdate only", func() { + source := `= Title + John Doe + v1.0, March 29, 2020` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + Revdate: "March 29, 2020", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("revision with revnumber and revdate - with colon separator", func() { + source := `= Title + John Doe + 1.0, March 29, 2020:` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + Revdate: "March 29, 2020", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("revision with revnumber only - comma suffix", func() { + source := `= Title + John Doe + 1.0,` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("revision with revdate as number - spaces and no prefix no suffix", func() { + source := `= Title + John Doe + 1.0` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revdate: "1.0", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("revision with revdate as alphanum - spaces and no prefix no suffix", func() { + source := `= Title + John Doe + 1.0a` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revdate: "1.0a", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("revision with revnumber only", func() { + source := `= Title + John Doe + v1.0:` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("revision with spaces and capital revnumber ", func() { + source := `= Title + John Doe + V1.0:` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("revision only - with comma separator", func() { + source := `= Title + John Doe + v1.0,` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("revision with revnumber plus comma and colon separators", func() { + source := `= Title + John Doe + v1.0,:` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("revision with revnumber and empty revremark", func() { + source := `= Title +John Doe +v1.0:` + Title := []interface{}{ + &types.StringElement{ + Content: "Title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: Title, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "John", + LastName: "Doe", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + }) + + }) + + Context("document header attributes", func() { + + It("valid attribute names", func() { + source := `:a: +:author: Xavier +:_author: Xavier` + expected := &types.Document{ + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "a", + }, + &types.AttributeDeclaration{ + Name: "author", + Value: "Xavier", + }, + &types.AttributeDeclaration{ + Name: "_author", + Value: "Xavier", + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("attributes and paragraph without blank line in-between", func() { + source := `:toc: +:date: 2017-01-01 +:author: Xavier +:hardbreaks: +a paragraph` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "toc": nil, + // "date": "2017-01-01", + // "author": "Xavier", + // types.DocumentAttrHardBreaks: nil, + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "toc", + }, + &types.AttributeDeclaration{ + Name: "date", + Value: "2017-01-01", + }, + &types.AttributeDeclaration{ + Name: "author", + Value: "Xavier", + }, + &types.AttributeDeclaration{ + Name: "hardbreaks", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph", + }, + }, + }, + }, + TableOfContents: &types.TableOfContents{}, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("contiguous attributes and paragraph with blank line in-between", func() { + source := `:toc: +:date: 2017-01-01 +:author: Xavier + +a paragraph` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "toc": nil, + // "date": "2017-01-01", + // "author": "Xavier", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "toc", + }, + &types.AttributeDeclaration{ + Name: "date", + Value: "2017-01-01", + }, + &types.AttributeDeclaration{ + Name: "author", + Value: "Xavier", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph"}, + }, + }, + }, + TableOfContents: &types.TableOfContents{}, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("splitted attributes and paragraph with blank line in-between", func() { + source := `:toc: +:date: 2017-01-01 + +:author: Xavier + +:hardbreaks: + +a paragraph` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "toc": nil, + // "date": "2017-01-01", + // "author": "Xavier", + // "hardbreaks": nil, + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "toc", + }, + &types.AttributeDeclaration{ + Name: "date", + Value: "2017-01-01", + }, + &types.AttributeDeclaration{ + Name: "author", + Value: "Xavier", + }, + &types.AttributeDeclaration{ + Name: "hardbreaks", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph"}, + }, + }, + }, + TableOfContents: &types.TableOfContents{}, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("no header and attributes in body", func() { + source := `a paragraph + +:toc: +:date: 2017-01-01 +:author: Xavier` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "toc": nil, + // "date": "2017-01-01", + // "author": "Xavier", + // }, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph"}, + }, + }, + &types.AttributeDeclaration{ + Name: "toc", + }, + &types.AttributeDeclaration{ + Name: "date", + Value: "2017-01-01", + }, + &types.AttributeDeclaration{ + Name: "author", + Value: "Xavier", + }, + }, + TableOfContents: &types.TableOfContents{}, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) + + Context("invalid cases", func() { + + It("paragraph without blank line before attribute declarations", func() { + source := `a paragraph +:toc: +:date: 2017-01-01 +:author: Xavier` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: `a paragraph +:toc: +:date: 2017-01-01 +:author: Xavier`, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("invalid attribute names", func() { + source := `:@date: 2017-01-01 +:{author}: Xavier` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: ":@date: 2017-01-01\n:", + }, + &types.AttributeSubstitution{ + Name: "author", + }, + &types.StringElement{ + Content: ": Xavier", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) + + Context("with overrides", func() { + + It("custom icon attribute", func() { + // given + attrs := map[string]interface{}{ + "icons": "font", + "source-highlighter": "pygments", + } + source := `{icons}` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "font"}, + }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithAttributes(attrs))).To(MatchDocument(expected)) + }) + }) + }) +}) diff --git a/pkg/parser/document_processing.go b/pkg/parser/document_processing.go index e9d714be..49613dce 100644 --- a/pkg/parser/document_processing.go +++ b/pkg/parser/document_processing.go @@ -1,7 +1,6 @@ package parser import ( - "fmt" "io" "github.com/bytesparadise/libasciidoc/pkg/configuration" @@ -10,75 +9,38 @@ import ( log "github.com/sirupsen/logrus" ) -// ParseDocument parses the content of the reader identitied by the filename -func ParseDocument(r io.Reader, config configuration.Configuration, options ...Option) (types.Document, error) { - rawDoc, err := ParseRawDocument(r, config, options...) - if err != nil { - return types.Document{}, err - } +const bufferSize = 10 - draftDoc, err := ApplySubstitutions(rawDoc, config) - if err != nil { - return types.Document{}, err - } - if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("draft doc:") - spew.Fdump(log.StandardLogger().Out, draftDoc) - } - - // now, merge list items into proper lists - blocks, err := rearrangeListItems(draftDoc.Elements, false) +// ParseDocument parses the content of the reader identitied by the filename +func ParseDocument(r io.Reader, config *configuration.Configuration, opts ...Option) (*types.Document, error) { + done := make(chan interface{}) + defer close(done) + + ctx := NewParseContext(config, opts...) // each pipeline step will have its own clone of `ctx` + footnotes := types.NewFootnotes() + doc, _, err := Aggregate(ctx.Clone(), + CollectFootnotes(footnotes, done, + // SplitHeader(done, + FilterOut(done, + ArrangeLists(done, + ApplySubstitutions(ctx.Clone(), done, // needs to be before 'ArrangeLists' + IncludeFiles(ctx.Clone(), done, + ParseFragments(ctx.Clone(), r, done), + ), + ), + ), + ), + ), + // ), + ) if err != nil { - return types.Document{}, err + return nil, err } - // filter out blocks not needed in the final doc - blocks = filter(blocks, allMatchers...) - - blocks, footnotes := processFootnotes(blocks) - // now, rearrange elements in a hierarchical manner - doc, err := rearrangeSections(blocks) - if err != nil { - return types.Document{}, err + if len(footnotes.Notes) > 0 { + doc.Footnotes = footnotes.Notes } - // also, set the footnotes - doc.Footnotes = footnotes - // insert the preamble at the right location - doc = includePreamble(doc) - doc.Attributes = doc.Attributes.SetAll(draftDoc.Attributes) - // also insert the table of contents - doc = includeTableOfContentsPlaceHolder(doc) - // finally - if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("final document:") - spew.Fdump(log.StandardLogger().Out, doc) + if log.IsLevelEnabled(log.InfoLevel) { + log.Infof("parsed document:\n%s", spew.Sdump(doc)) } return doc, nil } - -// ContextKey a non-built-in type for keys in the context -type ContextKey string - -// LevelOffset the key for the level offset of the file to include -const LevelOffset ContextKey = "leveloffset" - -// ParseRawDocument parses a document's content and applies the preprocessing directives (file inclusions) -func ParseRawDocument(r io.Reader, config configuration.Configuration, options ...Option) (types.RawDocument, error) { - // first, let's find all file inclusions and replace with the actual content to include - source, err := ParseRawSource(r, config, options...) - if err != nil { - return types.RawDocument{}, err - } - if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("source to parse:") - fmt.Fprintf(log.StandardLogger().Out, "'%s'\n", source) - } - // then let's parse the "source" to detect raw blocks - options = append(options, Entrypoint("RawDocument"), GlobalStore(usermacrosKey, config.Macros)) - if result, err := Parse(config.Filename, source, options...); err != nil { - return types.RawDocument{}, err - } else if doc, ok := result.(types.RawDocument); ok { - return doc, nil - } else { - return types.RawDocument{}, fmt.Errorf("unexpected type of content: '%T'", result) - } -} diff --git a/pkg/parser/document_processing_aggregate.go b/pkg/parser/document_processing_aggregate.go new file mode 100644 index 00000000..e34d6657 --- /dev/null +++ b/pkg/parser/document_processing_aggregate.go @@ -0,0 +1,196 @@ +package parser + +import ( + "github.com/bytesparadise/libasciidoc/pkg/types" + + log "github.com/sirupsen/logrus" +) + +// Aggregate pipeline task which organizes the sections in hierarchy, and +// keeps track of their references. +// Also, joins a +// Also, takes care of wrapping all blocks between header (section 0) and first child section +// into a `Preamble` +// Also, takes care of inserting the Table of Contents +// returns the whole document at once (or an error) +func Aggregate(ctx *ParseContext, fragmentStream <-chan types.DocumentFragment) (*types.Document, *types.TableOfContents, error) { + doc, toc, err := aggregate(ctx, fragmentStream) + if err != nil { + return nil, nil, err + } + insertPreamble(doc) + insertTableOfContents(ctx, doc, toc) + return doc, toc, nil +} + +func aggregate(ctx *ParseContext, fragmentStream <-chan types.DocumentFragment) (*types.Document, *types.TableOfContents, error) { + attrs := ctx.attributes + refs := types.ElementReferences{} + root := &types.Document{} + + lvls := &levels{ // TODO: unused? + root, + } + var toc *types.TableOfContents + for f := range fragmentStream { + if f.Error != nil { + log.Debugf("skipping aggregation because of fragment with error: %v", f.Error) + return nil, nil, f.Error + } + for _, element := range f.Elements { + switch e := element.(type) { + case *types.AttributeDeclaration: + attrs.set(e.Name, e.Value) + if e.Name == types.AttrTableOfContents { + toc = types.NewTableOfContents(attrs.getAsIntWithDefault(types.AttrTableOfContentsLevels, 2)) + } + // yet, retain the element, in case we need it during rendering (eg: `figure-caption`, etc.) + if err := lvls.appendElement(e); err != nil { + return nil, nil, err + } + case *types.FrontMatter: + attrs.setAll(e.Attributes) + if err := lvls.appendElement(e); err != nil { + return nil, nil, err + } + case *types.DocumentHeader: + // TODO: is it needed in this pipeline stage? + for _, elmt := range e.Elements { + switch attr := elmt.(type) { + case *types.AttributeDeclaration: + ctx.attributes.set(attr.Name, attr.Value) + case *types.AttributeReset: + ctx.attributes.unset(attr.Name) + } + } + if attrs.has(types.AttrTableOfContents) { + toc = types.NewTableOfContents(attrs.getAsIntWithDefault(types.AttrTableOfContentsLevels, 2)) + } + if err := lvls.appendElement(e); err != nil { + return nil, nil, err + } + // do not add header to ToC + case *types.AttributeReset: + attrs.unset(e.Name) + // yet, retain the element, in case we need it during rendering (eg: `figure-caption`, etc.) + if err := lvls.appendElement(e); err != nil { + return nil, nil, err + } + case *types.BlankLine, *types.SingleLineComment: + // ignore + case *types.Section: + if err := e.ResolveID(attrs.allAttributes(), refs); err != nil { + return nil, nil, err + } + if err := lvls.appendSection(e); err != nil { + return nil, nil, err + } + if toc != nil { + toc.Add(e) + } + default: + if err := lvls.appendElement(e); err != nil { + return nil, nil, err + } + } + } + } + + log.WithField("pipeline_task", "aggregate").Debug("done") + if len(refs) > 0 { + root.ElementReferences = refs + } + return root, toc, nil +} + +type levels []types.WithElementAddition + +func (l *levels) appendSection(s *types.Section) error { + // note: section levels start at 0, but first level is root (doc) + if idx, found := l.indexOfParent(s); found { + *l = (*l)[:idx+1] // trim to parent level + } + log.Debugf("adding section with level %d at position %d in levels", s.Level, len(*l)) + // append + if err := (*l)[len(*l)-1].AddElement(s); err != nil { + return err + } + *l = append(*l, s) + return nil +} + +// return the index of the parent element for the given section, +// taking account the given section's level, and also gaps in other +// sections (eg: `1,2,4` instead of `0,1,2`) +func (l *levels) indexOfParent(s *types.Section) (int, bool) { + for i, e := range *l { + if p, ok := e.(*types.Section); ok { + if p.Level >= s.Level { + log.Debugf("found parent at index %d for section with level %d", i-1, s.Level) + return i - 1, true // return previous + } + } + } + // + return -1, false +} + +func (l *levels) appendElement(e interface{}) error { + return (*l)[len(*l)-1].AddElement(e) +} + +func insertPreamble(doc *types.Document) { + preamble := newPreamble(doc) + // if no element in the preamble, or if no section in the document, + // or if all elements are AttributeDeclaration/AttributeReset and nothing else + // then no preamble to insert + if preamble == nil || !preamble.HasContent() { + log.Debugf("no preamble to insert") + return + } + // now, insert the preamble instead of the 'n' blocks that belong to the preamble + // and copy the other items + elements := make([]interface{}, len(doc.Elements)-len(preamble.Elements)+1) + if header, _, found := doc.Header(); found { + log.Debug("inserting preamble after header") + elements[0] = header + elements[1] = preamble + copy(elements[2:], doc.Elements[1+len(preamble.Elements):]) + } else { + log.Debug("inserting preamble at beginning of document") + elements[0] = preamble + copy(elements[1:], doc.Elements[len(preamble.Elements):]) + } + doc.Elements = elements +} + +func newPreamble(doc *types.Document) *types.Preamble { + if _, _, exists := doc.Header(); !exists { + log.Debug("skipping preamble: no header in doc") + return nil + } + preamble := &types.Preamble{ + Elements: make([]interface{}, 0, len(doc.Elements)), + } + for _, e := range doc.Elements { + switch e.(type) { + case *types.DocumentHeader: + continue + case *types.Section: + return preamble + default: + preamble.Elements = append(preamble.Elements, e) + } + } + return nil +} + +func insertTableOfContents(ctx *ParseContext, doc *types.Document, toc *types.TableOfContents) { + if toc == nil { + log.Debug("no table of contents to insert") + return + } + if ctx.attributes.has(types.AttrTableOfContents) { + doc.TableOfContents = toc + } +} diff --git a/pkg/parser/document_processing_aggregate_test.go b/pkg/parser/document_processing_aggregate_test.go new file mode 100644 index 00000000..91b54593 --- /dev/null +++ b/pkg/parser/document_processing_aggregate_test.go @@ -0,0 +1,346 @@ +package parser_test + +import ( + "github.com/bytesparadise/libasciidoc/pkg/configuration" + "github.com/bytesparadise/libasciidoc/pkg/parser" + "github.com/bytesparadise/libasciidoc/pkg/types" + . "github.com/bytesparadise/libasciidoc/testsupport" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("include preamble and table of contents when aggregating fragments", func() { + + // reusable elements + doctitle := []interface{}{ + &types.StringElement{Content: "A Title"}, + } + paragraph := &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "A short preamble"}, + }, + } + section1Title := []interface{}{ + &types.StringElement{Content: "section 1"}, + } + section1 := &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_section_1", + }, + Title: section1Title, + } + + It("with default placement and no header with section1", func() { + ctx := parser.NewParseContext(configuration.NewConfiguration()) + c := make(chan types.DocumentFragment, 4) + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrTableOfContents, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + paragraph, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + section1, + }, + } + close(c) + expected := &types.Document{ + // Attributes: types.Attributes{ + // types.AttrTableOfContents: nil, + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrTableOfContents, + }, + paragraph, + section1, + }, + ElementReferences: types.ElementReferences{ + "_section_1": section1Title, + }, + TableOfContents: &types.TableOfContents{ + Sections: []*types.ToCSection{ + { + ID: "_section_1", + Level: 1, + Title: "section 1", + }, + }, + }, + } + doc, _, err := parser.Aggregate(ctx, c) + Expect(err).NotTo(HaveOccurred()) + Expect(doc).To(MatchDocument(expected)) + }) + + It("with default placement and a header with section1", func() { + ctx := parser.NewParseContext(configuration.NewConfiguration()) + c := make(chan types.DocumentFragment, 4) + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrTableOfContents, + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + paragraph, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + section1, + }, + } + close(c) + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrTableOfContents, + }, + }, + }, + &types.Preamble{ + Elements: []interface{}{ + paragraph, + }, + }, + section1, + }, + ElementReferences: types.ElementReferences{ + "_section_1": section1Title, + }, + TableOfContents: &types.TableOfContents{ + Sections: []*types.ToCSection{ + { + ID: "_section_1", + Level: 1, + Title: "section 1", + }, + }, + }, + } + doc, _, err := parser.Aggregate(ctx, c) + Expect(err).NotTo(HaveOccurred()) + Expect(doc).To(MatchDocument(expected)) + }) + + It("with default placement and a header without section1", func() { + ctx := parser.NewParseContext(configuration.NewConfiguration()) + c := make(chan types.DocumentFragment, 4) + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrTableOfContents, + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + paragraph, + }, + } + close(c) + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrTableOfContents, + }, + }, + }, + paragraph, // not wrapped in a preamble since there is nothing afterwards + }, + TableOfContents: &types.TableOfContents{}, + } + doc, _, err := parser.Aggregate(ctx, c) + Expect(err).NotTo(HaveOccurred()) + Expect(doc).To(MatchDocument(expected)) + }) + + It("with preamble placement and no header with section1", func() { + ctx := parser.NewParseContext(configuration.NewConfiguration()) + c := make(chan types.DocumentFragment, 4) + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrTableOfContents, + Value: "preamble", + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + paragraph, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + section1, + }, + } + close(c) + expected := &types.Document{ + Elements: []interface{}{ // no preamble since no header, thus no ToC either + &types.AttributeDeclaration{ + Name: types.AttrTableOfContents, + Value: "preamble", + }, + paragraph, + section1, + }, + ElementReferences: types.ElementReferences{ + "_section_1": section1Title, + }, + TableOfContents: &types.TableOfContents{ + Sections: []*types.ToCSection{ + { + ID: "_section_1", + Level: 1, + Title: "section 1", + }, + }, + }, + } + doc, _, err := parser.Aggregate(ctx, c) + Expect(err).NotTo(HaveOccurred()) + Expect(doc).To(MatchDocument(expected)) + }) + + It("with preamble placement and header with content", func() { + ctx := parser.NewParseContext(configuration.NewConfiguration()) + c := make(chan types.DocumentFragment, 4) + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrTableOfContents, + Value: "preamble", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + paragraph, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + section1, + }, + } + close(c) + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "toc", + Value: "preamble", + }, + }, + }, + &types.Preamble{ + Elements: []interface{}{ + paragraph, + }, + }, + section1, + }, + ElementReferences: types.ElementReferences{ + "_section_1": section1Title, + }, + TableOfContents: &types.TableOfContents{ + Sections: []*types.ToCSection{ + { + ID: "_section_1", + Level: 1, + Title: "section 1", + }, + }, + }, + } + doc, _, err := parser.Aggregate(ctx, c) + Expect(err).NotTo(HaveOccurred()) + Expect(doc).To(MatchDocument(expected)) + }) + + It("with preamble placement and header without section1", func() { + ctx := parser.NewParseContext(configuration.NewConfiguration()) + c := make(chan types.DocumentFragment, 4) + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrTableOfContents, + Value: "preamble", + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, + Attributes: types.Attributes{ + types.AttrID: "_a_title", + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + paragraph, + }, + } + close(c) + expected := &types.Document{ // no ToC since no header, so no preamble either + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "toc", + Value: "preamble", + }, + &types.DocumentHeader{ + Title: doctitle, + Attributes: types.Attributes{ + types.AttrID: "_a_title", + }, + }, + paragraph, + }, + TableOfContents: &types.TableOfContents{}, + } + doc, _, err := parser.Aggregate(ctx, c) + Expect(err).NotTo(HaveOccurred()) + Expect(doc).To(MatchDocument(expected)) + }) + +}) diff --git a/pkg/parser/document_processing_apply_custom_substitutions_test.go b/pkg/parser/document_processing_apply_custom_substitutions_test.go deleted file mode 100644 index 5da06c0a..00000000 --- a/pkg/parser/document_processing_apply_custom_substitutions_test.go +++ /dev/null @@ -1,2819 +0,0 @@ -package parser_test - -import ( - "strings" - - "github.com/bytesparadise/libasciidoc/pkg/types" - . "github.com/bytesparadise/libasciidoc/testsupport" - - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint -) - -var _ = Describe("custom substitutions", func() { - - Context("example blocks", func() { - - // testing custom substitutions on example blocks only, as - // other verbatim blocks (fenced, literal, source, passthrough) - // share the same implementation - - // also, see https://asciidoctor.org/docs/user-manual/#incremental-substitutions - // "When you set the subs attribute on a block, you automatically remove all of its default substitutions. - // For example, if you set subs on a literal block, and assign it a value of attributes, - // only attributes are substituted." - - source := `:github-url: https://github.com - -[subs="$SUBS"] -==== -a link to https://example.com[] <1> -and on the + -*next* lines with a link to {github-url}[] - -* a list item -==== - -<1> a callout -` - Context("explicit substitutions", func() { - - It("should apply the default substitution", func() { - s := strings.ReplaceAll(source, "[subs=\"$SUBS\"]\n", "") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ExampleBlock{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "1", - }, - types.SpecialCharacter{ - Name: ">", - }, - }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the", - }, - types.LineBreak{}, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, - }, - }, - types.StringElement{ - Content: " lines with a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a list item", - }, - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'normal' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "normal") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "normal", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " ", - }, - types.SpecialCharacter{ // callout is not detected with the `normal` susbtitution - Name: "<", - }, - types.StringElement{ - Content: "1", - }, - types.SpecialCharacter{ - Name: ">", - }, - }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the", - }, - types.LineBreak{}, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, - }, - }, - types.StringElement{ - Content: " lines with a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a list item", - }, - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'quotes' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "quotes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "quotes", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, - }, - }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a list item", - }, - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'macros' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "macros") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "macros", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a list item", - }, - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'attributes' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "attributes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "attributes", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to https://github.com[]", - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a list item", - }, - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'attributes,macros' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "attributes,macros") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "attributes,macros", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a list item", - }, - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'specialchars' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "specialchars") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "specialchars", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "1", - }, - types.SpecialCharacter{ - Name: ">", - }, - }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a list item", - }, - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'replacements' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "replacements") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "replacements", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a list item", - }, - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'post_replacements' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "post_replacements") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "post_replacements", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the", - }, - types.LineBreak{}, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a list item", - }, - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'quotes,macros' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "quotes,macros") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "quotes,macros", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, - }, - }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a list item", - }, - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'macros,quotes' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "macros,quotes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "macros,quotes", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, - }, - }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a list item", - }, - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'none' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "none") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ExampleBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "none", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a list item", - }, - }, - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - }) - - }) - - Context("listing blocks", func() { - - Context("delimited blocks", func() { - // testing custom substitutions on listing blocks only, as - // other verbatim blocks (fenced, literal, source, passthrough) - // share the same implementation - - source := `:github-url: https://github.com - -[subs="$SUBS"] ----- -a link to https://example.com[] <1> -and on the + -*next* lines with a link to {github-url}[] - -* not a list item ----- - -<1> a callout -` - It("should apply the default substitution", func() { - s := strings.ReplaceAll(source, "[subs=\"$SUBS\"]\n", "") // remove the 'subs' attribute - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] ", - }, - types.Callout{ - Ref: 1, - }, - }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'normal' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "normal") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "normal", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " ", - }, - types.SpecialCharacter{ // callout is not detected with the `normal` susbtitution - Name: "<", - }, - types.StringElement{ - Content: "1", - }, - types.SpecialCharacter{ - Name: ">", - }, - }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the", - }, - types.LineBreak{}, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, - }, - }, - types.StringElement{ - Content: " lines with a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'quotes' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "quotes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "quotes", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, - }, - }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'macros' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "macros") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "macros", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'attributes' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "attributes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "attributes", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to https://github.com[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'attributes,macros' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "attributes,macros") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "attributes,macros", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'specialchars' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "specialchars") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "specialchars", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "1", - }, - types.SpecialCharacter{ - Name: ">", - }, - }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'replacements' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "replacements") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "replacements", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'post_replacements' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "post_replacements") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "post_replacements", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the", - }, - types.LineBreak{}, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'quotes,macros' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "quotes,macros") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "quotes,macros", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, - }, - }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'macros,quotes' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "macros,quotes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "macros,quotes", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, - }, - }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'none' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "none") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "none", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'quotes' substitutions on a passthrough block", func() { - source := `[subs=quotes] -.a title -++++ -_foo_ - -*bar* -++++` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.PassthroughBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "quotes", - types.AttrTitle: "a title", - }, - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "foo", - }, - }, - }, - }, - {}, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "bar", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - - }) - - It("should apply the 'quotes+' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "quotes+") // same as `quotes,"default"` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "quotes+", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] ", - }, - types.Callout{ - Ref: 1, - }, - }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the +", - }, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, - }, - }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'macros,attributes+' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "macros,attributes+") // same as `attributes,macros` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "macros,attributes+", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'attributes,+macros' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "attributes,+macros") // same as `attributes,macros` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "attributes,+macros", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the '+quotes' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "+quotes") // default + quotes - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "+quotes", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] ", - }, - types.Callout{ - Ref: 1, - }, - }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the +", - }, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, - }, - }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the '-quotes' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "-quotes") // default - quotes - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "-quotes", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] ", - }, - types.Callout{ - Ref: 1, - }, - }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - {}, - { - types.StringElement{ - Content: "* not a list item", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should fail when substitution is invalid", func() { - s := strings.ReplaceAll(source, "$SUBS", "invalid") - _, err := ParseDraftDocument(s) - Expect(err).To(HaveOccurred()) - }) - }) - - Context("paragraph blocks", func() { - - source := `:github-url: https://github.com - -[listing] -[subs="$SUBS"] -a link to https://example.com[] <1> -and on the + -*next* lines with a link to {github-url}[] - -<1> a callout` - - It("should apply the default substitution", func() { - s := strings.ReplaceAll(source, "[subs=\"$SUBS\"]\n", "") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Listing, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] ", - }, - types.Callout{ - Ref: 1, - }, - }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'quotes' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "quotes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Listing, - types.AttrSubstitutions: "quotes", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, - }, - }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the '+quotes' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "+quotes") // ie, default + quotes - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Listing, - types.AttrSubstitutions: "+quotes", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://example.com[] ", - }, - types.Callout{ - Ref: 1, - }, - }, - { - types.StringElement{ - Content: "and ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "more text", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: " on the +", - }, - }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "next", - }, - }, - }, - types.StringElement{ - Content: " lines with a link to {github-url}[]", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - - It("should apply the 'macros,+quotes,-quotes' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "macros,+quotes,-quotes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "github-url", - Value: "https://github.com", - }, - types.BlankLine{}, - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Listing, - types.AttrSubstitutions: "macros,+quotes,-quotes", // ie, "macros" only - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: " <1>", - }, - }, - { - types.StringElement{ - Content: "and on the +", - }, - }, - { - types.StringElement{ - Content: "*next* lines with a link to {github-url}[]", - }, - }, - }, - }, - types.BlankLine{}, - types.CalloutListItem{ - Ref: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a callout", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) - }) - }) - - }) -}) diff --git a/pkg/parser/document_processing_apply_substitutions.go b/pkg/parser/document_processing_apply_substitutions.go index 1c7cadb3..fc828918 100644 --- a/pkg/parser/document_processing_apply_substitutions.go +++ b/pkg/parser/document_processing_apply_substitutions.go @@ -1,689 +1,958 @@ package parser import ( + "bytes" "fmt" "strconv" "strings" - "github.com/bytesparadise/libasciidoc/pkg/configuration" "github.com/bytesparadise/libasciidoc/pkg/types" "github.com/davecgh/go-spew/spew" + "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) -// ---------------------------------------------------------------------------- -// Substitutions -// ---------------------------------------------------------------------------- +// TODO: convert `ctx *parseContext` as a local variable instead of a func param +func ApplySubstitutions(ctx *ParseContext, done <-chan interface{}, fragmentStream <-chan types.DocumentFragment) chan types.DocumentFragment { + processedFragmentStream := make(chan types.DocumentFragment, bufferSize) + go func() { + defer close(processedFragmentStream) + for f := range fragmentStream { + select { + case processedFragmentStream <- applySubstitutions(ctx, f): + case <-done: + log.WithField("pipeline_stage", "apply_substitutions").Debug("received 'done' signal") + return + } + } + log.WithField("pipeline_stage", "apply_substitutions").Debug("done") + }() + return processedFragmentStream +} -// ApplySubstitutions applies all the substitutions on delimited blocks, standalone paragraphs and paragraphs -// in continued list items, and then attribute substitutions, and as a result returns a `DraftDocument`. -func ApplySubstitutions(rawDoc types.RawDocument, config configuration.Configuration) (types.DraftDocument, error) { - attrs := types.AttributesWithOverrides{ - Content: types.Attributes{}, - Overrides: config.AttributeOverrides, - Counters: map[string]interface{}{}, +func applySubstitutions(ctx *ParseContext, f types.DocumentFragment) types.DocumentFragment { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.WithField("pipeline_stage", "apply_substitutions").Debugf("incoming fragment:\n%s", spew.Sdump(f)) + // } + // if the fragment already contains an error, then send it as-is downstream + if err := f.Error; err != nil { + log.Debugf("skipping substitutions because of fragment with error: %v", f.Error) + return f } - // also, add all front-matter key/values - attrs.Add(rawDoc.FrontMatter.Content) - // also, add all AttributeDeclaration at the top of the document - attrs.Add(rawDoc.Attributes()) + // stats := &Stats{} + opts := append(ctx.Opts, + GlobalStore(types.AttrImagesDir, ctx.attributes.get(types.AttrImagesDir)), + GlobalStore(usermacrosKey, ctx.userMacros), + // Debug(true), + // Statistics(stats, "NoMatch"), + ) - ctx := substitutionContext{ - attributes: attrs, - config: config, - } - elements, err := applySubstitutions(ctx, rawDoc.Elements) - if err != nil { - return types.DraftDocument{}, err - } - if len(elements) == 0 { - elements = nil // avoid carrying empty slice + elements := make([]interface{}, len(f.Elements)) + for i, element := range f.Elements { + var err error + if elements[i], err = applySubstitutionsOnElement(ctx, element, opts...); err != nil { + return types.NewErrorFragment(err) + } } - return types.DraftDocument{ - Attributes: attrs.All(), - FrontMatter: rawDoc.FrontMatter, - Elements: elements, - }, nil + f.Elements = elements + // if log.IsLevelEnabled(log.DebugLevel) { + // // log.WithField("pipeline_stage", "apply_substitutions").Debugf("fragment with substitutions applied:\n%s", spew.Sdump(f)) + // log.WithField("pipeline_stage", "apply_substitutions").Debugf("stats:\n%s", PrettyPrintStats(stats)) + // } + return f } -type substitutionContext struct { - attributes types.AttributesWithOverrides - config configuration.Configuration +func applySubstitutionsOnElement(ctx *ParseContext, element interface{}, opts ...Option) (interface{}, error) { + switch e := element.(type) { + case *types.FrontMatter: + ctx.attributes.setAll(e.Attributes) + return e, nil + case *types.AttributeDeclaration: + ctx.attributes.set(e.Name, e.Value) + return e, nil + case *types.AttributeReset: + ctx.attributes.unset(e.Name) + return e, nil + case *types.DocumentHeader: + if err := applySubstitutionsOnHeader(ctx, e, opts...); err != nil { + return nil, err + } + return e, nil + case types.BlockWithElements: + if err := applySubstitutionsOnBlockWithElements(ctx, e, opts...); err != nil { + return nil, err + } + return e, nil + case types.BlockWithLocation: + if err := applySubstitutionsOnBlockWithLocation(ctx, e, opts...); err != nil { + return nil, err + } + return e, nil + default: + // log.WithField("pipeline_stage", "fragment_processing").Debugf("forwarding fragment content of type '%T' as-is", e) + return element, nil + } } -// applySubstitutions applies the substitutions on paragraphs and delimited blocks (including when in continued list elements) -func applySubstitutions(ctx substitutionContext, elements []interface{}) ([]interface{}, error) { - if len(elements) == 0 { - return nil, nil +// special case for document header: process the optional attribute declarations first, then the title +func applySubstitutionsOnHeader(ctx *ParseContext, header *types.DocumentHeader, opts ...Option) error { + // TODO: duplicate from aggregate stage + for _, elmt := range header.Elements { + switch attr := elmt.(type) { + case *types.AttributeDeclaration: + ctx.attributes.set(attr.Name, attr.Value) + case *types.AttributeReset: + ctx.attributes.unset(attr.Name) + } } - if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("applying substitutions on:") - spew.Fdump(log.StandardLogger().Out, elements) + title, err := newHeaderSubstitution().processElements(ctx, header.Title, opts...) + if err != nil { + return err } - result := make([]interface{}, len(elements)) - for i, e := range elements { - if a, ok := e.(types.WithAttributesToSubstitute); ok { - log.Debugf("applying substitution on attributes of element of type '%T'", e) - attrs, err := applyAttributeSubstitutionsOnAttributes(ctx, a.AttributesToSubstitute()) - if err != nil { - return nil, err + header.Title = title + return nil +} + +func applySubstitutionsOnBlockWithElements(ctx *ParseContext, block types.BlockWithElements, opts ...Option) error { + if s := block.GetAttributes().GetAsStringWithDefault(types.AttrStyle, ""); s == types.Passthrough { + log.Debugf("skipping substitutions on passthrough block of type '%T'", block) + // simply merge the rawlines + // TODO: use types.Merge? + buf := &strings.Builder{} + for i, l := range block.GetElements() { + if l, ok := l.(types.RawLine); ok { + buf.WriteString(string(l)) + if i < len(block.GetElements())-1 { + buf.WriteString("\n") + } } - e = a.ReplaceAttributes(attrs) } - var err error - switch e := e.(type) { - case types.WithNestedElementSubstitution: - log.Debugf("applying substitution on nested elements of element of type '%T'", e) - subs, err := substitutionsFor(e) - if err != nil { - return nil, err - } - elements, err := applySubstitutionsOnElements(ctx, e.ElementsToSubstitute(), subs) - if err != nil { - return nil, err + return block.SetElements([]interface{}{ + &types.StringElement{ + Content: buf.String(), + }, + }) + } + log.Debugf("processing block with elements of type '%T'", block) + if err := newElementAttributesSubstitution().processAttributes(ctx, block); err != nil { + return err + } + // log.Debugf("applying substitutions on elements of block of type '%T'", block) + s, err := newSubstitutions(block) + if err != nil { + return err + } + // also process extra stuff + // TODO: move after call to `s.processBlockWithElements`? + switch b := block.(type) { + case *types.ListElements: + for _, e := range b.Elements { + if e, ok := e.(*types.LabeledListElement); ok { + // process term of labeled list elements + if e.Term, err = s.processElements(ctx, e.Term, opts...); err != nil { + return err + } + e.Term = types.TrimLeft(e.Term, " ") } - result[i] = e.ReplaceElements(elements) - case types.WithLineSubstitution: - log.Debugf("applying substitution on lines of element of type '%T'", e) - subs, err := substitutionsFor(e) - if err != nil { - return nil, err + } + case *types.DelimitedBlock: + // process author of markdown-style quote block + if b.Kind == types.MarkdownQuote { + if elements, attribution := extractMarkdownQuoteAttribution(b.Elements); attribution != "" { + b.Attributes = b.Attributes.Set(types.AttrQuoteAuthor, attribution) + b.Elements = elements } - elements, err := applySubstitutionsOnLines(ctx, e.LinesToSubstitute(), subs) - if err != nil { - return nil, err + } + case *types.Table: + if b.Header != nil { + if err = s.processBlockWithElements(ctx, b.Header, opts...); err != nil { + return err } - result[i] = e.SubstituteLines(elements) - case types.MarkdownQuoteBlock: // slightly different since there is an extraction for the author attributions - e, err := applySubstitutionsOnMarkdownQuoteBlock(ctx, e) + } + } + if err := s.processBlockWithElements(ctx, block, opts...); err != nil { + return err + } + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("processed block of type '%T' with elements: %s", block, spew.Sdump(block)) + // } + return nil +} + +func extractMarkdownQuoteAttribution(elements []interface{}) ([]interface{}, string) { + // first, check if last line is an attribution (author) + if len(elements) == 0 { + return elements, "" + } + log.Debugf("attempting to extract markdown-style quote block author") + if l, ok := elements[len(elements)-1].(types.RawLine); ok { + a, err := ParseReader("", strings.NewReader(string(l)), Entrypoint("MarkdownQuoteAttribution")) + // assume that the last line is not an author attribution if an error occurred + if err != nil { + log.Debugf("failed to extract markdown-style quote block author: %v", err) + return elements, "" + } + log.Debugf("found attribution in markdown block: '%[1]v' (%[1]T)", a) + if a, ok := a.(string); ok { + return elements[:len(elements)-1], a + } + } + return elements, "" +} + +func applySubstitutionsOnBlockWithLocation(ctx *ParseContext, block types.BlockWithLocation, opts ...Option) error { + log.Debugf("processing block with attributes and location") + if err := newElementAttributesSubstitution().processAttributes(ctx, block, opts...); err != nil { + return err + } + // log.Debugf("applying substitutions on `location` of block of type '%T'", block) + elements := block.GetLocation().Path + elements, _, err := replaceAttributeRefsInElements(ctx, elements) + if err != nil { + return err + } + block.GetLocation().SetPath(elements) + switch img := block.(type) { + case *types.ImageBlock, *types.InlineImage: + imagesdir := ctx.attributes.getAsStringWithDefault(types.AttrImagesDir, "") + img.GetLocation().SetPathPrefix(imagesdir) + } + return nil +} + +type substitutions []*substitution + +func newSubstitutions(b types.BlockWithAttributes) (substitutions, error) { + // TODO: introduce a `types.BlockWithSubstitution` interface? + // note: would also be helpful for paragraphs with `[listing]` style. + defaultSub, err := defaultSubstitution(b) + if err != nil { + return nil, errors.Wrap(err, "unable to determine substitutions") + } + subs := strings.Split(b.GetAttributes().GetAsStringWithDefault(types.AttrSubstitutions, defaultSub), ",") + result := make([]*substitution, 0, len(subs)) + // when dealing with incremental substitutions + if allIncremental(subs) { + d, err := newSubstitution(defaultSub) + if err != nil { + return nil, err + } + result = substitutions{d} + } + for _, sub := range subs { + // log.Debugf("checking subs '%s'", sub) + switch { + case strings.HasSuffix(sub, "+"): // prepend + s, err := newSubstitution(strings.TrimSuffix(sub, "+")) if err != nil { return nil, err } - result[i] = e - case types.ContinuedListItemElement: - r, err := applySubstitutions(ctx, []interface{}{e.Element}) + // log.Debugf("prepending subs '%s'", sub) + result = append(substitutions{s}, result...) + case strings.HasPrefix(sub, "+"): // append + s, err := newSubstitution(strings.TrimPrefix(sub, "+")) if err != nil { return nil, err } - e.Element = r[0] - result[i] = e - case types.ImageBlock: - if e.Location, err = applySubstitutionsOnLocation(ctx, e.Location); err != nil { - return nil, err + // log.Debugf("appending subs '%s'", sub) + result = append(result, s) + case strings.HasPrefix(sub, "-"): // remove from all substitutions + for _, s := range result { + s.disable(substitutionKind(strings.TrimPrefix(sub, "-"))) } - result[i] = e - case types.Section: - if e, err = applySubstitutionsOnSection(ctx, e); err != nil { - return nil, err - } - result[i] = e default: - // no support for element substitution here - // so let's proceed with attribute substitutions - if e, err = applyAttributeSubstitutionsOnElement(ctx, e); err != nil { + s, err := newSubstitution(sub) + if err != nil { return nil, err } - result[i] = e + result = append(result, s) } } - if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("applied substitutions:") - spew.Fdump(log.StandardLogger().Out, result) - } + + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debug("substitutions to apply:") + // for _, s := range result { + // log.Debugf("%s: %+v", s.entrypoint, s.rules) + // } + // } return result, nil } -// ---------------------------------------------------------------------------- -// Delimited Block substitutions -// ---------------------------------------------------------------------------- +// checks if all the given subs are incremental (ie, prefixed with `+|-` or suffixed with `-`) +func allIncremental(subs []string) bool { + // init with first substitution + allIncremental := true + // check others + for _, sub := range subs { + if !isIncrementalSubstitution(sub) { + return false + } + } + return allIncremental +} -var substitutions = map[string]elementsSubstitution{ - "inline_passthrough": substituteInlinePassthrough, - "callouts": substituteCallouts, - "specialcharacters": substituteSpecialCharacters, - "specialchars": substituteSpecialCharacters, - "quotes": substituteQuotedTexts, - "attributes": substituteAttributes, - "replacements": substituteReplacements, - "macros": substituteInlineMacros, - "post_replacements": substitutePostReplacements, - "none": substituteNone, +func isIncrementalSubstitution(sub string) bool { + return strings.HasPrefix(sub, "+") || + strings.HasPrefix(sub, "-") || + strings.HasSuffix(sub, "+") } -func substitutionsFor(block types.WithCustomSubstitutions) ([]elementsSubstitution, error) { - subs := make(funcs, 0, len(substitutions)) - subsitutionsToApply, err := block.SubstitutionsToApply() +func (s substitutions) processBlockWithElements(ctx *ParseContext, block types.BlockWithElements, opts ...Option) error { + elements, err := s.processElements(ctx, block.GetElements(), opts...) if err != nil { - return nil, err + return err } - for _, s := range subsitutionsToApply { - switch s { - case "normal": - subs = subs.append( - "specialcharacters", - "quotes", - "attributes", - "replacements", - "macros", - "post_replacements", - ) - case "inline_passthrough", "callouts", "specialcharacters", "specialchars", "quotes", "attributes", "macros", "replacements", "post_replacements", "none": - subs = subs.append(s) - case "+callouts", "+specialcharacters", "+specialchars", "+quotes", "+attributes", "+macros", "+replacements", "+post_replacements", "+none": - if len(subs) == 0 { - subs = subs.append(block.DefaultSubstitutions()...) - } - subs = subs.append(strings.ReplaceAll(s, "+", "")) - case "callouts+", "specialcharacters+", "specialchars+", "quotes+", "attributes+", "macros+", "replacements+", "post_replacements+", "none+": - if len(subs) == 0 { - subs = subs.append(block.DefaultSubstitutions()...) - } - subs = subs.prepend(strings.ReplaceAll(s, "+", "")) - case "-callouts", "-specialcharacters", "-specialchars", "-quotes", "-attributes", "-macros", "-replacements", "-post_replacements", "-none": - if len(subs) == 0 { - subs = subs.append(block.DefaultSubstitutions()...) - } - subs = subs.remove(strings.ReplaceAll(s, "-", "")) - default: - return nil, fmt.Errorf("unsupported substitution: '%s", s) + if err := block.SetElements(elements); err != nil { + return err + } + return nil +} + +func (s substitutions) processElements(ctx *ParseContext, elements []interface{}, opts ...Option) ([]interface{}, error) { + // skip if there's nothing to do + // (and no need to return an empty slice, btw) + if len(elements) == 0 { + return nil, nil + } + for _, substitution := range s { + var err error + elements, err = substitution.processElements(ctx, elements, opts...) + if err != nil { + return nil, err } } - result := make([]elementsSubstitution, 0, len(subs)) - for _, s := range subs { - if f, exists := substitutions[s]; exists { - result = append(result, f) + return elements, nil +} + +func defaultSubstitution(b interface{}) (string, error) { + // log.Debugf("looking-up default substitution for block of type '%T'", b) + switch b := b.(type) { + case *types.DelimitedBlock: + switch b.Kind { + case types.Listing, types.Fenced, types.Literal: + return "verbatim", nil + case types.Example, types.Quote, types.Verse, types.Sidebar, types.MarkdownQuote: + return "normal", nil + case types.Comment, types.Passthrough: + return "none", nil + default: + return "", fmt.Errorf("unsupported kind of delimited block: '%v'", b.Kind) + } + case *types.Paragraph: + // if listing paragraph: + switch b.GetAttributes().GetAsStringWithDefault(types.AttrStyle, "") { + case types.Listing: + return "verbatim", nil + default: + return "normal", nil } + case *types.ListElements, types.ListElement, *types.QuotedText, *types.Table: + return "normal", nil + case *types.Section: + return "header", nil + default: + return "", fmt.Errorf("unsupported kind of element: '%T'", b) + } +} + +func canHaveSubstitution(b interface{}) bool { + switch b.(type) { + case *types.DelimitedBlock, *types.Paragraph, *types.List, types.ListElement, *types.QuotedText, *types.Section: + return true + default: + return false } - result = append(result, splitLines) - return result, nil } -type funcs []string +type substitutionRule string + +const ( + AttributesGroup substitutionRule = "AttributesGroup" + ElementAttributesGroup substitutionRule = "ElementAttributesGroup" + HeaderGroup substitutionRule = "HeaderGroup" + MacrosGroup substitutionRule = "MacrosGroup" + NoneGroup substitutionRule = "NoneGroup" + NormalGroup substitutionRule = "NormalGroup" + QuotesGroup substitutionRule = "QuotesGroup" + ReplacementsGroup substitutionRule = "ReplacementsGroup" + PostReplacementsGroup substitutionRule = "PostReplacementsGroup" + SpecialcharactersGroup substitutionRule = "SpecialCharactersGroup" + VerbatimGroup substitutionRule = "VerbatimGroup" +) -func (f funcs) append(others ...string) funcs { - return append(f, others...) +type substitution struct { + entrypoint substitutionRule + rules map[substitutionKind]bool + // hasAttributeSubstitutions bool // TODO: replace with a key in the parser's store } -func (f funcs) prepend(other string) funcs { - return append(funcs{other}, f...) +func newSubstitution(kind string) (*substitution, error) { + switch kind { + case "attributes": + return newAttributesSubstitution(), nil + case "element_attributes": + return newElementAttributesSubstitution(), nil + case "header": + return newHeaderSubstitution(), nil + case "macros": + return newMacrosSubstitution(), nil + case "normal": + return newNormalSubstitution(), nil + case "none": + return newNoneSubstitution(), nil + case "quotes": + return newQuotesSubstitution(), nil + case "replacements": + return newReplacementsSubstitution(), nil + case "post_replacements": + return newPostReplacementsSubstitution(), nil + case "specialchars": + return newSpecialCharsSubstitution(), nil + case "verbatim": + return newVerbatimSubstitution(), nil + default: + return nil, fmt.Errorf("unsupported kind of substitution: '%v'", kind) + } } -func (f funcs) remove(other string) funcs { - for i, s := range f { - if s == other { - return append(f[:i], f[i+1:]...) - } +func (s *substitution) clone() *substitution { + rules := make(map[substitutionKind]bool, len(s.rules)) + for r, e := range s.rules { + rules[r] = e + } + return &substitution{ + entrypoint: s.entrypoint, + rules: rules, + // hasAttributeSubstitutions: false, // make sure it's set to false + } +} +func newAttributesSubstitution() *substitution { + return &substitution{ + entrypoint: AttributesGroup, + rules: map[substitutionKind]bool{ + InlinePassthroughs: true, + Attributes: true, + }, } - // unchanged - return f } -func applySubstitutionsOnElements(ctx substitutionContext, elements []interface{}, subs []elementsSubstitution) ([]interface{}, error) { - // apply all the substitutions on elements that need to be processed - for i, element := range elements { - switch e := element.(type) { - // if the block contains a block... - case types.WithNestedElementSubstitution: - lines, err := applySubstitutionsOnElements(ctx, e.ElementsToSubstitute(), subs) - if err != nil { - return nil, err - } - elements[i] = e.ReplaceElements(lines) - case types.WithLineSubstitution: - lines, err := applySubstitutionsOnLines(ctx, e.LinesToSubstitute(), subs) - if err != nil { - return nil, err - } - elements[i] = e.SubstituteLines(lines) - default: - // log.Debugf("nothing to substitute on element of type '%T'", element) - // do nothing - } +func newElementAttributesSubstitution() *substitution { + return &substitution{ + entrypoint: ElementAttributesGroup, + rules: map[substitutionKind]bool{ + InlinePassthroughs: true, + Attributes: true, + Quotes: true, + SpecialCharacters: true, // TODO: is it needed? + }, } - return elements, nil } -func applySubstitutionsOnLines(ctx substitutionContext, lines [][]interface{}, subs []elementsSubstitution) ([][]interface{}, error) { - var err error - for _, sub := range subs { - if lines, err = sub(ctx, lines); err != nil { - return nil, err - } +func newNormalSubstitution() *substitution { + return &substitution{ + entrypoint: NormalGroup, + rules: map[substitutionKind]bool{ + InlinePassthroughs: true, + SpecialCharacters: true, + Attributes: true, + Quotes: true, + Replacements: true, + Macros: true, + PostReplacements: true, + }, } - return lines, nil } -func applySubstitutionsOnMarkdownQuoteBlock(ctx substitutionContext, b types.MarkdownQuoteBlock) (types.MarkdownQuoteBlock, error) { - funcs := []elementsSubstitution{ - substituteInlinePassthrough, - substituteSpecialCharacters, - substituteQuotedTexts, - substituteAttributes, - substituteReplacements, - substituteInlineMacros, - substitutePostReplacements, - splitLines} - // attempt to extract the block attributions - var author string - if b.Lines, author = extractMarkdownQuoteAttribution(b.Lines); author != "" { - if b.Attributes == nil { - b.Attributes = types.Attributes{} - } - b.Attributes.Set(types.AttrQuoteAuthor, author) +func newHeaderSubstitution() *substitution { + return &substitution{ + entrypoint: HeaderGroup, + rules: map[substitutionKind]bool{ + InlinePassthroughs: true, + SpecialCharacters: true, + Attributes: true, + Quotes: true, + Macros: true, + Replacements: true, + }, + } +} + +func newMacrosSubstitution() *substitution { + return &substitution{ + entrypoint: MacrosGroup, + rules: map[substitutionKind]bool{ + Macros: true, + }, } - if len(b.Lines) == 0 { // no more line to parse after extracting the author - b.Lines = nil - return b, nil +} + +func newNoneSubstitution() *substitution { + return &substitution{ + entrypoint: NoneGroup, + rules: map[substitutionKind]bool{}, } - // apply all the substitutions - var err error - for _, sub := range funcs { - if b.Lines, err = sub(ctx, b.Lines); err != nil { - return types.MarkdownQuoteBlock{}, err - } +} + +func newQuotesSubstitution() *substitution { + return &substitution{ + entrypoint: QuotesGroup, + rules: map[substitutionKind]bool{ + Quotes: true, + }, } - return b, nil } -func extractMarkdownQuoteAttribution(lines [][]interface{}) ([][]interface{}, string) { - // first, check if last line is an attribution (author) - if len(lines) == 0 { - return lines, "" +func newReplacementsSubstitution() *substitution { + return &substitution{ + entrypoint: ReplacementsGroup, + rules: map[substitutionKind]bool{ + Replacements: true, + }, } - if l, ok := lines[len(lines)-1][0].(types.StringElement); ok { - a, err := ParseReader("", strings.NewReader(l.Content), Entrypoint("MarkdownQuoteAttribution")) - // assume that the last line is not an author attribution if an error occurred - if err != nil { - return lines, "" - } - if a, ok := a.(string); ok { - // log.Debugf("found attribution in markdown block: '%s'", a) - return lines[:len(lines)-1], a - } +} + +func newPostReplacementsSubstitution() *substitution { + return &substitution{ + entrypoint: PostReplacementsGroup, + rules: map[substitutionKind]bool{ + PostReplacements: true, + }, } - return lines, "" } -// ---------------------------------------------------------------------------- -// Section substitutions -// ---------------------------------------------------------------------------- +func newSpecialCharsSubstitution() *substitution { + return &substitution{ + entrypoint: SpecialcharactersGroup, + rules: map[substitutionKind]bool{ + SpecialCharacters: true, + }, + } +} -// applies the elements and attributes substitutions on the given section title. -func applySubstitutionsOnSection(ctx substitutionContext, s types.Section) (types.Section, error) { - elements := [][]interface{}{s.Title} // wrap to match the `elementsSubstitution` arg type - subs := []elementsSubstitution{ - substituteInlinePassthrough, - substituteSpecialCharacters, - substituteQuotedTexts, - substituteAttributes, - substituteReplacements, - substituteInlineMacros, - substitutePostReplacements, +func newVerbatimSubstitution() *substitution { + return &substitution{ + entrypoint: VerbatimGroup, + rules: map[substitutionKind]bool{ + SpecialCharacters: true, + Callouts: true, + }, } - var err error - for _, sub := range subs { - if elements, err = sub(ctx, elements); err != nil { - return types.Section{}, err - } +} + +func newTableColumnsAttrSubstitution() *substitution { + return &substitution{ + entrypoint: "TableColumnsAttribute", } - s.Title = elements[0] - if s, err = s.ResolveID(ctx.attributes); err != nil { - return types.Section{}, err +} + +func (s *substitution) disable(kinds ...substitutionKind) { + log.Debugf("disabling %v", kinds) + rules := make(map[substitutionKind]bool, len(s.rules)) + // TODO: use a single loop to copy/remove + for k, v := range s.rules { + rules[k] = v + } + for _, k := range kinds { + switch k { + case "specialchars": + delete(rules, SpecialCharacters) + default: + delete(rules, k) + } } // if log.IsLevelEnabled(log.DebugLevel) { - // // log.Debugf("section after substitution:") - // spew.Fdump(log.StandardLogger().Out, s) + // log.Debugf("remaining rules: %s", spew.Sdump(rules)) // } - return s, nil + s.rules = rules } -// ---------------------------------------------------------------------------- -// Location substitutions -// ---------------------------------------------------------------------------- +func (s *substitution) hasEnablements() bool { + return len(s.rules) > 0 +} -// applies the elements and attributes substitutions on the given image block. -func applySubstitutionsOnLocation(ctx substitutionContext, l types.Location) (types.Location, error) { - elements := [][]interface{}{l.Path} // wrap to match the `elementsSubstitution` arg type - subs := []elementsSubstitution{substituteAttributes} - var err error - for _, sub := range subs { - if elements, err = sub(ctx, elements); err != nil { - return types.Location{}, err - } +func (s *substitution) processAttributes(ctx *ParseContext, element types.BlockWithAttributes, opts ...Option) error { + if log.IsLevelEnabled(log.DebugLevel) { + log. + WithField("entrypoint", s.entrypoint). + Debugf("processing attributes of %s", spew.Sdump(element)) + } + // TODO: only parse element attributes if an attribute substitution occurred? + attrs, err := s.parseAttributes(element.GetAttributes(), opts...) + if err != nil { + return err } - l.Path = elements[0] - l = l.WithPathPrefix(ctx.attributes.GetAsStringWithDefault("imagesdir", "")) - return l, nil + element.SetAttributes(attrs) + found, err := replaceAttributeRefsInAttributes(ctx, element) + if err != nil { + return err + } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("attributes have substitions: %t", found) + } + if found { + // clone substitution so we start again with `hasAttributeSubstitutions=false` without loosing this `s.hasAttributeSubstitutions` value (needed to re-process elements) + return s.clone().processAttributes(ctx, element, opts...) + } + if log.IsLevelEnabled(log.DebugLevel) { + log.WithField("entrypoint", s.entrypoint).Debugf("done processing attributes of %s", spew.Sdump(element)) + } + return nil } -// ---------------------------------------------------------------------------- -// Individual substitution funcs -// ---------------------------------------------------------------------------- - -// includes a call to `elementsSubstitution` with some post-processing on the result -var substituteAttributes = func(ctx substitutionContext, lines [][]interface{}) ([][]interface{}, error) { - lines, err := newElementsSubstitution("AttributeSubs")(ctx, lines) // TODO: add a `substituteAttributes` var? +func (s *substitution) processElements(ctx *ParseContext, elements []interface{}, opts ...Option) ([]interface{}, error) { + if log.IsLevelEnabled(log.DebugLevel) { + // log.WithField("substitution_entrypoint", s.entrypoint).WithField("substitution_rules", s.rules).Debugf("processing %s", spew.Sdump(elements)) + log. + WithField("substitution_entrypoint", s.entrypoint). + WithField("substitution_rules", s.rules). + // WithField("hasAttributeSubstitutions", s.hasAttributeSubstitutions). + Debugf("processing elements") + } + elements, err := s.parseElements(ctx, elements, opts...) if err != nil { return nil, err } - for i, line := range lines { - line, err := applyAttributeSubstitutionsOnElements(ctx, line) - if err != nil { - return nil, err - } - lines[i] = types.Merge(line) + // log.WithField("group", step.group).Debug("attribute substitutions detected during parsing") + // apply substitutions on elements + elements, found, err := replaceAttributeRefsInElements(ctx, elements) + if err != nil { + return nil, err } - // if log.IsLevelEnabled(log.DebugLevel) { - // // log.Debugf("applied the 'attributes' substitution") - // spew.Fdump(log.StandardLogger().Out, lines) - // } - return lines, nil -} - -var ( - substituteInlinePassthrough = newElementsSubstitution("InlinePassthroughSubs") - substituteSpecialCharacters = newElementsSubstitution("SpecialCharacterSubs") - substituteQuotedTexts = newElementsSubstitution("QuotedTextSubs") - substituteReplacements = newElementsSubstitution("ReplacementSubs") - substituteInlineMacros = newElementsSubstitution("InlineMacroSubs") - substitutePostReplacements = newElementsSubstitution("PostReplacementSubs") - substituteNone = newElementsSubstitution("NoneSubs") - substituteCallouts = newElementsSubstitution("CalloutSubs") -) - -type elementsSubstitution func(ctx substitutionContext, lines [][]interface{}) ([][]interface{}, error) - -func newElementsSubstitution(rule string) elementsSubstitution { - return func(ctx substitutionContext, lines [][]interface{}) ([][]interface{}, error) { - log.Debugf("applying the '%s' rule on elements", rule) - placeholders := &placeholders{ - seq: 0, - elements: map[string]interface{}{}, - } - s := serializeLines(lines, placeholders) - imagesdirOption := GlobalStore("imagesdir", ctx.attributes.GetAsStringWithDefault("imagesdir", "")) - usermacrosOptions := GlobalStore(usermacrosKey, ctx.config.Macros) - // process placeholder content (eg: quoted text may contain an inline link) - for ref, placeholder := range placeholders.elements { - switch placeholder := placeholder.(type) { // TODO: create `PlaceHolder` interface? - case types.QuotedString: - var err error - if placeholder.Elements, err = parserPlaceHolderElements(placeholder.Elements, imagesdirOption, usermacrosOptions, Entrypoint(rule)); err != nil { - return nil, err - } - placeholders.elements[ref] = placeholder - case types.QuotedText: - var err error - if placeholder.Elements, err = parserPlaceHolderElements(placeholder.Elements, imagesdirOption, usermacrosOptions, Entrypoint(rule)); err != nil { - return nil, err - } - placeholders.elements[ref] = placeholder + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("content has attribute substitutions: %t", found) + } + if found { + elements, _ = types.NewInlineElements(elements) + // re-run the parser, skipping the `inline_passthrough` and `attribute` rules this time + s.disable(InlinePassthroughs) // TODO: verify when elements contain an `InlinePassthroughs` + if s.hasEnablements() { + if elements, err = s.parseElements(ctx, elements, opts...); err != nil { + return nil, err } } - elmts, err := parseContent("", s, imagesdirOption, usermacrosOptions, Entrypoint(rule)) - if err != nil { - return nil, err - } - elmts = restorePlaceholderElements(elmts, placeholders) - if log.IsLevelEnabled(log.DebugLevel) { - log.Debugf("applied the '%s' rule:", rule) - spew.Fdump(log.StandardLogger().Out, [][]interface{}{elmts}) - } - return [][]interface{}{elmts}, nil } + return elements, nil } -func parserPlaceHolderElements(elements []interface{}, options ...Option) ([]interface{}, error) { - result := make([]interface{}, 0, len(elements)) // default capacity (but may not be enough) - for _, element := range elements { - switch element := element.(type) { - case types.StringElement: - elmts, err := parseContent("", element.Content, options...) +func (s *substitution) parseElements(ctx *ParseContext, elements []interface{}, opts ...Option) ([]interface{}, error) { + if log.IsLevelEnabled(log.DebugLevel) { + log.WithField("entrypoint", s.entrypoint).Debug("parsing elements") + } + serialized, placeholders := serialize(elements) + if len(serialized) == 0 { + return nil, nil + } + result, err := s.parseContent(serialized, opts...) + if err != nil { + return nil, err + } + for _, element := range result { + if e, ok := element.(types.BlockWithAttributes); ok { + if len(e.GetAttributes()) == 0 { + log.Debug("no attribute to parse") + continue + } + // clone substitution, because we don't need all features (eg: inlinemacros) + sa := s.clone() + log.Debugf("disabling macros while parsing attributes") + sa.disable(Macros) // TODO: disable more rules (only keep what's in ElementAttributesGroup) + // skip call below if `sa` is empty. + if len(e.GetAttributes()) == 0 { + log.Debug("no rule enabled to parse attributes") + continue + } + attrs, err := sa.parseAttributes(e.GetAttributes(), opts...) if err != nil { return nil, err } - result = append(result, elmts...) - default: - result = append(result, element) + e.SetAttributes(attrs) } } - return result, nil -} -func parseContent(filename string, content string, options ...Option) ([]interface{}, error) { - result, err := ParseReader(filename, strings.NewReader(content), options...) - if err != nil { - return nil, errors.Wrapf(err, "unable to parse '%s'", content) - } - if result, ok := result.([]interface{}); ok { - return types.Merge(result), nil + // also, apply the substitutions on the placeholders, case by case + for _, element := range placeholders.elements { + if err := s.processPlaceHolderElements(ctx, element, opts...); err != nil { + return nil, err + } } - return []interface{}{result}, nil + return placeholders.restore(result) } -// replace the placeholders with their original element in the given elements -func restorePlaceholderElements(elements []interface{}, placeholders *placeholders) []interface{} { - // skip if there's nothing to restore - if len(placeholders.elements) == 0 { - return elements +func (s *substitution) processPlaceHolderElements(ctx *ParseContext, element interface{}, opts ...Option) error { + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("processing placeholder element of type '%T'", element) } - for i, e := range elements { - // - if e, ok := e.(types.ElementPlaceHolder); ok { - elements[i] = placeholders.elements[e.Ref] + switch e := element.(type) { + case types.BlockWithElements: + // if element has its own substitution attribute, then use it + if canHaveSubstitution(e) && e.GetAttributes().Has(types.AttrSubstitutions) { + subs, err := newSubstitutions(e) + if err != nil { + return err + } + return subs.processBlockWithElements(ctx, e, opts...) } - // for each element, check *all* interfaces to see if there's a need to replace the placeholders - if e, ok := e.(types.WithPlaceholdersInElements); ok { - elements[i] = e.RestoreElements(placeholders.elements) + if err := s.processBlockWithElements(ctx, e, opts...); err != nil { + return err } - if e, ok := e.(types.WithPlaceholdersInAttributes); ok { - elements[i] = e.RestoreAttributes(placeholders.elements) + case types.BlockWithLocation: + if err := s.processElementWithLocation(ctx, e, opts...); err != nil { + return err } - if e, ok := e.(types.WithPlaceholdersInLocation); ok { - elements[i] = e.RestoreLocation(placeholders.elements) + case *types.ListElementContinuation: + var err error + if e.Element, err = applySubstitutionsOnElement(ctx, e.Element); err != nil { + return err } + case []interface{}: + for _, elmt := range e { + if w, ok := elmt.(types.BlockWithElements); ok { + if err := s.processPlaceHolderElements(ctx, w, opts...); err != nil { + return err + } + } + } + default: + log.Debugf("skipping substitutions on block of type '%T'", e) } - return elements + return nil } -type placeholders struct { - seq int - elements map[string]interface{} +func (s *substitution) processBlockWithElements(ctx *ParseContext, block types.BlockWithElements, opts ...Option) error { + elements, err := s.processElements(ctx, block.GetElements(), opts...) + if err != nil { + return err + } + return block.SetElements(elements) } -func (p *placeholders) add(element interface{}) types.ElementPlaceHolder { - p.seq++ - p.elements[strconv.Itoa(p.seq)] = element - return types.ElementPlaceHolder{ - Ref: strconv.Itoa(p.seq), +func (s *substitution) processElementWithLocation(ctx *ParseContext, element types.BlockWithLocation, opts ...Option) error { + log.Debugf("processing element with location of type '%T'", element) + // process attributes + if err := s.processAttributes(ctx, element); err != nil { + return err } - + // process path + pathElements, err := s.processElements(ctx, element.GetLocation().Path, opts...) + if err != nil { + return err + } + element.GetLocation().SetPath(pathElements) + return nil } -func serializeLines(lines [][]interface{}, placeholders *placeholders) string { - result := strings.Builder{} - for i, line := range lines { - for _, e := range line { - switch e := e.(type) { - case types.StringElement: - result.WriteString(e.Content) - case types.SingleLineComment: - // replace with placeholder - p := placeholders.add(e) - result.WriteString(p.String()) - default: - // replace with placeholder - p := placeholders.add(e) - result.WriteString(p.String()) - } - } - if i < len(lines)-1 { - result.WriteString("\n") - } +func (s *substitution) parseAttributes(attributes types.Attributes, opts ...Option) (types.Attributes, error) { + if !(s.entrypoint == NormalGroup || s.entrypoint == AttributesGroup || s.entrypoint == QuotesGroup || s.entrypoint == ElementAttributesGroup) { // TODO: include special_characters? + // log.Debugf("no need to parse attributes for group '%s'", s.entrypoint) + return attributes, nil } // if log.IsLevelEnabled(log.DebugLevel) { - // log.Debug("serialized lines:") - // spew.Fdump(log.StandardLogger().Out, result.String()) + // log.Debugf("parsing attributes with group '%s' on %s", s.entrypoint, spew.Sdump(attributes)) // } - return result.String() -} - -func splitLines(_ substitutionContext, lines [][]interface{}) ([][]interface{}, error) { - result := make([][]interface{}, 0, len(lines)) - for _, line := range lines { - pendingLine := []interface{}{} - for _, element := range line { - switch element := element.(type) { - case types.StringElement: - // if content has line feeds, then split in multiple lines - split := strings.Split(element.Content, "\n") - for i, s := range split { - if len(s) > 0 { // no need to append an empty StringElement - pendingLine = append(pendingLine, types.StringElement{Content: s}) - } - if i < len(split)-1 { - result = append(result, pendingLine) - pendingLine = []interface{}{} // reset for the next line - } + for name, value := range attributes { + switch value := value.(type) { + case []interface{}: + // TODO: skip serializing/parsing if there's a single, non-string item + // Eg: + // ([]interface {}) (len=1) { + // (*types.AttributeSubstitution)({ + // Name: (string) (len=12) "github-title" + // }) + // } + serialized, placeholders := serialize(value) + if len(serialized) == 0 { + continue + } + values, err := s.parseContent(serialized, opts...) + if err != nil { + return nil, err + } + values, err = placeholders.restore(values) + if err != nil { + return nil, err + } + attributes[name] = values + case string: + if name == types.AttrCols { + // parse with a specific rule + values, err := newTableColumnsAttrSubstitution().parseContent([]byte(value), opts...) + if err != nil { + return nil, err } - default: - pendingLine = append(pendingLine, element) + attributes[name] = values + continue + } + values, err := s.parseContent([]byte(value), opts...) + if err != nil { + return nil, err } + attributes[name] = types.Reduce(values) + default: + attributes[name] = value } - // don't forget the last line (if applicable) - result = append(result, pendingLine) } - // if log.IsLevelEnabled(log.DebugLevel) { - // log.Debug("splitted lines") - // spew.Fdump(log.StandardLogger().Out, result) - // } - return result, nil + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("parsed attributes with rule '%s': %s", s.entrypoint, spew.Sdump(attributes)) + } + return attributes, nil } -// ---------------------------------------------------------------------------- -// Attribute substitutions -// ---------------------------------------------------------------------------- - -func applyAttributeSubstitutionsOnElements(ctx substitutionContext, elements []interface{}) ([]interface{}, error) { - result := make([]interface{}, len(elements)) // maximum capacity should exceed initial input - for i, element := range elements { - e, err := applyAttributeSubstitutionsOnElement(ctx, element) - if err != nil { - return nil, err - } - result[i] = e +func (s *substitution) parseContent(content []byte, opts ...Option) ([]interface{}, error) { + if log.IsLevelEnabled(log.DebugLevel) { + log.WithField("entrypoint", s.entrypoint).WithField("substitution_rules", s.rules).Debugf("parsing '%s'", content) } - return result, nil + result, err := Parse("", content, append(opts, Entrypoint(string(s.entrypoint)), GlobalStore(substitutionKey, s))...) + if err != nil { + return nil, err + } + r, ok := result.([]interface{}) + if !ok { + return nil, fmt.Errorf("unexpected type of content after parsing elements: '%T'", result) + } + return r, nil } -func applyAttributeSubstitutionsOnAttributes(ctx substitutionContext, attributes types.Attributes) (types.Attributes, error) { - for key, value := range attributes { - switch key { - case types.AttrRoles, types.AttrOptions: // multi-value attributes - result := []interface{}{} - if values, ok := value.([]interface{}); ok { - for _, value := range values { - switch value := value.(type) { - case []interface{}: - value, err := applyAttributeSubstitutionsOnElements(ctx, value) - if err != nil { - return nil, err - } - result = append(result, types.Reduce(value)) - default: - result = append(result, value) - } - - } - attributes[key] = result +// replaces the AttributeSubstitution by their actual values. +// TODO: returns `true` if at least one AttributeSubstitution was found (whatever its replacement)? +func replaceAttributeRefsInAttributes(ctx *ParseContext, b types.BlockWithAttributes) (bool, error) { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("replacing attribute refs in %s", spew.Sdump(b.GetAttributes())) + // } + found := false + for key, value := range b.GetAttributes() { + switch value := value.(type) { + case []interface{}: // multi-value attributes + value, f, err := replaceAttributeRefsInElements(ctx, value) + if err != nil { + return false, err + } + found = found || f + // (a bit hack-ish): do not merge values when the attribute is `roles` or `options` + switch key { + case types.AttrRoles, types.AttrOptions: + b.GetAttributes()[key] = value + default: + b.GetAttributes()[key] = types.Reduce(value) } default: // single-value attributes - if value, ok := value.([]interface{}); ok { - value, err := applyAttributeSubstitutionsOnElements(ctx, value) - if err != nil { - return nil, err - } - attributes[key] = types.Reduce(value) + value, f, err := replaceAttributeRefsInElement(ctx, value) + if err != nil { + return false, err } + found = found || f + b.GetAttributes()[key] = types.Reduce(value) } } // if log.IsLevelEnabled(log.DebugLevel) { - // log.Debug("applied substitutions on attributes") - // spew.Fdump(log.StandardLogger().Out, attributes) + // log.Debugf("replaced attribute refs: %s", spew.Sdump(b.GetAttributes())) // } - return attributes, nil -} - -func applyAttributeSubstitutionsOnLines(ctx substitutionContext, lines [][]interface{}) ([][]interface{}, error) { - for i, line := range lines { - line, err := applyAttributeSubstitutionsOnElements(ctx, line) - if err != nil { - return nil, err - } - lines[i] = types.Merge(line) - } - return lines, nil + return found, nil } -func applyAttributeSubstitutionsOnElement(ctx substitutionContext, element interface{}) (interface{}, error) { - var err error +// replaces the AttributeSubstitution or Counter substitution with its actual value, recursively if the given `element` +// is a slice +func replaceAttributeRefsInElement(ctx *ParseContext, element interface{}) (interface{}, bool, error) { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("replacing attribute references in element of type '%T'", element) + // } switch e := element.(type) { - case types.AttributeReset: - ctx.attributes.Set(e.Name, nil) // This allows us to test for a reset vs. undefined. - case types.AttributeSubstitution: - if value, ok := ctx.attributes.GetAsString(e.Name); ok { - element = types.StringElement{ - Content: value, - } - break - } - log.Warnf("unable to find attribute '%s'", e.Name) - element = types.StringElement{ - Content: "{" + e.Name + "}", + case []interface{}: + return replaceAttributeRefsInElements(ctx, e) + case *types.AttributeSubstitution: + s, found, err := ctx.attributes.getAsString(e.Name) + if err != nil { + return nil, false, err + } else if !found { + log.Warnf("unable to find attribute '%s'", e.Name) + return e, false, nil } + return &types.StringElement{ + Content: s, + }, true, nil case types.CounterSubstitution: - if element, err = applyCounterSubstitution(ctx, e); err != nil { - return nil, err + return counterToStringElement(ctx, e) + case types.BlockWithElements: + // replace AttributeSubstitutions on attributes + found := false + f, err := replaceAttributeRefsInAttributes(ctx, e) + if err != nil { + return nil, false, err } - case types.WithElementsToSubstitute: - elmts, err := applyAttributeSubstitutionsOnElements(ctx, e.ElementsToSubstitute()) + found = found || f + // replace AttributeSubstitutions on nested elements + elements, f, err := replaceAttributeRefsInElements(ctx, e.GetElements()) if err != nil { - return nil, err + return nil, false, err + } + found = found || f + // elements = types.Merge(elements) + if err := e.SetElements(elements); err != nil { + return nil, false, errors.Wrapf(err, "failed to replace attribute references in block of type '%T'", e) } - element = e.ReplaceElements(types.Merge(elmts)) - case types.WithLineSubstitution: - lines, err := applyAttributeSubstitutionsOnLines(ctx, e.LinesToSubstitute()) + return e, found, nil + case types.BlockWithLocation: + found := false + // replace AttributeSubstitutions on attributes + f, err := replaceAttributeRefsInAttributes(ctx, e) if err != nil { - return nil, err + return nil, false, err } - element = e.SubstituteLines(lines) - case types.ContinuedListItemElement: - if e.Element, err = applyAttributeSubstitutionsOnElement(ctx, e.Element); err != nil { - return nil, err + found = found || f + // replace AttributeSubstitutions on embedded location + f, err = replaceAttributeRefsInLocation(ctx, e) + if err != nil { + return nil, false, err } + found = found || f + return e, found, nil + case types.BlockWithAttributes: + // replace AttributeSubstitutions on attributes + + found, err := replaceAttributeRefsInAttributes(ctx, e) + return e, found, err + default: + return e, false, nil } - // also, retain the attribute declaration value (if applicable) - if e, ok := element.(types.AttributeDeclaration); ok { - ctx.attributes.Set(e.Name, e.Value) +} + +func replaceAttributeRefsInLocation(ctx *ParseContext, b types.BlockWithLocation) (bool, error) { + path, found, err := replaceAttributeRefsInElements(ctx, b.GetLocation().Path) + if err != nil { + return false, err } - return element, nil + b.GetLocation().Path = path + return found, nil } -// applyCounterSubstitutions is called by applyAttributeSubstitutionsOnElement. Unless there is an error with -// the element (the counter is the wrong type, which should never occur), it will return a `StringElement, true` -// (because we always either find the element, or allocate one), and `nil`. On an error it will return `nil, false`, -// and the error. The extra boolean here is to fit the calling expectations of our caller. This function was -// factored out of a case from applyAttributeSubstitutionsOnElement in order to reduce the complexity of that -// function, but otherwise it should have no callers. -func applyCounterSubstitution(ctx substitutionContext, c types.CounterSubstitution) (interface{}, error) { - counter := ctx.attributes.Counters[c.Name] +func replaceAttributeRefsInElements(ctx *ParseContext, elements []interface{}) ([]interface{}, bool, error) { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("replacing attribute refs in elements:\n%s", spew.Sdump(elements)) + // } + result := make([]interface{}, len(elements)) // maximum capacity should exceed initial input + found := false + for i, element := range elements { + element, f, err := replaceAttributeRefsInElement(ctx, element) + if err != nil { + return nil, false, err + } + found = found || f + result[i] = element + } + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("replaced attribute refs in elements:\n%s", spew.Sdump(result)) + // } + return result, found, nil +} + +func counterToStringElement(ctx *ParseContext, c types.CounterSubstitution) (*types.StringElement, bool, error) { + counter := ctx.counters[c.Name] if counter == nil { counter = 0 } increment := true if c.Value != nil { - ctx.attributes.Counters[c.Name] = c.Value + ctx.counters[c.Name] = c.Value counter = c.Value increment = false } @@ -692,28 +961,341 @@ func applyCounterSubstitution(ctx substitutionContext, c types.CounterSubstituti if increment { counter++ } - ctx.attributes.Counters[c.Name] = counter + ctx.counters[c.Name] = counter if c.Hidden { // return empty string facilitates merging - return types.StringElement{Content: ""}, nil + return &types.StringElement{Content: ""}, true, nil } - return types.StringElement{ + return &types.StringElement{ Content: strconv.Itoa(counter), - }, nil + }, true, nil case rune: if increment { counter++ } - ctx.attributes.Counters[c.Name] = counter + ctx.counters[c.Name] = counter if c.Hidden { // return empty string facilitates merging - return types.StringElement{Content: ""}, nil + return &types.StringElement{Content: ""}, true, nil } - return types.StringElement{ + return &types.StringElement{ Content: string(counter), - }, nil - + }, true, nil default: - return nil, fmt.Errorf("invalid counter type %T", counter) + return nil, false, fmt.Errorf("unexpected type of counter value: '%T'", counter) + } +} + +type placeholders struct { + seq int + elements map[string]interface{} +} + +func newPlaceholders() *placeholders { + return &placeholders{ + seq: 0, + elements: map[string]interface{}{}, + } +} + +func (p *placeholders) add(element interface{}) *types.ElementPlaceHolder { + p.seq++ + p.elements[strconv.Itoa(p.seq)] = element + return &types.ElementPlaceHolder{ + Ref: strconv.Itoa(p.seq), + } + +} + +// replace the placeholders with their original element in the given elements +func (p *placeholders) restore(elements []interface{}) ([]interface{}, error) { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("restoring placeholders in\n%s", spew.Sdump(elements)) + // } + // skip if there's nothing to restore + if len(p.elements) == 0 { + return elements, nil + } + for i, e := range elements { + // + if e, ok := e.(*types.ElementPlaceHolder); ok { + elements[i] = p.elements[e.Ref] + } + // also check nested elements (eg, in QuotedText, etc.) + // for each element, check *all* interfaces to see if there's a need to replace the placeholders + if e, ok := e.(types.BlockWithElements); ok { + elmts, err := p.restoreInBlockWithElements(e) + if err != nil { + return nil, err + } + elements[i] = elmts + } + if e, ok := e.(types.BlockWithAttributes); ok { + e, err := p.restoreInBlockWithAttributes(e) + if err != nil { + return nil, err + } + elements[i] = e + } + if e, ok := e.(types.BlockWithLocation); ok { + e, err := p.restoreInBlockWithLocation(e) + if err != nil { + return nil, err + } + elements[i] = e + } + } + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("restored elements:\n%v", spew.Sdump(elements)) + // } + return elements, nil +} + +func (p *placeholders) restoreInBlockWithElements(e types.BlockWithElements) (types.BlockWithElements, error) { + elements := e.GetElements() + result := make([]interface{}, len(elements)) + for i, e := range elements { + switch e := e.(type) { + case *types.ElementPlaceHolder: + result[i] = p.elements[e.Ref] + case []interface{}: + e, err := p.restore(e) + if err != nil { + return nil, err + } + result[i] = e + default: + result[i] = e + } + } + if err := e.SetElements(result); err != nil { + return nil, err } + return e, nil +} + +func (p *placeholders) restoreInBlockWithLocation(e types.BlockWithLocation) (types.BlockWithLocation, error) { + location := e.GetLocation() + result := make([]interface{}, len(location.Path)) + for i, e := range location.Path { + switch e := e.(type) { + case *types.ElementPlaceHolder: + result[i] = p.elements[e.Ref] + case []interface{}: + e, err := p.restore(e) + if err != nil { + return nil, err + } + result[i] = e + default: + result[i] = e + } + } + e.GetLocation().Path = result + return e, nil +} + +func (p *placeholders) restoreInBlockWithAttributes(e types.BlockWithAttributes) (types.BlockWithAttributes, error) { + attrs := e.GetAttributes() + for key, value := range attrs { + switch value := value.(type) { + case *types.ElementPlaceHolder: + attrs[key] = p.elements[value.Ref] + case []interface{}: + value, err := p.restore(value) + if err != nil { + return nil, err + } + attrs[key] = value + } + } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("restored placeholders in attributes:\n%s", spew.Sdump(attrs)) + } + return e, nil +} + +func serialize(content interface{}) ([]byte, *placeholders) { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("serializing:\n%v", spew.Sdump(content)) + // } + placeholders := newPlaceholders() + result := bytes.NewBuffer(nil) + switch content := content.(type) { + case string: // for attributes with simple (string) values + result.WriteString(content) + case []interface{}: // for paragraph lines, attributes with complex values, etc. + for i, element := range content { + switch element := element.(type) { + case types.RawContent: + result.WriteString(string(element)) + case types.RawLine: + result.WriteString(string(element)) + // add `\n` unless the next element is a single-line comment (otherwise we'll have to deal with an extra trailing `\n` afterwards) + if i < len(content)-1 { + if _, ok := content[i+1].(*types.SingleLineComment); !ok { + result.WriteString("\n") + } + } + case *types.SingleLineComment: + // replace with placeholder + p := placeholders.add(element) + result.WriteString(p.String()) + // add `\n` unless the next element is a single-line comment + if i < len(content)-1 { + if _, ok := content[i+1].(*types.SingleLineComment); !ok { + result.WriteString("\n") + } + } + case *types.StringElement: + result.WriteString(element.Content) + default: + // replace with placeholder + p := placeholders.add(element) + result.WriteString(p.String()) + } + } + } + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("serialized lines: '%s'\nplaceholders: %v", result.Bytes(), spew.Sdump(placeholders.elements)) + // } + return result.Bytes(), placeholders +} + +type grammarRule string + +const FileInclusion grammarRule = "FileInclusion" + +const disabledRules = "disabled_rules" + +func DisableRule(rule grammarRule) Option { + return func(p *parser) Option { + rules, ok := p.cur.globalStore[disabledRules].(map[grammarRule]bool) + if !ok { // 'rules' doesn't exist yet + rules = map[grammarRule]bool{} + p.cur.globalStore[disabledRules] = rules + + } + rules[rule] = true // mark as disabled + return nil // no need to provide an Option restore the setting + } +} + +func (c *current) isRuleEnabled(rule grammarRule) (bool, error) { + if rules, ok := c.globalStore[disabledRules].(map[grammarRule]bool); ok { + if disabled, found := rules[rule]; found { + return !disabled, nil + } + } + return true, nil + +} + +// sets the new substitution plan in the golbal store, overriding any exist–ing one +// NOTE: will override any existing substitution context +func (c *current) setCurrentSubstitution(kind string) error { + // log.Debugf("setting current substitution kind to '%s'", kind) + p, err := newSubstitution(kind) + if err != nil { + return err + } + c.state[substitutionKey] = p + return nil +} + +func (c *current) lookupCurrentSubstitution() (*substitution, bool) { + // look-up in the current state + if s, found := c.state[substitutionKey].(*substitution); found { + // log.Debug("found substitution in current state") + return s, found + } + // otherwise, lookup in the global-store + s, found := c.globalStore[substitutionKey].(*substitution) + return s, found +} + +func (c *current) isSubstitutionEnabled(k substitutionKind) (bool, error) { + s, found := c.lookupCurrentSubstitution() + if !found { + // log.Debugf("no current substitution, so assuming '%s' not enabled", k) + return false, nil // TODO: should return `true`, at least for `attributes`? + } + enabled, found := s.rules[k] + if !found { + // log.Debugf("substitution '%s' not configured in '%s'", k, s.entrypoint) + return false, nil + } + // log.Debugf("substitution '%s' enabled in rule '%s': %t", string(k), spew.Sdump(s.rules), enabled) + return enabled, nil +} + +type substitutionKind string + +const ( + // substitutionKey the key in which substitutions are stored in the parser's GlobalStore + substitutionKey string = "current_substitution" + + // Attributes the "attributes" substitution + Attributes substitutionKind = "attributes" + // Callouts the "callouts" substitution + Callouts substitutionKind = "callouts" + // InlinePassthroughs the "inline_passthrough" substitution + InlinePassthroughs substitutionKind = "inline_passthrough" // nolint: gosec + // Macros the "macros" substitution + Macros substitutionKind = "macros" + // None the "none" substitution + None substitutionKind = "none" + // PostReplacements the "post_replacements" substitution + PostReplacements substitutionKind = "post_replacements" + // Quotes the "quotes" substitution + Quotes substitutionKind = "quotes" + // Replacements the "replacements" substitution + Replacements substitutionKind = "replacements" + // SpecialCharacters the "specialchars" substitution + SpecialCharacters substitutionKind = "specialchars" +) + +const delimitedBlockScopeKey = "delimited_block_scope" + +// state info to indicate that parsing is happening within a delimited block of the given kind, +// in which case some grammar rules may need to be disabled +func (c *current) setWithinDelimitedBlockOfKind(kind string) { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("setting scope within block of kind '%s'", kind) + // } + c.globalStore[delimitedBlockScopeKey] = kind +} + +// state info to indicate that parsing is happening within a delimited block of the given kind, +// in which case some grammar rules may need to be disabled +func (c *current) unsetWithinDelimitedBlock() { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("unsetting scope within block of kind '%s'", kind) + // } + delete(c.globalStore, delimitedBlockScopeKey) +} + +// state info to determine if parsing is happening within a delimited block (any kind), +// in which case some grammar rules need to be disabled +func (c *current) isWithinDelimitedBlock() bool { + _, found := c.globalStore[delimitedBlockScopeKey].(string) + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("checking if within delimited block: %t", found) + // } + return found +} + +// state info to determine if parsing is happening within a delimited block of the given kind, +// in which case some grammar rules need to be disabled +func (c *current) isWithinDelimitedBlockOfKind(kind string) bool { + if k, found := c.globalStore[delimitedBlockScopeKey].(string); found { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("checking if within block of kind '%s': %t (1)", kind, k == kind) + // } + return k == kind + } + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("checking if within block of kind '%s': false (2)", kind) + // } + return false } diff --git a/pkg/parser/document_processing_apply_substitutions_test.go b/pkg/parser/document_processing_apply_substitutions_test.go index 145c1018..5576bd54 100644 --- a/pkg/parser/document_processing_apply_substitutions_test.go +++ b/pkg/parser/document_processing_apply_substitutions_test.go @@ -1,1058 +1,109 @@ package parser import ( - "github.com/bytesparadise/libasciidoc/pkg/configuration" "github.com/bytesparadise/libasciidoc/pkg/types" . "github.com/onsi/ginkgo" //nolint golint . "github.com/onsi/gomega" //nolint golint ) -var _ = Describe("document substitutions", func() { +var _ = Describe("new substitutions", func() { - Context("paragraphs", func() { + Context("listing block", func() { - It("should replace with new StringElement on first position", func() { - // given - elements := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.AttributeSubstitution{ - Name: "foo", - }, - types.StringElement{ - Content: " and more content.", - }, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "foo": "bar", - }, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "bar and more content.", - }, - }, - }, - }, - })) - }) - - It("should replace with new StringElement on middle position", func() { - // given - elements := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "baz, ", - }, - types.AttributeSubstitution{ - Name: "foo", - }, - types.StringElement{ - Content: " and more content.", - }, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "foo": "bar", - }, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "baz, bar and more content.", - }, - }, - }, - }, - })) - }) - - It("should replace with undefined attribute", func() { - // given - elements := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "baz, ", - }, - types.AttributeSubstitution{ - Name: "foo", - }, - types.StringElement{ - Content: " and more content.", - }, - }, - }, - }, + It("default subs", func() { + b := &types.DelimitedBlock{ + Kind: types.Listing, } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{}, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "baz, {foo} and more content.", - }, - }, + Expect(newSubstitutions(b)).To(Equal(substitutions{ + { + entrypoint: "VerbatimGroup", + rules: map[substitutionKind]bool{ + SpecialCharacters: true, + Callouts: true, }, }, })) }) + Context("incremental subs", func() { - It("should merge without substitution", func() { - // given - elements := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "baz, ", - }, - types.StringElement{ - Content: "foo", - }, - types.StringElement{ - Content: " and more content.", - }, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{}, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "baz, foo and more content.", - }, - }, - }, - }, - })) - }) - - It("should replace with new link", func() { - // given - elements := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.AttributeSubstitution{ - Name: "scheme", - }, - types.StringElement{ - Content: "://", - }, - types.AttributeSubstitution{ - Name: "host", - }, - types.StringElement{ - Content: "[].", // explicit use of `[]` to avoid grabbing the `.` - }, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "foo": "bar", - "scheme": "https", - "host": "example.com", - }, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - types.StringElement{ - Content: ".", - }, - }, - }, - }, - })) - }) - - It("should substitute title attribute", func() { - // given - elements := []interface{}{ - types.Paragraph{ + It("-callouts", func() { + b := &types.DelimitedBlock{ + Kind: types.Listing, Attributes: types.Attributes{ - types.AttrTitle: []interface{}{ - types.StringElement{ - Content: "a ", - }, - types.AttributeSubstitution{ - Name: "title", - }, - }, + types.AttrSubstitutions: "-callouts", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph with title '", - }, - types.AttributeSubstitution{ - Name: "title", - }, - types.StringElement{ - Content: "'", - }, + } + Expect(newSubstitutions(b)).To(Equal(substitutions{ + { + entrypoint: "VerbatimGroup", + rules: map[substitutionKind]bool{ + SpecialCharacters: true, }, }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "title": "cookie", - }, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrTitle: "a cookie", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph with title 'cookie'", - }, - }, - }, - }, - })) - }) - }) - - Context("paragraph with attributes", func() { + })) + }) - It("should replace title attribute", func() { - // given - elements := []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - "title": []interface{}{ - types.AttributeSubstitution{ - Name: "title", - }, - }, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some content.", - }, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "title": "TITLE", - }, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.Paragraph{ + It("-specialchars", func() { + b := &types.DelimitedBlock{ + Kind: types.Listing, Attributes: types.Attributes{ - "title": "TITLE", + types.AttrSubstitutions: "-specialchars", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some content.", - }, + } + Expect(newSubstitutions(b)).To(Equal(substitutions{ + { + entrypoint: "VerbatimGroup", + rules: map[substitutionKind]bool{ + Callouts: true, }, }, - }, - })) + })) + }) }) - It("should replace roles attribute", func() { - // given - elements := []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{ - []interface{}{ - types.AttributeSubstitution{ - Name: "role1", - }, - }, - []interface{}{ - types.AttributeSubstitution{ - Name: "role2", - }, - }, - }, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some content.", - }, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "role1": "ROLE1", - "role2": "ROLE2", - }, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"ROLE1", "ROLE2"}, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some content.", - }, - }, - }, - }, - })) - }) - - }) - - Context("image blocks", func() { + Context("absolute subs", func() { - It("should substitute inline attribute", func() { - elements := []interface{}{ - types.ImageBlock{ + It("macros", func() { + b := &types.DelimitedBlock{ + Kind: types.Listing, Attributes: types.Attributes{ - types.AttrImageAlt: []interface{}{ - types.AttributeSubstitution{ - Name: "alt", - }, - }, - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "foo.png"}, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "alt": "cookie", - }, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: "cookie", // substituted + types.AttrSubstitutions: "macros", }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "foo.png"}, + } + Expect(newSubstitutions(b)).To(Equal(substitutions{ + { + entrypoint: "MacrosGroup", + rules: map[substitutionKind]bool{ + Macros: true, }, }, - }, - })) + })) + }) }) - It("should substitute inline attribute", func() { - elements := []interface{}{ - types.ImageBlock{ - Location: types.Location{ - Path: []interface{}{ - types.AttributeSubstitution{ - Name: "path", - }, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "path": "cookie.png", - }, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.ImageBlock{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "cookie.png"}, - }, - }, - }, - })) - }) - - }) - - Context("list items", func() { + Context("mixing subs", func() { - It("should replace with new StringElement in ordered list item", func() { - // given - elements := []interface{}{ - types.OrderedListItem{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.AttributeSubstitution{ - Name: "foo", - }, - types.StringElement{ - Content: " and more content.", - }, - }, - }, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "foo": "bar", - }, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.OrderedListItem{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "bar and more content.", - }, - }, - }, - }, - }, - }, - })) - }) - - It("should replace with new StringElement in unordered list item", func() { - // given - elements := []interface{}{ - types.UnorderedListItem{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.AttributeSubstitution{ - Name: "foo", - }, - types.StringElement{ - Content: " and more content.", - }, - }, - }, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "foo": "bar", - }, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.UnorderedListItem{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "bar and more content.", - }, - }, - }, - }, - }, - }, - })) - }) - - It("should replace with new StringElement in labeled list item", func() { - // given - elements := []interface{}{ - types.LabeledListItem{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.AttributeSubstitution{ - Name: "foo", - }, - types.StringElement{ - Content: " and more content.", - }, - }, - }, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "foo": "bar", - }, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.LabeledListItem{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "bar and more content.", - }, - }, - }, - }, - }, - }, - })) - }) - }) - - Context("delimited blocks", func() { - - It("should replace with new StringElement in delimited block", func() { - // given - elements := []interface{}{ - types.ExampleBlock{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.AttributeSubstitution{ - Name: "foo", - }, - types.StringElement{ - Content: " and more content.", - }, - }, - }, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "foo": "bar", - }, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.ExampleBlock{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "bar and more content.", - }, - }, - }, - }, - }, - }, - })) - }) - }) - - Context("quoted texts", func() { - - It("should replace with new StringElement in quoted text", func() { - // given - elements := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "hello ", - }, - types.QuotedText{ - Elements: []interface{}{ - types.AttributeSubstitution{ - Name: "foo", - }, - types.StringElement{ - Content: " and more content.", - }, - }, - }, - }, - { - types.StringElement{ - Content: "and another line", - }, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "foo": "bar", - }, - Overrides: map[string]string{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "hello ", - }, - types.QuotedText{ - Elements: []interface{}{ - types.StringElement{ - Content: "bar and more content.", - }, - }, - }, - }, - { - types.StringElement{ - Content: "and another line", - }, - }, - }, - }, - })) - }) - }) - - Context("attribute overrides", func() { - - It("should replace with new StringElement on first position", func() { - // given - elements := []interface{}{ - types.AttributeDeclaration{ - Name: "foo", - Value: "foo", - }, - types.AttributeReset{ - Name: "foo", - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.AttributeSubstitution{ - Name: "foo", - }, - types.StringElement{ - Content: " and more content.", - }, - }, - }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "foo": "bar", - }, - Overrides: map[string]string{ - "foo": "BAR", - }, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - // then - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ // at this stage, AttributeDeclaration and AttributeReset are still present - types.AttributeDeclaration{ - Name: "foo", - Value: "foo", - }, - types.AttributeReset{ - Name: "foo", - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "BAR and more content.", - }, - }, - }, - }, - })) - }) - }) - - Context("counters", func() { - - It("should start at one", func() { - // given - elements := []interface{}{ - types.CounterSubstitution{ - Name: "foo", - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{}, - Overrides: map[string]string{}, - Counters: map[string]interface{}{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ // at this stage, AttributeDeclaration and AttributeReset are still present - types.StringElement{ - Content: "1", - }, - })) - }) - - It("should increment correctly", func() { - // given - elements := []interface{}{ - types.CounterSubstitution{ - Name: "foo", - }, - types.CounterSubstitution{ - Name: "bar", - }, - types.CounterSubstitution{ - Name: "foo", - }, - types.CounterSubstitution{ - Name: "alpha", - Value: 'a', - Hidden: true, - }, - types.CounterSubstitution{ - Name: "alpha", - }, - types.CounterSubstitution{ - Name: "set", - Value: 33, - Hidden: true, - }, - types.CounterSubstitution{ - Name: "set", - Hidden: true, - }, - types.CounterSubstitution{ - Name: "set", - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{}, - Overrides: map[string]string{}, - Counters: map[string]interface{}{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ - // elements are not concatenated after calling `applyAttributeSubstitutionsOnElements` - types.StringElement{Content: "1"}, - types.StringElement{Content: "1"}, - types.StringElement{Content: "2"}, - types.StringElement{Content: ""}, - types.StringElement{Content: "b"}, - types.StringElement{Content: ""}, - types.StringElement{Content: ""}, - types.StringElement{Content: "35"}, - })) - }) - }) - - Context("recursive attributes", func() { - - It("should substitute an attribute in another attribute", func() { - elements := []interface{}{ - types.AttributeDeclaration{ - Name: "def", - Value: "foo", - }, - types.AttributeDeclaration{ - Name: "abc", - Value: []interface{}{ - types.AttributeSubstitution{ - Name: "def", - }, - types.StringElement{ - Content: "bar", - }, + It("macros,+quotes,-quotes", func() { + b := &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "macros,+quotes,-quotes", }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.AttributeSubstitution{ - Name: "abc", - }, + } + Expect(newSubstitutions(b)).To(Equal(substitutions{ + { + entrypoint: "MacrosGroup", + rules: map[substitutionKind]bool{ + Macros: true, }, }, - }, - } - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{}, - Overrides: map[string]string{}, - Counters: map[string]interface{}{}, - }, - config: configuration.NewConfiguration(), - } - // when - result, err := applySubstitutions(ctx, elements) - Expect(err).To(Not(HaveOccurred())) - Expect(result).To(Equal([]interface{}{ // at this stage, AttributeDeclaration and AttributeReset are still present - types.AttributeDeclaration{ - Name: "def", - Value: "foo", - }, - types.AttributeDeclaration{ - Name: "abc", - Value: "foobar", - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foobar", - }, - }, + { + entrypoint: "QuotesGroup", + rules: map[substitutionKind]bool{}, // TODO: remove substitution entry when `rules` is empty }, - }, - })) + })) + }) }) - - }) -}) - -var _ = Describe("substitution funcs", func() { - - It("should append sub", func() { - // given" - f := funcs{"attributes", "quotes"} - // when - f = f.append("macros") - // then - Expect(f).To(Equal(funcs{"attributes", "quotes", "macros"})) - }) - - It("should append subs", func() { - // given" - f := funcs{"attributes"} - // when - f = f.append("quotes", "macros") - // then - Expect(f).To(Equal(funcs{"attributes", "quotes", "macros"})) - }) - - It("should prepend sub", func() { - // given" - f := funcs{"attributes", "quotes"} - // when - f = f.prepend("macros") - // then - Expect(f).To(Equal(funcs{"macros", "attributes", "quotes"})) - }) - - It("should remove first sub", func() { - // given" - f := funcs{"attributes", "quotes", "macros"} - // when - f = f.remove("attributes") - // then - Expect(f).To(Equal(funcs{"quotes", "macros"})) - }) - - It("should remove middle sub", func() { - // given" - f := funcs{"attributes", "quotes", "macros"} - // when - f = f.remove("quotes") - // then - Expect(f).To(Equal(funcs{"attributes", "macros"})) - }) - - It("should remove last sub", func() { - // given" - f := funcs{"attributes", "quotes", "macros"} - // when - f = f.remove("macros") - // then - Expect(f).To(Equal(funcs{"attributes", "quotes"})) - }) - - It("should remove non existinge", func() { - // given" - f := funcs{"attributes", "quotes", "macros"} - // when - f = f.remove("other") - // then - Expect(f).To(Equal(funcs{"attributes", "quotes", "macros"})) }) }) diff --git a/pkg/parser/document_processing_arrange_lists.go b/pkg/parser/document_processing_arrange_lists.go new file mode 100644 index 00000000..d359f336 --- /dev/null +++ b/pkg/parser/document_processing_arrange_lists.go @@ -0,0 +1,185 @@ +package parser + +import ( + "github.com/bytesparadise/libasciidoc/pkg/types" + + "github.com/pkg/errors" + log "github.com/sirupsen/logrus" +) + +// ArrangeLists pipeline task which consists join list elements into lists +func ArrangeLists(done <-chan interface{}, fragmentStream <-chan types.DocumentFragment) <-chan types.DocumentFragment { + arrangedStream := make(chan types.DocumentFragment, bufferSize) + go func() { + defer close(arrangedStream) + for fragment := range fragmentStream { + select { + case <-done: + log.WithField("pipeline_task", "arrange_lists").Debug("received 'done' signal") + return + case arrangedStream <- arrangeLists(fragment): + } + } + log.WithField("pipeline_task", "arrange_lists").Debug("done") + }() + return arrangedStream +} + +func arrangeLists(f types.DocumentFragment) types.DocumentFragment { + // if the fragment contains an error, then send it as-is downstream + if err := f.Error; err != nil { + log.Debugf("skipping list elements arrangement: %v", f.Error) + return f + } + // if log.IsLevelEnabled(log.DebugLevel) { + // log.WithField("pipeline_task", "arrange_lists").Debugf("arranging list elements: %s", spew.Sdump(f.Elements...)) + // } + elements, err := arrangeListElements(f.Elements) + if err != nil { + return types.NewErrorFragment(err) + } + result := types.DocumentFragment{ + Elements: elements, + } + // if log.IsLevelEnabled(log.DebugLevel) { + // log.WithField("pipeline_task", "arrange_lists").Debugf("arranged lists: %s", spew.Sdump(result)) + // } + + return result +} + +func arrangeListElements(elements []interface{}) ([]interface{}, error) { + result := make([]interface{}, 0, len(elements)) + + for _, element := range elements { + switch e := element.(type) { + case *types.DelimitedBlock: + log.Debug("checking elements in DelimitedBlock") + var err error + if e.Elements, err = arrangeListElements(e.Elements); err != nil { + return nil, err + } + result = append(result, e) + case *types.ListElements: + log.Debug("arranging list elements in ListElements") + l, err := doArrangeListElements(e.Elements) + if err != nil { + return nil, err + } + result = append(result, l) + default: + result = append(result, e) + } + } + if len(result) == 0 { + result = nil + } + return result, nil +} + +func doArrangeListElements(elements []interface{}) (interface{}, error) { + lists := newListStack() // so we can support delimited blocks in list elements, etc. + +content: + for _, element := range elements { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("arranging element of type '%T'", element) + // } + // lookup the parent block which can add the given element + if parentBlock := lists.parentFor(element); parentBlock != nil { + if err := parentBlock.AddElement(element); err != nil { + return nil, errors.Wrap(err, "unable to assemble list elements") + } + continue content + } + + switch e := element.(type) { + case types.ListElement: + // adjust style/level if needed + e.AdjustStyle(lists.get()) + list, err := types.NewList(e) + if err != nil { + return nil, errors.Wrap(err, "unable to assemble list elements") + } + log.Debugf("adding a new list of kind '%s'", list.Kind) + if err := lists.push(list); err != nil { + return nil, errors.Wrap(err, "unable to assemble list elements") + } + default: + return nil, errors.Errorf("unable to process element of type '%T' in the list", element) + } + } + return lists.root(), nil +} + +type listStack struct { + stack []*types.List +} + +func newListStack() *listStack { + return &listStack{ + stack: []*types.List{}, + } +} + +func (s *listStack) root() *types.List { + if len(s.stack) > 0 { + return s.stack[0] + } + return nil +} + +func (s *listStack) push(l *types.List) error { + // also append to last element following the path from `root` + if len(s.stack) > 0 { + if err := s.stack[len(s.stack)-1].LastElement().AddElement(l); err != nil { + return err + } + } + s.stack = append(s.stack, l) + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("added list to stack (len=%d)", len(s.stack)) + // } + return nil +} + +// returns the top element of the stack without removing it +func (s *listStack) get() *types.List { + if len(s.stack) == 0 { + return nil + } + return s.stack[len(s.stack)-1] +} + +// returns and removes the top element of the stack +func (s *listStack) pop() *types.List { + if len(s.stack) == 0 { + return nil + } + l := s.stack[len(s.stack)-1] + s.stack = s.stack[:len(s.stack)-1] + return l +} + +func (s *listStack) parentFor(element interface{}) *types.List { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("looking-up parent for %s", spew.Sdump(element)) + // } + if c, ok := element.(*types.ListElementContinuation); ok { + for i := 0; i < c.Offset; i++ { + s.pop() + } + } + for i := len(s.stack) - 1; i >= 0; i-- { + // log.Debugf("checking stack at index %d", i) + if l := s.stack[i]; l.CanAddElement(element) { + // if match, then `pop` all + // log.Debugf("found matching list of kind '%s' for element of type '%T' at index %d", l.Kind, element, i) + // clears the following content off the stack + s.stack = s.stack[:i+1] + return l + } + } + // log.Debugf("can't add element of type '%T' to any list in the stack", element) + return nil +} diff --git a/pkg/parser/document_processing_collect_footnotes.go b/pkg/parser/document_processing_collect_footnotes.go new file mode 100644 index 00000000..5b8874cf --- /dev/null +++ b/pkg/parser/document_processing_collect_footnotes.go @@ -0,0 +1,32 @@ +package parser + +import ( + "github.com/bytesparadise/libasciidoc/pkg/types" + log "github.com/sirupsen/logrus" +) + +func CollectFootnotes(n *types.Footnotes, done <-chan interface{}, fragmentStream <-chan types.DocumentFragment) chan types.DocumentFragment { + processedFragmentStream := make(chan types.DocumentFragment, bufferSize) + go func() { + defer close(processedFragmentStream) + for f := range fragmentStream { + select { + case <-done: + log.WithField("pipeline_stage", "collect_footnotes").Debug("received 'done' signal") + return + case processedFragmentStream <- collectFootnotes(n, f): + } + } + log.WithField("pipeline_stage", "collect_footnotes").Debug("done") + }() + return processedFragmentStream +} + +func collectFootnotes(n *types.Footnotes, f types.DocumentFragment) types.DocumentFragment { + for _, e := range f.Elements { + if e, ok := e.(types.WithFootnotes); ok { + e.SubstituteFootnotes(n) + } + } + return f +} diff --git a/pkg/parser/document_processing_collect_footnotes_test.go b/pkg/parser/document_processing_collect_footnotes_test.go new file mode 100644 index 00000000..daf417ab --- /dev/null +++ b/pkg/parser/document_processing_collect_footnotes_test.go @@ -0,0 +1,442 @@ +package parser_test + +import ( + "github.com/bytesparadise/libasciidoc/pkg/parser" + "github.com/bytesparadise/libasciidoc/pkg/types" + . "github.com/bytesparadise/libasciidoc/testsupport" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("collect footnotes", func() { + + Context("in section titles", func() { + + var sectionWithFootnote1 *types.Section + var sectionWithFootnoteRef1 *types.Section + var sectionWithFootnote2 *types.Section + var sectionWithFootnoteRef2 *types.Section + var sectionWithoutFootnote *types.Section + + BeforeEach(func() { + sectionWithFootnote1 = &types.Section{ + Title: []interface{}{ + &types.StringElement{ + Content: "cookies", + }, + &types.Footnote{ + Ref: "", // without ref + Elements: []interface{}{ + &types.StringElement{ + Content: "cookies", + }, + }, + }, + }, + } + sectionWithFootnoteRef1 = &types.Section{ + Title: []interface{}{ + &types.StringElement{ + Content: "cookies", + }, + &types.FootnoteReference{ + ID: 1, + }, + }, + } + sectionWithFootnote2 = &types.Section{ + Title: []interface{}{ + &types.StringElement{ + Content: "pasta", + }, + &types.Footnote{ + Ref: "pasta", // with ref + Elements: []interface{}{ + &types.StringElement{ + Content: "pasta", + }, + }, + }, + }, + } + sectionWithFootnoteRef2 = &types.Section{ + Title: []interface{}{ + &types.StringElement{ + Content: "pasta", + }, + &types.FootnoteReference{ + ID: 2, + Ref: "pasta", // with ref + }, + }, + } + sectionWithoutFootnote = &types.Section{ + Title: []interface{}{ + &types.StringElement{ + Content: "coffee", + }, + }, + } + }) + + It("no footnote", func() { + c := make(chan types.DocumentFragment, 1) + c <- types.DocumentFragment{ + Elements: []interface{}{ + sectionWithoutFootnote, + }, + } + close(c) + footnotes := types.NewFootnotes() + result := parser.CollectFootnotes(footnotes, make(<-chan interface{}), c) + Expect(<-result).To(MatchDocumentFragment(types.DocumentFragment{ + Elements: []interface{}{ + sectionWithoutFootnote, + }, + })) + Expect(footnotes.Notes).To(BeEmpty()) + }) + + It("single footnote", func() { + c := make(chan types.DocumentFragment, 1) + c <- types.DocumentFragment{ + Elements: []interface{}{ + sectionWithFootnote1, + sectionWithoutFootnote, + }, + } + close(c) + footnotes := types.NewFootnotes() + result := parser.CollectFootnotes(footnotes, make(<-chan interface{}), c) + Expect(<-result).To(MatchDocumentFragment(types.DocumentFragment{ + Elements: []interface{}{ + sectionWithFootnoteRef1, + sectionWithoutFootnote, + }, + })) + Expect(footnotes.Notes).To(Equal([]*types.Footnote{ + { + ID: 1, // set + Ref: "", // without ref + Elements: []interface{}{ + &types.StringElement{ + Content: "cookies", + }, + }, + }, + })) + }) + + It("multiple footnotes in same fragment", func() { + c := make(chan types.DocumentFragment, 1) + c <- types.DocumentFragment{ + Elements: []interface{}{ + sectionWithFootnote1, + sectionWithoutFootnote, + sectionWithFootnote2, + }, + } + close(c) + footnotes := types.NewFootnotes() + result := parser.CollectFootnotes(footnotes, make(<-chan interface{}), c) + Expect(<-result).To(MatchDocumentFragment(types.DocumentFragment{ + Elements: []interface{}{ + sectionWithFootnoteRef1, + sectionWithoutFootnote, + sectionWithFootnoteRef2, + }, + })) + Expect(footnotes.Notes).To(Equal([]*types.Footnote{ + { + ID: 1, // set + Ref: "", // without ref + Elements: []interface{}{ + &types.StringElement{ + Content: "cookies", + }, + }, + }, + { + ID: 2, // set + Ref: "pasta", // with ref + Elements: []interface{}{ + &types.StringElement{ + Content: "pasta", + }, + }, + }, + })) + }) + + It("multiple footnotes in separate fragments", func() { + c := make(chan types.DocumentFragment, 2) + c <- types.DocumentFragment{ + Elements: []interface{}{ + sectionWithoutFootnote, + sectionWithFootnote1, + sectionWithoutFootnote, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + sectionWithoutFootnote, + sectionWithFootnote2, + sectionWithoutFootnote, + }, + } + close(c) + footnotes := types.NewFootnotes() + result := parser.CollectFootnotes(footnotes, make(<-chan interface{}), c) + Expect(<-result).To(MatchDocumentFragment(types.DocumentFragment{ + Elements: []interface{}{ + sectionWithoutFootnote, + sectionWithFootnoteRef1, + sectionWithoutFootnote, + }, + })) + Expect(<-result).To(MatchDocumentFragment(types.DocumentFragment{ + Elements: []interface{}{ + sectionWithoutFootnote, + sectionWithFootnoteRef2, + sectionWithoutFootnote, + }, + })) + Expect(footnotes.Notes).To(Equal([]*types.Footnote{ + { + ID: 1, // set + Ref: "", // without ref + Elements: []interface{}{ + &types.StringElement{ + Content: "cookies", + }, + }, + }, + { + ID: 2, // set + Ref: "pasta", // with ref + Elements: []interface{}{ + &types.StringElement{ + Content: "pasta", + }, + }, + }, + })) + }) + }) + + Context("in paragraphs", func() { + + var paragraphWithFootnote1 *types.Paragraph + var paragraphWithFootnoteRef1 *types.Paragraph + var paragraphWithFootnote2 *types.Paragraph + var paragraphWithFootnoteRef2 *types.Paragraph + var paragraphWithoutFootnote *types.Paragraph + + BeforeEach(func() { + paragraphWithFootnote1 = &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "cookies", + }, + &types.Footnote{ + Ref: "", // without ref + Elements: []interface{}{ + &types.StringElement{ + Content: "cookies", + }, + }, + }, + }, + } + paragraphWithFootnoteRef1 = &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "cookies", + }, + &types.FootnoteReference{ + ID: 1, + }, + }, + } + paragraphWithFootnote2 = &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "pasta", + }, + &types.Footnote{ + Ref: "pasta", // with ref + Elements: []interface{}{ + &types.StringElement{ + Content: "pasta", + }, + }, + }, + }, + } + paragraphWithFootnoteRef2 = &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "pasta", + }, + &types.FootnoteReference{ + ID: 2, + Ref: "pasta", // with ref + }, + }, + } + paragraphWithoutFootnote = &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "coffee", + }, + }, + } + }) + + It("no footnote", func() { + c := make(chan types.DocumentFragment, 1) + c <- types.DocumentFragment{ + Elements: []interface{}{ + paragraphWithoutFootnote, + }, + } + close(c) + footnotes := types.NewFootnotes() + result := parser.CollectFootnotes(footnotes, make(<-chan interface{}), c) + Expect(<-result).To(MatchDocumentFragment(types.DocumentFragment{ + Elements: []interface{}{ + paragraphWithoutFootnote, + }, + })) + Expect(footnotes.Notes).To(BeEmpty()) + }) + + It("single footnote", func() { + c := make(chan types.DocumentFragment, 1) + c <- types.DocumentFragment{ + Elements: []interface{}{ + paragraphWithFootnote1, + paragraphWithoutFootnote, + }, + } + close(c) + footnotes := types.NewFootnotes() + result := parser.CollectFootnotes(footnotes, make(<-chan interface{}), c) + Expect(<-result).To(MatchDocumentFragment(types.DocumentFragment{ + Elements: []interface{}{ + paragraphWithFootnoteRef1, + paragraphWithoutFootnote, + }, + })) + Expect(footnotes.Notes).To(Equal([]*types.Footnote{ + { + ID: 1, // set + Ref: "", // without ref + Elements: []interface{}{ + &types.StringElement{ + Content: "cookies", + }, + }, + }, + })) + }) + + It("multiple footnotes in same fragment", func() { + c := make(chan types.DocumentFragment, 1) + c <- types.DocumentFragment{ + Elements: []interface{}{ + paragraphWithFootnote1, + paragraphWithoutFootnote, + paragraphWithFootnote2, + }, + } + close(c) + footnotes := types.NewFootnotes() + result := parser.CollectFootnotes(footnotes, make(<-chan interface{}), c) + Expect(<-result).To(MatchDocumentFragment(types.DocumentFragment{ + Elements: []interface{}{ + paragraphWithFootnoteRef1, + paragraphWithoutFootnote, + paragraphWithFootnoteRef2, + }, + })) + Expect(footnotes.Notes).To(Equal([]*types.Footnote{ + { + ID: 1, // set + Ref: "", // without ref + Elements: []interface{}{ + &types.StringElement{ + Content: "cookies", + }, + }, + }, + { + ID: 2, // set + Ref: "pasta", // with ref + Elements: []interface{}{ + &types.StringElement{ + Content: "pasta", + }, + }, + }, + })) + }) + + It("multiple footnotes in separate fragments", func() { + c := make(chan types.DocumentFragment, 2) + c <- types.DocumentFragment{ + Elements: []interface{}{ + paragraphWithoutFootnote, + paragraphWithFootnote1, + paragraphWithoutFootnote, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + paragraphWithoutFootnote, + paragraphWithFootnote2, + paragraphWithoutFootnote, + }, + } + close(c) + footnotes := types.NewFootnotes() + result := parser.CollectFootnotes(footnotes, make(<-chan interface{}), c) + Expect(<-result).To(MatchDocumentFragment(types.DocumentFragment{ + Elements: []interface{}{ + paragraphWithoutFootnote, + paragraphWithFootnoteRef1, + paragraphWithoutFootnote, + }, + })) + Expect(<-result).To(MatchDocumentFragment(types.DocumentFragment{ + Elements: []interface{}{ + paragraphWithoutFootnote, + paragraphWithFootnoteRef2, + paragraphWithoutFootnote, + }, + })) + Expect(footnotes.Notes).To(Equal([]*types.Footnote{ + { + ID: 1, // set + Ref: "", // without ref + Elements: []interface{}{ + &types.StringElement{ + Content: "cookies", + }, + }, + }, + { + ID: 2, // set + Ref: "pasta", // with ref + Elements: []interface{}{ + &types.StringElement{ + Content: "pasta", + }, + }, + }, + })) + }) + }) + +}) diff --git a/pkg/parser/document_processing_custom_substitutions_test.go b/pkg/parser/document_processing_custom_substitutions_test.go new file mode 100644 index 00000000..5424fc19 --- /dev/null +++ b/pkg/parser/document_processing_custom_substitutions_test.go @@ -0,0 +1,160 @@ +package parser + +import ( + "github.com/bytesparadise/libasciidoc/pkg/types" + log "github.com/sirupsen/logrus" + + . "github.com/onsi/ginkgo/extensions/table" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = DescribeTable("compute valid custom substitutions", + + func(block types.BlockWithAttributes, expected substitutions) { + // given + log.Debugf("processing '%v'", block) + // when + result, err := newSubstitutions(block) + // then + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(Equal(expected)) + }, + + Entry(`listing block with default substitutions`, + &types.DelimitedBlock{ + Kind: types.Listing, + }, + substitutions{ + // default + &substitution{ + entrypoint: VerbatimGroup, + rules: map[substitutionKind]bool{ + SpecialCharacters: true, + Callouts: true, + }, + }, + }, + ), + Entry(`example block with default substitutions`, + &types.DelimitedBlock{ + Kind: types.Example, + }, + substitutions{ + // default + &substitution{ + entrypoint: NormalGroup, + rules: map[substitutionKind]bool{ + InlinePassthroughs: true, + SpecialCharacters: true, + Attributes: true, + Quotes: true, + Replacements: true, + Macros: true, + PostReplacements: true, + }, + }, + }, + ), + Entry(`listing block with custom 'attributes,quotes' substitutions`, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: `attributes,quotes`, + }, + }, + substitutions{ + &substitution{ + entrypoint: AttributesGroup, + rules: map[substitutionKind]bool{ + InlinePassthroughs: true, + Attributes: true, + }, + }, + &substitution{ + entrypoint: QuotesGroup, + rules: map[substitutionKind]bool{ + Quotes: true, + }, + }, + }, + ), + // incremental substitutions + Entry(`listing block with incremental '+attributes' substitutions `, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: `+attributes`, + }, + }, + substitutions{ + // default + &substitution{ + entrypoint: VerbatimGroup, + rules: map[substitutionKind]bool{ + SpecialCharacters: true, + Callouts: true, + }, + }, + // appended + &substitution{ + entrypoint: AttributesGroup, + rules: map[substitutionKind]bool{ + InlinePassthroughs: true, + Attributes: true, + }, + }, + }, + ), + Entry(`listing block with incremental 'attributes+' substitutions `, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: `attributes+`, + }, + }, + substitutions{ + // prepended + &substitution{ + entrypoint: AttributesGroup, + rules: map[substitutionKind]bool{ + InlinePassthroughs: true, + Attributes: true, + }, + }, + // default + &substitution{ + entrypoint: VerbatimGroup, + rules: map[substitutionKind]bool{ + SpecialCharacters: true, + Callouts: true, + }, + }, + }, + ), + Entry(`listing block with incremental 'attributes+,-specialchars' substitutions `, + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: `attributes+,-specialchars`, + }, + }, + substitutions{ + // prepended + &substitution{ + entrypoint: AttributesGroup, + rules: map[substitutionKind]bool{ + InlinePassthroughs: true, + Attributes: true, + }, + }, + // default + &substitution{ + entrypoint: VerbatimGroup, + rules: map[substitutionKind]bool{ + // SpecialCharacters: true, // removed + Callouts: true, + }, + }, + }, + ), +) diff --git a/pkg/parser/document_processing_filter_blocks.go b/pkg/parser/document_processing_filter_blocks.go deleted file mode 100644 index 93722f24..00000000 --- a/pkg/parser/document_processing_filter_blocks.go +++ /dev/null @@ -1,109 +0,0 @@ -package parser - -import ( - "github.com/bytesparadise/libasciidoc/pkg/types" - log "github.com/sirupsen/logrus" -) - -// Filter removes all blocks that should not appear in the final document: -// - blank lines (except in delimited blocks) -// - all document attribute declaration/substitution/reset -// - empty preambles -// - single line comments and comment blocks -// - standalone attributes -func filter(elements []interface{}, matchers ...filterMatcher) []interface{} { - log.Debug("filtering elements out") - result := make([]interface{}, 0, len(elements)) -elements: - for _, element := range elements { - // check if filter option applies to the element - for _, match := range matchers { - if match(element) { - // log.Debugf("discarding element of type '%T'", element) - continue elements - } - } - // log.Debugf("keeping element of type '%T'", element) - - // also, process the content if the element to retain - switch e := element.(type) { - case types.Paragraph: - log.Debug("filtering on paragraph") - lines := make([][]interface{}, 0, len(e.Lines)) - for _, l := range e.Lines { - // log.Debugf("filtering on paragraph line of type '%T'", l) - l = filter(l, matchers...) - if len(l) > 0 { - lines = append(lines, l) - } - } - e.Lines = lines - result = append(result, e) - case types.ExampleBlock: - e.Elements = filter(e.Elements, matchers...) - result = append(result, e) - case types.QuoteBlock: - e.Elements = filter(e.Elements, matchers...) - result = append(result, e) - case types.SidebarBlock: - e.Elements = filter(e.Elements, matchers...) - result = append(result, e) - case types.OrderedList: - items := make([]types.OrderedListItem, len(e.Items)) - for i, item := range e.Items { - item.Elements = filter(item.Elements, matchers...) - items[i] = item - } - e.Items = items - result = append(result, e) - case types.UnorderedList: - items := make([]types.UnorderedListItem, len(e.Items)) - for i, item := range e.Items { - item.Elements = filter(item.Elements, matchers...) - items[i] = item - } - e.Items = items - result = append(result, e) - case types.LabeledList: - items := make([]types.LabeledListItem, len(e.Items)) - for i, item := range e.Items { - item.Elements = filter(item.Elements, matchers...) - items[i] = item - } - e.Items = items - result = append(result, e) - default: - result = append(result, e) - } - } - return result -} - -// AllMatchers all the matchers needed to remove the unneeded blocks/elements from the final document -var allMatchers = []filterMatcher{attributeMatcher, singleLineCommentMatcher, commentBlockMatcher} - -// filterMatcher returns true if the given element is to be filtered out -type filterMatcher func(element interface{}) bool - -// attributeMatcher filters the element if it is a AttributeDeclaration, -// a AttributeSubstitution, a AttributeReset or a standalone Attribute -var attributeMatcher filterMatcher = func(element interface{}) bool { - switch element.(type) { - case types.AttributeDeclaration, types.AttributeSubstitution, types.AttributeReset, types.Attributes, types.CounterSubstitution, types.StandaloneAttributes: - return true - default: - return false - } -} - -// singleLineCommentMatcher filters the element if it is a SingleLineComment -var singleLineCommentMatcher filterMatcher = func(element interface{}) bool { - _, ok := element.(types.SingleLineComment) - return ok -} - -// commentBlockMatcher filters the element if it is a NormalDelimitedBlock of kind 'Comment' -var commentBlockMatcher filterMatcher = func(element interface{}) bool { - _, ok := element.(types.CommentBlock) - return ok -} diff --git a/pkg/parser/document_processing_filter_blocks_test.go b/pkg/parser/document_processing_filter_blocks_test.go deleted file mode 100644 index 53943599..00000000 --- a/pkg/parser/document_processing_filter_blocks_test.go +++ /dev/null @@ -1,297 +0,0 @@ -package parser - -import ( - "github.com/bytesparadise/libasciidoc/pkg/types" - - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint -) - -var _ = Describe("block filters", func() { - - It("should retain blank line in a delimited block", func() { - actual := []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - {}, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - }, - }, - }, - } - expected := []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - {}, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - }, - }, - }, - } - Expect(filter(actual, allMatchers...)).To(Equal(expected)) - }) - - It("should remove document attribute declaration", func() { - actual := []interface{}{ - types.AttributeDeclaration{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - }, - }, - }, - } - expected := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - }, - }, - }, - } - Expect(filter(actual, allMatchers...)).To(Equal(expected)) - }) - - It("should remove document attribute substitution", func() { - actual := []interface{}{ - types.AttributeSubstitution{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - }, - }, - }, - } - expected := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - }, - }, - }, - } - Expect(filter(actual, allMatchers...)).To(Equal(expected)) - }) - - It("should remove document attribute reset", func() { - actual := []interface{}{ - types.AttributeReset{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - }, - }, - }, - } - expected := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - }, - }, - }, - } - Expect(filter(actual, allMatchers...)).To(Equal(expected)) - }) - - It("should remove comment block", func() { - actual := []interface{}{ - types.CommentBlock{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - }, - }, - }, - } - expected := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - }, - }, - }, - } - Expect(filter(actual, allMatchers...)).To(Equal(expected)) - }) - - It("should remove single line comment as a block", func() { - actual := []interface{}{ - types.SingleLineComment{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - }, - }, - }, - } - expected := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - }, - }, - }, - } - Expect(filter(actual, allMatchers...)).To(Equal(expected)) - }) - - It("should remove single line comment in a paragraph", func() { - actual := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - types.SingleLineComment{}, - }, - }, - }, - } - expected := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{}, - }, - }, - }, - } - Expect(filter(actual, allMatchers...)).To(Equal(expected)) - }) - - It("should retain paragraph with single line comment only", func() { - actual := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.SingleLineComment{}, - }, - }, - }, - } - expected := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{}, - }, - } - Expect(filter(actual, allMatchers...)).To(Equal(expected)) - }) - - It("should retain paragraph with empty content", func() { - actual := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {}, - }, - }, - } - expected := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{}, - }, - } - Expect(filter(actual, allMatchers...)).To(Equal(expected)) - }) - - It("should remove single line comment in an ordered list item", func() { - actual := []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Elements: []interface{}{ - types.StringElement{}, - types.SingleLineComment{}, - }, - }, - }, - }, - } - expected := []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Elements: []interface{}{ - types.StringElement{}, - }, - }, - }, - }, - } - Expect(filter(actual, allMatchers...)).To(Equal(expected)) - }) - - It("should remove single line comment in an ordered list item", func() { - actual := []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Elements: []interface{}{ - types.StringElement{}, - types.SingleLineComment{}, - }, - }, - }, - }, - } - expected := []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Elements: []interface{}{ - types.StringElement{}, - }, - }, - }, - }, - } - Expect(filter(actual, allMatchers...)).To(Equal(expected)) - }) - - It("should remove single line comment in an labeled list item", func() { - actual := []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Elements: []interface{}{ - types.StringElement{}, - types.SingleLineComment{}, - }, - }, - }, - }, - } - expected := []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Elements: []interface{}{ - types.StringElement{}, - }, - }, - }, - }, - } - Expect(filter(actual, allMatchers...)).To(Equal(expected)) - }) - -}) diff --git a/pkg/parser/document_processing_filter_elements.go b/pkg/parser/document_processing_filter_elements.go new file mode 100644 index 00000000..fefb3481 --- /dev/null +++ b/pkg/parser/document_processing_filter_elements.go @@ -0,0 +1,116 @@ +package parser + +import ( + "github.com/bytesparadise/libasciidoc/pkg/types" + log "github.com/sirupsen/logrus" +) + +// Filter removes all blocks that should not appear in the final document: +// - blank lines (except in delimited blocks) +// - empty preambles +// - single line comments and comment blocks +func FilterOut(done <-chan interface{}, fragmentStream <-chan types.DocumentFragment) <-chan types.DocumentFragment { + resultStream := make(chan types.DocumentFragment, bufferSize) + go func() { + defer close(resultStream) + for fragment := range fragmentStream { + select { + case resultStream <- filterOut(fragment, allMatchers...): + case <-done: + log.WithField("pipeline_task", "filter_out").Debug("received 'done' signal") + return + } + } + log.WithField("pipeline_task", "filter_out").Debug("done") + }() + return resultStream +} + +func filterOut(f types.DocumentFragment, matchers ...filterMatcher) types.DocumentFragment { + if err := f.Error; err != nil { + log.Debugf("skipping filter because of fragment with error: %v", f.Error) + return f + } + elements, err := doFilterOut(f.Elements, matchers...) + if err != nil { + return types.NewErrorFragment(err) + } + return types.NewDocumentFragment(elements...) +} + +func doFilterOut(elements []interface{}, matchers ...filterMatcher) ([]interface{}, error) { + result := make([]interface{}, 0, len(elements)) + // log.Debug("filtering elements out") +elements: + for _, element := range elements { + // check if filter option applies to the element + for _, match := range matchers { + if match(element) { + // log.Debugf("discarding element of type '%T'", element) + continue elements + } + } + // also, process the content of the element to retain + switch element := element.(type) { + case *types.Paragraph: + elmts, err := doFilterOut(element.Elements, matchers...) + if err != nil { + return nil, err + } + element.Elements = elmts + case *types.DelimitedBlock: + elmts, err := doFilterOut(element.Elements, singleLineCommentMatcher, commentBlockMatcher, blanklineMatcher) // keep blanklines are not retained in delimited blocks + if err != nil { + return nil, err + } + element.Elements = elmts + case *types.List: + for _, elmt := range element.Elements { + elmts, err := doFilterOut(elmt.GetElements(), matchers...) + if err != nil { + return nil, err + } + if err := elmt.SetElements(elmts); err != nil { + return nil, err + } + } + case types.ListElement: + elmts, err := doFilterOut(element.GetElements(), matchers...) + if err != nil { + return nil, err + } + if err := element.SetElements(elmts); err != nil { + return nil, err + } + } + result = append(result, element) + } + if len(result) == 0 { + return nil, nil + } + return result, nil +} + +// AllMatchers all the matchers needed to remove the unneeded blocks/elements from the final document +var allMatchers = []filterMatcher{blanklineMatcher, singleLineCommentMatcher, commentBlockMatcher} + +// filterMatcher returns true if the given element is to be filtered out +type filterMatcher func(element interface{}) bool + +// singleLineCommentMatcher filters the element if it is a SingleLineComment +var singleLineCommentMatcher filterMatcher = func(element interface{}) bool { + _, ok := element.(*types.SingleLineComment) + return ok +} + +// commentBlockMatcher filters the element if it is a NormalDelimitedBlock of kind 'Comment' +var commentBlockMatcher filterMatcher = func(element interface{}) bool { + e, ok := element.(*types.DelimitedBlock) + return ok && e.Kind == types.Comment +} + +// blanklineMatcher filters the element if it is a NormalDelimitedBlock of kind 'Comment' +var blanklineMatcher filterMatcher = func(element interface{}) bool { + _, ok := element.(*types.BlankLine) + return ok +} diff --git a/pkg/parser/document_processing_filter_elements_test.go b/pkg/parser/document_processing_filter_elements_test.go new file mode 100644 index 00000000..607dbbbd --- /dev/null +++ b/pkg/parser/document_processing_filter_elements_test.go @@ -0,0 +1,235 @@ +package parser + +import ( + "github.com/bytesparadise/libasciidoc/pkg/types" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("element filters", func() { + + It("should retain content in a delimited block and paragraph", func() { + actual := []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{}, + }, + }, + &types.BlankLine{}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{}, + }, + }, + } + expected := []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{}, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{}, + }, + }, + } + Expect(doFilterOut(actual, allMatchers...)).To(Equal(expected)) + }) + + It("should not retain blanklines in a delimited blocks", func() { + actual := []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{}, + &types.BlankLine{}, + &types.StringElement{}, + }, + }, + } + expected := []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{}, + // &types.BlankLine{}, + &types.StringElement{}, + }, + }, + } + Expect(doFilterOut(actual, allMatchers...)).To(Equal(expected)) + }) + + // It("should remove document attribute declaration", func() { + // actual := []interface{}{ + // &types.AttributeDeclaration{}, + // &types.Paragraph{ + // Elements: []interface{}{ + // &types.StringElement{}, + // }, + // }, + // } + // expected := []interface{}{ + // &types.Paragraph{ + // Elements: []interface{}{ + // &types.StringElement{}, + // }, + // }, + // } + // Expect(filterComments(actual, allMatchers...)).To(Equal(expected)) + // }) + + // It("should remove document attribute substitution", func() { + // actual := []interface{}{ + // &types.AttributeSubstitution{}, + // &types.Paragraph{ + // Elements: []interface{}{ + // &types.StringElement{}, + // }, + // }, + // } + // expected := []interface{}{ + // &types.Paragraph{ + // Elements: []interface{}{ + // &types.StringElement{}, + // }, + // }, + // } + // Expect(filterComments(actual, allMatchers...)).To(Equal(expected)) + // }) + + // It("should remove document attribute reset", func() { + // actual := []interface{}{ + // &types.AttributeReset{}, + // &types.Paragraph{ + // Elements: []interface{}{ + // &types.StringElement{}, + // }, + // }, + // } + // expected := []interface{}{ + // &types.Paragraph{ + // Elements: []interface{}{ + // &types.StringElement{}, + // }, + // }, + // } + // Expect(filterComments(actual, allMatchers...)).To(Equal(expected)) + // }) + + It("should remove comment block", func() { + actual := []interface{}{ + &types.DelimitedBlock{ + Kind: types.Comment, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{}, + }, + }, + } + expected := []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{}, + }, + }, + } + Expect(doFilterOut(actual, allMatchers...)).To(Equal(expected)) + }) + + It("should remove single line comment as a block", func() { + actual := []interface{}{ + &types.SingleLineComment{}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{}, + }, + }, + } + expected := []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{}, + }, + }, + } + Expect(doFilterOut(actual, allMatchers...)).To(Equal(expected)) + }) + + It("should remove single line comment in a paragraph", func() { + actual := []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{}, + &types.SingleLineComment{}, + }, + }, + } + expected := []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{}, + }, + }, + } + Expect(doFilterOut(actual, allMatchers...)).To(Equal(expected)) + }) + + It("should retain paragraph with single line comment only", func() { + actual := []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.SingleLineComment{}, + }, + }, + } + expected := []interface{}{ + &types.Paragraph{}, + } + Expect(doFilterOut(actual, allMatchers...)).To(Equal(expected)) + }) + + It("should retain paragraph with empty content", func() { + actual := []interface{}{ + &types.Paragraph{}, + } + expected := []interface{}{ + &types.Paragraph{}, + } + Expect(doFilterOut(actual, allMatchers...)).To(Equal(expected)) + }) + + It("should remove single line comment in an ordered list item", func() { + actual := []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Elements: []interface{}{ + &types.StringElement{}, + &types.SingleLineComment{}, + }, + }, + }, + }, + } + expected := []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Elements: []interface{}{ + &types.StringElement{}, + }, + }, + }, + }, + } + Expect(doFilterOut(actual, allMatchers...)).To(Equal(expected)) + }) +}) diff --git a/pkg/parser/document_processing_footnotes.go b/pkg/parser/document_processing_footnotes.go deleted file mode 100644 index e3a89ae6..00000000 --- a/pkg/parser/document_processing_footnotes.go +++ /dev/null @@ -1,19 +0,0 @@ -package parser - -import ( - "github.com/bytesparadise/libasciidoc/pkg/types" - "github.com/sirupsen/logrus" -) - -// processes the footnotes in the blocks, replaces them with `FootnoteReference` -// and keep them in a separate `Footnotes` -func processFootnotes(blocks []interface{}) ([]interface{}, []types.Footnote) { - logrus.Debug("processing footnotes...") - footnotes := types.NewFootnotes() - for i, block := range blocks { - if c, ok := block.(types.FootnotesContainer); ok { - blocks[i] = c.SubstituteFootnotes(footnotes) - } - } - return blocks, footnotes.Notes() -} diff --git a/pkg/parser/document_processing_footnotes_test.go b/pkg/parser/document_processing_footnotes_test.go deleted file mode 100644 index a36f2364..00000000 --- a/pkg/parser/document_processing_footnotes_test.go +++ /dev/null @@ -1,121 +0,0 @@ -package parser - -import ( - "github.com/bytesparadise/libasciidoc/pkg/types" - - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint -) - -var _ = Describe("footnotes", func() { - - It("should replace footnotes with footnote references", func() { - - source := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "A statement.", - }, - types.Footnote{ - Elements: []interface{}{ - types.StringElement{ - Content: "a regular footnote.", - }, - }, - }, - }, - { - types.StringElement{ - Content: "A bold statement!", - }, - types.Footnote{ - Ref: "disclaimer", - Elements: []interface{}{ - types.StringElement{ - Content: "Opinions are my own.", - }, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "Another outrageous statement.", - }, - types.Footnote{ - Ref: "disclaimer", - Elements: []interface{}{}, - }, - }, - }, - }, - } - expectedDraftDoc := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "A statement.", - }, - types.FootnoteReference{ - ID: 1, - }, - }, - { - types.StringElement{ - Content: "A bold statement!", - }, - types.FootnoteReference{ - ID: 2, - Ref: "disclaimer", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "Another outrageous statement.", - }, - types.FootnoteReference{ - ID: 2, - Ref: "disclaimer", - Duplicate: true, // this FootnoteReference targets an already-existing footnote - }, - }, - }, - }, - } - expectedFootnotes := []types.Footnote{ - { - ID: 1, - Elements: []interface{}{ - types.StringElement{ - Content: "a regular footnote.", - }, - }, - }, - { - ID: 2, - Ref: "disclaimer", - Elements: []interface{}{ - types.StringElement{ - Content: "Opinions are my own.", - }, - }, - }, - } - actualDraftDoc, actualFootnotes := processFootnotes(source) - Expect(actualDraftDoc).To(Equal(expectedDraftDoc)) - Expect(actualFootnotes).To(Equal(expectedFootnotes)) - }) - -}) diff --git a/pkg/parser/document_processing_include_files.go b/pkg/parser/document_processing_include_files.go index 6f5abe4c..63fc0573 100644 --- a/pkg/parser/document_processing_include_files.go +++ b/pkg/parser/document_processing_include_files.go @@ -10,232 +10,283 @@ import ( "strconv" "strings" - "github.com/bytesparadise/libasciidoc/pkg/configuration" "github.com/bytesparadise/libasciidoc/pkg/types" + "github.com/davecgh/go-spew/spew" "github.com/pkg/errors" - log "github.com/sirupsen/logrus" ) -// ParseRawSource parses a document's content and applies the preprocessing directives (file inclusions) -func ParseRawSource(r io.Reader, config configuration.Configuration, options ...Option) ([]byte, error) { - ctx := substitutionContext{ - attributes: types.AttributesWithOverrides{ - Content: map[string]interface{}{}, - Overrides: map[string]string{}, - Counters: map[string]interface{}{}, - }, - config: config, - } - return parseRawSource(ctx, r, []levelOffset{}, append(options, Entrypoint("RawSource"))...) -} - -func parseRawSource(ctx substitutionContext, r io.Reader, levelOffsets []levelOffset, options ...Option) ([]byte, error) { - lines, err := ParseReader(ctx.config.Filename, r, options...) - if err != nil { - log.Errorf("failed to parse raw document: %s", err) - return nil, err - } - l, ok := lines.([]interface{}) - if !ok { - return nil, fmt.Errorf("unexpected type of raw lines: '%T'", lines) - } - return processFileInclusions(ctx, l, levelOffsets, options...) +func IncludeFiles(ctx *ParseContext, done <-chan interface{}, fragmentStream <-chan types.DocumentFragment) <-chan types.DocumentFragment { + resultStream := make(chan types.DocumentFragment, bufferSize) + go func() { + defer close(resultStream) + for fragment := range fragmentStream { + select { + case resultStream <- includeFiles(ctx, fragment.Elements, done): + case <-done: + log.WithField("pipeline_task", "include_files").Debug("received 'done' signal") + return + } + } + log.WithField("pipeline_task", "include_files").Debug("done") + }() + return resultStream } -// processFileInclusions processes the file inclusions in the given lines and returns a serialized content which can be parsed again -func processFileInclusions(ctx substitutionContext, lines []interface{}, levelOffsets []levelOffset, options ...Option) ([]byte, error) { - result := bytes.NewBuffer(nil) - for _, line := range lines { - switch l := line.(type) { - case []interface{}: - for _, e := range l { - if s, ok := e.(types.StringElement); ok { - result.WriteString(s.Content) - continue - } - return nil, fmt.Errorf("unexpected type of element in raw line: '%T'", e) +func includeFiles(ctx *ParseContext, elements []interface{}, done <-chan interface{}) types.DocumentFragment { + result := make([]interface{}, 0, len(elements)) + for _, element := range elements { + switch e := element.(type) { + case *types.AttributeDeclaration: + ctx.attributes.set(e.Name, e.Value) + result = append(result, element) + case *types.AttributeReset: + ctx.attributes.unset(e.Name) + result = append(result, element) + case *types.FileInclusion: + // use an Entrypoint based on the Delimited block kind + f := doIncludeFile(ctx.Clone(), e, done) + if f.Error != nil { + return f } - // append linefeed - result.WriteString("\n") - case types.RawSection: - for _, offset := range levelOffsets { - oldLevel := l.Level - offset.apply(&l) - // replace the absolute when the first section is processed with a relative offset - // which is based on the actual level offset that resulted in the application of the absolute offset - if offset.absolute { - levelOffsets = []levelOffset{ - relativeOffset(l.Level - oldLevel), - } - } - } - result.WriteString(l.Stringify()) - // append linefeed - result.WriteString("\n") - case types.AttributeDeclaration: - ctx.attributes.Set(l.Name, l.Value) - result.WriteString(l.Stringify()) - // append linefeed - result.WriteString("\n") - case types.FileInclusion: - includedLines, err := parseFileToInclude(ctx, l, levelOffsets, options...) - if err != nil { - return nil, err + result = append(result, f.Elements...) + case *types.DelimitedBlock: + f := includeFiles(ctx.WithinDelimitedBlock(e), e.Elements, done) + if f.Error != nil { + return f } - result.Write(includedLines) + e.Elements = f.Elements + result = append(result, e) default: - return nil, fmt.Errorf("unexpected type of line: '%T'", line) + result = append(result, element) } } - return result.Bytes(), nil - -} - -// levelOffset a func that applies a given offset to the sections of a child document to include in a parent doc (the caller) -type levelOffset struct { - absolute bool - value int - apply func(*types.RawSection) + return types.NewDocumentFragment(result...) } -func relativeOffset(offset int) levelOffset { - return levelOffset{ - absolute: false, - value: offset, - apply: func(s *types.RawSection) { - s.Level += offset - }, +// replace the content of this FileInclusion element the content of the target file +// note: there is a trade-off here: we include the whole content of the file in the current +// fragment, making it potentially big, but at the same time we ensure that the context +// of the inclusion (for example, within a delimited block) is not lost. +func doIncludeFile(ctx *ParseContext, e *types.FileInclusion, done <-chan interface{}) types.DocumentFragment { + // ctx.Opts = append(ctx.Opts, GlobalStore(documentHeaderKey, true)) + fileContent, err := contentOf(ctx, e) + if err != nil { + return types.NewErrorFragment(err) } -} - -func absoluteOffset(offset int) levelOffset { - return levelOffset{ - absolute: true, - value: offset, - apply: func(s *types.RawSection) { - s.Level = offset - }, + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("including content of '%s' with offsets %v", e.Location.Stringify(), ctx.levelOffsets) } -} - -// applies the elements and attributes substitutions on the given image block. -func applySubstitutionsOnFileInclusion(ctx substitutionContext, f types.FileInclusion) (types.FileInclusion, error) { - elements := [][]interface{}{f.Location.Path} // wrap to - elements, err := substituteAttributes(ctx, elements) - if err != nil { - return types.FileInclusion{}, err + elements := []interface{}{} + for f := range ParseFragments(ctx, fileContent, done) { + if f.Error != nil { + return f + } + // apply level offset on sections + for i, e := range f.Elements { + switch e := e.(type) { + case *types.DocumentHeader: + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("applying offsets to header section: %v", ctx.levelOffsets) + } + // header becomes a "regular" section + s := &types.Section{ + Title: e.Title, + Elements: e.Elements, + } + ctx.levelOffsets.apply(s) + if s.Level == 0 { // no level change: keep as the header + f.Elements[i] = e + } else { // level changed: becomes a section with some elements + f.Elements[i] = s + } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("applied offsets to header/section: level is now %d", s.Level) + } + case *types.Section: + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("applying offsets to section of level %d: %v", e.Level, ctx.levelOffsets) + } + ctx.levelOffsets.apply(e) + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("applied offsets to section: level is now %d", e.Level) + } + } + } + elements = append(elements, f.Elements...) } - f.Location.Path = elements[0] - return f, nil + // and recursively... + return includeFiles(ctx, elements, done) } -func parseFileToInclude(ctx substitutionContext, incl types.FileInclusion, levelOffsets []levelOffset, options ...Option) ([]byte, error) { - incl, err := applySubstitutionsOnFileInclusion(ctx, incl) - if err != nil { - return nil, err +func contentOf(ctx *ParseContext, incl *types.FileInclusion) (io.Reader, error) { + if err := applySubstitutionsOnBlockWithLocation(ctx, incl); err != nil { + log.Error(err) + return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) } path := incl.Location.Stringify() - currentDir := filepath.Dir(ctx.config.Filename) - f, absPath, done, err := open(filepath.Join(currentDir, path)) - defer done() + currentDir := filepath.Dir(ctx.filename) + f, absPath, closeFile, err := open(filepath.Join(currentDir, path)) if err != nil { - return nil, fmt.Errorf("Unresolved directive in %s - %s", ctx.config.Filename, incl.RawText) + return nil, errors.Wrapf(err, "Unresolved directive in %s - %s", ctx.filename, incl.RawText) } + defer closeFile() content := bytes.NewBuffer(nil) scanner := bufio.NewScanner(bufio.NewReader(f)) if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("parsing file to include") - spew.Fdump(log.StandardLogger().Out, incl) + log.Debugf("parsing file to %s", incl.RawText) } - if lr, ok := lineRanges(incl, ctx.config); ok { + if lr, ok, err := lineRanges(incl); err != nil { + log.Error(err) + return nil, errors.Wrapf(err, "Unresolved directive in %s - %s", ctx.filename, incl.RawText) + } else if ok { if err := readWithinLines(scanner, content, lr); err != nil { - return nil, fmt.Errorf("Unresolved directive in %s - %s", ctx.config.Filename, incl.RawText) + log.Error(err) + return nil, errors.Wrapf(err, "Unresolved directive in %s - %s", ctx.filename, incl.RawText) } - } else if tr, ok := tagRanges(incl, ctx.config); ok { + } else if tr, ok, err := tagRanges(incl); err != nil { + log.Error(err) + return nil, errors.Wrapf(err, "Unresolved directive in %s - %s", ctx.filename, incl.RawText) + } else if ok { if err := readWithinTags(path, scanner, content, tr); err != nil { - return nil, err // keep the underlying error here + log.Error(err) + return nil, errors.Wrapf(err, "Unresolved directive in %s - %s", ctx.filename, incl.RawText) } } else { if err := readAll(scanner, content); err != nil { - return nil, fmt.Errorf("Unresolved directive in %s - %s", ctx.config.Filename, incl.RawText) + log.Error(err) + return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) } } if err := scanner.Err(); err != nil { - return nil, fmt.Errorf("Unresolved directive in %s - %s", ctx.config.Filename, incl.RawText) + log.Error(err) + return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) } - // just include the file content if the file to include is not an Asciidoc document. + // cloning the context to avoid altering the original as we process recursively embedded file inclusions + ctx.filename = absPath + // if the file to include is not an Asciidoc document, just return the content as "raw lines" if !IsAsciidoc(absPath) { - return content.Bytes(), nil + log.Debugf("file '%s' is not an Asciidoc file. Scanning content without looking for nested file inclusions", absPath) + // send(types.NewDocumentFragment(lineOffset, []interface{}{types.RawLine(content.String())}), done, resultStream) + // return + ctx.Opts = append(ctx.Opts, DisableRule(FileInclusion)) } + + // level offset // parse the content, and returns the corresponding elements - l, found, err := incl.Attributes.GetAsString(types.AttrLevelOffset) - if err != nil { - return nil, err - } - if found { - offset, err := strconv.Atoi(l) + if lvl, found, err := incl.Attributes.GetAsString(types.AttrLevelOffset); err != nil { + log.Error(err) + return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) + } else if found { + offset, err := strconv.Atoi(lvl) if err != nil { - return nil, errors.Wrap(err, "unable to read file to include") + log.Error(err) + return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) } - if strings.HasPrefix(l, "+") || strings.HasPrefix(l, "-") { - levelOffsets = append(levelOffsets, relativeOffset(offset)) + if strings.HasPrefix(lvl, "+") || strings.HasPrefix(lvl, "-") { + ctx.levelOffsets = append(ctx.levelOffsets, relativeOffset(offset)) } else { - levelOffsets = []levelOffset{absoluteOffset(offset)} - + ctx.levelOffsets = []*levelOffset{absoluteOffset(offset)} } } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("content of '%s':\n%s", absPath, content.String()) + } + return content, nil +} + +type levelOffsets []*levelOffset + +func (l levelOffsets) apply(s *types.Section) { + for _, offset := range l { + offset.apply(s) + } +} - actualFilename := ctx.config.Filename - defer func() { - // restore actual filename after exiting - ctx.config.Filename = actualFilename - }() - ctx.config.Filename = absPath - // now, let's parse this content and process nested file inclusions - return parseRawSource(ctx, content, levelOffsets, options...) +func (l levelOffsets) clone() levelOffsets { + result := make([]*levelOffset, len(l)) + copy(result, l) + return result +} + +// levelOffset a func that applies a given offset to the sections of a child document to include in a parent doc (the caller) +type levelOffset struct { + absolute bool + value int +} + +func (l *levelOffset) apply(s *types.Section) { + // also, absolute offset becomes relative offset after processing the first section, + // so that the hierarchy of subsequent sections of the doc to include is preserved + if l.absolute { + l.absolute = false + l.value = l.value - s.Level + } + s.Level += l.value +} + +func relativeOffset(offset int) *levelOffset { + return &levelOffset{ + absolute: false, + value: offset, + } +} + +func absoluteOffset(offset int) *levelOffset { + return &levelOffset{ + absolute: true, + value: offset, + } +} + +func (l levelOffset) String() string { + if l.absolute { + return strconv.Itoa(l.value) + } + return fmt.Sprintf("+%d", l.value) } // lineRanges parses the `lines` attribute if it exists in the given FileInclusion, and returns // a corresponding `LineRanges` (or `false` if parsing failed to invalid input) -func lineRanges(incl types.FileInclusion, config configuration.Configuration) (types.LineRanges, bool) { +func lineRanges(incl *types.FileInclusion) (types.LineRanges, bool, error) { lineRanges, exists, err := incl.Attributes.GetAsString(types.AttrLineRanges) if err != nil { - log.Errorf("Unresolved directive in %s - %s", config.Filename, incl.RawText) - return types.LineRanges{}, false + return types.LineRanges{}, false, err } if exists { lr, err := Parse("", []byte(lineRanges), Entrypoint("LineRanges")) if err != nil { - log.Errorf("Unresolved directive in %s - %s", config.Filename, incl.RawText) - return types.LineRanges{}, false + return types.LineRanges{}, false, err } - return types.NewLineRanges(lr), true + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("line ranges to include: %s", spew.Sdump(lr)) + } + return types.NewLineRanges(lr), true, nil } - return types.LineRanges{}, false + return types.LineRanges{}, false, nil } // tagRanges parses the `tags` attribute if it exists in the given FileInclusion, and returns // a corresponding `TagRanges` (or `false` if parsing failed to invalid input) -func tagRanges(incl types.FileInclusion, config configuration.Configuration) (types.TagRanges, bool) { +func tagRanges(incl *types.FileInclusion) (types.TagRanges, bool, error) { tagRanges, exists, err := incl.Attributes.GetAsString(types.AttrTagRanges) if err != nil { - log.Errorf("Unresolved directive in %s - %s", config.Filename, incl.RawText) - return types.TagRanges{}, false + return types.TagRanges{}, false, err } - log.Debugf("tag ranges to include: %v", spew.Sdump(tagRanges)) if exists { + log.Debugf("tag ranges to include: %v", spew.Sdump(tagRanges)) tr, err := Parse("", []byte(tagRanges), Entrypoint("TagRanges")) if err != nil { - log.Errorf("Unresolved directive in %s - %s", config.Filename, incl.RawText) - return types.TagRanges{}, false + return types.TagRanges{}, false, err } - return types.NewTagRanges(tr), true + return types.NewTagRanges(tr), true, nil } - return types.TagRanges{}, false + return types.TagRanges{}, false, nil } +// TODO: instead of reading and parsing afterwards, simply parse the lines immediately? ie: `readWithinLines` -> `parseWithinLines` +// (also, use a specific entrypoint if the doc is not a .adoc) func readWithinLines(scanner *bufio.Scanner, content *bytes.Buffer, lineRanges types.LineRanges) error { line := 0 for scanner.Scan() { @@ -313,7 +364,7 @@ func readWithinTags(path string, scanner *bufio.Scanner, content *bytes.Buffer, continue default: if tr, found := currentRanges[tag.Name]; !found { - return fmt.Errorf("tag '%s' not found in include file: %s", tag.Name, path) + return fmt.Errorf("tag '%s' not found in file to include", tag.Name) } else if tr.EndLine == -1 { log.Warnf("detected unclosed tag '%s' starting at line %d of include file: %s", tag.Name, tr.StartLine, path) } @@ -364,8 +415,7 @@ func open(path string) (*os.File, string, func(), error) { }, err } dir := filepath.Dir(absPath) - err = os.Chdir(dir) - if err != nil { + if err = os.Chdir(dir); err != nil { return nil, "", func() { // log.Debugf("restoring current working dir to: %s", wd) if err := os.Chdir(wd); err != nil { // restore the previous working directory diff --git a/pkg/parser/document_processing_include_files_test.go b/pkg/parser/document_processing_include_files_test.go index 0279920b..e8fc6161 100644 --- a/pkg/parser/document_processing_include_files_test.go +++ b/pkg/parser/document_processing_include_files_test.go @@ -1,1987 +1,1488 @@ package parser_test import ( - "strings" - - "github.com/bytesparadise/libasciidoc/pkg/parser" + "github.com/bytesparadise/libasciidoc/pkg/configuration" "github.com/bytesparadise/libasciidoc/pkg/types" . "github.com/bytesparadise/libasciidoc/testsupport" - "github.com/davecgh/go-spew/spew" . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/ginkgo/extensions/table" . "github.com/onsi/gomega" //nolint golint log "github.com/sirupsen/logrus" ) -var _ = DescribeTable("'FileLocation' pattern", - func(filename string, expected interface{}) { - reader := strings.NewReader(filename) - actual, err := parser.ParseReader(filename, reader, parser.Entrypoint("FileLocation")) - Expect(err).ToNot(HaveOccurred()) - GinkgoT().Log("actual result: %s", spew.Sdump(actual)) - GinkgoT().Log("expected result: %s", spew.Sdump(expected)) - Expect(actual).To(Equal(expected)) - }, - Entry("'chapter-a.adoc'", "chapter-a.adoc", types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "chapter-a.adoc", - }, - }, - }), - Entry("'chapter_a.adoc'", "chapter_a.adoc", types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "chapter_a.adoc", - }, - }, - }), - Entry("'../../test/includes/chapter_a.adoc'", "../../test/includes/chapter_a.adoc", types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "../../test/includes/chapter_a.adoc", - }, - }, - }), - Entry("'{includedir}/chapter-{foo}.adoc'", "{includedir}/chapter-{foo}.adoc", types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "{includedir}/chapter-{foo}.adoc", // attribute substitutions are treared as part of the string element - }, - }, - }), - Entry("'{scheme}://{path}'", "{scheme}://{path}", types.Location{ - Path: []interface{}{ - types.StringElement{ // attribute substitutions are treared as part of the string element - Content: "{scheme}://{path}", - }, - }, - }), -) - -var _ = DescribeTable("check asciidoc file", - func(path string, expectation bool) { - Expect(parser.IsAsciidoc(path)).To(Equal(expectation)) - }, - Entry("foo.adoc", "foo.adoc", true), - Entry("foo.asc", "foo.asc", true), - Entry("foo.ad", "foo.ad", true), - Entry("foo.asciidoc", "foo.asciidoc", true), - Entry("foo.txt", "foo.txt", true), - Entry("foo.csv", "foo.csv", false), - Entry("foo.go", "foo.go", false), -) - var _ = Describe("file inclusions", func() { - Context("in raw documents", func() { - - Context("with file inclusions", func() { - - It("should include adoc file without leveloffset from local file", func() { - logs, reset := ConfigureLogger(log.WarnLevel) - defer reset() - source := "include::../../test/includes/chapter-a.adoc[]" - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, - }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, - }, - }, - }, - }, - } - result, err := ParseRawDocument(source, WithFilename("foo.adoc")) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchRawDocument(expected)) - // verify no error/warning in logs - Expect(logs).ToNot(ContainAnyMessageWithLevels(log.ErrorLevel, log.WarnLevel)) - }) + Context("in final documents", func() { - It("should include adoc file without leveloffset from relative file", func() { - logs, reset := ConfigureLogger(log.WarnLevel) - defer reset() - source := "include::../../../test/includes/chapter-a.adoc[]" - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, - }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, - }, + It("should include adoc file without leveloffset from local file", func() { + logs, reset := ConfigureLogger(log.WarnLevel) + defer reset() + source := "include::../../test/includes/chapter-a.adoc[]" + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "Chapter A", }, }, }, - } - Expect(ParseRawDocument(source, WithFilename("tmp/foo.adoc"))).To(MatchRawDocument(expected)) - // verify no error/warning in logs - Expect(logs).ToNot(ContainAnyMessageWithLevels(log.ErrorLevel, log.WarnLevel)) - }) - - It("should include adoc file with leveloffset", func() { - logs, reset := ConfigureLogger(log.WarnLevel) - defer reset() - source := "include::../../test/includes/chapter-a.adoc[leveloffset=+1]" - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, - }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", }, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - // verify no error/warning in logs - Expect(logs).ToNot(ContainAnyMessageWithLevels(log.ErrorLevel, log.WarnLevel)) - }) + }, + } + result, err := ParseDocument(source, configuration.WithFilename("test.adoc")) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDocument(expected)) + // verify no error/warning in logs + Expect(logs).ToNot(ContainAnyMessageWithLevels(log.ErrorLevel, log.WarnLevel)) + }) - It("should include section 0 by default", func() { - source := "include::../../test/includes/chapter-a.adoc[]" - // at this level (parsing), it is expected that the Section 0 is part of the Prefligh document - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, - }, - Elements: []interface{}{}, + It("should include adoc file with leveloffset", func() { + logs, reset := ConfigureLogger(log.WarnLevel) + defer reset() + source := "include::../../test/includes/chapter-a.adoc[leveloffset=+1]" + title := []interface{}{ + &types.StringElement{ + Content: "Chapter A", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_chapter_a", }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Level: 1, // offset by +1 + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "content", }, }, }, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_chapter_a": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + // verify no error/warning in logs + Expect(logs).ToNot(ContainAnyMessageWithLevels(log.ErrorLevel, log.WarnLevel)) + }) - It("should not include section 0 when attribute found", func() { - source := `:includedir: ../../test/includes + It("should include file with attribute in path", func() { + source := `:includedir: ../../test/includes include::{includedir}/chapter-a.adoc[]` - // at this level (parsing), it is expected that the Section 0 is part of the Prefligh document - expected := types.RawDocument{ - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "includedir", - Value: "../../test/includes", - }, - types.BlankLine{}, - types.Section{ - Level: 0, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, - }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, - }, + title := []interface{}{ + &types.StringElement{ + Content: "Chapter A", + }, + } + expected := &types.Document{ + // Attributes: types.Attributes{ + // "includedir": "../../test/includes", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "includedir", + Value: "../../test/includes", + }, + &types.DocumentHeader{ + Title: title, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", }, }, }, - } - result, err := ParseRawDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchRawDocument(expected)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("should not further process with non-asciidoc files", func() { - source := `:includedir: ../../test/includes + It("should not further process with non-asciidoc files", func() { + source := `:includedir: ../../test/includes include::{includedir}/include.foo[]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "includedir", - Value: "../../test/includes", - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "*some strong content*", + expected := &types.Document{ + // Attributes: types.Attributes{ + // "includedir": "../../test/includes", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "includedir", + Value: "../../test/includes", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "some strong content", }, }, }, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "include::hello_world.go.txt[]", - }, - }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: `include::hello_world.go.txt[]`, }, }, }, - } - Expect(ParseRawDocument(source, WithFilename("foo.bar"))).To(MatchRawDocument(expected)) // parent doc may not need to be a '.adoc' - }) + }, + } + // Expect(ParseDocument(source, WithFilename("foo.bar"))).To(MatchDocumentFragments(expected)) // parent doc may not need to be a '.adoc' + result, err := ParseDocument(source, configuration.WithFilename("test.adoc")) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDocument(expected)) // parent doc may not need to be a '.adoc' + }) - It("should include grandchild content without offset", func() { - source := `include::../../test/includes/grandchild-include.adoc[]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "grandchild title", - }, - }, - Elements: []interface{}{}, + It("should include grandchild content without offset", func() { + source := `include::../../test/includes/grandchild-include.adoc[]` + title := []interface{}{ + &types.StringElement{ + Content: "grandchild title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_grandchild_title", }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Level: 1, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "first line of grandchild", }, }, }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "last line of grandchild", }, }, }, }, }, - } - Expect(ParseRawDocument(source, WithFilename("test.adoc"))).To(MatchRawDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_grandchild_title": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("should include grandchild content with relative offset", func() { - source := `include::../../test/includes/grandchild-include.adoc[leveloffset=+1]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 2, - Title: []interface{}{ - types.StringElement{ - Content: "grandchild title", - }, - }, - Elements: []interface{}{}, + It("should include grandchild content with relative offset", func() { + source := `include::../../test/includes/grandchild-include.adoc[leveloffset=+1]` + title := []interface{}{ + &types.StringElement{ + Content: "grandchild title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_grandchild_title", }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Level: 2, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "first line of grandchild", }, }, }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "last line of grandchild", }, }, }, }, }, - } - Expect(ParseRawDocument(source, WithFilename("test.adoc"))).To(MatchRawDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_grandchild_title": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("should include grandchild content with absolute offset", func() { - source := `include::../../test/includes/grandchild-include.adoc[leveloffset=0]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: []interface{}{ - types.StringElement{ - Content: "grandchild title", - }, - }, - Elements: []interface{}{}, + It("should include grandchild content with absolute offset", func() { + source := `include::../../test/includes/grandchild-include.adoc[leveloffset=0]` + title := []interface{}{ + &types.StringElement{ + Content: "grandchild title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_grandchild_title", }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Level: 0, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "first line of grandchild", }, }, }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "last line of grandchild", }, }, }, }, }, - } - Expect(ParseRawDocument(source, WithFilename("test.adoc"))).To(MatchRawDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_grandchild_title": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("should include child and grandchild content with relative level offset", func() { - source := `include::../../test/includes/parent-include-relative-offset.adoc[leveloffset=+1]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, // here the level is changed from `0` to `1` since `root` doc has a `leveloffset=+1` during its inclusion - Title: []interface{}{ - types.StringElement{ - Content: "parent title", - }, - }, - Elements: []interface{}{}, + It("should include child and grandchild content with relative level offset", func() { + source := `include::../../test/includes/parent-include-relative-offset.adoc[leveloffset=+1]` + parentTitle := []interface{}{ + &types.StringElement{ + Content: "parent title", + }, + } + childSection1Title := []interface{}{ + &types.StringElement{ + Content: "child section 1", + }, + } + childSection2Title := []interface{}{ + &types.StringElement{ + Content: "child section 2", + }, + } + grandchildTitle := []interface{}{ + &types.StringElement{ + Content: "grandchild title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_parent_title", }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Level: 1, // here the level is changed from `0` to `1` since `root` doc has a `leveloffset=+1` during its inclusion + Title: parentTitle, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "first line of parent", }, }, }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "child preamble", }, }, }, - }, - types.BlankLine{}, - types.Section{ - Level: 3, // here the level is changed from `1` to `3` since both `root` and `parent` docs have a `leveloffset=+1` during their inclusion - Title: []interface{}{ - types.StringElement{ - Content: "child section 1", - }, - }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of child", - }, - }, - }, - }, - types.BlankLine{}, - types.Section{ - Level: 4, // here the level is changed from `1` to `4` since both `root`, `parent` and `child` docs have a `leveloffset=+1` during their inclusion - Title: []interface{}{ - types.StringElement{ - Content: "grandchild title", - }, - }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of grandchild", - }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_child_section_1", }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of grandchild", + Level: 3, // here the level is changed from `1` to `3` since both `root` and `parent` docs have a `leveloffset=+1` during their inclusion + Title: childSection1Title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "first line of child", + }, + }, }, - }, - }, - }, - types.BlankLine{}, - types.Section{ - Level: 4, // here the level is changed from `2` to `4` since both `root` and `parent` docs have a `leveloffset=+1` during their inclusion - Title: []interface{}{ - types.StringElement{ - Content: "child section 2", - }, - }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of child", + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_grandchild_title", + }, + Level: 4, // here the level is changed from `1` to `4` since both `root`, `parent` and `child` docs have a `leveloffset=+1` during their inclusion + Title: grandchildTitle, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "first line of grandchild", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of grandchild", + }, + }, + }, + }, }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of parent", + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_child_section_2", + }, + Level: 4, // here the level is changed from `2` to `4` since both `root` and `parent` docs have a `leveloffset=+1` during their inclusion + Title: childSection2Title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of child", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of parent", + }, + }, + }, + }, }, }, }, }, }, - } - Expect(ParseRawDocument(source, WithFilename("test.adoc"))).To(MatchRawDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_parent_title": parentTitle, + "_child_section_1": childSection1Title, + "_child_section_2": childSection2Title, + "_grandchild_title": grandchildTitle, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("should include child and grandchild content with relative then absolute level offset", func() { - source := `include::../../test/includes/parent-include-absolute-offset.adoc[leveloffset=+1]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, // here the level is offset by `+1` as per root doc attribute in the `include` macro - Title: []interface{}{ - types.StringElement{ - Content: "parent title", - }, - }, - Elements: []interface{}{}, + It("should include child and grandchild content with relative then absolute level offset", func() { + source := `include::../../test/includes/parent-include-absolute-offset.adoc[leveloffset=+1]` + parentTitle := []interface{}{ + &types.StringElement{ + Content: "parent title", + }, + } + childSection1Title := []interface{}{ + &types.StringElement{ + Content: "child section 1", + }, + } + childSection2Title := []interface{}{ + &types.StringElement{ + Content: "child section 2", + }, + } + grandchildTitle := []interface{}{ + &types.StringElement{ + Content: "grandchild title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_parent_title", }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Level: 1, // here the level is changed from `0` to `1` since `root` doc has a `leveloffset=+1` during its inclusion + Title: parentTitle, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "first line of parent", }, }, }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "child preamble", }, }, }, - }, - types.BlankLine{}, - types.Section{ - Level: 3, // here level is forced to "absolute 3" - Title: []interface{}{ - types.StringElement{ - Content: "child section 1", + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_child_section_1", }, - }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of child", + Level: 3, // here level is forced to "absolute 3" + Title: childSection1Title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "first line of child", + }, + }, + }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_grandchild_title", + }, + Level: 4, // here the level is set to `4` because it the first section was moved from `1` to `3` so we use the same offset here + Title: grandchildTitle, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "first line of grandchild", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of grandchild", + }, + }, + }, + }, + }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_child_section_2", + }, + Level: 4, // here the level is changed from `2` to `4` since both `root` and `parent` docs have a `leveloffset=+1` during their inclusion + Title: childSection2Title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of child", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of parent", + }, + }, + }, + }, }, }, }, }, - types.BlankLine{}, - types.Section{ - Level: 4, // here the level is set to `4` because it was its parent was offset by 3... - Title: []interface{}{ - types.StringElement{ - Content: "grandchild title", - }, + }, + }, + ElementReferences: types.ElementReferences{ + "_parent_title": parentTitle, + "_child_section_1": childSection1Title, + "_child_section_2": childSection2Title, + "_grandchild_title": grandchildTitle, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + It("should include adoc with attributes file within main content", func() { + source := `include::../../test/includes/attributes.adoc[]` + expected := &types.Document{ + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "author", + Value: "Xavier", + }, + &types.AttributeDeclaration{ + Name: "leveloffset", + Value: "+1", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "some content", }, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of grandchild", - }, - }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + It("should include adoc with attributes file within listing block", func() { + source := `---- +include::../../test/includes/attributes.adoc[] +----` + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: `:author: Xavier +:leveloffset: +1 + +some content`, }, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of grandchild", - }, - }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + It("should include adoc file within fenced block", func() { + source := "```\n" + + "include::../../test/includes/parent-include.adoc[]\n" + + "```\n" + + "<1> a callout" + // include the doc without parsing the elements (besides the file inclusions) + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Fenced, + Elements: []interface{}{ + &types.StringElement{ + Content: `:leveloffset: +1 + += parent title + +first line of parent + += child title + +first line of child + +== grandchild title + +first line of grandchild + +last line of grandchild + +last line of child + +last line of parent `, }, - }, - types.BlankLine{}, - types.Section{ - Level: 4, // here the level is set to `4` because it the first section was moved from `1` to `3` so we use the same offset here - Title: []interface{}{ - types.StringElement{ - Content: "child section 2", - }, + &types.Callout{ + Ref: 1, }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of child", - }, - }, + &types.StringElement{ + Content: "\n\n:leveloffset!:", }, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of parent", + }, + &types.List{ + Kind: types.CalloutListKind, + Elements: []types.ListElement{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a callout", + }, + }, }, }, }, }, }, - } - Expect(ParseRawDocument(source, WithFilename("test.adoc"))).To(MatchRawDocument(expected)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("should include adoc file within fenced block", func() { - source := "```\n" + - "include::../../test/includes/parent-include.adoc[]\n" + - "```" - expected := types.RawDocument{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ + It("should include adoc file within quote block", func() { + source := "____\n" + + "include::../../test/includes/parent-include.adoc[]\n" + + "____" + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Quote, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "leveloffset", + Value: string("+1"), + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "= parent title", }, }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "first line of parent", }, }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "= child title", }, }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "first line of child", }, }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "== grandchild title", }, }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "first line of grandchild", }, }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "last line of grandchild", }, }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "last line of child", }, }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ - Content: "last line of parent", - }, - }, }, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) - - It("should include adoc file within quote block", func() { - source := "____\n" + - "include::../../test/includes/parent-include.adoc[]\n" + - "____" - expected := types.RawDocument{ - Elements: []interface{}{ - types.QuoteBlock{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "= parent title", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of parent", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "= child title", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of child", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "== grandchild title", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of grandchild", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of parent ", }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of grandchild", - }, - }, + &types.SpecialCharacter{ + Name: "<", }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of child", - }, - }, + &types.StringElement{ + Content: "1", }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of parent", - }, - }, + &types.SpecialCharacter{ + Name: ">", }, }, }, + &types.AttributeReset{ + Name: "leveloffset", + }, }, }, - } - result, err := ParseRawDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchRawDocument(expected)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - Context("with line ranges", func() { + Context("with line ranges", func() { - Context("with unquoted line ranges", func() { + Context("unquoted", func() { - It("file inclusion with single unquoted line", func() { - source := `include::../../test/includes/chapter-a.adoc[lines=1]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, + It("with single unquoted line", func() { + source := `include::../../test/includes/chapter-a.adoc[lines=1]` + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "Chapter A", }, - Elements: []interface{}{}, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("file inclusion with multiple unquoted lines", func() { - source := `include::../../test/includes/chapter-a.adoc[lines=1..2]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, + It("with multiple unquoted lines", func() { + source := `include::../../test/includes/chapter-a.adoc[lines=1..3]` + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "Chapter A", }, - Elements: []interface{}{}, }, - types.BlankLine{}, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) - - It("file inclusion with multiple unquoted ranges", func() { - source := `include::../../test/includes/chapter-a.adoc[lines=1;3..4;6..-1]` // paragraph becomes the author since the in-between blank line is stripped out - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "content", - }, - }, - }, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", }, - Elements: []interface{}{}, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("file inclusion with invalid unquoted range - case 1", func() { - _, reset := ConfigureLogger(log.WarnLevel) - defer reset() - source := `include::../../test/includes/chapter-a.adoc[lines=1;3..4;6..foo]` // not a number - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, + It("with multiple unquoted ranges (becoming authors)", func() { + source := `include::../../test/includes/chapter-a.adoc[lines=1;3..4;6..-1]` // paragraph becomes the author since the in-between blank line is stripped out + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "Chapter A", }, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "content", + }, }, }, }, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("file inclusion with invalid unquoted range - case 2", func() { - source := `include::../../test/includes/chapter-a.adoc[lines=1,3..4,6..-1]` // using commas instead of semi-colons - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, + It("with invalid unquoted range - case 1", func() { + _, reset := ConfigureLogger(log.WarnLevel) + defer reset() + source := `include::../../test/includes/chapter-a.adoc[lines=1;3..4;6..foo]` // not a number + _, err := ParseDocument(source, configuration.WithFilename("test.adoc")) + Expect(err).To(HaveOccurred()) + }) + + It("with invalid unquoted range - case 2", func() { + source := `include::../../test/includes/chapter-a.adoc[lines=1,3..4,6..-1]` // using commas instead of semi-colons + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "Chapter A", }, - Elements: []interface{}{}, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) }) + }) - Context("with quoted line ranges", func() { + Context("quoted", func() { - It("file inclusion with single quoted line", func() { - logs, reset := ConfigureLogger(log.WarnLevel) - defer reset() - source := `include::../../test/includes/chapter-a.adoc[lines="1"]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, + It("with single line", func() { + logs, reset := ConfigureLogger(log.WarnLevel) + defer reset() + source := `include::../../test/includes/chapter-a.adoc[lines="1"]` + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "Chapter A", }, - Elements: []interface{}{}, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - // verify no error/warning in logs - Expect(logs).ToNot(ContainAnyMessageWithLevels(log.ErrorLevel, log.WarnLevel)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + // verify no error/warning in logs + Expect(logs).ToNot(ContainAnyMessageWithLevels(log.ErrorLevel, log.WarnLevel)) + }) - It("file inclusion with multiple quoted lines", func() { - source := `include::../../test/includes/chapter-a.adoc[lines="1..2"]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, + It("with multiple lines", func() { + source := `include::../../test/includes/chapter-a.adoc[lines="1..2"]` + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "Chapter A", }, - Elements: []interface{}{}, }, - types.BlankLine{}, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("file inclusion with multiple quoted ranges with colons", func() { - // here, the `content` paragraph gets attached to the header and becomes the author - source := `include::../../test/includes/chapter-a.adoc[lines="1,3..4,6..-1"]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "content", - }, - }, - }, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, + It("with multiple ranges with colons (becoming authors)", func() { + // here, the `content` paragraph gets attached to the header and becomes the author + source := `include::../../test/includes/chapter-a.adoc[lines="1,3..4,6..-1"]` + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "Chapter A", }, - Elements: []interface{}{}, }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) - - It("file inclusion with multiple quoted ranges with semicolons", func() { - // here, the `content` paragraph gets attached to the header and becomes the author - source := `include::../../test/includes/chapter-a.adoc[lines="1;3..4;6..-1"]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrAuthors: []types.DocumentAuthor{ + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ { - FullName: "content", + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "content", + }, }, }, }, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, - }, - Elements: []interface{}{}, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("file inclusion with invalid quoted range - case 1", func() { - _, reset := ConfigureLogger(log.WarnLevel) - defer reset() - source := `include::../../test/includes/chapter-a.adoc[lines="1,3..4,6..foo"]` // not a number - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, + It("with multiple ranges with semicolons (becoming authors)", func() { + // here, the `content` paragraph gets attached to the header and becomes the author + source := `include::../../test/includes/chapter-a.adoc[lines="1;3..4;6..-1"]` + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "Chapter A", }, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "content", + }, }, }, }, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) - - It("file inclusion with ignored tags", func() { - // include using a line range a file having tags - source := `include::../../test/includes/tag-include.adoc[lines=3]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "Section 1", - }, - }, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) }) - }) - Context("with tag ranges", func() { - - It("file inclusion with single tag", func() { - logs, reset := ConfigureLogger(log.WarnLevel) + It("with invalid range - case 1", func() { + _, reset := ConfigureLogger(log.WarnLevel) defer reset() - source := `include::../../test/includes/tag-include.adoc[tag=section]` - expected := types.RawDocument{ + source := `include::../../test/includes/chapter-a.adoc[lines="1,3..4,6..foo"]` // not a number + _, err := ParseDocument(source, configuration.WithFilename("test.adoc")) + Expect(err).To(HaveOccurred()) + }) + + It("with ignored tags", func() { + // include using a line range a file having tags + source := `include::../../test/includes/tag-include.adoc[lines=3]` + title := []interface{}{ + &types.StringElement{ + Content: "Section 1", + }, + } + expected := &types.Document{ Elements: []interface{}{ - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "Section 1", - }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_1", }, - Elements: []interface{}{}, + Level: 1, + Title: title, }, }, + ElementReferences: types.ElementReferences{ + "_section_1": title, + }, } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - // verify no error/warning in logs - Expect(logs).ToNot(ContainAnyMessageWithLevels(log.ErrorLevel, log.WarnLevel)) + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) }) + }) + }) - It("file inclusion with surrounding tag", func() { - logs, reset := ConfigureLogger(log.WarnLevel) - defer reset() - source := `include::../../test/includes/tag-include.adoc[tag=doc]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "Section 1", - }, - }, - Elements: []interface{}{}, + Context("with tag ranges", func() { + + It("with single tag", func() { + logs, reset := ConfigureLogger(log.WarnLevel) + defer reset() + source := `include::../../test/includes/tag-include.adoc[tag=section]` + title := []interface{}{ + &types.StringElement{ + Content: "Section 1", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_1", + }, + Level: 1, + Title: title, + }, + }, + ElementReferences: types.ElementReferences{ + "_section_1": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + // verify no error/warning in logs + Expect(logs).ToNot(ContainAnyMessageWithLevels(log.ErrorLevel, log.WarnLevel)) + }) + + It("with surrounding tag", func() { + logs, reset := ConfigureLogger(log.WarnLevel) + defer reset() + source := `include::../../test/includes/tag-include.adoc[tag=doc]` + title := []interface{}{ + &types.StringElement{ + Content: "Section 1", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_1", }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Level: 1, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "content", }, }, }, }, - types.BlankLine{}, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - // verify no error/warning in logs - Expect(logs).ToNot(ContainAnyMessageWithLevels(log.ErrorLevel, log.WarnLevel)) - }) + }, + ElementReferences: types.ElementReferences{ + "_section_1": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + // verify no error/warning in logs + Expect(logs).ToNot(ContainAnyMessageWithLevels(log.ErrorLevel, log.WarnLevel)) + }) - It("file inclusion with unclosed tag", func() { - // setup logger to write in a buffer so we can check the output - logs, reset := ConfigureLogger(log.WarnLevel) - defer reset() - source := `include::../../test/includes/tag-include-unclosed.adoc[tag=unclosed]` - expected := types.RawDocument{ - Elements: []interface{}{ - // leading blanklines are ignored - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, - }, + It("with unclosed tag", func() { + // setup logger to write in a buffer so we can check the output + logs, reset := ConfigureLogger(log.WarnLevel) + defer reset() + source := `include::../../test/includes/tag-include-unclosed.adoc[tag=unclosed]` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", }, }, - types.BlankLine{}, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "end", - }, - }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "end", }, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - // verify error in logs - Expect(logs).To(ContainMessageWithLevel(log.WarnLevel, - "detected unclosed tag 'unclosed' starting at line 6 of include file: ../../test/includes/tag-include-unclosed.adoc", - )) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + // verify error in logs + Expect(logs).To(ContainMessageWithLevel(log.WarnLevel, + "detected unclosed tag 'unclosed' starting at line 6 of include file: ../../test/includes/tag-include-unclosed.adoc", + )) + }) - It("file inclusion with unknown tag", func() { - // given - source := `include::../../test/includes/tag-include.adoc[tag=unknown]` - // when/then - _, err := ParseRawDocument(source) - // verify error in logs - Expect(err).To(MatchError("tag 'unknown' not found in include file: ../../test/includes/tag-include.adoc")) - }) + It("with unknown tag", func() { + // given + // setup logger to write in a buffer so we can check the output + logs, reset := ConfigureLogger(log.WarnLevel) + defer reset() + source := `include::../../test/includes/tag-include.adoc[tag=unknown]` + // when/then + _, err := ParseDocument(source, configuration.WithFilename("test.adoc")) + // verify error in logs + Expect(err.Error()).To(ContainSubstring("Unresolved directive in test.adoc - include::../../test/includes/tag-include.adoc[tag=unknown]: tag 'unknown' not found in file to include")) + Expect(logs).To(ContainMessageWithLevel(log.ErrorLevel, "tag 'unknown' not found in file to include")) - It("file inclusion with no tag", func() { - source := `include::../../test/includes/tag-include.adoc[]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "Section 1", - }, - }, - Elements: []interface{}{}, + }) + + It("with no tag", func() { + source := `include::../../test/includes/tag-include.adoc[]` + title := []interface{}{ + &types.StringElement{ + Content: "Section 1", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_1", }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Level: 1, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "content", }, }, }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "end", }, }, }, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_section_1": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - Context("permutations", func() { + Context("permutations", func() { - It("all lines", func() { - source := `include::../../test/includes/tag-include.adoc[tag=**]` // includes all content except lines with tags - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "Section 1", - }, - }, - Elements: []interface{}{}, + It("all lines", func() { + source := `include::../../test/includes/tag-include.adoc[tag=**]` // includes all content except lines with tags + title := []interface{}{ + &types.StringElement{ + Content: "Section 1", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_1", }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Level: 1, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "content", }, }, }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "end", }, }, }, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_section_1": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("all tagged regions", func() { - source := `include::../../test/includes/tag-include.adoc[tag=*]` // includes all sections - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "Section 1", - }, - }, - Elements: []interface{}{}, + It("all tagged regions", func() { + source := `include::../../test/includes/tag-include.adoc[tag=*]` // includes all regions + title := []interface{}{ + &types.StringElement{ + Content: "Section 1", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_1", }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Level: 1, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "content", }, }, }, }, - types.BlankLine{}, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_section_1": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("all the lines outside and inside of tagged regions", func() { - source := `include::../../test/includes/tag-include.adoc[tag=**;*]` // includes all sections - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "Section 1", - }, - }, - Elements: []interface{}{}, + It("all the lines outside and inside of tagged regions", func() { + source := `include::../../test/includes/tag-include.adoc[tag=**;*]` // includes all regions + title := []interface{}{ + &types.StringElement{ + Content: "Section 1", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_1", }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Level: 1, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "content", }, }, }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "end", }, }, }, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_section_1": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("regions tagged doc, but not nested regions tagged content", func() { - source := `include::../../test/includes/tag-include.adoc[tag=doc;!content]` // includes all sections - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "Section 1", - }, - }, - Elements: []interface{}{}, + It("regions tagged doc, but not nested regions tagged content", func() { + source := `include::../../test/includes/tag-include.adoc[tag=doc;!content]` // includes all `doc` but `content` + title := []interface{}{ + &types.StringElement{ + Content: "Section 1", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_1", }, - types.BlankLine{}, + Level: 1, + Title: title, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_section_1": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("all tagged regions, but excludes any regions tagged content", func() { - source := `include::../../test/includes/tag-include.adoc[tag=*;!content]` // includes all sections - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "Section 1", - }, - }, - Elements: []interface{}{}, + It("all tagged regions, but excludes any regions tagged content", func() { + source := `include::../../test/includes/tag-include.adoc[tag=*;!content]` // includes all but `content` + title := []interface{}{ + &types.StringElement{ + Content: "Section 1", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_1", }, - types.BlankLine{}, + Level: 1, + Title: title, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_section_1": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("all tagged regions, but excludes any regions tagged content", func() { - source := `include::../../test/includes/tag-include.adoc[tag=**;!content]` // includes all sections - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "Section 1", - }, - }, - Elements: []interface{}{}, + It("all tagged regions, but excludes any regions tagged content", func() { + source := `include::../../test/includes/tag-include.adoc[tag=**;!content]` // includes all lines but `content` + title := []interface{}{ + &types.StringElement{ + Content: "Section 1", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_1", }, - types.BlankLine{}, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Level: 1, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "end", }, }, }, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_section_1": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("**;!* — selects only the regions of the document outside of tags", func() { - source := `include::../../test/includes/tag-include.adoc[tag=**;!*]` // includes all sections - expected := types.RawDocument{ - Elements: []interface{}{ - // leading blanklines are ignored - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "end", - }, - }, + It("**;!* — selects only the regions of the document outside of tags", func() { + source := `include::../../test/includes/tag-include.adoc[tag=**;!*]` // excludes all regions + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "end", }, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) }) }) + }) - Context("with missing file to include", func() { + Context("with missing file to include", func() { - It("should fail if directory does not exist in standalone block", func() { - source := `include::{unknown}/unknown.adoc[leveloffset=+1]` - _, err := ParseRawDocument(source) - Expect(err).To(MatchError("Unresolved directive in test.adoc - include::{unknown}/unknown.adoc[leveloffset=+1]")) - }) + // var reset func() - It("should fail if file is missing in standalone block", func() { - source := `include::{unknown}/unknown.adoc[leveloffset=+1]` - _, err := ParseRawDocument(source) - Expect(err).To(MatchError("Unresolved directive in test.adoc - include::{unknown}/unknown.adoc[leveloffset=+1]")) - }) + // BeforeEach(func() { + // _, reset = ConfigureLogger(log.ErrorLevel, DiscardStdout()) + // }) - It("should fail if file with attribute in path is not resolved in standalone block", func() { - source := `include::{includedir}/unknown.adoc[leveloffset=+1]` - _, err := ParseRawDocument(source) - Expect(err).To(MatchError("Unresolved directive in test.adoc - include::{includedir}/unknown.adoc[leveloffset=+1]")) - }) + // AfterEach(func() { + // defer reset() + // }) - It("should fail if file is missing in delimited block", func() { - source := `---- + It("should fail if directory does not exist in standalone block", func() { + source := `include::{unknown}/unknown.adoc[leveloffset=+1]` + _, err := ParseDocument(source, configuration.WithFilename("test.adoc")) + Expect(err.Error()).To(ContainSubstring("Unresolved directive in test.adoc - include::{unknown}/unknown.adoc[leveloffset=+1]")) + }) + + It("should fail if file is missing in standalone block", func() { + source := `include::{unknown}/unknown.adoc[leveloffset=+1]` + _, err := ParseDocument(source, configuration.WithFilename("test.adoc")) + Expect(err.Error()).To(ContainSubstring("Unresolved directive in test.adoc - include::{unknown}/unknown.adoc[leveloffset=+1]")) + }) + + It("should fail if file with attribute in path is not resolved in standalone block", func() { + source := `include::{includedir}/unknown.adoc[leveloffset=+1]` + _, err := ParseDocument(source, configuration.WithFilename("test.adoc")) + Expect(err.Error()).To(ContainSubstring("Unresolved directive in test.adoc - include::{includedir}/unknown.adoc[leveloffset=+1]")) + }) + + It("should fail if file is missing in delimited block", func() { + source := `---- include::../../test/includes/unknown.adoc[leveloffset=+1] ----` - _, err := ParseRawDocument(source) - Expect(err).To(MatchError("Unresolved directive in test.adoc - include::../../test/includes/unknown.adoc[leveloffset=+1]")) - }) + _, err := ParseDocument(source, configuration.WithFilename("test.adoc")) + Expect(err.Error()).To(ContainSubstring("Unresolved directive in test.adoc - include::../../test/includes/unknown.adoc[leveloffset=+1]")) + }) - It("should fail if file with attribute in path is not resolved in delimited block", func() { - // setup logger to write in a buffer so we can check the output - source := `---- + It("should fail if file with attribute in path is not resolved in delimited block", func() { + source := `---- include::{includedir}/unknown.adoc[leveloffset=+1] ----` - _, err := ParseRawDocument(source) - Expect(err).To(MatchError("Unresolved directive in test.adoc - include::{includedir}/unknown.adoc[leveloffset=+1]")) - }) + _, err := ParseDocument(source, configuration.WithFilename("test.adoc")) + Expect(err.Error()).To(ContainSubstring("Unresolved directive in test.adoc - include::{includedir}/unknown.adoc[leveloffset=+1]")) }) + }) - Context("with inclusion with attribute in path", func() { + Context("with inclusion with attribute in path", func() { - It("should resolve path with attribute in standalone block from local file", func() { - source := `:includedir: ../../test/includes + It("should resolve path with attribute in standalone block from local file", func() { + source := `:includedir: ../../test/includes include::{includedir}/grandchild-include.adoc[]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "includedir", - Value: "../../test/includes", - }, - types.BlankLine{}, - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "grandchild title", - }, - }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of grandchild", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of grandchild", - }, - }, - }, - }, + title := []interface{}{ + &types.StringElement{ + Content: "grandchild title", + }, + } + expected := &types.Document{ + // Attributes: types.Attributes{ + // "includedir": "../../test/includes", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "includedir", + Value: "../../test/includes", }, - } - Expect(ParseRawDocument(source, WithFilename("foo.adoc"))).To(MatchRawDocument(expected)) - }) - - It("should resolve path with attribute in standalone block from relative file", func() { - source := `:includedir: ../../../test/includes - -include::{includedir}/grandchild-include.adoc[]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "includedir", - Value: "../../../test/includes", - }, - types.BlankLine{}, - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "grandchild title", - }, - }, - Elements: []interface{}{}, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_grandchild_title", }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Level: 1, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "first line of grandchild", }, }, }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "last line of grandchild", }, }, }, }, }, - } - Expect(ParseRawDocument(source, WithFilename("tmp/foo.adoc"))).To(MatchRawDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_grandchild_title": title, + }, + } + // Expect(ParseDocument(source, WithFilename("foo.adoc"))).To(MatchDocument(expected)) + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) - It("should resolve path with attribute in delimited block", func() { - source := `:includedir: ../../test/includes + It("should resolve path with attribute in delimited block", func() { + source := `:includedir: ../../test/includes ---- include::{includedir}/grandchild-include.adoc[] ----` - expected := types.RawDocument{ - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: "includedir", - Value: "../../test/includes", - }, - types.BlankLine{}, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "== grandchild title", - }, - }, - { - types.StringElement{}, - }, - { - types.StringElement{ - Content: "first line of grandchild", - }, - }, - { - types.StringElement{}, - }, - { - types.StringElement{ - Content: "last line of grandchild", - }, - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "includedir": "../../test/includes", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "includedir", + Value: "../../test/includes", + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "== grandchild title\n\nfirst line of grandchild\n\nlast line of grandchild", }, }, }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) }) + }) - Context("inclusion of non-asciidoc file", func() { + Context("inclusion of non-asciidoc file", func() { - It("include go file without any range", func() { + It("include go file without any range in listing block", func() { - source := `---- + source := `---- include::../../test/includes/hello_world.go.txt[] ----` - expected := types.RawDocument{ - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: `package includes`, - }, - }, - { - // TODO: why do we need such an empty StringElement? - types.StringElement{ - Content: ``, - }, - }, - { - types.StringElement{ - Content: `import "fmt"`, - }, - }, - { - types.StringElement{ - Content: ``, - }, - }, - { - types.StringElement{ - Content: `func helloworld() {`, - }, - }, - { - types.StringElement{ - Content: ` fmt.Println("hello, world!")`, - }, - }, - { - types.StringElement{ - Content: `}`, - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: `package includes - It("include go file with a simple range", func() { +import "fmt" - source := `---- -include::../../test/includes/hello_world.go.txt[lines=1] -----` - expected := types.RawDocument{ - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: `package includes`, - }, - }, +func helloworld() { + fmt.Println("hello, world!") +}`, }, }, }, - } - result, err := ParseRawDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchRawDocument(expected)) - }) + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) }) - }) - - }) - - Context("in final documents", func() { - It("should include child and grandchild content with relative level offset", func() { - source := `include::../../test/includes/parent-include-relative-offset.adoc[leveloffset=+1]` - expected := types.Document{ - ElementReferences: types.ElementReferences{ - "_parent_title": []interface{}{ - types.StringElement{ - Content: "parent title", - }, - }, - "_child_section_1": []interface{}{ - types.StringElement{ - Content: "child section 1", - }, - }, - "_child_section_2": []interface{}{ - types.StringElement{ - Content: "child section 2", - }, - }, - "_grandchild_title": []interface{}{ - types.StringElement{ - Content: "grandchild title", - }, - }, - }, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_parent_title", - }, - Level: 1, // here the level is changed from `0` to `1` since `root` doc has a `leveloffset=+1` during its inclusion - Title: []interface{}{ - types.StringElement{ - Content: "parent title", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of parent", - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "child preamble", - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_child_section_1", - }, - Level: 3, // here the level is changed from `1` to `3` since both `root` and `parent` docs have a `leveloffset=+1` during their inclusion - Title: []interface{}{ - types.StringElement{ - Content: "child section 1", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of child", - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_grandchild_title", - }, - Level: 4, // here the level is changed from `1` to `4` since both `root`, `parent` and `child` docs have a `leveloffset=+1` during their inclusion - Title: []interface{}{ - types.StringElement{ - Content: "grandchild title", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of grandchild", - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of grandchild", - }, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_child_section_2", - }, - Level: 4, // here the level is changed from `2` to `4` since both `root` and `parent` docs have a `leveloffset=+1` during their inclusion - Title: []interface{}{ - types.StringElement{ - Content: "child section 2", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of child", - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of parent", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + It("include go file with a simple range in listing block", func() { - It("should include child and grandchild content with relative then absolute level offset", func() { - source := `include::../../test/includes/parent-include-absolute-offset.adoc[leveloffset=+1]` - expected := types.Document{ - ElementReferences: types.ElementReferences{ - "_parent_title": []interface{}{ - types.StringElement{ - Content: "parent title", - }, - }, - "_child_section_1": []interface{}{ - types.StringElement{ - Content: "child section 1", - }, - }, - "_child_section_2": []interface{}{ - types.StringElement{ - Content: "child section 2", - }, - }, - "_grandchild_title": []interface{}{ - types.StringElement{ - Content: "grandchild title", - }, - }, - }, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_parent_title", - }, - Level: 1, // here the level is offset by `+1` as per root doc attribute in the `include` macro - Title: []interface{}{ - types.StringElement{ - Content: "parent title", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of parent", - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "child preamble", - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_child_section_1", - }, - Level: 3, // here level is forced to "absolute 3" - Title: []interface{}{ - types.StringElement{ - Content: "child section 1", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of child", - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_grandchild_title", - }, - Level: 4, // here the level is set to `4` because it was its parent was offset by 3... - Title: []interface{}{ - types.StringElement{ - Content: "grandchild title", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of grandchild", - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of grandchild", - }, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_child_section_2", - }, - Level: 4, // here the level is set to `4` because it the first section was moved from `1` to `3` so we use the same offset here - Title: []interface{}{ - types.StringElement{ - Content: "child section 2", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of child", - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of parent", - }, - }, - }, - }, - }, - }, + source := `---- +include::../../test/includes/hello_world.go.txt[lines=1] +----` + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: `package includes`, }, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) }) }) }) diff --git a/pkg/parser/document_processing_include_toc_placeholder.go b/pkg/parser/document_processing_include_toc_placeholder.go deleted file mode 100644 index 4c8c011b..00000000 --- a/pkg/parser/document_processing_include_toc_placeholder.go +++ /dev/null @@ -1,66 +0,0 @@ -package parser - -import ( - "github.com/bytesparadise/libasciidoc/pkg/types" - log "github.com/sirupsen/logrus" -) - -// IncludeTableOfContentsPlaceHolder includes a `TableOfContentsPlaceHolder` block in the document -// if the `toc` attribute is present -func includeTableOfContentsPlaceHolder(doc types.Document) types.Document { - if t, found := doc.Attributes[types.AttrTableOfContents]; found { - doc = doInsertTableOfContentsPlaceHolder(doc, t) - } - return doc -} - -func doInsertTableOfContentsPlaceHolder(doc types.Document, location interface{}) types.Document { - // insert a TableOfContentsPlaceHolder element if `toc` value is: - // - "auto" (or `nil`) - // - "preamble" - toc := types.TableOfContentsPlaceHolder{} - switch location { - case "auto", nil: - // insert TableOfContentsPlaceHolder at first position (in section '0' if it exists) - if header, ok := doc.Header(); ok { - header.Elements = append([]interface{}{toc}, header.Elements...) - doc.Elements[0] = header - } else { - doc.Elements = append([]interface{}{toc}, doc.Elements...) - } - case "preamble": - // lookup preamble in elements (should be first) - // insert TableOfContentsPlaceHolder just after preamble - if header, ok := doc.Header(); ok { - if preambleIndex, ok := lookupPreamble(header.Elements); ok { - header.Elements = insertAt(header.Elements, toc, preambleIndex) - doc.Elements[0] = header - } - } else if preambleIndex, ok := lookupPreamble(doc.Elements); ok { - doc.Elements = insertAt(doc.Elements, toc, preambleIndex) - } - // case "macro": - default: - log.Warnf("invalid or unsupported value for 'toc' attribute: '%s'", location) - } - return doc -} - -// returns the index of the preamble if it was found in the given elements -func lookupPreamble(elements []interface{}) (int, bool) { - for i, e := range elements { - if _, ok := e.(types.Preamble); ok { - return i, true - } - } - return -1, false -} - -// inserts the given element at the given index -func insertAt(elements []interface{}, element interface{}, index int) []interface{} { - remainingElements := make([]interface{}, len(elements)-(index+1)) - copy(remainingElements, elements[index+1:]) - result := append(elements[0:index+1], element) - result = append(result, remainingElements...) - return result -} diff --git a/pkg/parser/document_processing_include_toc_placeholder_test.go b/pkg/parser/document_processing_include_toc_placeholder_test.go deleted file mode 100644 index 58bf3e5b..00000000 --- a/pkg/parser/document_processing_include_toc_placeholder_test.go +++ /dev/null @@ -1,251 +0,0 @@ -package parser - -import ( - "github.com/bytesparadise/libasciidoc/pkg/types" - - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint -) - -var _ = Describe("include table of contents", func() { - - // reusable elements - doctitle := []interface{}{ - types.StringElement{Content: "A Title"}, - } - preamble := types.Preamble{ - Elements: []interface{}{ - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "A short preamble"}, - }, - }, - }, - types.BlankLine{}, - }, - } - section := types.Section{ - Level: 1, - Attributes: types.Attributes{ - types.AttrID: "_section_1", - }, - Title: []interface{}{ - types.StringElement{Content: "section 1"}, - }, - Elements: []interface{}{}, - } - tocPlaceHolder := types.TableOfContentsPlaceHolder{} - - It("table of contents with default placement and no header with content", func() { - source := types.Document{ - Attributes: types.Attributes{ - types.AttrTableOfContents: nil, - }, - Elements: []interface{}{ - preamble, - section, - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrTableOfContents: nil, - }, - Elements: []interface{}{ - tocPlaceHolder, - preamble, - section, - }, - } - Expect(includeTableOfContentsPlaceHolder(source)).To(Equal(expected)) - }) - - It("table of contents with default placement and a header with content", func() { - source := types.Document{ - Attributes: types.Attributes{ - types.AttrTableOfContents: nil, - }, - ElementReferences: types.ElementReferences{}, // can leave empty for this test - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: doctitle, - Attributes: types.Attributes{ - types.AttrID: "_a_title", - }, - Elements: []interface{}{ - preamble, - section, - }, - }, - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrTableOfContents: nil, - }, - ElementReferences: types.ElementReferences{}, // can leave empty for this test - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: doctitle, - Attributes: types.Attributes{ - types.AttrID: "_a_title", - }, - Elements: []interface{}{ - tocPlaceHolder, - preamble, - section, - }, - }, - }, - } - Expect(includeTableOfContentsPlaceHolder(source)).To(Equal(expected)) - }) - - It("table of contents with default placement and a header without content", func() { - source := types.Document{ - Attributes: types.Attributes{ - types.AttrTableOfContents: nil, - }, - ElementReferences: types.ElementReferences{}, // can leave empty for this test - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: doctitle, - Attributes: types.Attributes{ - types.AttrID: "_a_title", - }, - Elements: []interface{}{ - preamble, - }, - }, - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrTableOfContents: nil, - }, - ElementReferences: types.ElementReferences{}, // can leave empty for this test - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: doctitle, - Attributes: types.Attributes{ - types.AttrID: "_a_title", - }, - Elements: []interface{}{ - tocPlaceHolder, - preamble, - }, - }, - }, - } - Expect(includeTableOfContentsPlaceHolder(source)).To(Equal(expected)) - }) - - It("table of contents with preamble placement and no header with content", func() { - source := types.Document{ - Attributes: types.Attributes{ - types.AttrTableOfContents: "preamble", - }, - Elements: []interface{}{ - preamble, - section, - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrTableOfContents: "preamble", - }, - Elements: []interface{}{ - preamble, - tocPlaceHolder, - section, - }, - } - Expect(includeTableOfContentsPlaceHolder(source)).To(Equal(expected)) - }) - - It("table of contents with preamble placement and header with content", func() { - source := types.Document{ - Attributes: types.Attributes{ - types.AttrTableOfContents: "preamble", - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: doctitle, - Attributes: types.Attributes{ - types.AttrID: "_a_title", - }, - Elements: []interface{}{ - preamble, - section, - }, - }, - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrTableOfContents: "preamble", - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: doctitle, - Attributes: types.Attributes{ - types.AttrID: "_a_title", - }, - Elements: []interface{}{ - preamble, - tocPlaceHolder, - section, - }, - }, - }, - } - Expect(includeTableOfContentsPlaceHolder(source)).To(Equal(expected)) - }) - - It("table of contents with preamble placement and header without content", func() { - source := types.Document{ - Attributes: types.Attributes{ - types.AttrTableOfContents: "preamble", - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: doctitle, - Attributes: types.Attributes{ - types.AttrID: "_a_title", - }, - Elements: []interface{}{ - preamble, - }, - }, - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrTableOfContents: "preamble", - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Title: doctitle, - Attributes: types.Attributes{ - types.AttrID: "_a_title", - }, - Elements: []interface{}{ - preamble, - tocPlaceHolder, - }, - }, - }, - } - Expect(includeTableOfContentsPlaceHolder(source)).To(Equal(expected)) - }) - -}) diff --git a/pkg/parser/document_processing_insert_preamble.go b/pkg/parser/document_processing_insert_preamble.go deleted file mode 100644 index 6e0fa965..00000000 --- a/pkg/parser/document_processing_insert_preamble.go +++ /dev/null @@ -1,41 +0,0 @@ -package parser - -import ( - "github.com/bytesparadise/libasciidoc/pkg/types" -) - -// includePreamble wraps all document elements before the first section in a `Preamble`, -// unless the document has no section. Returns a new document with the changes. -func includePreamble(doc types.Document) types.Document { - if header, ok := doc.Header(); ok { - header.Elements = doInsertPreamble(header.Elements) - doc.Elements[0] = header // need to update the header in the parent doc as we don't use pointers here. - } else { - doc.Elements = doInsertPreamble(doc.Elements) - } - return doc -} - -func doInsertPreamble(blocks []interface{}) []interface{} { - preamble := types.Preamble{ - Elements: make([]interface{}, 0, len(blocks)), - } - for _, block := range blocks { - switch block.(type) { - case types.Section: - break - default: - preamble.Elements = append(preamble.Elements, block) - } - } - // no element in the preamble, or no section in the document, so no preamble to generate - if len(preamble.Elements) == 0 || len(preamble.Elements) == len(blocks) { - return blocks - } - // now, insert the preamble instead of the 'n' blocks that belong to the preamble - // and copy the other items - result := make([]interface{}, len(blocks)-len(preamble.Elements)+1) - result[0] = preamble - copy(result[1:], blocks[len(preamble.Elements):]) - return result -} diff --git a/pkg/parser/document_processing_insert_preamble_test.go b/pkg/parser/document_processing_insert_preamble_test.go index 6e9e857c..4080e270 100644 --- a/pkg/parser/document_processing_insert_preamble_test.go +++ b/pkg/parser/document_processing_insert_preamble_test.go @@ -7,240 +7,166 @@ import ( . "github.com/onsi/gomega" //nolint golint ) -var _ = Describe("preambles", func() { +var _ = Describe("insert preambles", func() { - sectionATitle := []interface{}{ - types.StringElement{Content: "Section A"}, + header := &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "title", + }, + }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "biscuits", + Value: "cookies", + }, + }, } - - sectionBTitle := []interface{}{ - types.StringElement{Content: "Section B"}, + sectionA := &types.Section{ + Level: 1, + Title: []interface{}{ + &types.StringElement{Content: "Section A"}, + }, + Attributes: types.Attributes{ + types.AttrID: "_section_a", + }, } - - It("doc without sections", func() { - source := types.Document{ - Attributes: types.Attributes{ - types.AttrTitle: "foo", - }, - ElementReferences: types.ElementReferences{ - "_section_a": sectionATitle, - "_section_b": sectionBTitle, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a short paragraph"}, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "another short paragraph"}, - }, - }, - }, - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrTitle: "foo", - }, - ElementReferences: types.ElementReferences{ - "_section_a": sectionATitle, - "_section_b": sectionBTitle, + sectionB := &types.Section{ + Level: 1, + Title: []interface{}{ + &types.StringElement{Content: "Section B"}, + }, + Attributes: types.Attributes{ + types.AttrID: "_section_b", + }, + } + paragraph := &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a short paragraph", }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a short paragraph"}, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "another short paragraph"}, - }, - }, - }, + }, + } + anotherParagraph := &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "another short paragraph", }, - } - Expect(includePreamble(source)).To(Equal(expected)) + }, + } + blankline := &types.BlankLine{} + + Context("no insertion", func() { + + It("should not insert when no sections", func() { + // given + doc := &types.Document{ + Elements: []interface{}{ + header, + paragraph, + blankline, + paragraph, + }, + } + expected := &types.Document{ + Elements: []interface{}{ + header, + paragraph, + blankline, + paragraph, + }, + } + // when + insertPreamble(doc) + // then + Expect(doc).To(Equal(expected)) + }) + + It("should not insert when no header", func() { + // given + doc := &types.Document{ + Elements: []interface{}{ + paragraph, + sectionA, + sectionB, + }, + } + expected := &types.Document{ + Elements: []interface{}{ + paragraph, + sectionA, + sectionB, + }, + } + // when + insertPreamble(doc) + // then + Expect(doc).To(Equal(expected)) + }) }) - It("doc with 1-paragraph preamble", func() { - source := types.Document{ - Attributes: types.Attributes{ - types.AttrTitle: "foo", - }, - ElementReferences: types.ElementReferences{ - "_section_a": sectionATitle, - "_section_b": sectionBTitle, - }, + It("should insert preamble with 1 paragraph and blankline", func() { + // given + doc := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a short paragraph"}, - }, - }, - }, - types.BlankLine{}, - types.Section{ - Level: 1, - Title: sectionATitle, - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - - Elements: []interface{}{}, - }, - types.Section{ - Level: 1, - Title: sectionBTitle, - Attributes: types.Attributes{ - types.AttrID: "_section_b", - }, - Elements: []interface{}{}, - }, + header, + paragraph, + blankline, + sectionA, + sectionB, }, } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrTitle: "foo", - }, - ElementReferences: types.ElementReferences{ - "_section_a": sectionATitle, - "_section_b": sectionBTitle, - }, + expected := &types.Document{ Elements: []interface{}{ - types.Preamble{ + header, + &types.Preamble{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{Content: "a short paragraph"}}, - }, - }, - types.BlankLine{}, + paragraph, + blankline, }, }, - types.Section{ - Level: 1, - Title: sectionATitle, - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - - Elements: []interface{}{}, - }, - types.Section{ - Level: 1, - Title: sectionBTitle, - Attributes: types.Attributes{ - types.AttrID: "_section_b", - }, - Elements: []interface{}{}, - }, + sectionA, + sectionB, }, } - Expect(includePreamble(source)).To(Equal(expected)) + // when + insertPreamble(doc) + // then + Expect(doc).To(Equal(expected)) }) - It("doc with 2-paragraph preamble", func() { - source := types.Document{ - Attributes: types.Attributes{ - types.AttrTitle: "foo", - }, - ElementReferences: types.ElementReferences{ - "_section_a": sectionATitle, - "_section_b": sectionBTitle, - }, + It("should insert preamble with 2 paragraphs and blanklines", func() { + // given + doc := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a short paragraph"}, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "another short paragraph"}, - }, - }, - }, - types.BlankLine{}, - types.Section{ - Level: 1, - Title: sectionATitle, - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - - Elements: []interface{}{}, - }, - types.Section{ - Level: 1, - Title: sectionBTitle, - Attributes: types.Attributes{ - types.AttrID: "_section_b", - }, - Elements: []interface{}{}, - }, + header, + paragraph, + blankline, + anotherParagraph, + blankline, + sectionA, + sectionB, }, } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrTitle: "foo", - }, - ElementReferences: types.ElementReferences{ - "_section_a": sectionATitle, - "_section_b": sectionBTitle, - }, + expected := &types.Document{ Elements: []interface{}{ - types.Preamble{ + header, + &types.Preamble{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{Content: "a short paragraph"}}, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{Content: "another short paragraph"}}, - }, - }, - types.BlankLine{}, - }, - }, - types.Section{ - Level: 1, - Title: sectionATitle, - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - - Elements: []interface{}{}, - }, - types.Section{ - Level: 1, - Title: sectionBTitle, - Attributes: types.Attributes{ - types.AttrID: "_section_b", + paragraph, + blankline, + anotherParagraph, + blankline, }, - Elements: []interface{}{}, }, + sectionA, + sectionB, }, } - Expect(includePreamble(source)).To(Equal(expected)) + // when + insertPreamble(doc) + // then + Expect(doc).To(Equal(expected)) }) }) diff --git a/pkg/parser/document_processing_insert_toc_test.go b/pkg/parser/document_processing_insert_toc_test.go new file mode 100644 index 00000000..de2234cb --- /dev/null +++ b/pkg/parser/document_processing_insert_toc_test.go @@ -0,0 +1,261 @@ +package parser + +// . "github.com/onsi/ginkgo" //nolint golint +// . "github.com/onsi/gomega" //nolint golint + +// var _ = Describe("insert table of contents", func() { + +// var header, sectionA, sectionB, paragraph, anotherParagraph, blankline, preamble interface{} +// BeforeEach(func() { + +// header = &types.DocumentHeader{ +// Title: []interface{}{ +// &types.StringElement{ +// Content: "title", +// }, +// }, +// Elements: []interface{}{ +// &types.AttributeDeclaration{ +// Name: "biscuits", +// Value: "cookies", +// }, +// }, +// } +// sectionA = &types.Section{ +// Level: 1, +// Title: []interface{}{ +// &types.StringElement{Content: "Section A"}, +// }, +// Attributes: types.Attributes{ +// types.AttrID: "_section_a", +// }, +// } +// sectionB = &types.Section{ +// Level: 1, +// Title: []interface{}{ +// &types.StringElement{Content: "Section B"}, +// }, +// Attributes: types.Attributes{ +// types.AttrID: "_section_b", +// }, +// } +// paragraph = &types.Paragraph{ +// Elements: []interface{}{ +// &types.StringElement{ +// Content: "a short paragraph", +// }, +// }, +// } +// anotherParagraph = &types.Paragraph{ +// Elements: []interface{}{ +// &types.StringElement{ +// Content: "another short paragraph", +// }, +// }, +// } +// blankline = &types.BlankLine{} +// preamble = &types.Preamble{ +// Elements: []interface{}{ +// paragraph, +// blankline, +// }, +// } +// }) +// toc := &types.TableOfContents{ +// Sections: []*types.ToCSection{ +// { +// ID: "_section_a", +// Level: 1, +// Title: "Section A", +// }, +// { +// ID: "_section_b", +// Level: 1, +// Title: "Section B", +// }, +// }, +// } + +// Context("no insertion", func() { + +// It("should not insert when no placement attribute", func() { +// // given +// doc := &types.Document{ +// Elements: []interface{}{ +// header, +// sectionA, +// sectionB, +// }, +// } +// expected := &types.Document{ +// Elements: []interface{}{ +// header, +// sectionA, +// sectionB, +// }, +// } +// // when +// ctx := NewParseContext(configuration.NewConfiguration()) // no `:toc:` attribute declaration +// insertTableOfContents(ctx, doc, toc) + +// // then +// Expect(doc).To(Equal(expected)) +// }) + +// It("should not insert when no toc generated", func() { +// // given +// doc := &types.Document{ +// Elements: []interface{}{ +// header, +// paragraph, +// blankline, +// anotherParagraph, +// }, +// } + +// expected := &types.Document{ +// Elements: []interface{}{ +// header, +// paragraph, +// blankline, +// anotherParagraph, +// }, +// } +// // when +// ctx := NewParseContext(configuration.NewConfiguration()) +// ctx.attributes[types.AttrTableOfContents] = nil // default placement +// insertTableOfContents(ctx, doc, nil) // no ToC since no sections in doc + +// // then +// Expect(doc).To(Equal(expected)) +// }) + +// It("should not insert when missing preamble", func() { +// // given +// doc := &types.Document{ +// Elements: []interface{}{ +// header, +// sectionA, +// sectionB, +// }, +// } +// expected := &types.Document{ +// Elements: []interface{}{ +// header, +// sectionA, +// sectionB, +// }, +// } +// // when +// ctx := NewParseContext(configuration.NewConfiguration()) +// ctx.attributes[types.AttrTableOfContents] = "preamble" +// insertTableOfContents(ctx, doc, toc) + +// // then +// Expect(doc).To(Equal(expected)) +// // TODO: also check that there was a warning in the logs +// }) +// }) + +// It("should insert within header", func() { +// // given +// doc := &types.Document{ +// Elements: []interface{}{ +// header, +// preamble, +// sectionA, +// sectionB, +// }, +// } +// expected := &types.Document{ +// Elements: []interface{}{ +// &types.DocumentHeader{ +// Title: []interface{}{ +// &types.StringElement{ +// Content: "title", +// }, +// }, +// Elements: []interface{}{ +// &types.AttributeDeclaration{ +// Name: "biscuits", +// Value: "cookies", +// }, +// toc, // inserted here +// }, +// }, +// preamble, +// sectionA, +// sectionB, +// }, +// } +// // when +// ctx := NewParseContext(configuration.NewConfiguration()) +// ctx.attributes[types.AttrTableOfContents] = nil // default placement (within header) +// insertTableOfContents(ctx, doc, toc) + +// // then +// Expect(doc).To(Equal(expected)) +// }) + +// It("should insert at first position when no header", func() { +// // given +// doc := &types.Document{ +// Elements: []interface{}{ +// paragraph, +// anotherParagraph, +// sectionA, +// sectionB, +// }, +// } +// expected := &types.Document{ +// Elements: []interface{}{ +// toc, // inserted here +// paragraph, +// anotherParagraph, +// sectionA, +// sectionB, +// }, +// } +// // when +// ctx := NewParseContext(configuration.NewConfiguration()) +// ctx.attributes[types.AttrTableOfContents] = nil // default placement (within header) +// insertTableOfContents(ctx, doc, toc) + +// // then +// Expect(doc).To(Equal(expected)) +// }) + +// It("should insert within preamble", func() { +// // given +// doc := &types.Document{ +// Elements: []interface{}{ +// header, +// preamble, +// sectionA, +// sectionB, +// }, +// } +// expected := &types.Document{ +// Elements: []interface{}{ +// header, +// &types.Preamble{ +// Elements: []interface{}{ +// paragraph, +// blankline, +// toc, // appended here +// }, +// }, +// sectionA, +// sectionB, +// }, +// } +// // when +// ctx := NewParseContext(configuration.NewConfiguration()) +// ctx.attributes[types.AttrTableOfContents] = "preamble" +// insertTableOfContents(ctx, doc, toc) + +// // then +// Expect(doc).To(Equal(expected)) +// }) + +// }) diff --git a/pkg/parser/document_processing_parse_fragments.go b/pkg/parser/document_processing_parse_fragments.go new file mode 100644 index 00000000..686644cd --- /dev/null +++ b/pkg/parser/document_processing_parse_fragments.go @@ -0,0 +1,113 @@ +package parser + +import ( + "io" + "io/ioutil" + + "github.com/bytesparadise/libasciidoc/pkg/types" + "github.com/davecgh/go-spew/spew" + "github.com/pkg/errors" + log "github.com/sirupsen/logrus" +) + +func ParseFragments(ctx *ParseContext, source io.Reader, done <-chan interface{}) <-chan types.DocumentFragment { + resultStream := make(chan types.DocumentFragment, bufferSize) + go func() { + defer close(resultStream) + b, err := ioutil.ReadAll(source) + if err != nil { + resultStream <- types.NewErrorFragment(err) + return + } + p := newParser(ctx.filename, b, ctx.Opts...) + if err := p.setup(g); err != nil { + resultStream <- types.NewErrorFragment(err) + return + } + log.WithField("pipeline_task", "document_parsing").Debug("start of document parsing") + parsing: + for { + element, err := p.next() + if err != nil { + log.WithError(err).Error("error while parsing") + resultStream <- types.NewErrorFragment(err) + break parsing + } + if element == nil { + break parsing + } + f := types.DocumentFragment{} + if elements, ok := element.([]interface{}); ok { + f.Elements = elements + } else { + f.Elements = []interface{}{element} + } + // look-up delimited blocks with normal content (will need 2nd pass to parse their content) + for _, e := range f.Elements { + if b, ok := e.(*types.DelimitedBlock); ok && + (b.Kind == types.Example || b.Kind == types.Quote || b.Kind == types.Sidebar) { + // if parsing failed, delimited block will be empty + if b.Elements, err = parseDelimitedBlockElements(ctx, b); err != nil { + f.Error = err + break + } + } + } + + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("parsed fragment:\n%s", spew.Sdump(f)) + } + select { + case <-done: + log.Info("exiting the document parsing routine") + break parsing // stops/exits the go routine + case resultStream <- f: + } + } + log.WithField("pipeline_task", "document_parsing").Debug("end of document parsing") + }() + return resultStream +} + +func parseDelimitedBlockElements(ctx *ParseContext, b *types.DelimitedBlock) ([]interface{}, error) { + log.Debugf("parsing content of delimited block of kind '%s'", b.Kind) + // TODO: use real Substitution? + content, placeholders := serialize(b.Elements) // don't expect placeholders + opts := append(ctx.Opts, Entrypoint("DelimitedBlockElements"), GlobalStore(delimitedBlockScopeKey, b.Kind)) + f, err := Parse("", content, opts...) + if err != nil { + return nil, errors.Wrap(err, "unable to parse content") // ignore error (malformed content) + } + result, ok := f.([]interface{}) + if !ok { + return nil, errors.Errorf("unexpected type of result after parsing fragments: '%T'", result) + } + return placeholders.restore(result) +} + +const documentHeaderKey = "document_header" +const frontMatterKey = "front_matter" + +func (c *current) isFrontMatterAllowed() bool { + allowed, found := c.globalStore[frontMatterKey].(bool) + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("checking if FrontMatter is allowed: %t", found && allowed && !c.isWithinDelimitedBlock()) + // } + return found && allowed && !c.isWithinDelimitedBlock() +} + +func (c *current) setFrontMatterAllowed(a bool) { + c.globalStore[frontMatterKey] = a +} + +func (c *current) isDocumentHeaderAllowed() bool { + allowed, found := c.globalStore[documentHeaderKey].(bool) + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("checking if DocumentHeader is allowed: %t", found && allowed && !c.isWithinDelimitedBlock()) + // } + return found && allowed && !c.isWithinDelimitedBlock() +} + +func (c *current) setDocumentHeaderAllowed(a bool) { + c.globalStore[documentHeaderKey] = a +} diff --git a/pkg/parser/document_processing_parse_fragments_test.go b/pkg/parser/document_processing_parse_fragments_test.go new file mode 100644 index 00000000..d0742c7c --- /dev/null +++ b/pkg/parser/document_processing_parse_fragments_test.go @@ -0,0 +1,507 @@ +package parser_test + +import ( + "github.com/bytesparadise/libasciidoc/pkg/types" + . "github.com/bytesparadise/libasciidoc/testsupport" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("document fragment parsing", func() { + + Context("paragraphs", func() { + + It("should parse 1 paragraph with single line", func() { + source := `a line` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("a line"), + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + It("should parse 2 paragraphs with single line each", func() { + source := `a line + +another line` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("a line"), + }, + }, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("another line"), + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + It("should parse markdown quote block with single marker", func() { + source := `> some text +on *multiple lines*` + + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.MarkdownQuote, + Elements: []interface{}{ + types.RawLine("some text"), + types.RawLine("on *multiple lines*"), + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + It("should parse markdown quote block with multiple markers", func() { + source := `> some text +> on *multiple lines*` + + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.MarkdownQuote, + Elements: []interface{}{ + types.RawLine("some text"), + types.RawLine("on *multiple lines*"), + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + }) + + Context("as delimited blocks", func() { + + It("should parse 1 delimited block with single rawline", func() { + source := `---- +a line +----` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + types.RawLine("a line"), + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + It("should collect 1 delimited block with multiple rawlines only", func() { + source := `---- +a line + +**** +not a sidebar block +**** +---- +` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + types.RawLine("a line"), + types.RawLine(""), + types.RawLine("****"), + types.RawLine("not a sidebar block"), + types.RawLine("****"), + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + It("should collect 1 delimited block with attributes, multiple rawlines and content afterwards", func() { + source := `[source,text] +---- +a line + +another line +---- + + +a paragraph +on +3 lines. + +` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrStyle: "source", + types.AttrLanguage: "text", + }, + Elements: []interface{}{ + types.RawLine("a line"), + types.RawLine(""), + types.RawLine("another line"), + }, + }, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("a paragraph"), + types.RawLine("on"), + types.RawLine("3 lines."), + }, + }, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + }) + + Context("sections", func() { + + It("should collect 1 section and content afterwards", func() { + source := `== section title + + +a paragraph +on +3 lines. + +` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: []interface{}{ + types.RawLine("section title"), + }, + }, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("a paragraph"), + types.RawLine("on"), + types.RawLine("3 lines."), + }, + }, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + }) + + Context("lists", func() { + + It("should parse callout list elements without blankline in-between", func() { + source := `<1> first element +<2> second element +` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ListElements{ + Elements: []interface{}{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("first element"), + }, + }, + }, + }, + &types.CalloutListElement{ + Ref: 2, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("second element"), + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + It("should parse callout list elements with blanklines in-between", func() { + source := `<1> first element + + +<2> second element +` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ListElements{ + Elements: []interface{}{ + &types.CalloutListElement{ + Ref: 1, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("first element"), + }, + }, + }, + }, + &types.CalloutListElement{ + Ref: 2, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("second element"), + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + It("should parse ordered list elements without blanklines in-between", func() { + source := `. first element +. second element +` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ListElements{ + Elements: []interface{}{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("first element"), + }, + }, + }, + }, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("second element"), + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + It("should parse ordered list elements with blanklines in-between", func() { + source := `. first element + + +. second element +` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ListElements{ + Elements: []interface{}{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("first element"), + }, + }, + }, + }, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("second element"), + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + It("should parse single ordered list element with multiple lines", func() { + source := `. element +on +multiple +lines +` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ListElements{ + Elements: []interface{}{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + // suffix spaces are trimmed + types.RawLine("element"), + types.RawLine("on"), + types.RawLine("multiple"), + types.RawLine("lines"), + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + It("should parse multiple ordered list element with multiple lines", func() { + source := `. first element +on +multiple +lines +. second element +on +multiple +lines +` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.ListElements{ + Elements: []interface{}{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + // suffix spaces are trimmed on each line + types.RawLine("first element"), + types.RawLine("on"), + types.RawLine("multiple"), + types.RawLine("lines"), + }, + }, + }, + }, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + // suffix spaces are trimmed on each line + types.RawLine("second element"), + types.RawLine("on"), + types.RawLine("multiple"), + types.RawLine("lines"), + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + }) + +}) diff --git a/pkg/parser/document_processing_raw_source_test.go b/pkg/parser/document_processing_raw_source_test.go new file mode 100644 index 00000000..78ee8d7e --- /dev/null +++ b/pkg/parser/document_processing_raw_source_test.go @@ -0,0 +1,70 @@ +package parser_test + +import ( + "strings" + + "github.com/bytesparadise/libasciidoc/pkg/parser" + "github.com/bytesparadise/libasciidoc/pkg/types" + + . "github.com/onsi/ginkgo/extensions/table" + . "github.com/onsi/gomega" //nolint golint +) + +var _ = DescribeTable("'FileLocation' pattern", + func(filename string, expected interface{}) { + reader := strings.NewReader(filename) + actual, err := parser.ParseReader(filename, reader, parser.Entrypoint("FileLocation")) + Expect(err).ToNot(HaveOccurred()) + // GinkgoT().Log("actual result: %s", spew.Sdump(actual)) + // GinkgoT().Log("expected result: %s", spew.Sdump(expected)) + Expect(actual).To(Equal(expected)) + }, + Entry("'chapter-a.adoc'", "chapter-a.adoc", &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "chapter-a.adoc", + }, + }, + }), + Entry("'chapter_a.adoc'", "chapter_a.adoc", &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "chapter_a.adoc", + }, + }, + }), + Entry("'../../test/includes/chapter_a.adoc'", "../../test/includes/chapter_a.adoc", &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "../../test/includes/chapter_a.adoc", + }, + }, + }), + Entry("'{includedir}/chapter-{foo}.adoc'", "{includedir}/chapter-{foo}.adoc", &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "{includedir}/chapter-{foo}.adoc", // attribute substitutions are treared as part of the string element + }, + }, + }), + Entry("'{scheme}://{path}'", "{scheme}://{path}", &types.Location{ + Path: []interface{}{ + &types.StringElement{ // attribute substitutions are treared as part of the string element + Content: "{scheme}://{path}", + }, + }, + }), +) + +var _ = DescribeTable("check asciidoc file", + func(path string, expectation bool) { + Expect(parser.IsAsciidoc(path)).To(Equal(expectation)) + }, + Entry("foo.adoc", "foo.adoc", true), + Entry("foo.asc", "foo.asc", true), + Entry("foo.ad", "foo.ad", true), + Entry("foo.asciidoc", "foo.asciidoc", true), + Entry("foo.txt", "foo.txt", true), + Entry("foo.csv", "foo.csv", false), + Entry("foo.go", "foo.go", false), +) diff --git a/pkg/parser/document_processing_rearrange_lists.go b/pkg/parser/document_processing_rearrange_lists.go deleted file mode 100644 index a9f498da..00000000 --- a/pkg/parser/document_processing_rearrange_lists.go +++ /dev/null @@ -1,294 +0,0 @@ -package parser - -import ( - "reflect" - "strings" - - "github.com/bytesparadise/libasciidoc/pkg/types" - - "github.com/pkg/errors" - log "github.com/sirupsen/logrus" -) - -// rearrangeListItems moves the list items into lists, and nested lists if needed -func rearrangeListItems(blocks []interface{}, withinDelimitedBlock bool) ([]interface{}, error) { - log.Debug("rearranging list items...") - a := &listArranger{ - blocks: make([]interface{}, 0, len(blocks)), - lists: make([]types.List, 0, len(blocks)), - blanklineCounter: 0, - withinDelimitedBlock: withinDelimitedBlock, - } - var err error - for _, block := range blocks { - switch block := block.(type) { - case types.ExampleBlock: - if block.Elements, err = rearrangeListItems(block.Elements, true); err != nil { - return nil, err - } - a.appendBlock(block) - case types.QuoteBlock: - if block.Elements, err = rearrangeListItems(block.Elements, true); err != nil { - return nil, err - } - a.appendBlock(block) - case types.SidebarBlock: - if block.Elements, err = rearrangeListItems(block.Elements, true); err != nil { - return nil, err - } - a.appendBlock(block) - case types.OrderedListItem, types.UnorderedListItem, types.LabeledListItem, types.CalloutListItem: - // there's a special case: if the next list item has attributes and was preceded by a - // blank line, then we need to start a new list - if a.blanklineCounter > 0 && len(block.(types.DocumentElement).GetAttributes()) > 0 { - a.appendPendingLists() - } - if err = a.appendListItem(block); err != nil { - return nil, errors.Wrapf(err, "unable to rearrange list items in delimited block") - } - case types.ContinuedListItemElement: - block.Offset = a.blanklineCounter - a.appendContinuedListItemElement(block) - case types.BlankLine: - a.appendBlankline(block) - default: - a.appendBlock(block) - } - } - // also when all is done, process the remaining pending list items - a.appendPendingLists() - return a.blocks, nil -} - -type listArranger struct { - blocks []interface{} - lists []types.List - blanklineCounter int - withinDelimitedBlock bool -} - -// an block which is not a list item was found. -// the first thing to do is to process the pending list items, -// then only append this block to the result -func (a *listArranger) appendBlock(block interface{}) { - if len(a.lists) > 0 { - a.pruneLists(0) - for _, list := range a.lists { - a.blocks = append(a.blocks, unPtr(list)) - } - // reset the list for further usage while processing the rest of the document - a.lists = []types.List{} - } - a.blocks = append(a.blocks, block) -} - -func (a *listArranger) appendList(list types.List) { - a.lists = append(a.lists, list) -} - -func (a *listArranger) appendBlankline(l types.BlankLine) { - // blank lines are not part of the resulting Document sections (or top-level), but they are part of the delimited blocks - // in some cases, they can also be used to split lists apart (when the next item has some attributes, - // or if the next block is a comment) - if a.withinDelimitedBlock && len(a.lists) == 0 { // only retain blank lines if within a delimited block, but not currently dealing with a list (or a set of nested lists) - a.appendBlock(l) - } - a.blanklineCounter++ -} - -func (a *listArranger) appendContinuedListItemElement(item types.ContinuedListItemElement) { - item.Offset = a.blanklineCounter - a.pruneLists(len(a.lists) - 1 - item.Offset) - // log.Debugf("appending continued list item element with offset=%d (depth=%d)", item.Offset, len(a.lists)) - // lookup the list at which the item should be attached - parentList := &(a.lists[len(a.lists)-1]) - parentItem := (*parentList).LastItem() - parentItem.AddElement(item.Element) - a.blanklineCounter = 0 -} - -func (a *listArranger) appendListItem(item interface{}) error { - a.blanklineCounter = 0 - switch item := item.(type) { - case types.OrderedListItem: - return a.appendOrderedListItem(&item) - case types.UnorderedListItem: - return a.appendUnorderedListItem(&item) - case types.LabeledListItem: - return a.appendLabeledListItem(item) - case types.CalloutListItem: - return a.appendCalloutListItem(item) - } - return nil -} - -func (a *listArranger) appendPendingLists() { - if len(a.lists) > 0 { - // log.Debugf("processing the remaining %d lists...", len(a.lists)) - a.pruneLists(0) - for _, list := range a.lists { - a.blocks = append(a.blocks, unPtr(list)) - } - a.lists = []types.List{} - } -} - -func (a *listArranger) appendOrderedListItem(item *types.OrderedListItem) error { - maxLevel := 0 - // log.Debugf("looking-up list for ordered list having items with level=%d and number style=%v", item.Level, item.Style) - for i, list := range a.lists { - if list, ok := list.(*types.OrderedList); ok { - // assume we can't have empty lists - maxLevel++ - if list.Items[0].Style == item.Style { - // log.Debugf("found a matching ordered list at level %d", list.Items[0].Level) - // prune items of "deeper/lower" level - a.pruneLists(i) - // apply the same level - item.Level = list.Items[0].Level - list.AddItem(*item) - // also, prune the pointers to the remaining sublists (in case there is any...) - return nil - } - } - } - // no match found: create a new list and if needed, adjust the level of the item - // force the current item level to (last seen level + 1) - item.Level = maxLevel + 1 - // log.Debugf("adding a new ordered list") - a.appendList(types.NewOrderedList(item)) - return nil -} - -func (a *listArranger) appendCalloutListItem(item types.CalloutListItem) error { - for i, list := range a.lists { - if list, ok := list.(*types.CalloutList); ok { - // assume we can't have empty lists - // log.Debugf("found a matching callout list") - // prune items of "deeper/lower" level - a.pruneLists(i) - // apply the same level - list.AddItem(item) - // also, prune the pointers to the remaining sublists (in case there is any...) - return nil - } - } - // no match found: create a new list and if needed, adjust the level of the item - // log.Debugf("adding a new callout list") - a.appendList(types.NewCalloutList(item)) - return nil -} - -func (a *listArranger) appendUnorderedListItem(item *types.UnorderedListItem) error { - maxLevel := 0 - // log.Debugf("looking-up list for unordered list item with level=%d and bullet style=%v", item.Level, item.BulletStyle) - for i, list := range a.lists { - if list, ok := list.(*types.UnorderedList); ok { - // assume we can't have empty lists - maxLevel++ - if list.Items[0].BulletStyle == item.BulletStyle { - // log.Debugf("found a matching unordered list at level %d", list.Items[0].Level) - // prune items of "deeper/lower" level - a.pruneLists(i) - // apply the same level - item.Level = list.Items[0].Level - list.AddItem(*item) - return nil - } - } - } - // no match found: create a new list and if needed, adjust the level of the item - // log.Debugf("adding a new unordered list") - // also, force the current item level to (last seen level + 1) - item.Level = maxLevel + 1 - // also, force the bullet-style based on the list on the level above (if it exists) - if len(a.lists) > 0 { - parentList := &(a.lists[len(a.lists)-1]) - parentItem := (*parentList).LastItem() - // also, force the bullet style - if parentItem, ok := parentItem.(*types.UnorderedListItem); ok { - item.BulletStyle = item.BulletStyle.NextLevel(parentItem.BulletStyle) - } - } - a.appendList(types.NewUnorderedList(*item)) - return nil -} - -func (a *listArranger) appendLabeledListItem(item types.LabeledListItem) error { - // first, let's parse the labeled list item term for more complex content - if len(item.Term) == 1 { - if term, ok := item.Term[0].(types.StringElement); ok { - var err error - // TODO: do we really need that? - item.Term, err = parseLabeledListItemTerm(term.Content) - if err != nil { - return err - } - } - } - maxLevel := 0 - // log.Debugf("looking-up list for labeled list item with level=%d and term=%s", item.Level, item.Term) - for i, list := range a.lists { - // log.Debugf(" comparing with list of type %T at level %d", list, i) - if list, ok := list.(*types.LabeledList); ok { - // assume we can't have empty lists - maxLevel++ - // log.Debugf(" comparing with list item level %d vs %d", list.Items[0].Level, item.Level) - if list.Items[0].Level == item.Level { - // log.Debugf("found a matching labeled list") - a.pruneLists(i) - list.AddItem(item) - // log.Debugf("labeled list at level %d now has %d items", maxLevel, len(list.Items)) - return nil - } - } - } - // no match found: create a new list and if needed, adjust the level of the item - // log.Debugf("adding a new labeled list") - // also, force the current item level to (last seen level + 1) - item.Level = maxLevel + 1 - a.appendList(types.NewLabeledList(item)) - return nil -} - -// a labeled list item term may contain links, images, quoted text, footnotes, etc. -func parseLabeledListItemTerm(term string) ([]interface{}, error) { - // result := []interface{}{} - elements, err := ParseReader("", strings.NewReader(term), Entrypoint("LabeledListItemTerm")) - if err != nil { - return []interface{}{}, errors.Wrap(err, "error while parsing content for inline links") - } - return elements.([]interface{}), nil -} - -func (a *listArranger) pruneLists(level int) { - if level+1 < len(a.lists) { - // log.Debugf("pruning the list path from %d to %d level(s) deep", len(a.lists), level+1) - // add the last list(s) as children of their parent, in reverse order, - // because we copy the value, not the pointers - for i := len(a.lists) - 1; i > level; i-- { - // log.Debugf("appending list at depth %d to the last item of the parent list...", (i + 1)) - parentList := &(a.lists[i-1]) - parentItem := (*parentList).LastItem() - switch childList := a.lists[i].(type) { - case *types.OrderedList: - parentItem.AddElement(*childList) - case *types.UnorderedList: - parentItem.AddElement(*childList) - case *types.LabeledList: - parentItem.AddElement(*childList) - } - } - // also, prune the pointers to the remaining sublists - a.lists = a.lists[0 : level+1] - } -} - -func unPtr(value interface{}) interface{} { - v := reflect.ValueOf(value) - k := v.Kind() - if k == reflect.Ptr && v.Elem().IsValid() { - return v.Elem().Interface() - } - return value -} diff --git a/pkg/parser/document_processing_rearrange_lists_test.go b/pkg/parser/document_processing_rearrange_lists_test.go deleted file mode 100644 index 4864a981..00000000 --- a/pkg/parser/document_processing_rearrange_lists_test.go +++ /dev/null @@ -1,1119 +0,0 @@ -package parser - -import ( - "github.com/bytesparadise/libasciidoc/pkg/types" - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint -) - -var _ = Describe("rearrange lists", func() { - - It("mixed lists - complex case 1", func() { - // - unordered 1 - // 1. ordered 1.1 - // a. ordered 1.1.a - // b. ordered 1.1.b - // c. ordered 1.1.c - // 2. ordered 1.2 - // i) ordered 1.2.i - // ii) ordered 1.2.ii - // 3. ordered 1.3 - // 4. ordered 1.4 - // - unordered 2 - // * unordered 2.1 - actual := []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 1"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1.a"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1.b"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1.c"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.2"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 2, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.2.i"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 2, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.2.ii"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.3"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.4"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 2"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 2.1"}, - }, - }, - }, - }, - }, - } - expected := []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 1"}, - }, - }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1"}, - }, - }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1.a"}, - }, - }, - }, - }, - }, - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1.b"}, - }, - }, - }, - }, - }, - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1.c"}, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.2"}, - }, - }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.2.i"}, - }, - }, - }, - }, - }, - { - Level: 2, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.2.ii"}, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.3"}, - }, - }, - }, - }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.4"}, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 2"}, - }, - }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 2.1"}, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(rearrangeListItems(actual, false)).To(Equal(expected)) - }) - - It("labeled list with rich terms", func() { - actual := []interface{}{ - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "`foo` term", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "description 1"}, - }, - }, - }, - }, - }, - types.LabeledListItem{ - Level: 2, - Term: []interface{}{ - types.StringElement{ - Content: "`bar` term", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "description 2"}, - }, - }, - }, - }, - }, - types.LabeledListItem{ - Level: 2, - Term: []interface{}{ - types.StringElement{ - Content: "icon:caution[]", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "description 3"}, - }, - }, - }, - }, - }, - } - expected := []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, - Term: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{ - Content: "foo", - }, - }, - }, - types.StringElement{ - Content: " term", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "description 1"}, - }, - }, - }, - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 2, - Term: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{ - Content: "bar", - }, - }, - }, - types.StringElement{ - Content: " term", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "description 2"}, - }, - }, - }, - }, - }, - { - Level: 2, - Term: []interface{}{ - types.Icon{ - Class: "caution", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "description 3"}, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(rearrangeListItems(actual, false)).To(Equal(expected)) - }) - - It("callout list items and a block afterwards", func() { - actual := []interface{}{ - types.CalloutListItem{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "description 1"}, - }, - }, - }, - }, - }, - types.CalloutListItem{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "description 2"}, - }, - }, - }, - }, - }, - types.ExampleBlock{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, - }, - }, - }, - }, - }, - } - expected := []interface{}{ - types.CalloutList{ - Items: []types.CalloutListItem{ - { - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "description 1"}, - }, - }, - }, - }, - }, - { - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "description 2"}, - }, - }, - }, - }, - }, - }, - }, - types.ExampleBlock{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, - }, - }, - }, - }, - }, - } - Expect(rearrangeListItems(actual, false)).To(Equal(expected)) - }) - - It("unordered list items and continued list item attached to grandparent", func() { - // * grandparent list item - // ** parent list item - // *** child list item - // - // - // + - // paragraph attached to parent list item - - actual := []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.ContinuedListItemElement{ - Element: types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to grandparent list item"}, - }, - }, - }, - }, - } - expected := []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, - }, - }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, - }, - }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to grandparent list item"}, - }, - }, - }, - }, - }, - }, - }, - } - Expect(rearrangeListItems(actual, false)).To(Equal(expected)) - }) - - It("unordered list items and continued list item attached to parent", func() { - // * grandparent list item - // ** parent list item - // *** child list item - // - // + - // paragraph attached to parent list item - - actual := []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.ContinuedListItemElement{ - Element: types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to parent list item"}, - }, - }, - }, - }, - } - expected := []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, - }, - }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, - }, - }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, - }, - }, - }, - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to parent list item"}, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(rearrangeListItems(actual, false)).To(Equal(expected)) - }) - - It("unordered list items and continued list item attached to parent", func() { - // * grandparent list item - // ** parent list item - // *** child list item - // - // + - // paragraph attached to parent list item - - actual := []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.ContinuedListItemElement{ - Element: types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to parent list item"}, - }, - }, - }, - }, - } - expected := []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, - }, - }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, - }, - }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, - }, - }, - }, - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to parent list item"}, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(rearrangeListItems(actual, false)).To(Equal(expected)) - }) - - It("unordered list items and continued list item attached to parent and grandparent", func() { - // * grandparent list item - // ** parent list item - // *** child list item - // - // + - // paragraph attached to parent list item - // - // + - // paragraph attached to grandparent list item - - actual := []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.ContinuedListItemElement{ - Element: types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to parent list item"}, - }, - }, - }, - }, - types.BlankLine{}, - types.ContinuedListItemElement{ - Element: types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to grandparent list item"}, - }, - }, - }, - }, - } - expected := []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, - }, - }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, - }, - }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, - }, - }, - }, - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to parent list item"}, - }, - }, - }, - }, - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to grandparent list item"}, - }, - }, - }, - }, - }, - }, - }, - } - Expect(rearrangeListItems(actual, false)).To(Equal(expected)) - }) - -}) diff --git a/pkg/parser/document_processing_rearrange_sections.go b/pkg/parser/document_processing_rearrange_sections.go deleted file mode 100644 index defee6cb..00000000 --- a/pkg/parser/document_processing_rearrange_sections.go +++ /dev/null @@ -1,113 +0,0 @@ -package parser - -import ( - "strconv" - - "github.com/bytesparadise/libasciidoc/pkg/types" -) - -// rearrangeSections moves elements into section to obtain a hierarchical document instead of a flat thing -func rearrangeSections(blocks []interface{}) (types.Document, error) { - - // use same logic as with list items: - // only append a child section to her parent section when - // a sibling or higher level section is processed. - - // log.Debugf("rearranging sections in %d blocks...", len(blocks)) - tle := make([]interface{}, 0, len(blocks)) // top-level elements - sections := make([]types.Section, 0, 6) // the path to the current section (eg: []{section-level0, section-level1, etc.}) - elementRefs := types.ElementReferences{} - var previous *types.Section // the current "parent" section - for _, element := range blocks { - if e, ok := element.(types.Section); ok { - // avoid duplicate IDs in sections - if err := referenceSection(&e, elementRefs); err != nil { - return types.Document{}, err - } - if previous == nil { // set first parent - // log.Debugf("setting section with title %v as a top-level element", e.Title) - sections = append(sections, e) - } else if e.Level > previous.Level { // add new level - // log.Debugf("adding section with title %v as the first section at level %d", e.Title, e.Level) - sections = append(sections, e) - } else { // replace at the deepest level - sections = pruneSections(sections, e.Level) - if len(sections) > 0 && sections[0].Level == e.Level { - // log.Debugf("moving section with title %v as a new top-level element", e.Title) - tle = append(tle, sections[0]) - sections = make([]types.Section, 0, 6) - } - // log.Debugf("adding section with title %v as another section at level %d", e.Title, e.Level) - sections = append(sections, e) - } - previous = &e // pointer to new current parent - } else { - if previous == nil { - // log.Debugf("adding element of type %T as a top-level element", element) - tle = append(tle, element) - } else { - parentSection := &(sections[len(sections)-1]) - // log.Debugf("adding element of type %T as a child of section with level %d", element, parentSection.Level) - (*parentSection).AddElement(element) - } - } - } - // process the remaining sections - sections = pruneSections(sections, 1) - if len(sections) > 0 { - tle = append(tle, sections[0]) - } - if len(elementRefs) == 0 { - elementRefs = nil - } - return types.Document{ - Elements: tle, - ElementReferences: elementRefs, - }, nil -} - -func referenceSection(e *types.Section, elementRefs types.ElementReferences) error { - attrID, found, err := e.Attributes.GetAsString(types.AttrID) - if err != nil { - return err - } - if !found { - return nil - } - for i := 1; ; i++ { - var id string - if i == 1 { - id = attrID - } else { - id = attrID + "_" + strconv.Itoa(i) - } - if _, found := elementRefs[id]; !found { - elementRefs[id] = e.Title - // override the element id - e.Attributes.Set(types.AttrID, id) - break - } - } - elementRefs[attrID] = e.Title - return nil -} - -func pruneSections(sections []types.Section, level int) []types.Section { - if len(sections) > 0 && level > 0 { // && level < len(sections) { - // log.Debugf("pruning the section path with %d level(s) of deep", len(sections)) - // add the last list(s) as children of their parent, in reverse order, - // because we copy the value, not the pointers - cut := len(sections) - for i := len(sections) - 1; i > 0 && sections[i].Level >= level; i-- { - parentSection := &(sections[i-1]) - // log.Debugf("appending section at depth %d (%v) to the last element of the parent section (%v)", i, sections[i].Title, parentSection.Title) - (*parentSection).AddElement(sections[i]) - cut = i - } - // also, prune the pointers to the remaining sublists - sections := sections[0:cut] - // log.Debugf("sections list has now %d top-level elements", len(sections)) - return sections - } - return sections -} diff --git a/pkg/parser/document_processing_rearrange_sections_test.go b/pkg/parser/document_processing_rearrange_sections_test.go deleted file mode 100644 index 8669cbef..00000000 --- a/pkg/parser/document_processing_rearrange_sections_test.go +++ /dev/null @@ -1,464 +0,0 @@ -package parser - -import ( - "github.com/bytesparadise/libasciidoc/pkg/types" - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint -) - -var _ = Describe("rearrange sections", func() { - - It("section levels 1, 2, 3, 2", func() { - // = a header - // - // == Section A - // a paragraph - // - // === Section A.a - // a paragraph - // - // == Section B - // a paragraph - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } - sectionATitle := []interface{}{ - types.StringElement{Content: "Section A"}, - } - sectionAaTitle := []interface{}{ - types.StringElement{Content: "Section A.a"}, - } - sectionBTitle := []interface{}{ - types.StringElement{Content: "Section B"}, - } - actual := []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", - }, - Level: 0, - Title: doctitle, - Elements: []interface{}{}, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - Level: 1, - Title: sectionATitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a", - }, - Level: 2, - Title: sectionAaTitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_b", - }, - Level: 1, - Title: sectionBTitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - } - expected := types.Document{ - ElementReferences: types.ElementReferences{ - "_a_header": doctitle, - "_section_a": sectionATitle, - "_section_a_a": sectionAaTitle, - "_section_b": sectionBTitle, - }, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", - }, - Level: 0, - Title: doctitle, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - Level: 1, - Title: sectionATitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a", - }, - Level: 2, - Title: sectionAaTitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_b", - }, - Level: 1, - Title: sectionBTitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(rearrangeSections(actual)).To(Equal(expected)) - }) - - It("section levels 1, 2, 3, 3", func() { - // = a header - // - // == Section A - // a paragraph - // - // === Section A.a - // a paragraph - // - // === Section A.b - // a paragraph - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } - sectionATitle := []interface{}{ - types.StringElement{Content: "Section A"}, - } - sectionAaTitle := []interface{}{ - types.StringElement{Content: "Section A.a"}, - } - sectionBTitle := []interface{}{ - types.StringElement{Content: "Section A.b"}, - } - actual := []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", - }, - Level: 0, - Title: doctitle, - Elements: []interface{}{}, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - Level: 1, - Title: sectionATitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a", - }, - Level: 2, - Title: sectionAaTitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_b", - }, - Level: 2, - Title: sectionBTitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - } - expected := types.Document{ - ElementReferences: types.ElementReferences{ - "_a_header": doctitle, - "_section_a": sectionATitle, - "_section_a_a": sectionAaTitle, - "_section_a_b": sectionBTitle, - }, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", - }, - Level: 0, - Title: doctitle, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - Level: 1, - Title: sectionATitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a", - }, - Level: 2, - Title: sectionAaTitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_b", - }, - Level: 2, - Title: sectionBTitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(rearrangeSections(actual)).To(Equal(expected)) - }) - - It("section levels 1, 3, 4, 4", func() { - // = a header - // - // === Section A - // a paragraph - // - // ==== Section A.a - // a paragraph - // - // ==== Section A.b - // a paragraph - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } - sectionATitle := []interface{}{ - types.StringElement{Content: "Section A"}, - } - sectionAaTitle := []interface{}{ - types.StringElement{Content: "Section A.a"}, - } - sectionBTitle := []interface{}{ - types.StringElement{Content: "Section A.b"}, - } - actual := []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", - }, - Level: 0, - Title: doctitle, - Elements: []interface{}{}, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - Level: 2, - Title: sectionATitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a", - }, - Level: 3, - Title: sectionAaTitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_b", - }, - Level: 3, - Title: sectionBTitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - } - expected := types.Document{ - ElementReferences: types.ElementReferences{ - "_a_header": doctitle, - "_section_a": sectionATitle, - "_section_a_a": sectionAaTitle, - "_section_a_b": sectionBTitle, - }, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", - }, - Level: 0, - Title: doctitle, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - Level: 2, - Title: sectionATitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a", - }, - Level: 3, - Title: sectionAaTitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_b", - }, - Level: 3, - Title: sectionBTitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(rearrangeSections(actual)).To(Equal(expected)) - }) - -}) diff --git a/pkg/parser/document_processing_test.go b/pkg/parser/document_processing_test.go deleted file mode 100644 index f484a98f..00000000 --- a/pkg/parser/document_processing_test.go +++ /dev/null @@ -1,254 +0,0 @@ -package parser_test - -import ( - "github.com/bytesparadise/libasciidoc/pkg/configuration" - "github.com/bytesparadise/libasciidoc/pkg/types" - . "github.com/bytesparadise/libasciidoc/testsupport" - - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint -) - -var _ = Describe("document processing", func() { - - Context("article docs", func() { - - It("should retain attributes passed in configuration", func() { - source := `[source] ----- -foo -----` - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrSyntaxHighlighter: "pygments", - }, - Elements: []interface{}{ - types.ListingBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Source, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source, configuration.WithAttributes(map[string]string{ - types.AttrSyntaxHighlighter: "pygments", - }))).To(Equal(expected)) - }) - - It("should include toc and preamble", func() { - source := `= A title -:toc: - -Preamble comes here - -== Section A - -=== Section A.a - -== Section B - -== Section C` - headerTitle := []interface{}{ - types.StringElement{ - Content: "A title", - }, - } - titleSectionA := []interface{}{ - types.StringElement{ - Content: "Section A", - }, - } - titleSectionAa := []interface{}{ - types.StringElement{ - Content: "Section A.a", - }, - } - titleSectionB := []interface{}{ - types.StringElement{ - Content: "Section B", - }, - } - titleSectionC := []interface{}{ - types.StringElement{ - Content: "Section C", - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrTableOfContents: nil, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_a_title", - }, - Title: headerTitle, - Elements: []interface{}{ - types.TableOfContentsPlaceHolder{}, - types.Preamble{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "Preamble comes here", - }, - }, - }, - }, - }, - }, - types.Section{ - Level: 1, - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - Title: titleSectionA, - Elements: []interface{}{ - types.Section{ - Level: 2, - Attributes: types.Attributes{ - types.AttrID: "_section_a_a", - }, - Title: titleSectionAa, - Elements: []interface{}{}, - }, - }, - }, - types.Section{ - Level: 1, - Attributes: types.Attributes{ - types.AttrID: "_section_b", - }, - Title: titleSectionB, - Elements: []interface{}{}, - }, - types.Section{ - Level: 1, - Attributes: types.Attributes{ - types.AttrID: "_section_c", - }, - Title: titleSectionC, - Elements: []interface{}{}, - }, - }, - }, - }, - ElementReferences: types.ElementReferences{ - "_a_title": headerTitle, - "_section_a": titleSectionA, - "_section_a_a": titleSectionAa, - "_section_b": titleSectionB, - "_section_c": titleSectionC, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - }) - - Context("manpage docs", func() { - - It("manpage without preamble", func() { - source := `= eve(1) -Andrew Stanton -v1.0.0 - -== Name - -eve - analyzes an image to determine if it's a picture of a life form - -== Synopsis -` - headerSectionTitle := []interface{}{ - types.StringElement{ - Content: "eve(1)", - }, - } - nameSectionTitle := []interface{}{ - types.StringElement{ - Content: "Name", - }, - } - synopisSectionTitle := []interface{}{ - types.StringElement{ - Content: "Synopsis", - }, - } - - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrDocType: "manpage", - types.AttrAuthors: []types.DocumentAuthor{ - { - FullName: "Andrew Stanton", - }, - }, - "firstname": "Andrew", - "lastname": "Stanton", - "author": "Andrew Stanton", - "authorinitials": "AS", - types.AttrRevision: types.DocumentRevision{ - Revnumber: "1.0.0", - }, - "revnumber": "1.0.0", - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_eve_1", - }, - Title: headerSectionTitle, - Elements: []interface{}{ - types.Section{ - Level: 1, - Attributes: types.Attributes{ - types.AttrID: "_name", - }, - Title: nameSectionTitle, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "eve - analyzes an image to determine if it\u2019s a picture of a life form", - }, - }, - }, - }, - }, - }, - types.Section{ - Level: 1, - Attributes: types.Attributes{ - types.AttrID: "_synopsis", - }, - Title: synopisSectionTitle, - Elements: []interface{}{}, - }, - }, - }, - }, - ElementReferences: types.ElementReferences{ - "_eve_1": headerSectionTitle, - "_name": nameSectionTitle, - "_synopsis": synopisSectionTitle, - }, - } - Expect(ParseDocument(source, - configuration.WithAttributes(map[string]string{ - types.AttrDocType: "manpage", - }, - ))).To(MatchDocument(expected)) - }) - - }) -}) diff --git a/pkg/parser/document_test.go b/pkg/parser/document_test.go index 56367a76..88a42279 100644 --- a/pkg/parser/document_test.go +++ b/pkg/parser/document_test.go @@ -10,12 +10,12 @@ import ( var _ = Describe("documents", func() { - Context("draft documents", func() { + Context("raw documents", func() { It("should parse empty document", func() { source := `` - expected := types.DraftDocument{} - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + expected := []types.DocumentFragment{} + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("should parse header without empty first line", func() { @@ -23,42 +23,38 @@ var _ = Describe("documents", func() { Garrett D'Amore 1.0, July 4, 2020 ` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "revnumber": "1.0", - "revdate": "July 4, 2020", - "author": "Garrett D'Amore", - "authorinitials": "GD", - "authors": []types.DocumentAuthor{ - { - FullName: "Garrett D'Amore", - Email: "", - }, - }, - "firstname": "Garrett", - "lastname": "D'Amore", - "revision": types.DocumentRevision{ - Revnumber: "1.0", - Revdate: "July 4, 2020", - Revremark: "", - }, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - "id": "_my_title", - }, - Title: []interface{}{ - types.StringElement{ - Content: "My title", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + types.RawLine("My title"), + }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "Garrett", + LastName: "D'Amore", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + Revdate: "July 4, 2020", + }, + }, }, }, - Elements: []interface{}{}, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) @@ -67,54 +63,115 @@ Garrett D'Amore = My title Garrett D'Amore 1.0, July 4, 2020` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "revnumber": "1.0", - "revdate": "July 4, 2020", - "author": "Garrett D'Amore", - "authorinitials": "GD", - "authors": []types.DocumentAuthor{ - { - FullName: "Garrett D'Amore", - Email: "", - }, - }, - "firstname": "Garrett", - "lastname": "D'Amore", - "revision": types.DocumentRevision{ - Revnumber: "1.0", - Revdate: "July 4, 2020", - Revremark: "", - }, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - "id": "_my_title", - }, - Title: []interface{}{ - types.StringElement{ - Content: "My title", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + types.RawLine("My title"), + }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "Garrett", + LastName: "D'Amore", + }, + }, + }, + }, + &types.AttributeDeclaration{ + Name: types.AttrRevision, + Value: &types.DocumentRevision{ + Revnumber: "1.0", + Revdate: "July 4, 2020", + }, + }, }, }, - Elements: []interface{}{}, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) }) - Context("final documents", func() { + Context("in final documents", func() { It("should parse empty document", func() { source := `` - expected := types.Document{ - Elements: []interface{}{}, + expected := &types.Document{} + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("should parse basic document", func() { + source := `== Lorem Ipsum + +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, +sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. +At vero eos et accusam et justo duo dolores et ea rebum. +Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, +sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. +At vero eos et accusam et justo duo dolores et ea rebum. +Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit *amet*.` + + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_lorem_ipsum", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Lorem Ipsum", + }, + }, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + // suffix spaces are trimmed on each line + Content: `Lorem ipsum dolor sit amet, consetetur sadipscing elitr, +sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. +At vero eos et accusam et justo duo dolores et ea rebum. +Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. +Lorem ipsum dolor sit amet, consetetur sadipscing elitr, +sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, +sed diam voluptua. +At vero eos et accusam et justo duo dolores et ea rebum. +Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit `, + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "amet", + }, + }, + }, + &types.StringElement{ + Content: ".", + }, + }, + }, + }, + }, + }, + ElementReferences: types.ElementReferences{ + "_lorem_ipsum": []interface{}{ + &types.StringElement{Content: "Lorem Ipsum"}, + }, + }, } - Expect(ParseDocument(source)).To(Equal(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) }) diff --git a/pkg/parser/element_attributes_test.go b/pkg/parser/element_attributes_test.go index e38376bf..ab690890 100644 --- a/pkg/parser/element_attributes_test.go +++ b/pkg/parser/element_attributes_test.go @@ -3,6 +3,7 @@ package parser_test import ( "github.com/bytesparadise/libasciidoc/pkg/types" . "github.com/bytesparadise/libasciidoc/testsupport" + "github.com/sirupsen/logrus" . "github.com/onsi/ginkgo" //nolint golint . "github.com/onsi/gomega" //nolint golint @@ -10,7 +11,7 @@ import ( var _ = Describe("element attributes", func() { - Context("final documents", func() { + Context("in final documents", func() { Context("element links", func() { @@ -19,17 +20,15 @@ var _ = Describe("element attributes", func() { It("element link alone", func() { source := `[link=http://foo.bar] a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ "link": "http://foo.bar", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph", }, }, }, @@ -40,17 +39,15 @@ a paragraph` It("spaces in link", func() { source := `[link= http://foo.bar ] a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ "link": "http://foo.bar", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph", }, }, }, @@ -63,22 +60,29 @@ a paragraph` Context("with invalid syntax", func() { It("spaces before keyword", func() { + // Note: Asciidoctor will produce a different output in this case source := `[ link=http://foo.bar] a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "[ link=http://foo.bar]", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "[ link=", }, - { - types.StringElement{ - Content: "a paragraph", + &types.InlineLink{ + Location: &types.Location{ + Scheme: "http://", + Path: []interface{}{ + &types.StringElement{ + Content: "foo.bar", + }, + }, }, }, + &types.StringElement{ + Content: "]\na paragraph", + }, }, }, }, @@ -87,22 +91,29 @@ a paragraph` }) It("unbalanced brackets", func() { + // Note: Asciidoctor will produce a different output in this case source := `[link=http://foo.bar a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "[link=http://foo.bar", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "[link=", }, - { - types.StringElement{ - Content: "a paragraph", + &types.InlineLink{ + Location: &types.Location{ + Scheme: "http://", + Path: []interface{}{ + &types.StringElement{ + Content: "foo.bar", + }, + }, }, }, + &types.StringElement{ + Content: "\na paragraph", + }, }, }, }, @@ -119,17 +130,15 @@ a paragraph` It("normal syntax", func() { source := `[[img-foobar]] a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrID: "img-foobar", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph", }, }, }, @@ -141,17 +150,15 @@ a paragraph` It("short-hand syntax", func() { source := `[#img-foobar] a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrID: "img-foobar", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph", }, }, }, @@ -166,19 +173,12 @@ a paragraph` It("extra spaces", func() { source := `[ #img-foobar ] a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "[ #img-foobar ]", - }, - }, - { - types.StringElement{ - Content: "a paragraph", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "[ #img-foobar ]\na paragraph", }, }, }, @@ -190,19 +190,12 @@ a paragraph` It("unbalanced brackets", func() { source := `[#img-foobar a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "[#img-foobar", - }, - }, - { - types.StringElement{ - Content: "a paragraph", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "[#img-foobar\na paragraph", }, }, }, @@ -220,17 +213,15 @@ a paragraph` It("valid element title", func() { source := `.a title a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrTitle: "a title", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph", }, }, }, @@ -245,25 +236,18 @@ a paragraph` It("extra space after dot", func() { source := `. a title a list item!` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a title", - }, - }, - { - types.StringElement{ - Content: "a list item!", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a title\na list item!", }, }, }, @@ -280,19 +264,12 @@ a list item!` source := `!a title a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "!a title", - }, - }, - { - types.StringElement{ - Content: "a paragraph", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "!a title\na paragraph", }, }, }, @@ -310,17 +287,15 @@ a paragraph` It("shortcut role element", func() { source := `[.a_role] a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrRoles: []interface{}{"a_role"}, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph", }, }, }, @@ -332,17 +307,15 @@ a paragraph` It("full role syntax", func() { source := `[role=a_role] a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrRoles: []interface{}{"a_role"}, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph", }, }, }, @@ -353,18 +326,22 @@ a paragraph` }) It("blank line after role attribute", func() { + // blanklines after attributes are not supported in Libasciidoc source := `[.a_role] a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - // attribute was attached to blankline, which was filtered out in the final doc - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{ + &types.Paragraph{ + // Attributes: types.Attributes{ + // types.AttrRoles: []interface{}{ + // "a_role", + // }, + // }, + Elements: []interface{}{ + &types.StringElement{ Content: "a paragraph", }, - }, }, }, }, @@ -373,21 +350,25 @@ a paragraph` }) It("blank lines after id, role and title attributes", func() { + // blanklines after attributes are not supported in Libasciidoc source := `[.a_role] [[ID]] .title a paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - // attributes were attached to blankline, which was filtered out in the final doc - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{ + &types.Paragraph{ + // Attributes: types.Attributes{ + // types.AttrID: "ID", + // types.AttrTitle: "title", + // types.AttrRoles: []interface{}{"a_role"}, + // }, + Elements: []interface{}{ + &types.StringElement{ Content: "a paragraph", }, - }, }, }, }, @@ -399,38 +380,39 @@ a paragraph` Context("standalone attributes", func() { It("single standalone attribute", func() { + // TODO: find a way to avoid error in the logs + _, restoreLogger := ConfigureLogger(logrus.FatalLevel) + defer restoreLogger() source := `[.a_role] ` - expected := types.Document{ - Elements: []interface{}{}, - } + expected := &types.Document{} Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("multiple standalone attributes", func() { + _, restoreLogger := ConfigureLogger(logrus.FatalLevel) + defer restoreLogger() source := `[.a_role] [[ID]] .title` - expected := types.Document{ - Elements: []interface{}{}, - } + expected := &types.Document{} Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("multiple standalone attributes after a paragraph", func() { + _, restoreLogger := ConfigureLogger(logrus.FatalLevel) + defer restoreLogger() source := `a paragraph [.a_role] [[ID]] .title` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph", }, }, }, diff --git a/pkg/parser/footnote_test.go b/pkg/parser/footnote_test.go index b98ed89d..47576845 100644 --- a/pkg/parser/footnote_test.go +++ b/pkg/parser/footnote_test.go @@ -10,34 +10,32 @@ import ( . "github.com/onsi/gomega" //nolint golint ) -var _ = Describe("footnotes - document", func() { +var _ = Describe("footnotes", func() { - Context("final documents", func() { + Context("in final documents", func() { It("footnote with single-line content", func() { footnoteContent := "some content" source := fmt.Sprintf(`foo footnote:[%s]`, footnoteContent) - expected := types.Document{ - Footnotes: []types.Footnote{ - { - ID: 1, + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ Elements: []interface{}{ - types.StringElement{ - Content: footnoteContent, + &types.StringElement{ + Content: "foo ", + }, + &types.FootnoteReference{ + ID: 1, }, }, }, }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo ", - }, - types.FootnoteReference{ - ID: 1, - }, + Footnotes: []*types.Footnote{ + { + ID: 1, + Elements: []interface{}{ + &types.StringElement{ + Content: footnoteContent, }, }, }, @@ -50,28 +48,28 @@ var _ = Describe("footnotes - document", func() { source := `foo footnote:[some *rich* https://foo.com[content]]` footnote1 := types.Footnote{ Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "some ", }, - types.QuotedText{ + &types.QuotedText{ Kind: types.SingleQuoteBold, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "rich", }, }, }, - types.StringElement{ + &types.StringElement{ Content: " ", }, - types.InlineLink{ + &types.InlineLink{ Attributes: types.Attributes{ types.AttrInlineLinkText: "content", }, - Location: types.Location{ + Location: &types.Location{ Scheme: "https://", Path: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "foo.com", }, }, @@ -79,23 +77,21 @@ var _ = Describe("footnotes - document", func() { }, }, } - expected := types.Document{ - Footnotes: []types.Footnote{ + expected := &types.Document{ + Footnotes: []*types.Footnote{ { ID: 1, Elements: footnote1.Elements, }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo ", - }, - types.FootnoteReference{ - ID: 1, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "foo ", + }, + &types.FootnoteReference{ + ID: 1, }, }, }, @@ -106,27 +102,25 @@ var _ = Describe("footnotes - document", func() { It("footnote in a paragraph", func() { source := `This is another paragraph.footnote:[I am footnote text and will be displayed at the bottom of the article.]` - expected := types.Document{ - Footnotes: []types.Footnote{ + expected := &types.Document{ + Footnotes: []*types.Footnote{ { ID: 1, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "I am footnote text and will be displayed at the bottom of the article.", }, }, }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "This is another paragraph.", - }, - types.FootnoteReference{ - ID: 1, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "This is another paragraph.", + }, + &types.FootnoteReference{ + ID: 1, }, }, }, @@ -141,12 +135,12 @@ A bold statement!footnote:disclaimer[Opinions are my own.] Another outrageous statement.footnote:disclaimer[]` - expected := types.Document{ - Footnotes: []types.Footnote{ + expected := &types.Document{ + Footnotes: []*types.Footnote{ { ID: 1, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "a regular footnote.", }, }, @@ -155,45 +149,39 @@ Another outrageous statement.footnote:disclaimer[]` ID: 2, Ref: "disclaimer", Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Opinions are my own.", }, }, }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "A statement.", - }, - types.FootnoteReference{ - ID: 1, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "A statement.", }, - { - types.StringElement{ - Content: "A bold statement!", - }, - types.FootnoteReference{ - ID: 2, - Ref: "disclaimer", - }, + &types.FootnoteReference{ + ID: 1, + }, + &types.StringElement{ + Content: "\nA bold statement!", + }, + &types.FootnoteReference{ + ID: 2, + Ref: "disclaimer", }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "Another outrageous statement.", - }, - types.FootnoteReference{ - ID: 2, - Ref: "disclaimer", - Duplicate: true, // this FootnoteReference targets an already-existing footnote - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Another outrageous statement.", + }, + &types.FootnoteReference{ + ID: 2, + Ref: "disclaimer", + Duplicate: true, // this FootnoteReference targets an already-existing footnote }, }, }, @@ -202,10 +190,9 @@ Another outrageous statement.footnote:disclaimer[]` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("footnotes in document", func() { + It("in section and paragraphs", func() { source := `= title -:idprefix: id_ a premable with a footnote:[foo] @@ -213,32 +200,23 @@ a premable with a footnote:[foo] a paragraph with another footnote.footnote:[baz]` - docTitle := []interface{}{ - types.StringElement{ - Content: "title", - }, - } section1Title := []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "section 1 ", }, - types.FootnoteReference{ + &types.FootnoteReference{ ID: 2, }, } - expected := types.Document{ - Attributes: types.Attributes{ - "idprefix": "id_", - }, + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "id_title": docTitle, - "id_section_1": section1Title, + "_section_1": section1Title, }, - Footnotes: []types.Footnote{ + Footnotes: []*types.Footnote{ { ID: 1, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "foo", }, }, @@ -246,7 +224,7 @@ a paragraph with another footnote.footnote:[baz]` { ID: 2, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "bar", }, }, @@ -254,54 +232,48 @@ a paragraph with another footnote.footnote:[baz]` { ID: 3, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "baz", }, }, }, }, Elements: []interface{}{ - types.Section{ - Level: 0, - Title: docTitle, - Attributes: types.Attributes{ - types.AttrID: "id_title", + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "title", + }, }, + }, + &types.Preamble{ // preamble is inserted Elements: []interface{}{ - types.Preamble{ // preamble is inserted + &types.Paragraph{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a premable with a ", - }, - types.FootnoteReference{ - ID: 1, - }, - }, - }, + &types.StringElement{ + Content: "a premable with a ", + }, + &types.FootnoteReference{ + ID: 1, }, }, }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "id_section_1", - }, - Level: 1, - Title: section1Title, + }, + }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_1", + }, + Level: 1, + Title: section1Title, + Elements: []interface{}{ + &types.Paragraph{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph with another footnote.", - }, - types.FootnoteReference{ - ID: 3, - }, - }, - }, + &types.StringElement{ + Content: "a paragraph with another footnote.", + }, + &types.FootnoteReference{ + ID: 3, }, }, }, diff --git a/pkg/parser/frontmatter_test.go b/pkg/parser/frontmatter_test.go index af8dc633..cc7d189c 100644 --- a/pkg/parser/frontmatter_test.go +++ b/pkg/parser/frontmatter_test.go @@ -10,28 +10,28 @@ import ( var _ = Describe("front-matters", func() { - Context("final documents", func() { + Context("in final documents", func() { Context("yaml front-matter", func() { - It("front-matter with simple attributes", func() { + It("with simple attributes", func() { source := `--- title: a title author: Xavier --- first paragraph` - expected := types.Document{ - Attributes: types.Attributes{ - "title": "a title", // TODO: convert `title` attribute from front-matter into `doctitle` here ? - "author": "Xavier", - }, + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "first paragraph"}, - }, + &types.FrontMatter{ + Attributes: types.Attributes{ + "title": "a title", // TODO: convert `title` attribute from front-matter into `doctitle` here ? + "author": "Xavier", + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "first paragraph"}, }, }, }, @@ -44,13 +44,12 @@ first paragraph` --- first paragraph` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "first paragraph"}, - }, + &types.FrontMatter{}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "first paragraph"}, }, }, }, diff --git a/pkg/parser/generate.go b/pkg/parser/generate.go index b0587bb5..5a60c7f4 100644 --- a/pkg/parser/generate.go +++ b/pkg/parser/generate.go @@ -1,3 +1,3 @@ package parser -//go:generate pigeon -optimize-parser -optimize-grammar -alternate-entrypoints RawSource,RawDocument,DocumentBlock,FileLocation,IncludedFileLine,LabeledListItemTerm,SpecialCharacterSubs,MarkdownQuoteAttribution,QuotedTextSubs,NoneSubs,AttributeSubs,ReplacementSubs,PostReplacementSubs,InlinePassthroughSubs,CalloutSubs,InlineMacroSubs,MarkdownQuoteMacroSubs,BlockAttributes,InlineAttributes,LineRanges,TagRanges -o parser.go parser.peg +//go:generate pigeon -optimize-parser -optimize-grammar -alternate-entrypoints DocumentFragment,PostReplacementsGroup,DelimitedBlockElements,ElementAttributesGroup,DocumentFragmentWithinVerbatimBlock,NormalGroup,HeaderGroup,AttributesGroup,MacrosGroup,QuotesGroup,NoneGroup,ReplacementsGroup,SpecialCharactersGroup,VerbatimGroup,FileLocation,IncludedFileLine,MarkdownQuoteAttribution,BlockAttributes,InlineAttributes,TableColumnsAttribute,LineRanges,TagRanges -o parser.go parser.peg diff --git a/pkg/parser/icon_test.go b/pkg/parser/icon_test.go index 98de8fbc..dee85f15 100644 --- a/pkg/parser/icon_test.go +++ b/pkg/parser/icon_test.go @@ -15,239 +15,221 @@ var _ = Describe("icons", func() { It("inline icon with empty alt only", func() { source := "icon:tip[]" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.Icon{ - Class: "tip", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.Icon{ + Class: "tip", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("inline icon with empty alt and trailing spaces", func() { source := "icon:note[] \t\t " - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.Icon{ - Class: "note", - }, - types.StringElement{ - Content: " \t\t ", - }, + &types.Paragraph{ + Elements: []interface{}{ + // suffix spaces are trimmed on each line + &types.Icon{ + Class: "note", }, + // &types.StringElement{ + // Content: " \t\t ", + // }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("inline icon with empty alt surrounded by text", func() { source := "beware icon:caution[] of tigers" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "beware ", - }, - types.Icon{ - Class: "caution", - }, - types.StringElement{ - Content: " of tigers", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "beware ", + }, + &types.Icon{ + Class: "caution", + }, + &types.StringElement{ + Content: " of tigers", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("inline icon with size alone", func() { source := "icon:caution[2x]" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.Icon{ - Class: "caution", - Attributes: types.Attributes{types.AttrIconSize: "2x"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.Icon{ + Class: "caution", + Attributes: types.Attributes{types.AttrIconSize: "2x"}, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("inline icon with other attribute (title)", func() { source := "icon:caution[title=\"bogus\"]" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.Icon{ - Class: "caution", - Attributes: types.Attributes{types.AttrTitle: "bogus"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.Icon{ + Class: "caution", + Attributes: types.Attributes{types.AttrTitle: "bogus"}, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("inline icon with anchor attribute", func() { source := "icon:caution[id=anchor]" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.Icon{ - Class: "caution", - Attributes: types.Attributes{ - types.AttrID: "anchor", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.Icon{ + Class: "caution", + Attributes: types.Attributes{ + types.AttrID: "anchor", }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("inline icon with multiple other attributes", func() { - source := "icon:caution[id=anchor,title=\"White Fang\"]" - expected := types.DraftDocument{ + source := `icon:caution[id=anchor,title="White Fang"]` + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.Icon{ - Class: "caution", - Attributes: types.Attributes{ - types.AttrID: "anchor", - types.AttrTitle: "White Fang", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.Icon{ + Class: "caution", + Attributes: types.Attributes{ + types.AttrID: "anchor", + types.AttrTitle: "White Fang", }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("inline icon with size and multiple other attributes", func() { source := "icon:caution[fw,id=anchor,title=\"White Fang\"]" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.Icon{ - Class: "caution", - Attributes: types.Attributes{ - types.AttrID: "anchor", - types.AttrTitle: "White Fang", - types.AttrIconSize: "fw", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.Icon{ + Class: "caution", + Attributes: types.Attributes{ + types.AttrID: "anchor", + types.AttrTitle: "White Fang", + types.AttrIconSize: "fw", }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("inline icon with space after colon", func() { source := "here is my icon: icon:info[]" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "here is my icon: ", - }, - types.Icon{ - Class: "info", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "here is my icon: ", + }, + &types.Icon{ + Class: "info", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("inline icon in title works", func() { source := `== a icon:note[] from me` - expected := types.DraftDocument{ + title := []interface{}{ + &types.StringElement{ + Content: "a ", + }, + &types.Icon{ + Class: "note", + }, + &types.StringElement{ + Content: " from me", + }, + } + expected := &types.Document{ Elements: []interface{}{ - types.Section{ + &types.Section{ Attributes: types.Attributes{ types.AttrID: "_a_note_from_me", }, Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "a ", - }, - types.Icon{ - Class: "note", - }, - types.StringElement{ - Content: " from me", - }, - }, - Elements: []interface{}{}, + Title: title, }, }, + ElementReferences: types.ElementReferences{ + "_a_note_from_me": title, + }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("inline icon at title start", func() { source := `= icon:warning[] or what icon:note[] to do` - expected := types.DraftDocument{ + title := []interface{}{ + &types.Icon{Class: "warning"}, + &types.StringElement{Content: " or what "}, + &types.Icon{Class: "note"}, + &types.StringElement{Content: " to do"}, + } + expected := &types.Document{ Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_warning_or_what_note_to_do", - }, - Title: []interface{}{ - types.Icon{Class: "warning"}, - types.StringElement{Content: " or what "}, - types.Icon{Class: "note"}, - types.StringElement{Content: " to do"}, - }, - Elements: []interface{}{}, + &types.DocumentHeader{ + Title: title, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) // Note that the parsing that occurs here does not include the re-parse of the list item term. @@ -255,38 +237,34 @@ var _ = Describe("icons", func() { It("inline icon as labeled list item description", func() { source := `discount:: icon:tags[alt="Discount"] Cheap cheap! item 2:: two` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: "::", Term: []interface{}{ - types.StringElement{Content: "discount"}, + &types.StringElement{Content: "discount"}, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.Icon{Class: "tags", Attributes: types.Attributes{types.AttrImageAlt: "Discount"}}, - types.StringElement{Content: " Cheap cheap!"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.Icon{Class: "tags", Attributes: types.Attributes{types.AttrImageAlt: "Discount"}}, + &types.StringElement{Content: " Cheap cheap!"}, }, }, }, }, - { - Level: 1, + &types.LabeledListElement{ + Style: "::", Term: []interface{}{ - types.StringElement{Content: "item 2"}, + &types.StringElement{Content: "item 2"}, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "two"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "two"}, }, }, }, @@ -301,96 +279,88 @@ item 2:: two` It("inline icon in quoted text", func() { source := `an _italicized icon:warning[] message_` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "an ", - }, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italicized "}, - types.Icon{Class: "warning"}, - types.StringElement{Content: " message"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "an ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "italicized "}, + &types.Icon{Class: "warning"}, + &types.StringElement{Content: " message"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("inline icon in marked text", func() { source := `#marked icon:warning[] message#` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMarked, - Elements: []interface{}{ - types.StringElement{Content: "marked "}, - types.Icon{Class: "warning"}, - types.StringElement{Content: " message"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMarked, + Elements: []interface{}{ + &types.StringElement{Content: "marked "}, + &types.Icon{Class: "warning"}, + &types.StringElement{Content: " message"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("inline icon in bold text", func() { source := `in *bold icon:warning[] message*` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "in "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold "}, - types.Icon{Class: "warning"}, - types.StringElement{Content: " message"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "in "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold "}, + &types.Icon{Class: "warning"}, + &types.StringElement{Content: " message"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("inline icon in monospace text", func() { source := "in `monospace icon:warning[] message`" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "in "}, - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "monospace "}, - types.Icon{Class: "warning"}, - types.StringElement{Content: " message"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "in "}, + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "monospace "}, + &types.Icon{Class: "warning"}, + &types.StringElement{Content: " message"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) }) diff --git a/pkg/parser/image_test.go b/pkg/parser/image_test.go index c51b5916..d37f5115 100644 --- a/pkg/parser/image_test.go +++ b/pkg/parser/image_test.go @@ -10,224 +10,50 @@ import ( var _ = Describe("block images", func() { - Context("draft documents", func() { + Context("in final documents", func() { It("with empty alt", func() { - source := "image::images/foo.png[]" - expected := types.DraftDocument{ + source := "image::images/cookie.png[]" + expected := &types.Document{ Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ + &types.ImageBlock{ + Location: &types.Location{ Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with empty alt and trailing spaces", func() { - source := "image::images/foo.png[] \t\t " - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with alt", func() { - source := `image::images/foo.png[the foo.png image]` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: "the foo.png image", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + &types.StringElement{ + Content: "images/cookie.png", + }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("with attribute alt", func() { - source := `:alt: the foo.png image + It("with attribute substitution in alt text", func() { + source := `:alt: the cookie.png image -image::images/foo.png[{alt}]` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "alt": "the foo.png image", - }, +image::images/cookie.png[{alt}]` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "alt": "the cookie.png image", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "alt", - Value: "the foo.png image", + Value: "the cookie.png image", }, - types.BlankLine{}, - types.ImageBlock{ + &types.ImageBlock{ Attributes: types.Attributes{ - types.AttrImageAlt: "the foo.png image", // substituted + types.AttrImageAlt: "the cookie.png image", // substituted }, - Location: types.Location{ + Location: &types.Location{ Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with quoted text in attribute alt", func() { - source := `image::images/foo.png[*alt text*]` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "alt text", - }, - }, + &types.StringElement{ + Content: "images/cookie.png", }, }, }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with dimensions and id link title meta", func() { - source := `[#img-foobar] -.A title to foobar -[link=http://foo.bar] -image::images/foo.png[the foo.png image, 600, 400]` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrID: "img-foobar", - // types.AttrCustomID: true, true, - types.AttrTitle: "A title to foobar", - types.AttrInlineLink: "http://foo.bar", - types.AttrImageAlt: "the foo.png image", - types.AttrWidth: "600", - types.AttrHeight: "400", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - It("with roles", func() { - source := `[.role1.role2] -image::images/foo.png[the foo.png image, 600, 400]` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: "the foo.png image", - types.AttrWidth: "600", - types.AttrHeight: "400", - types.AttrRoles: []interface{}{"role1", "role2"}, - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - }, - } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) - }) - - It("with special characters", func() { - source := `image::http://example.com/foo.png?a=1&b=2[]` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ - Scheme: "http://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com/foo.png?a=1&b=2", // no special character substitution on image block location - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("final documents", func() { - - It("with empty alt", func() { - source := "image::images/foo.png[]" - expected := types.Document{ - Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("with attribute alt", func() { - source := `:alt: the foo.png image - -image::images/foo.png[{alt}]` - expected := types.Document{ - Attributes: types.Attributes{ - "alt": "the foo.png image", - }, - Elements: []interface{}{ - types.ImageBlock{ - Attributes: types.Attributes{ - types.AttrImageAlt: "the foo.png image", // substituted - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, }, }, } @@ -238,17 +64,22 @@ image::images/foo.png[{alt}]` source := ` :imagesdir: ./path/to/images -image::foo.png[]` - expected := types.Document{ - Attributes: types.Attributes{ - "imagesdir": "./path/to/images", - }, +image::cookie.png[]` + expected := &types.Document{ + // Attributes: types.Attributes{ + // types.AttrImagesDir: "./path/to/images", + // }, Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ + &types.AttributeDeclaration{ + Name: "imagesdir", + Value: "./path/to/images", + }, + &types.ImageBlock{ + Location: &types.Location{ Path: []interface{}{ - types.StringElement{Content: "./path/to/images/"}, - types.StringElement{Content: "foo.png"}, + &types.StringElement{ + Content: "./path/to/images/cookie.png", + }, }, }, }, @@ -261,16 +92,22 @@ image::foo.png[]` source := ` :dir: ./path/to/images -image::{dir}/foo.png[]` - expected := types.Document{ - Attributes: types.Attributes{ - "dir": "./path/to/images", - }, +image::{dir}/cookie.png[]` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "dir": "./path/to/images", + // }, Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ + &types.AttributeDeclaration{ + Name: "dir", + Value: "./path/to/images", + }, + &types.ImageBlock{ + Location: &types.Location{ Path: []interface{}{ - types.StringElement{Content: "./path/to/images/foo.png"}, + &types.StringElement{ + Content: "./path/to/images/cookie.png", + }, }, }, }, @@ -283,17 +120,22 @@ image::{dir}/foo.png[]` source := ` :imagesdir: ./path/to/images -image::foo.png[]` - expected := types.Document{ - Attributes: types.Attributes{ - "imagesdir": "./path/to/images", - }, +image::cookie.png[]` + expected := &types.Document{ + // Attributes: types.Attributes{ + // types.AttrImagesDir: "./path/to/images", + // }, Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ + &types.AttributeDeclaration{ + Name: "imagesdir", + Value: "./path/to/images", + }, + &types.ImageBlock{ + Location: &types.Location{ Path: []interface{}{ - types.StringElement{Content: "./path/to/images/"}, - types.StringElement{Content: "foo.png"}, + &types.StringElement{ + Content: "./path/to/images/cookie.png", + }, }, }, }, @@ -306,17 +148,22 @@ image::foo.png[]` source := ` :imagesdir: ./path/to/images -image::{imagesdir}/foo.png[]` - expected := types.Document{ - Attributes: types.Attributes{ - "imagesdir": "./path/to/images", - }, +image::{imagesdir}/cookie.png[]` + expected := &types.Document{ + // Attributes: types.Attributes{ + // types.AttrImagesDir: "./path/to/images", + // }, Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ + &types.AttributeDeclaration{ + Name: "imagesdir", + Value: "./path/to/images", + }, + &types.ImageBlock{ + Location: &types.Location{ Path: []interface{}{ - types.StringElement{Content: "./path/to/images/"}, - types.StringElement{Content: "./path/to/images/foo.png"}, + &types.StringElement{ + Content: "./path/to/images/./path/to/images/cookie.png", + }, }, }, }, @@ -326,434 +173,138 @@ image::{imagesdir}/foo.png[]` }) It("2 block images", func() { - source := `image::images/foo.png[] -image::images/bar.png[]` - expected := types.Document{ + source := `image::images/cookie.png[] +image::images/pasta.png[]` + expected := &types.Document{ Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ + &types.ImageBlock{ + Location: &types.Location{ Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - types.ImageBlock{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/bar.png"}, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - }) - - Context("errors", func() { - - It("appending inline content", func() { - source := "a paragraph\nimage::images/foo.png[]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph", - }, - }, - { - types.StringElement{ - Content: "image::images/foo.png[]", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("paragraph with block image with alt and dimensions", func() { - source := "a foo image::foo.png[foo image, 600, 400] bar" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a foo image::foo.png[foo image, 600, 400] bar"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) -}) - -var _ = Describe("inline images", func() { - - Context("draft documents", func() { - - It("with empty alt only", func() { - source := "image:images/foo.png[]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, + &types.StringElement{ + Content: "images/cookie.png", }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with empty alt and trailing spaces", func() { - source := "image:images/foo.png[] \t\t " - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - types.StringElement{ - Content: " \t\t ", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("surrounded with test", func() { - source := "a foo image:images/foo.png[] bar..." - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a foo ", - }, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - types.StringElement{ - Content: " bar\u2026\u200b", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with alt alone", func() { - source := "image:images/foo.png[the foo.png image]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "the foo.png image", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with alt and width", func() { - source := "image:images/foo.png[the foo.png image, 600]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "the foo.png image", - types.AttrWidth: "600", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with alt, width and height", func() { - source := "image:images/foo.png[the foo.png image, 600, 400]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "the foo.png image", - types.AttrWidth: "600", - types.AttrHeight: "400", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, + &types.ImageBlock{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "images/pasta.png", }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("with alt, but empty width and height", func() { - source := "image:images/foo.png[the foo.png image, , ]" - expected := types.DraftDocument{ + It("with role above", func() { + source := `.mytitle +[#myid] +[.myrole] +image::cookie.png[cookie image, 600, 400]` + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "the foo.png image", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, + &types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrID: "myid", + types.AttrTitle: "mytitle", + types.AttrRoles: []interface{}{ + "myrole", }, + types.AttrImageAlt: "cookie image", + types.AttrWidth: "600", + types.AttrHeight: "400", }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with single other attribute only", func() { - source := "image:images/foo.png[id=myid]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrID: "myid", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "cookie.png", }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("with multiple other attributes only", func() { - source := "image:images/foo.png[id=myid, title= mytitle, role = myrole ]" - expected := types.DraftDocument{ + It("with link", func() { + source := "image::cookie.png[cookie image, link=https://cookie.dev]" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrID: "myid", - types.AttrTitle: "mytitle", - types.AttrRoles: []interface{}{"myrole"}, - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - }, + &types.ImageBlock{ + Attributes: types.Attributes{ + types.AttrImageAlt: "cookie image", + types.AttrInlineLink: "https://cookie.dev", }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with alt, width, height and other attributes", func() { - source := "image:images/foo.png[foo, 600, 400, id=myid, title=mytitle, role=myrole ]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineImage{ - Attributes: types.Attributes{ - types.AttrImageAlt: "foo", - types.AttrWidth: "600", - types.AttrHeight: "400", - types.AttrID: "myid", - // types.AttrCustomID: true, true, - types.AttrTitle: "mytitle", - types.AttrRoles: []interface{}{"myrole"}, - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "cookie.png", }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + }) - It("in a paragraph with space after colon", func() { - source := "this is an image: image:images/foo.png[]" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "this is an image: ", - }, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + Context("errors", func() { - It("in a paragraph without space separator", func() { - source := "this is an inline.image:images/foo.png[]" - expected := types.DraftDocument{ + It("appending inline content", func() { + source := "a paragraph\nimage::images/cookie.png[]" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "this is an inline.", - }, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, - }, - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph\nimage::images/cookie.png[]", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("with special characters", func() { - source := `image:http://example.com/foo.png?a=1&b=2[]` - expected := types.DraftDocument{ + It("paragraph with block image with alt and dimensions", func() { + source := "a cookie image::cookie.png[cookie image, 600, 400] image" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineImage{ - Location: types.Location{ - Scheme: "http://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com/foo.png?a=1", - }, - types.SpecialCharacter{ - Name: "&", - }, - types.StringElement{ - Content: "b=2", - }, - }, - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a cookie image::cookie.png[cookie image, 600, 400] image", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - }) +}) + +var _ = Describe("inline images", func() { - Context("final documents", func() { + Context("in final documents", func() { It("with empty alt only", func() { - source := "image:images/foo.png[]" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "images/foo.png"}, + source := "image:images/cookie.png[]" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.InlineImage{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "images/cookie.png", }, }, }, @@ -769,24 +320,32 @@ var _ = Describe("inline images", func() { source := ` :dir: ./path/to/images -an image:{dir}/foo.png[].` - expected := types.Document{ - Attributes: types.Attributes{ - "dir": "./path/to/images", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "an "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "./path/to/images/foo.png"}, +an image:{dir}/cookie.png[].` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "dir": "./path/to/images", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "dir", + Value: "./path/to/images", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "an ", + }, + &types.InlineImage{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "./path/to/images/cookie.png", }, }, }, - types.StringElement{Content: "."}, + }, + &types.StringElement{ + Content: ".", }, }, }, @@ -799,25 +358,32 @@ an image:{dir}/foo.png[].` source := ` :imagesdir: ./path/to/images -an image:foo.png[].` - expected := types.Document{ - Attributes: types.Attributes{ - "imagesdir": "./path/to/images", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "an "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "./path/to/images/"}, - types.StringElement{Content: "foo.png"}, +an image:cookie.png[].` + expected := &types.Document{ + // Attributes: types.Attributes{ + // types.AttrImagesDir: "./path/to/images", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "imagesdir", + Value: "./path/to/images", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "an ", + }, + &types.InlineImage{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "./path/to/images/cookie.png", }, }, }, - types.StringElement{Content: "."}, + }, + &types.StringElement{ + Content: ".", }, }, }, @@ -830,46 +396,32 @@ an image:foo.png[].` source := ` :imagesdir: ./path/to/images -an image:{imagesdir}/foo.png[].` - expected := types.Document{ - Attributes: types.Attributes{ - "imagesdir": "./path/to/images", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "an "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "./path/to/images/"}, - types.StringElement{Content: "./path/to/images/foo.png"}, +an image:{imagesdir}/cookie.png[].` + expected := &types.Document{ + // Attributes: types.Attributes{ + // types.AttrImagesDir: "./path/to/images", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "imagesdir", + Value: "./path/to/images", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "an ", + }, + &types.InlineImage{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "./path/to/images/./path/to/images/cookie.png", }, }, }, - types.StringElement{Content: "."}, }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("with document attribute in URL", func() { - source := `:path: ./path/to/images - -image::{path}/foo.png[]` - expected := types.Document{ - Attributes: types.Attributes{ - "path": "./path/to/images", - }, - Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "./path/to/images/foo.png"}, // resolved + &types.StringElement{ + Content: ".", }, }, }, @@ -877,21 +429,25 @@ image::{path}/foo.png[]` } Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - }) - - Context("errors", func() { - It("appending inline content", func() { - source := "a paragraph\nimage::images/foo.png[]" - expected := types.Document{ + It("with link", func() { + source := "image:cookie.png[cookie image, link=https://cookie.dev]" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - { - types.StringElement{Content: "image::images/foo.png[]"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlineImage{ + Attributes: types.Attributes{ + types.AttrImageAlt: "cookie image", + types.AttrInlineLink: "https://cookie.dev", + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "cookie.png", + }, + }, + }, }, }, }, diff --git a/pkg/parser/index_terms_test.go b/pkg/parser/index_terms_test.go index 6528a8c7..6e4c0167 100644 --- a/pkg/parser/index_terms_test.go +++ b/pkg/parser/index_terms_test.go @@ -10,28 +10,27 @@ import ( var _ = Describe("index terms", func() { - Context("final documents", func() { + Context("in final documents", func() { It("index term in existing paragraph line", func() { source := `a paragraph with an ((index)) term.` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph with an ", - }, - types.IndexTerm{ - Term: []interface{}{types.StringElement{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph with an ", + }, + &types.IndexTerm{ + Term: []interface{}{ + &types.StringElement{ Content: "index", }, - }, - }, - types.StringElement{ - Content: " term.", }, }, + &types.StringElement{ + Content: " term.", + }, }, }, }, @@ -42,34 +41,30 @@ var _ = Describe("index terms", func() { It("index term in single paragraph line", func() { source := `((foo_bar_baz _italic_ normal)) a paragraph with an index term.` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.IndexTerm{ - Term: []interface{}{ - types.StringElement{ - Content: "foo_bar_baz ", - }, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "italic", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.IndexTerm{ + Term: []interface{}{ + &types.StringElement{ + Content: "foo_bar_baz ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "italic", }, }, - types.StringElement{ - Content: " normal", - }, + }, + &types.StringElement{ + Content: " normal", }, }, }, - { - types.StringElement{ - Content: "a paragraph with an index term.", - }, + &types.StringElement{ + Content: "\na paragraph with an index term.", }, }, }, @@ -82,26 +77,24 @@ a paragraph with an index term.` var _ = Describe("concealed index terms", func() { - Context("final documents", func() { + Context("in final documents", func() { It("concealed index term in existing paragraph line", func() { source := `a paragraph with an index term (((index, term, here))).` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph with an index term ", - }, - types.ConcealedIndexTerm{ - Term1: "index", - Term2: "term", - Term3: "here", - }, - types.StringElement{ - Content: ".", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph with an index term ", + }, + &types.ConcealedIndexTerm{ + Term1: "index", + Term2: "term", + Term3: "here", + }, + &types.StringElement{ + Content: ".", }, }, }, @@ -113,20 +106,16 @@ var _ = Describe("concealed index terms", func() { It("concealed index term in separate paragraph line", func() { source := `(((index, term))) a paragraph with an index term.` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.ConcealedIndexTerm{ - Term1: "index", - Term2: "term", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.ConcealedIndexTerm{ + Term1: "index", + Term2: "term", }, - { - types.StringElement{ - Content: "a paragraph with an index term.", - }, + &types.StringElement{ + Content: "\na paragraph with an index term.", }, }, }, diff --git a/pkg/parser/inline_elements_test.go b/pkg/parser/inline_elements_test.go index 8c33ea0e..d26e892a 100644 --- a/pkg/parser/inline_elements_test.go +++ b/pkg/parser/inline_elements_test.go @@ -10,20 +10,18 @@ import ( var _ = Describe("inline elements", func() { - Context("final documents", func() { + Context("in final documents", func() { It("bold text without parenthesis", func() { source := "*some bold content*" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "some bold content"}, }, }, }, @@ -35,20 +33,18 @@ var _ = Describe("inline elements", func() { It("bold text within parenthesis", func() { source := "(*some bold content*)" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "("}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "("}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "some bold content"}, }, - types.StringElement{Content: ")"}, }, + &types.StringElement{Content: ")"}, }, }, }, @@ -58,13 +54,11 @@ var _ = Describe("inline elements", func() { It("non-bold text within words", func() { source := "some*bold*content" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "some*bold*content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "some*bold*content"}, }, }, }, @@ -74,13 +68,11 @@ var _ = Describe("inline elements", func() { It("non-italic text within words", func() { source := "some_italic_content" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "some_italic_content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "some_italic_content"}, }, }, }, @@ -89,13 +81,11 @@ var _ = Describe("inline elements", func() { }) It("non-monospace text within words", func() { source := "some`monospace`content" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "some`monospace`content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "some`monospace`content"}, }, }, }, @@ -105,13 +95,11 @@ var _ = Describe("inline elements", func() { It("invalid bold portion of text", func() { source := "*foo*bar" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "*foo*bar"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "*foo*bar"}, }, }, }, @@ -121,19 +109,17 @@ var _ = Describe("inline elements", func() { It("valid bold portion of text", func() { source := "**foo**bar" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "foo"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.DoubleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "foo"}, }, - types.StringElement{Content: "bar"}, }, + &types.StringElement{Content: "bar"}, }, }, }, @@ -143,13 +129,11 @@ var _ = Describe("inline elements", func() { It("latin characters", func() { source := "à bientôt" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "à bientôt"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "à bientôt"}, }, }, }, diff --git a/pkg/parser/labeled_list_test.go b/pkg/parser/labeled_list_test.go index eb6670e4..cb23f78e 100644 --- a/pkg/parser/labeled_list_test.go +++ b/pkg/parser/labeled_list_test.go @@ -10,714 +10,46 @@ import ( var _ = Describe("labeled lists", func() { - Context("draft documents", func() { + Context("in final documents", func() { - It("with a term and description on 2 lines", func() { - source := `Item1:: -Item 1 description -on 2 lines` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item1", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 1 description"}, - }, - { - types.StringElement{Content: "on 2 lines"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with a single term and no description", func() { - source := `Item1::` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Term: []interface{}{ - types.StringElement{ - Content: "Item1", - }, - }, - Level: 1, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with a quoted text in term and in description", func() { - source := "`foo()`::\n" + - `This function is _untyped_.` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Term: []interface{}{ - types.StringElement{ - Content: "`foo()`", // the term is a raw string in the DraftDocument - }, - }, - Level: 1, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "This function is ", - }, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "untyped", - }, - }, - }, - types.StringElement{ - Content: ".", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with a horizontal layout attribute", func() { - source := `[horizontal] -Item1:: foo` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Attributes: types.Attributes{ - "style": "horizontal", - }, - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item1", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with a title attribute", func() { - source := `[title="Fighters"] -Item1:: foo` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Attributes: types.Attributes{ - types.AttrTitle: "Fighters", - }, - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item1", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - }, - }, - }, - }, - }, - } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) - }) - - It("with a single term and a blank line", func() { - source := `Item1:: - ` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item1", - }, - }, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with multiple sibling items", func() { - source := `Item 1:: -Item 1 description -Item 2:: -Item 2 description -Item 3:: -Item 3 description` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item 1", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 1 description"}, - }, - }, - }, - }, - }, - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item 2", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 2 description"}, - }, - }, - }, - }, - }, - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item 3", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 3 description"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with multiple nested items", func() { - source := `Item 1:: -Item 1 description -Item 2::: -Item 2 description -Item 3:::: -Item 3 description` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item 1", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 1 description"}, - }, - }, - }, - }, - }, - types.LabeledListItem{ - Level: 2, - Term: []interface{}{ - types.StringElement{ - Content: "Item 2", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 2 description"}, - }, - }, - }, - }, - }, - types.LabeledListItem{ - Level: 3, - Term: []interface{}{ - types.StringElement{ - Content: "Item 3", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 3 description"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with nested unordered list - case 1", func() { - source := `Empty item:: -* foo -* bar -Item with description:: something simple` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Empty item", - }, - }, - Elements: []interface{}{}, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "bar"}, - }, - }, - }, - }, - }, - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item with description", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "something simple"}, - }, - }, - }, - }, - }, - }, - } - - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with a single item and paragraph", func() { - source := `Item 1:: -foo -bar - -a normal paragraph.` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item 1", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - { - types.StringElement{Content: "bar"}, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a normal paragraph."}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with item continuation", func() { - source := `Item 1:: -+ ----- -a fenced block ----- -Item 2:: something simple -+ ----- -another fenced block -----` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item 1", - }, - }, - Elements: []interface{}{}, - }, - // the `+` continuation produces the element below - types.ContinuedListItemElement{ - Offset: 0, - Element: types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a fenced block", - }, - }, - }, - }, - }, - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item 2", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "something simple", - }, - }, - }, - }, - }, - }, - // the `+` continuation produces the second element below - types.ContinuedListItemElement{ - Offset: 0, - Element: types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "another fenced block", - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("without item continuation", func() { - source := `Item 1:: ----- -a fenced block ----- -Item 2:: something simple ----- -another fenced block -----` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item 1", - }, - }, - Elements: []interface{}{}, - }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a fenced block", - }, - }, - }, - }, - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Item 2", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "something simple"}, - }, - }, - }, - }, - }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "another fenced block", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with nested unordered list - case 2", func() { - source := `Labeled item:: -- unordered item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Labeled item", - }, - }, - Elements: []interface{}{}, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered item"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with title", func() { - source := `.Labeled, single-line -first term:: definition of the first term -second term:: definition of the second term` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Attributes: types.Attributes{ - types.AttrTitle: "Labeled, single-line", - }, - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "first term", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "definition of the first term", - }, - }, - }, - }, - }, - }, - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "second term", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "definition of the second term", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("max level of labeled items - case 1", func() { - source := `.Labeled, max nesting -level 1:: description 1 -level 2::: description 2 -level 3:::: description 3 -level 1:: description 1` - expected := types.DraftDocument{ + It("with terms and descriptions on same lines", func() { + source := `CPU:: The brain of the computer. +Hard drive:: Permanent storage for operating system and/or user files.` + expected := &types.Document{ Elements: []interface{}{ - types.LabeledListItem{ - Attributes: types.Attributes{ - types.AttrTitle: "Labeled, max nesting", - }, - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "level 1", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 1", - }, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, + Term: []interface{}{ + &types.StringElement{ + Content: "CPU", }, }, - }, - }, - }, - types.LabeledListItem{ - Level: 2, - Term: []interface{}{ - types.StringElement{ - Content: "level 2", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 2", + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "The brain of the computer.", + }, }, }, }, }, - }, - }, - types.LabeledListItem{ - Level: 3, - Term: []interface{}{ - types.StringElement{ - Content: "level 3", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 3", - }, + &types.LabeledListElement{ + Style: types.DoubleColons, + Term: []interface{}{ + &types.StringElement{ + Content: "Hard drive", }, }, - }, - }, - }, - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "level 1", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 1", + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Permanent storage for operating system and/or user files.", + }, }, }, }, @@ -726,128 +58,30 @@ level 1:: description 1` }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + Expect(ParseDocument(source)).To(MatchDocument(expected)) - It("max level of labeled items - case 2", func() { - source := `.Labeled, max nesting -level 1:: description 1 -level 2::: description 2 -level 3:::: description 3 -level 2::: description 2` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Attributes: types.Attributes{ - types.AttrTitle: "Labeled, max nesting", - }, - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "level 1", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 1", - }, - }, - }, - }, - }, - }, - types.LabeledListItem{ - Level: 2, - Term: []interface{}{ - types.StringElement{ - Content: "level 2", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 2", - }, - }, - }, - }, - }, - }, - types.LabeledListItem{ - Level: 3, - Term: []interface{}{ - types.StringElement{ - Content: "level 3", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 3", - }, - }, - }, - }, - }, - }, - types.LabeledListItem{ - Level: 2, - Term: []interface{}{ - types.StringElement{ - Content: "level 2", - }, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 2", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) - }) - - Context("final documents", func() { - It("with a term and description on 2 lines", func() { source := `Item1:: Item 1 description on 2 lines` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item1", }, }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 1 description"}, - }, - { - types.StringElement{Content: "on 2 lines"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Item 1 description\non 2 lines", }, }, }, @@ -862,19 +96,18 @@ on 2 lines` It("with a single term and no description", func() { source := `Item1::` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item1", }, }, - - Level: 1, - Elements: []interface{}{}, }, }, }, @@ -886,40 +119,39 @@ on 2 lines` It("with a quoted text in term and in description", func() { source := "`foo()`::\n" + `This function is _untyped_.` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.QuotedText{ + &types.QuotedText{ Kind: types.SingleQuoteMonospace, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "foo()", }, }, }, }, - Level: 1, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "This function is ", - }, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "untyped", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "This function is ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "untyped", }, }, - types.StringElement{ - Content: ".", - }, + }, + &types.StringElement{ + Content: ".", }, }, }, @@ -931,21 +163,24 @@ on 2 lines` } Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("with a index term", func() { source := "((`foo`))::\n" + `This function is _untyped_.` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.IndexTerm{ + &types.IndexTerm{ Term: []interface{}{ - types.QuotedText{ + &types.QuotedText{ Kind: types.SingleQuoteMonospace, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "foo", }, }, @@ -953,25 +188,22 @@ on 2 lines` }, }, }, - Level: 1, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "This function is ", - }, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "untyped", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "This function is ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "untyped", }, }, - types.StringElement{ - Content: ".", - }, + }, + &types.StringElement{ + Content: ".", }, }, }, @@ -987,36 +219,35 @@ on 2 lines` It("with a concealed index term in term", func() { source := "(((foo,bar)))::\n" + `This function is _untyped_.` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.ConcealedIndexTerm{ + &types.ConcealedIndexTerm{ Term1: "foo", Term2: "bar", }, }, - Level: 1, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "This function is ", - }, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "untyped", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "This function is ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "untyped", }, }, - types.StringElement{ - Content: ".", - }, + }, + &types.StringElement{ + Content: ".", }, }, }, @@ -1032,26 +263,26 @@ on 2 lines` It("with a horizontal layout attribute", func() { source := `[horizontal] Item1:: foo` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ + &types.List{ + Kind: types.LabeledListKind, Attributes: types.Attributes{ "style": "horizontal", }, - Items: []types.LabeledListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item1", }, }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "foo", }, }, }, @@ -1067,19 +298,18 @@ Item1:: foo` It("with a single term and a blank line", func() { source := `Item1:: ` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item1", }, }, - - Elements: []interface{}{}, }, }, }, @@ -1095,59 +325,57 @@ Item 2:: Item 2 description Item 3:: Item 3 description` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item 1", }, }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 1 description"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Item 1 description", }, }, }, }, }, - { - Level: 1, + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item 2", }, }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 2 description"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Item 2 description", }, }, }, }, }, - { - Level: 1, + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item 3", }, }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 3 description"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Item 3 description", }, }, }, @@ -1167,59 +395,59 @@ Item 2::: Item 2 description Item 3:::: Item 3 description` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item 1", }, }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 1 description"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Item 1 description", }, }, }, - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 2, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.TripleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item 2", }, }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 2 description"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Item 2 description", }, }, }, - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 3, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.QuadrupleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item 3", }, }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 3 description"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Item 3 description", }, }, }, @@ -1245,44 +473,43 @@ Item 3 description` * foo * bar Item with description:: something simple` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Empty item", }, }, - Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "foo", }, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "bar"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "bar", }, }, }, @@ -1292,18 +519,18 @@ Item with description:: something simple` }, }, }, - { - Level: 1, + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item with description", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "something simple"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "something simple", }, }, }, @@ -1313,7 +540,6 @@ Item with description:: something simple` }, }, } - Expect(ParseDocument(source)).To(MatchDocument(expected)) }) @@ -1323,26 +549,23 @@ foo bar a normal paragraph.` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item 1", }, }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - { - types.StringElement{Content: "bar"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "foo\nbar", }, }, }, @@ -1350,10 +573,10 @@ a normal paragraph.` }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a normal paragraph."}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a normal paragraph.", }, }, }, @@ -1373,52 +596,49 @@ Item 2:: something simple ---- another fenced block ----` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item 1", }, }, - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a fenced block", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "a fenced block", }, }, }, }, }, - { - Level: 1, + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item 2", }, }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "something simple"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "something simple", }, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "another fenced block", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "another fenced block", }, }, }, @@ -1441,46 +661,44 @@ Item 2:: something simple ---- another fenced block ----` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item 1", }, }, - - Elements: []interface{}{}, }, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a fenced block", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "a fenced block", }, }, }, - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item 2", }, }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "something simple"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "something simple", }, }, }, @@ -1488,12 +706,11 @@ another fenced block }, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "another fenced block", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "another fenced block", }, }, }, @@ -1505,29 +722,30 @@ another fenced block It("with nested unordered list - case 2", func() { source := `Labeled item:: - unordered item` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Labeled item", }, }, Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.Dash, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered item"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "unordered item", }, }, }, @@ -1548,46 +766,43 @@ another fenced block source := `.Labeled, single-line first term:: definition of the first term second term:: definition of the second term` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ + &types.List{ + Kind: types.LabeledListKind, Attributes: types.Attributes{ types.AttrTitle: "Labeled, single-line", }, - Items: []types.LabeledListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "first term", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "definition of the first term", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "definition of the first term", }, }, }, }, }, - { - Level: 1, + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "second term", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "definition of the second term", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "definition of the second term", }, }, }, @@ -1608,65 +823,62 @@ level 1:: description 1 level 2::: description 2 level 3:::: description 3 level 1:: description 1` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ + &types.List{ + Kind: types.LabeledListKind, Attributes: types.Attributes{ types.AttrTitle: "Labeled, max nesting", }, - Items: []types.LabeledListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "level 1", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 1", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "description 1", }, }, }, - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 2, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.TripleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "level 2", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 2", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "description 2", }, }, }, - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 3, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.QuadrupleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "level 3", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 3", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "description 3", }, }, }, @@ -1680,20 +892,18 @@ level 1:: description 1` }, }, }, - { - Level: 1, + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "level 1", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 1", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "description 1", }, }, }, @@ -1712,65 +922,62 @@ level 1:: description 1 level 2::: description 2 level 3:::: description 3 level 2::: description 2` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ + &types.List{ + Kind: types.LabeledListKind, Attributes: types.Attributes{ types.AttrTitle: "Labeled, max nesting", }, - Items: []types.LabeledListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "level 1", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 1", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "description 1", }, }, }, - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 2, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.TripleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "level 2", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 2", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "description 2", }, }, }, - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 3, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.QuadrupleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "level 3", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 3", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "description 3", }, }, }, @@ -1780,20 +987,18 @@ level 2::: description 2` }, }, }, - { - Level: 2, + &types.LabeledListElement{ + Style: types.TripleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "level 2", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "description 2", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "description 2", }, }, }, @@ -1812,23 +1017,22 @@ level 2::: description 2` It("item with predefined attribute", func() { source := `level 1:: {amp}` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "level 1", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.PredefinedAttribute{Name: "amp"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.PredefinedAttribute{Name: "amp"}, }, }, }, @@ -1842,22 +1046,23 @@ level 2::: description 2` It("item with a colon the term", func() { source := `what: ever:: text` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "what: ever", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "text"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "text", }, }, }, @@ -1870,7 +1075,7 @@ level 2::: description 2` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("with multiple item continuations", func() { + It("multiple elements with item continuations", func() { source := `Item 1:: content 1 + @@ -1884,76 +1089,77 @@ addition IMPORTANT: important + TIP: tip` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item 1", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "content 1"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content 1", }, }, }, - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Note, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "note"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "note", }, }, }, }, }, - { - Level: 1, + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "Item 2", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "content 2"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content 2", }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "addition"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "addition", }, }, }, - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Important, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "important"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "important", }, }, }, - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Tip, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "tip"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "tip", }, }, }, @@ -1966,7 +1172,7 @@ TIP: tip` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("with list item continuations", func() { + It("single element with multiple item continuations", func() { source := `item:: This is the first line of the first paragraph. This is the second line of the first paragraph. @@ -1978,64 +1184,47 @@ This is the next continuation paragraph. + TIP: We can embed admonitions too! ` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 1, + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "item", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "This is the first line of the first paragraph.", - }, - }, - { - types.StringElement{ - Content: "This is the second line of the first paragraph.", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "This is the first line of the first paragraph.\nThis is the second line of the first paragraph.", }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "This is the first line of the continuation paragraph.", - }, - }, - { - types.StringElement{ - Content: "This is the second line of the continuation paragraph.", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "This is the first line of the continuation paragraph.\nThis is the second line of the continuation paragraph.", }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "This is the next continuation paragraph.", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "This is the next continuation paragraph.", }, }, }, - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Tip, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "We can embed admonitions too!", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "We can embed admonitions too!", }, }, }, @@ -2045,10 +1234,103 @@ TIP: We can embed admonitions too! }, }, } - result, err := ParseDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("with description after blanklines", func() { + source := `term:: + + +a paragraph` + + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, + Term: []interface{}{ + &types.StringElement{ + Content: "term", + }, + }, + Elements: []interface{}{ + &types.Paragraph{ // paragraph gets attached to labeled list element even if there a blanklines in-between + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph", + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("with descriptions after blanklines", func() { + source := `term 1:: + + +paragraph 1 +on 2 lines + +term 2 :: + + +paragraph 2 +on 2 lines, too` + + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, + Term: []interface{}{ + &types.StringElement{ + Content: "term 1", + }, + }, + Elements: []interface{}{ + &types.Paragraph{ // paragraph gets attached to labeled list element even if there a blanklines in-between + Elements: []interface{}{ + &types.StringElement{ + Content: "paragraph 1\non 2 lines", + }, + }, + }, + }, + }, + &types.LabeledListElement{ + Style: types.DoubleColons, + Term: []interface{}{ + &types.StringElement{ + Content: "term 2", + }, + }, + Elements: []interface{}{ + &types.Paragraph{ // paragraph gets attached to labeled list element even if there a blanklines in-between + Elements: []interface{}{ + &types.StringElement{ + Content: "paragraph 2\non 2 lines, too", + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + }) }) diff --git a/pkg/parser/line_break_test.go b/pkg/parser/line_break_test.go new file mode 100644 index 00000000..ced739be --- /dev/null +++ b/pkg/parser/line_break_test.go @@ -0,0 +1,54 @@ +package parser_test + +import ( + "github.com/bytesparadise/libasciidoc/pkg/types" + . "github.com/bytesparadise/libasciidoc/testsupport" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("line breaks", func() { + + Context("in final documents", func() { + + It("simple case", func() { + source := `since 2021 +` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "since 2021", + }, + &types.LineBreak{}, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("after punctuation", func() { + source := `:author: Xavier +Copyright (C) 2021 {author}. +` + expected := &types.Document{ + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "author", + Value: "Xavier", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Copyright © 2021 Xavier.", + }, + &types.LineBreak{}, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) +}) diff --git a/pkg/parser/link_test.go b/pkg/parser/link_test.go index b1360885..58ef0875 100644 --- a/pkg/parser/link_test.go +++ b/pkg/parser/link_test.go @@ -10,135 +10,23 @@ import ( var _ = Describe("links", func() { - Context("draft documents", func() { - - Context("external link", func() { - - It("with special characters in URL", func() { - source := `a link to https://example.com?a=1&b=2` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com?a=1", - }, - types.SpecialCharacter{ - Name: "&", - }, - types.StringElement{ - Content: "b=2", - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("with quoted text in attributes", func() { - source := `a link to https://example.com[*alt text*]` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Attributes: types.Attributes{ - types.AttrInlineLinkText: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "alt text", - }, - }, - }, - }, - }, - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("relative link", func() { - - It("with text, target and role", func() { - source := `a link to link:https://example.com[example,window=mytarget,role=myrole]` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Attributes: types.Attributes{ - types.AttrInlineLinkText: "example", - types.AttrInlineLinkTarget: "mytarget", - types.AttrRoles: []interface{}{"myrole"}, - }, - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("final documents", func() { + Context("in final documents", func() { Context("external links", func() { It("without text", func() { source := "a link to https://example.com" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, @@ -152,19 +40,17 @@ var _ = Describe("links", func() { It("with empty text", func() { source := "a link to https://example.com[]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, @@ -178,29 +64,27 @@ var _ = Describe("links", func() { It("with text only", func() { source := "a link to mailto:foo@bar[the foo@bar email]." - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "mailto:", - Path: []interface{}{ - types.StringElement{ - Content: "foo@bar", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "mailto:", + Path: []interface{}{ + &types.StringElement{ + Content: "foo@bar", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "the foo@bar email", - }, }, - types.StringElement{ - Content: ".", + Attributes: types.Attributes{ + types.AttrInlineLinkText: "the foo@bar email", }, }, + &types.StringElement{ + Content: ".", + }, }, }, }, @@ -210,25 +94,23 @@ var _ = Describe("links", func() { It("with text and extra attributes", func() { source := "a link to mailto:foo@bar[the foo@bar email, foo=bar]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "mailto:", - Path: []interface{}{ - types.StringElement{ - Content: "foo@bar", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "mailto:", + Path: []interface{}{ + &types.StringElement{ + Content: "foo@bar", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "the foo@bar email", - "foo": "bar", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "the foo@bar email", + "foo": "bar", }, }, }, @@ -243,34 +125,25 @@ var _ = Describe("links", func() { and more text on the next lines` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "http://", - Path: []interface{}{ - types.StringElement{ - Content: "website.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "http://", + Path: []interface{}{ + &types.StringElement{ + Content: "website.com", }, }, }, }, - { - types.StringElement{ - Content: "and more text on the", - }, - }, - { - types.StringElement{ - Content: "next lines", - }, + &types.StringElement{ + Content: "\nand more text on the\nnext lines", }, }, }, @@ -284,34 +157,25 @@ next lines` and more text on the next lines` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "http://", - Path: []interface{}{ - types.StringElement{ - Content: "website.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "http://", + Path: []interface{}{ + &types.StringElement{ + Content: "website.com", }, }, }, }, - { - types.StringElement{ - Content: "and more text on the", - }, - }, - { - types.StringElement{ - Content: "next lines", - }, + &types.StringElement{ + Content: "\nand more text on the\nnext lines", }, }, }, @@ -322,24 +186,22 @@ next lines` It("with more text afterwards", func() { source := `a link to https://example.com and more text` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, - types.StringElement{Content: " and more text"}, }, + &types.StringElement{Content: " and more text"}, }, }, }, @@ -351,26 +213,24 @@ next lines` It("only with text having comma", func() { source := `a link to http://website.com[A, B, and C]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "http://", - Path: []interface{}{ - types.StringElement{ - Content: "website.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "http://", + Path: []interface{}{ + &types.StringElement{ + Content: "website.com", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "A", - types.AttrPositional2: "B", - types.AttrPositional3: "and C", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "A", + types.AttrPositional2: "B", + types.AttrPositional3: "and C", }, }, }, @@ -382,24 +242,22 @@ next lines` It("only with doublequoted text having comma", func() { source := `a link to http://website.com["A, B, and C"]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "http://", - Path: []interface{}{ - types.StringElement{ - Content: "website.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "http://", + Path: []interface{}{ + &types.StringElement{ + Content: "website.com", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "A, B, and C", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "A, B, and C", }, }, }, @@ -411,25 +269,23 @@ next lines` It("with doublequoted text having comma and other attrs", func() { source := `a link to http://website.com["A, B, and C", role=foo]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "http://", - Path: []interface{}{ - types.StringElement{ - Content: "website.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "http://", + Path: []interface{}{ + &types.StringElement{ + Content: "website.com", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "A, B, and C", - types.AttrRoles: []interface{}{"foo"}, - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "A, B, and C", + types.AttrRoles: []interface{}{"foo"}, }, }, }, @@ -441,27 +297,25 @@ next lines` It("with text having comma and other attributes", func() { source := `a link to http://website.com[A, B, and C, role=foo]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "http://", - Path: []interface{}{ - types.StringElement{ - Content: "website.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "http://", + Path: []interface{}{ + &types.StringElement{ + Content: "website.com", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "A", - types.AttrPositional2: "B", - types.AttrPositional3: "and C", - types.AttrRoles: []interface{}{"foo"}, - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "A", + types.AttrPositional2: "B", + types.AttrPositional3: "and C", + types.AttrRoles: []interface{}{"foo"}, }, }, }, @@ -474,19 +328,17 @@ next lines` It("with special characters", func() { source := "a link to https://foo*_.com" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "foo*_.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "foo*_.com", }, }, }, @@ -498,55 +350,55 @@ next lines` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("with quoted text", func() { + It("with quoted text without attributes", func() { source := "a link to https://example.com[_a_ *b* `c`]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Attributes: types.Attributes{ - types.AttrInlineLinkText: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "a", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "a", }, }, - types.StringElement{ - Content: " ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "b", - }, + }, + &types.StringElement{ + Content: " ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "b", }, }, - types.StringElement{ - Content: " ", - }, - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{ - Content: "c", - }, + }, + &types.StringElement{ + Content: " ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{ + Content: "c", }, }, }, }, - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, @@ -560,34 +412,32 @@ next lines` It("with quoted text with attributes", func() { source := "a link to https://example.com[[.myrole1]_a_]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Attributes: types.Attributes{ - types.AttrInlineLinkText: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"myrole1"}, - }, - Elements: []interface{}{ - types.StringElement{ - Content: "a", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Attributes: types.Attributes{ + types.AttrRoles: []interface{}{"myrole1"}, + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a", }, }, }, }, - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, @@ -601,62 +451,60 @@ next lines` It("with quoted texts with attributes", func() { source := "a link to https://example.com[[.myrole1]_a_ [.myrole2]*b* [.myrole3]`c`]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Attributes: types.Attributes{ - types.AttrInlineLinkText: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"myrole1"}, - }, - Elements: []interface{}{ - types.StringElement{ - Content: "a", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Attributes: types.Attributes{ + types.AttrRoles: []interface{}{"myrole1"}, + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a", }, }, - types.StringElement{ - Content: " ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"myrole2"}, - }, - Elements: []interface{}{ - types.StringElement{ - Content: "b", - }, + }, + &types.StringElement{ + Content: " ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Attributes: types.Attributes{ + types.AttrRoles: []interface{}{"myrole2"}, + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "b", }, }, - types.StringElement{ - Content: " ", - }, - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"myrole3"}, - }, - Elements: []interface{}{ - types.StringElement{ - Content: "c", - }, + }, + &types.StringElement{ + Content: " ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Attributes: types.Attributes{ + types.AttrRoles: []interface{}{"myrole3"}, + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "c", }, }, }, }, - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, @@ -671,22 +519,20 @@ next lines` It("in bold text", func() { source := `a link to *https://example.com[]*` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, @@ -702,19 +548,17 @@ next lines` It("with special characters", func() { source := "a link to https://foo*_.com" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "foo*_.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "foo*_.com", }, }, }, @@ -729,22 +573,20 @@ next lines` It("in bold text", func() { source := `a link to *https://example.com[]*` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, @@ -761,22 +603,20 @@ next lines` It("in italic text", func() { source := `a link to _https://example.com[]_` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, @@ -793,30 +633,35 @@ next lines` Context("with document attribute substitutions", func() { It("with a document attribute substitution for the whole URL", func() { - source := ` -:url: https://example.com + source := `:url: https://example.com :url: https://foo2.bar a link to {url}` - expected := types.Document{ - Attributes: types.Attributes{ - "url": "https://foo2.bar", // overridden by second declaration - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "url": "https://foo2.bar", // overridden by second declaration + // }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "foo2.bar", - }, + &types.AttributeDeclaration{ + Name: "url", + Value: "https://example.com", + }, + &types.AttributeDeclaration{ + Name: "url", + Value: "https://foo2.bar", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "foo2.bar", }, }, }, @@ -829,40 +674,45 @@ a link to {url}` }) It("with two document attribute substitutions only", func() { - source := ` -:scheme: https + source := `:scheme: https :path: example.com a link to {scheme}://{path} and https://foo.com` - expected := types.Document{ - Attributes: types.Attributes{ - "scheme": "https", - "path": "example.com", - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "scheme": "https", + // "path": "example.com", + // }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.AttributeDeclaration{ + Name: "scheme", + Value: "https", + }, + &types.AttributeDeclaration{ + Name: "path", + Value: "example.com", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, - types.StringElement{Content: " and "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "foo.com", - }, + }, + &types.StringElement{Content: " and "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "foo.com", }, }, }, @@ -875,45 +725,52 @@ a link to {scheme}://{path} and https://foo.com` }) It("with two document attribute substitutions in bold text", func() { - source := ` -:scheme: https + source := `:scheme: https :path: example.com a link to *{scheme}://{path}[] and https://foo.com[]*` - expected := types.Document{ - Attributes: types.Attributes{ - "scheme": "https", - "path": "example.com", - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "scheme": "https", + // "path": "example.com", + // }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.AttributeDeclaration{ + Name: "scheme", + Value: "https", + }, + &types.AttributeDeclaration{ + Name: "path", + Value: "example.com", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, }, - types.StringElement{ - Content: " and ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "foo.com", - }, + }, + &types.StringElement{ + Content: " and ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "foo.com", }, }, }, @@ -928,42 +785,49 @@ a link to *{scheme}://{path}[] and https://foo.com[]*` }) It("with two document attribute substitutions and a reset", func() { - source := ` -:scheme: https + source := `:scheme: https :path: example.com :!path: a link to {scheme}://{path} and https://foo.com` - expected := types.Document{ - Attributes: types.Attributes{ - "scheme": "https", - "path": nil, - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "scheme": "https", + // }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "{path}", - }, + &types.AttributeDeclaration{ + Name: "scheme", + Value: "https", + }, + &types.AttributeDeclaration{ + Name: "path", + Value: "example.com", + }, + &types.AttributeReset{ + Name: "path", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.AttributeSubstitution{ + Name: "path", // substitution failed at during parsing }, }, }, - types.StringElement{Content: " and "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "foo.com", - }, + }, + &types.StringElement{Content: " and "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "foo.com", }, }, }, @@ -980,46 +844,43 @@ a link to {scheme}://{path} and https://foo.com` :scheme: https :path: example.com` - title := []interface{}{ - types.StringElement{Content: "a title to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "a title to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", + }, + }, + }, }, - }, - }, - }, - types.StringElement{Content: " and "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "foo.com", + &types.StringElement{Content: " and "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "foo.com", + }, + }, + }, }, }, - }, - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - "scheme": "https", - "path": "example.com", - }, - ElementReferences: types.ElementReferences{ - "_a_title_to_httpsexample_com_and_httpsfoo_com": title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_a_title_to_httpsexample_com_and_httpsfoo_com", + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "scheme", + Value: "https", + }, + &types.AttributeDeclaration{ + Name: "path", + Value: "example.com", + }, }, - Title: title, - Elements: []interface{}{}, }, }, } @@ -1033,45 +894,54 @@ a link to {scheme}://{path} and https://foo.com` == a title to {scheme}://{path} and https://foo.com` title := []interface{}{ - types.StringElement{Content: "a title to "}, - types.InlineLink{ - Location: types.Location{ + &types.StringElement{ + Content: "a title to ", + }, + &types.InlineLink{ + Location: &types.Location{ Scheme: "https://", Path: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "example.com", }, }, }, }, - types.StringElement{Content: " and "}, - types.InlineLink{ - Location: types.Location{ + &types.StringElement{Content: " and "}, + &types.InlineLink{ + Location: &types.Location{ Scheme: "https://", Path: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "foo.com", }, }, }, }, } - expected := types.Document{ - Attributes: types.Attributes{ - "scheme": "https", - "path": "example.com", - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "scheme": "https", + // "path": "example.com", + // }, ElementReferences: types.ElementReferences{ "_a_title_to_httpsexample_com_and_httpsfoo_com": title, }, Elements: []interface{}{ - types.Section{ + &types.AttributeDeclaration{ + Name: "scheme", + Value: "https", + }, + &types.AttributeDeclaration{ + Name: "path", + Value: "example.com", + }, + &types.Section{ Level: 1, Attributes: types.Attributes{ types.AttrID: "_a_title_to_httpsexample_com_and_httpsfoo_com", }, - Title: title, - Elements: []interface{}{}, + Title: title, }, }, } @@ -1084,19 +954,17 @@ a link to {scheme}://{path} and https://foo.com` It("relative link to doc without text", func() { source := "a link to link:foo.adoc[]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "", - Path: []interface{}{ - types.StringElement{ - Content: "foo.adoc", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "", + Path: []interface{}{ + &types.StringElement{ + Content: "foo.adoc", }, }, }, @@ -1110,24 +978,22 @@ a link to {scheme}://{path} and https://foo.com` It("relative link to doc with text", func() { source := "a link to link:foo.adoc[foo doc]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "", - Path: []interface{}{ - types.StringElement{ - Content: "foo.adoc", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "", + Path: []interface{}{ + &types.StringElement{ + Content: "foo.adoc", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "foo doc", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "foo doc", }, }, }, @@ -1139,24 +1005,22 @@ a link to {scheme}://{path} and https://foo.com` It("relative link to external URL with text only", func() { source := "a link to link:https://example.com[foo doc]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "foo doc", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "foo doc", }, }, }, @@ -1168,25 +1032,23 @@ a link to {scheme}://{path} and https://foo.com` It("relative link to external URL with text and extra attributes", func() { source := "a link to link:https://example.com[foo doc, foo=bar]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "foo doc", - "foo": "bar", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "foo doc", + "foo": "bar", }, }, }, @@ -1198,24 +1060,22 @@ a link to {scheme}://{path} and https://foo.com` It("relative link to external URL with extra attributes only", func() { source := "a link to link:https://example.com[foo=bar]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, - Attributes: types.Attributes{ - "foo": "bar", - }, + }, + Attributes: types.Attributes{ + "foo": "bar", }, }, }, @@ -1227,14 +1087,12 @@ a link to {scheme}://{path} and https://foo.com` It("invalid relative link to doc", func() { source := "a link to link:foo.adoc" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to link:foo.adoc", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to link:foo.adoc", }, }, }, @@ -1243,55 +1101,53 @@ a link to {scheme}://{path} and https://foo.com` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("relative link with quoted text attribute", func() { + It("with quoted text attribute", func() { source := "link:/[a _a_ b *b* c `c`]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineLink{ - Location: types.Location{ - Scheme: "", - Path: []interface{}{ - types.StringElement{ - Content: "/", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlineLink{ + Location: &types.Location{ + Scheme: "", + Path: []interface{}{ + &types.StringElement{ + Content: "/", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: []interface{}{ - types.StringElement{ - Content: "a ", - }, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "a", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: []interface{}{ + &types.StringElement{ + Content: "a ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "a", }, }, - types.StringElement{ - Content: " b ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "b", - }, + }, + &types.StringElement{ + Content: " b ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "b", }, }, - types.StringElement{ - Content: " c ", - }, - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{ - Content: "c", - }, + }, + &types.StringElement{ + Content: " c ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{ + Content: "c", }, }, }, @@ -1305,32 +1161,30 @@ a link to {scheme}://{path} and https://foo.com` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("relative link with all valid characters", func() { + It("with all valid characters", func() { source := `a link to link:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~:/?#@!$&;=()*+,-_.%[as expected]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "", - Path: []interface{}{ - types.StringElement{ - Content: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~:/?#@!$", - }, - types.SpecialCharacter{ - Name: "&", - }, - types.StringElement{ - Content: ";=()*+,-_.%", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "", + Path: []interface{}{ + &types.StringElement{ + Content: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~:/?#@!$", + }, + &types.SpecialCharacter{ + Name: "&", + }, + &types.StringElement{ + Content: ";=()*+,-_.%", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "as expected", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "as expected", }, }, }, @@ -1340,32 +1194,27 @@ a link to {scheme}://{path} and https://foo.com` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("relative link with encoded space", func() { + It("with encoded space", func() { source := `Test 1: link:/test/a b[with space] Test 2: link:/test/a%20b[with encoded space]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "Test 1: link:/test/a b[with space]", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Test 1: link:/test/a b[with space]\nTest 2: ", }, - { - types.StringElement{Content: "Test 2: "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "", - Path: []interface{}{ - types.StringElement{ - Content: "/test/a%20b", - }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "", + Path: []interface{}{ + &types.StringElement{ + Content: "/test/a%20b", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "with encoded space", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "with encoded space", }, }, }, @@ -1375,7 +1224,7 @@ Test 2: link:/test/a%20b[with encoded space]` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("relative link with two document attribute substitutions and a reset", func() { + It("with two document attribute substitutions and a reset", func() { source := ` :scheme: link :path: example.com @@ -1384,37 +1233,45 @@ Test 2: link:/test/a%20b[with encoded space]` a link to {scheme}:{path}[] and https://foo.com` - expected := types.Document{ - Attributes: types.Attributes{ - "scheme": "link", - "path": nil, - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "scheme": "link", + // }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "{path}", - }, + &types.AttributeDeclaration{ + Name: "scheme", + Value: "link", + }, + &types.AttributeDeclaration{ + Name: "path", + Value: "example.com", + }, + &types.AttributeReset{ + Name: "path", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a link to ", + }, + &types.InlineLink{ + Location: &types.Location{ + Path: []interface{}{ + &types.AttributeSubstitution{ + Name: "path", }, }, }, - types.StringElement{ - Content: " and ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "foo.com", - }, + }, + &types.StringElement{ + Content: " and ", + }, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "foo.com", }, }, }, @@ -1428,20 +1285,18 @@ a link to {scheme}:{path}[] and https://foo.com` It("relative link within quoted text", func() { source := "*link:foo[]*" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.InlineLink{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.InlineLink{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "foo", }, }, }, @@ -1459,26 +1314,24 @@ a link to {scheme}:{path}[] and https://foo.com` It("relative link only with text having comma", func() { source := `a link to link:https://example.com[A, B, and C]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "A", - types.AttrPositional2: "B", - types.AttrPositional3: "and C", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "A", + types.AttrPositional2: "B", + types.AttrPositional3: "and C", }, }, }, @@ -1490,24 +1343,22 @@ a link to {scheme}:{path}[] and https://foo.com` It("relative link only with doublequoted text having comma", func() { source := `a link to link:https://example.com["A, B, and C"]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "A, B, and C", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "A, B, and C", }, }, }, @@ -1517,27 +1368,25 @@ a link to {scheme}:{path}[] and https://foo.com` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("relative link with doublequoted text having comma and other attrs", func() { + It("with doublequoted text having comma and other attrs", func() { source := `a link to link:https://example.com["A, B, and C", role=foo]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "A, B, and C", - types.AttrRoles: []interface{}{"foo"}, - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "A, B, and C", + types.AttrRoles: []interface{}{"foo"}, }, }, }, @@ -1547,29 +1396,27 @@ a link to {scheme}:{path}[] and https://foo.com` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("relative link with text having comma and other attributes", func() { + It("with text having comma and other attributes", func() { source := `a link to link:https://example.com[A, B, and C, role=foo]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "example.com", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "example.com", }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: "A", - types.AttrPositional2: "B", - types.AttrPositional3: "and C", - types.AttrRoles: []interface{}{"foo"}, - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: "A", + types.AttrPositional2: "B", + types.AttrPositional3: "and C", + types.AttrRoles: []interface{}{"foo"}, }, }, }, @@ -1578,10 +1425,7 @@ a link to {scheme}:{path}[] and https://foo.com` } Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - }) - }) - }) }) diff --git a/pkg/parser/mixed_lists_test.go b/pkg/parser/mixed_lists_test.go index 1e3e4a2d..0a699edf 100644 --- a/pkg/parser/mixed_lists_test.go +++ b/pkg/parser/mixed_lists_test.go @@ -8,57 +8,53 @@ import ( . "github.com/onsi/gomega" //nolint golint ) -var _ = Describe("mixed lists - document", func() { +var _ = Describe("mixed lists", func() { - Context("valid mixed lists", func() { + Context("in final documents", func() { - It("ordered list with nested unordered lists", func() { - source := `. Item 1 + Context("valid mixed lists", func() { + + It("ordered list with nested unordered lists", func() { + source := `. Item 1 * Item A * Item B . Item 2 * Item C * Item D` - expected := types.Document{ - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 1"}, + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "Item 1"}, }, }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item A"}, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "Item A"}, }, }, }, }, - }, - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item B"}, + &types.UnorderedListElement{ + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "Item B"}, }, }, }, @@ -67,43 +63,35 @@ var _ = Describe("mixed lists - document", func() { }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item 2"}, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "Item 2"}, }, }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item C"}, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "Item C"}, }, }, }, }, - }, - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Item D"}, + &types.UnorderedListElement{ + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "Item D"}, }, }, }, @@ -115,57 +103,60 @@ var _ = Describe("mixed lists - document", func() { }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("unordered list item and order list item with roman numbering", func() { - source := `- unordered list item + It("unordered list item and order list item with roman numbering", func() { + source := `- unordered list item II) ordered list item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "unordered list item", + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "unordered list item", + }, + }, }, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.UpperRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "ordered list item", + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.UpperRoman, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "ordered list item", + }, + }, + }, + }, + }, + }, }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) }) - }) - Context("complex cases", func() { + Context("complex cases", func() { - It("complex case 1 - mixed lists", func() { - source := `- unordered 1 + It("complex case 1 - mixed lists", func() { + source := `- unordered 1 1. ordered 1.1 a. ordered 1.1.a b. ordered 1.1.b @@ -177,71 +168,60 @@ var _ = Describe("mixed lists - document", func() { 4. ordered 1.4 - unordered 2 * unordered 2.1` - expected := types.Document{ - Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 1"}, + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "unordered 1"}, }, }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1"}, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.1"}, }, }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1.a"}, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.1.a"}, }, }, }, }, - }, - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1.b"}, + &types.OrderedListElement{ + Style: types.LowerAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.1.b"}, }, }, }, }, - }, - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1.c"}, + &types.OrderedListElement{ + Style: types.LowerAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.1.c"}, }, }, }, @@ -250,41 +230,33 @@ var _ = Describe("mixed lists - document", func() { }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.2"}, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.2"}, }, }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.2.i"}, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerRoman, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.2.i"}, }, }, }, }, - }, - { - Level: 2, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.2.ii"}, + &types.OrderedListElement{ + Style: types.LowerRoman, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.2.ii"}, }, }, }, @@ -293,28 +265,22 @@ var _ = Describe("mixed lists - document", func() { }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.3"}, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.3"}, }, }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.4"}, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.4"}, }, }, }, @@ -323,30 +289,25 @@ var _ = Describe("mixed lists - document", func() { }, }, }, - }, - { - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 2"}, + &types.UnorderedListElement{ + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "unordered 2"}, }, }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 2.1"}, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "unordered 2.1"}, }, }, }, @@ -358,13 +319,12 @@ var _ = Describe("mixed lists - document", func() { }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("complex case 2 - mixed lists", func() { - source := `- unordered 1 + It("complex case 2 - mixed lists", func() { + source := `- unordered 1 1. ordered 1.1 a. ordered 1.1.a b. ordered 1.1.b @@ -388,71 +348,60 @@ ii) ordered 1.2.ii .. ordered 3.2.I .. ordered 3.2.II . ordered 3.3` - expected := types.Document{ - Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 1"}, + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "unordered 1"}, }, }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1"}, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.1"}, }, }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1.a"}, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.1.a"}, }, }, }, }, - }, - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1.b"}, + &types.OrderedListElement{ + Style: types.LowerAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.1.b"}, }, }, }, }, - }, - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.1.c"}, + &types.OrderedListElement{ + Style: types.LowerAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.1.c"}, }, }, }, @@ -461,41 +410,33 @@ ii) ordered 1.2.ii }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.2"}, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.2"}, }, }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.2.i"}, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerRoman, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.2.i"}, }, }, }, }, - }, - { - Level: 2, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.2.ii"}, + &types.OrderedListElement{ + Style: types.LowerRoman, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.2.ii"}, }, }, }, @@ -504,28 +445,22 @@ ii) ordered 1.2.ii }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.3"}, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.3"}, }, }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 1.4"}, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 1.4"}, }, }, }, @@ -534,64 +469,48 @@ ii) ordered 1.2.ii }, }, }, - }, - { - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 2"}, + &types.UnorderedListElement{ + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "unordered 2"}, }, }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 2.1"}, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "unordered 2.1"}, }, }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 2.1.1"}, - }, - { - types.StringElement{Content: "with some"}, // heading tabs are trimmed - }, - { - types.StringElement{Content: "extra lines."}, // heading tabs are trimmed + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "unordered 2.1.1\nwith some\nextra lines."}, // heading tabs are trimmed }, }, }, }, - }, - { - Level: 3, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 2.1.2"}, + &types.UnorderedListElement{ + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "unordered 2.1.2"}, }, }, }, @@ -600,16 +519,13 @@ ii) ordered 1.2.ii }, }, }, - }, - { - Level: 2, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 2.2"}, + &types.UnorderedListElement{ + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "unordered 2.2"}, }, }, }, @@ -618,71 +534,58 @@ ii) ordered 1.2.ii }, }, }, - }, - { - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "unordered 3"}, + &types.UnorderedListElement{ + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "unordered 3"}, }, }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 3.1"}, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 3.1"}, }, }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 3.2"}, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 3.2"}, }, }, - }, - types.OrderedList{ - Attributes: types.Attributes{ - types.AttrStyle: "upperroman", - }, - Items: []types.OrderedListItem{ - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 3.2.I"}, + &types.List{ + Kind: types.OrderedListKind, + Attributes: types.Attributes{ + types.AttrStyle: "upperroman", + }, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 3.2.I"}, }, }, }, }, - }, - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 3.2.II"}, + &types.OrderedListElement{ + Style: types.LowerAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 3.2.II"}, }, }, }, @@ -691,15 +594,12 @@ ii) ordered 1.2.ii }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "ordered 3.3"}, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "ordered 3.3"}, }, }, }, @@ -711,57 +611,54 @@ ii) ordered 1.2.ii }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("complex case 4 - mixed lists", func() { - source := `.Mixed + It("complex case 4 - mixed lists", func() { + source := `.Mixed Operating Systems:: . Fedora * Desktop` - expected := types.Document{ - Elements: []interface{}{ - types.LabeledList{ - Attributes: types.Attributes{ - types.AttrTitle: "Mixed", - }, - Items: []types.LabeledListItem{ - { - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Operating Systems", + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.LabeledListKind, + Attributes: types.Attributes{ + types.AttrTitle: "Mixed", + }, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: "::", + Term: []interface{}{ + &types.StringElement{ + Content: "Operating Systems", + }, }, - }, - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Fedora", }, }, }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Desktop", }, }, @@ -779,13 +676,12 @@ Operating Systems:: }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("complex case 5 - mixed lists and a paragraph", func() { - source := `.Mixed + It("complex case 5 - mixed lists and a paragraph", func() { + source := `.Mixed Operating Systems:: Linux::: . Fedora @@ -807,57 +703,56 @@ Cloud Providers:: a paragraph ` - expected := types.Document{ - Elements: []interface{}{ - types.LabeledList{ - Attributes: types.Attributes{ - types.AttrTitle: "Mixed", - }, - Items: []types.LabeledListItem{ - { - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Operating Systems", + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.LabeledListKind, + Attributes: types.Attributes{ + types.AttrTitle: "Mixed", + }, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: "::", + Term: []interface{}{ + &types.StringElement{ + Content: "Operating Systems", + }, }, - }, - Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 2, - Term: []interface{}{ - types.StringElement{ - Content: "Linux", + Elements: []interface{}{ + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: ":::", + Term: []interface{}{ + &types.StringElement{ + Content: "Linux", + }, }, - }, - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Fedora", }, }, }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Desktop", }, }, @@ -868,47 +763,39 @@ a paragraph }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Ubuntu", }, }, }, - }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Desktop", }, }, }, }, }, - }, - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.UnorderedListElement{ + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Server", }, }, @@ -923,40 +810,35 @@ a paragraph }, }, }, - }, - { - Level: 2, - Term: []interface{}{ - types.StringElement{ - Content: "BSD", + &types.LabeledListElement{ + Style: ":::", + Term: []interface{}{ + &types.StringElement{ + Content: "BSD", + }, }, - }, - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "FreeBSD", }, }, }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "NetBSD", }, }, @@ -971,50 +853,46 @@ a paragraph }, }, }, - }, - { - Level: 1, - Term: []interface{}{ - types.StringElement{ - Content: "Cloud Providers", + &types.LabeledListElement{ + Style: "::", + Term: []interface{}{ + &types.StringElement{ + Content: "Cloud Providers", + }, }, - }, - Elements: []interface{}{ - types.LabeledList{ - Items: []types.LabeledListItem{ - { - Level: 2, - Term: []interface{}{ - types.StringElement{ - Content: "PaaS", + Elements: []interface{}{ + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: ":::", + Term: []interface{}{ + &types.StringElement{ + Content: "PaaS", + }, }, - }, - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "OpenShift", }, }, }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "CloudBees", }, }, @@ -1025,40 +903,35 @@ a paragraph }, }, }, - }, - { - Level: 2, - Term: []interface{}{ - types.StringElement{ - Content: "IaaS", + &types.LabeledListElement{ + Style: ":::", + Term: []interface{}{ + &types.StringElement{ + Content: "IaaS", + }, }, - }, - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Amazon EC2", }, }, }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Rackspace", }, }, @@ -1075,61 +948,54 @@ a paragraph }, }, }, - }, - // types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "a paragraph", }, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) }) - }) - Context("distinct list blocks", func() { + Context("distinct list blocks", func() { - It("same list without attributes", func() { - source := `[lowerroman, start=5] + It("same list without attributes", func() { + source := `[lowerroman, start=5] . Five .. a . Six` - expected := types.Document{ - Elements: []interface{}{ // a single ordered list - types.OrderedList{ - Attributes: types.Attributes{ - types.AttrStyle: "lowerroman", - types.AttrStart: "5", - }, - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, // will be overridden during rendering - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + expected := &types.Document{ + Elements: []interface{}{ // a single ordered list + &types.List{ + Kind: types.OrderedListKind, + Attributes: types.Attributes{ + types.AttrStyle: "lowerroman", + types.AttrStart: "5", + }, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, // will be overridden during rendering + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Five", }, }, }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "a", }, }, @@ -1140,15 +1006,12 @@ a paragraph }, }, }, - }, - { - Level: 1, - Style: types.Arabic, // will be overridden during rendering - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.OrderedListElement{ + Style: types.Arabic, // will be overridden during rendering + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Six", }, }, @@ -1158,68 +1021,61 @@ a paragraph }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("same list with custom number style on sublist", func() { - // need to be aligned on first column of file - source := `[lowerroman, start=5] + It("same list with custom number style on sublist", func() { + // need to be aligned on first column of file + source := `[lowerroman, start=5] . Five [upperalpha] .. a .. b . Six` - expected := types.Document{ - Elements: []interface{}{ // a single ordered list - types.OrderedList{ - Attributes: types.Attributes{ - types.AttrStyle: "lowerroman", - types.AttrStart: "5", - }, - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, // will be overridden during rendering - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + expected := &types.Document{ + Elements: []interface{}{ // a single ordered list + &types.List{ + Kind: types.OrderedListKind, + Attributes: types.Attributes{ + types.AttrStyle: "lowerroman", + types.AttrStart: "5", + }, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, // will be overridden during rendering + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Five", }, }, }, - }, - types.OrderedList{ - Attributes: types.Attributes{ - types.AttrStyle: "upperalpha", - }, - Items: []types.OrderedListItem{ - { - Level: 2, - Style: types.LowerAlpha, // will be overridden during rendering - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.List{ + Kind: types.OrderedListKind, + Attributes: types.Attributes{ + types.AttrStyle: "upperalpha", + }, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerAlpha, // will be overridden during rendering + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "a", }, }, }, }, }, - }, - { - Level: 2, - Style: types.LowerAlpha, // will be overridden during rendering - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.OrderedListElement{ + Style: types.LowerAlpha, // will be overridden during rendering + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "b", }, }, @@ -1230,15 +1086,12 @@ a paragraph }, }, }, - }, - { - Level: 1, - Style: types.Arabic, // will be overridden during rendering - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.OrderedListElement{ + Style: types.Arabic, // will be overridden during rendering + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Six", }, }, @@ -1248,34 +1101,32 @@ a paragraph }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("distinct lists with blankline and item attribute - case 1", func() { - source := `[lowerroman, start=5] + It("distinct lists with blankline and item attribute - case 1", func() { + source := `[lowerroman, start=5] . Five [upperalpha] .. a . Six` - expected := types.Document{ - Elements: []interface{}{ // a single ordered list - types.OrderedList{ - Attributes: types.Attributes{ - types.AttrStyle: "lowerroman", - types.AttrStart: "5", - }, - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + expected := &types.Document{ + Elements: []interface{}{ // 2 distinct ordered lists because of `[upperalpha]` + &types.List{ + Kind: types.OrderedListKind, + Attributes: types.Attributes{ + types.AttrStyle: "lowerroman", + types.AttrStart: "5", + }, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Five", }, }, @@ -1284,35 +1135,31 @@ a paragraph }, }, }, - }, - types.OrderedList{ - Attributes: types.Attributes{ - types.AttrStyle: "upperalpha", - }, - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.List{ + Kind: types.OrderedListKind, + Attributes: types.Attributes{ + types.AttrStyle: "upperalpha", + }, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "a", }, }, }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Six", }, }, @@ -1326,55 +1173,53 @@ a paragraph }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("distinct lists with blankline and item attribute - case 2", func() { + It("distinct lists with blankline and item attribute - case 2", func() { - source := `.Checklist + source := `.Checklist - [*] checked - normal list item .Ordered, basic . Step 1 . Step 2` - expected := types.Document{ - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.Attributes{ - types.AttrTitle: "Checklist", - }, - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.Checked, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrCheckStyle: types.Checked, - }, - Lines: [][]interface{}{ - { - types.StringElement{ + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.UnorderedListKind, + Attributes: types.Attributes{ + types.AttrTitle: "Checklist", + }, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.Dash, + CheckStyle: types.Checked, + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrCheckStyle: types.Checked, + }, + Elements: []interface{}{ + &types.StringElement{ Content: "checked", }, }, }, }, }, - }, - { - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.UnorderedListElement{ + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + // Attributes: types.Attributes{ + // types.AttrCheckStyle: types.NoCheck, + // }, + Elements: []interface{}{ + &types.StringElement{ Content: "normal list item", }, }, @@ -1383,35 +1228,30 @@ a paragraph }, }, }, - }, - types.OrderedList{ - Attributes: types.Attributes{ - types.AttrTitle: "Ordered, basic", - }, - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.List{ + Kind: types.OrderedListKind, + Attributes: types.Attributes{ + types.AttrTitle: "Ordered, basic", + }, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Step 1", }, }, }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "Step 2", }, }, @@ -1421,42 +1261,40 @@ a paragraph }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("same list with single comment line inside", func() { - source := `. a + It("same list with single comment line inside", func() { + source := `. a // - . b` - expected := types.Document{ - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "a", }, }, }, + // &types.SingleLineComment{ + // Content: " -", + // }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "b", }, }, @@ -1466,44 +1304,48 @@ a paragraph }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("same list with multiple comment lines inside", func() { - source := `. a + It("same list with multiple comment lines inside", func() { + source := `. a // - // - // - . b` - expected := types.Document{ - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "a", }, }, }, + // &types.SingleLineComment{ + // Content: " -", + // }, + // &types.SingleLineComment{ + // Content: " -", + // }, + // &types.SingleLineComment{ + // Content: " -", + // }, }, }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "b", }, }, @@ -1513,28 +1355,26 @@ a paragraph }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("distinct lists separated by single comment line", func() { - source := `. a + It("distinct lists separated by single comment line", func() { + source := `. a // - . b` - expected := types.Document{ - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "a", }, }, @@ -1543,17 +1383,18 @@ a paragraph }, }, }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + // &types.SingleLineComment{ + // Content: " -", + // }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "b", }, }, @@ -1563,30 +1404,28 @@ a paragraph }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("distinct lists separated by multiple comment lines", func() { - source := `. a + It("distinct lists separated by multiple comment lines", func() { + source := `. a // - // - // - . b` - expected := types.Document{ - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "a", }, }, @@ -1595,17 +1434,24 @@ a paragraph }, }, }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ + // &types.SingleLineComment{ + // Content: " -", + // }, + // &types.SingleLineComment{ + // Content: " -", + // }, + // &types.SingleLineComment{ + // Content: " -", + // }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "b", }, }, @@ -1615,9 +1461,9 @@ a paragraph }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) }) }) }) diff --git a/pkg/parser/ordered_list_test.go b/pkg/parser/ordered_list_test.go index 1a7f746d..e4094d7d 100644 --- a/pkg/parser/ordered_list_test.go +++ b/pkg/parser/ordered_list_test.go @@ -10,1033 +10,39 @@ import ( var _ = Describe("ordered lists", func() { - Context("draft documents", func() { - - Context("ordered list item alone", func() { - - // same single item in the list for each test in this context - elements := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item"}, - }, - }, - }, - } - - It("ordered list item with implicit numbering style", func() { - source := `.. item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 2, - Style: types.LowerAlpha, - Elements: elements, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("ordered list item with arabic numbering style", func() { - source := `1. item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: elements, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("ordered list item with lower alpha numbering style", func() { - source := `b. item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.LowerAlpha, - Elements: elements, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("ordered list item with upper alpha numbering style", func() { - source := `B. item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.UpperAlpha, - Elements: elements, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("ordered list item with lower roman numbering style", func() { - source := `i) item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.LowerRoman, - Elements: elements, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("ordered list item with upper roman numbering style", func() { - source := `I) item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.UpperRoman, - Elements: elements, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("ordered list item with explicit numbering style", func() { - source := `[lowerroman] -. item -. item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Attributes: types.Attributes{ - "style": "lowerroman", - }, - Level: 1, - Style: types.Arabic, - Elements: elements, - }, - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: elements, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("ordered list item with explicit start only", func() { - source := `[start=5] -. item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Attributes: types.Attributes{ - "start": "5", - }, - Elements: elements, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("ordered list item with explicit quoted numbering and start", func() { - source := `["lowerroman", start="5"] -. item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Attributes: types.Attributes{ - "style": "lowerroman", - "start": "5", - }, - Elements: elements, - }, - }, - } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) - }) - - It("max level of ordered items - case 1", func() { - source := `.Ordered, max nesting -. level 1 -.. level 2 -... level 3 -.... level 4 -..... level 5 -. level 1` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Attributes: types.Attributes{ - types.AttrTitle: "Ordered, max nesting", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", - }, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 3, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", - }, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 4, - Style: types.UpperAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", - }, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 5, - Style: types.UpperRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", - }, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("max level of ordered items - case 2", func() { - source := `.Ordered, max nesting -. level 1 -.. level 2 -... level 3 -.... level 4 -..... level 5 -.. level 2b` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Attributes: types.Attributes{ - types.AttrTitle: "Ordered, max nesting", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", - }, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 3, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", - }, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 4, - Style: types.UpperAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", - }, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 5, - Style: types.UpperRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", - }, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2b", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("items without numbers", func() { - - It("ordered list with simple unnumbered items", func() { - source := `. a -. b` - - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "b"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("ordered list with unnumbered items", func() { - source := `. item 1 -. item 2` - - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("ordered list with custom numbering on child items with tabs ", func() { - // note: the [upperroman] attribute must be at the beginning of the line - source := `. item 1 - .. item 1.1 -[upperroman] - ... item 1.1.1 - ... item 1.1.2 - .. item 1.2 - . item 2 - .. item 2.1` - - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 3, - Style: types.LowerRoman, - Attributes: types.Attributes{ - "style": "upperroman", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1.1"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 3, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1.2"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2.1"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("ordered list with all default styles and blank lines", func() { - source := `. level 1 - -.. level 2 - - -... level 3 - - - -.... level 4 -..... level 5. - - -` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "level 1"}, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.OrderedListItem{ - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "level 2"}, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.OrderedListItem{ - Level: 3, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "level 3"}, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.BlankLine{}, - types.OrderedListItem{ - Level: 4, - Style: types.UpperAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "level 4"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 5, - Style: types.UpperRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "level 5."}, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.BlankLine{}, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("numbered items", func() { - - It("ordered list with simple numbered items", func() { - source := `1. a -2. b` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "b"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("ordered list with numbered items", func() { - source := `1. item 1 -a. item 1.a -2. item 2 -b. item 2.a` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.a"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2.a"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("list item continuation", func() { - - It("ordered list with item continuation - case 1", func() { - source := `. foo -+ ----- -a delimited block ----- -+ ----- -another delimited block ----- -. bar -` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "foo", - }, - }, - }, - }, - }, - }, - types.ContinuedListItemElement{ - Offset: 0, - Element: types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a delimited block", - }, - }, - }, - }, - }, - types.ContinuedListItemElement{ - Offset: 0, - Element: types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "another delimited block", - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "bar", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("ordered list with item continuation - case 2", func() { - source := `. {blank} -+ ----- -print("one") ----- -. {blank} -+ ----- -print("two") -----` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.PredefinedAttribute{Name: "blank"}, - }, - }, - }, - }, - }, - types.ContinuedListItemElement{ - Offset: 0, - Element: types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "print(\"one\")", - }, - }, - }, - }, - }, - types.OrderedListItem{ - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.PredefinedAttribute{Name: "blank"}, - }, - }, - }, - }, - }, - types.ContinuedListItemElement{ - Offset: 0, - Element: types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "print(\"two\")", - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("final documents", func() { - - Context("ordered list item alone", func() { - - // same single item in the list for each test in this context - elements := []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item"}, - }, + Context("in final documents", func() { + + // same single element in the list for each test in this context + elements := []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "element", }, }, - } - - It("ordered list item with implicit numbering style", func() { - source := `.. item` - expected := types.Document{ - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.LowerAlpha, - Elements: elements, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("ordered list item with arabic numbering style", func() { - source := `1. item` - expected := types.Document{ - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: elements, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("ordered list item with lower alpha numbering style", func() { - source := `b. item` - expected := types.Document{ - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.LowerAlpha, - Elements: elements, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("ordered list item with upper alpha numbering style", func() { - source := `B. item` - expected := types.Document{ - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - - Level: 1, - Style: types.UpperAlpha, - Elements: elements, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + }, + } - It("ordered list item with lower roman numbering style", func() { - source := `i) item` - expected := types.Document{ - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.LowerRoman, - Elements: elements, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + Context("ordered list element alone", func() { - It("ordered list item with upper roman numbering style", func() { - source := `I) item` - expected := types.Document{ + It("with implicit numbering style on a single line", func() { + source := `. element on a single line` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.UpperRoman, - Elements: elements, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "element on a single line", + }, + }, + }, + }, }, }, }, @@ -1045,20 +51,25 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list item with predefined attribute", func() { - source := `. {amp}` - expected := types.Document{ + It("with implicit numbering style on multiple lines with tabs", func() { + // heading and trailing spaces must be trimmed on each line + source := `. element + on + multiple + lines +` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.PredefinedAttribute{Name: "amp"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "element\non\nmultiple\nlines", // spaces are trimmed }, }, }, @@ -1071,25 +82,15 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list item with explicit numbering style", func() { - source := `[lowerroman] -. item -. item` - expected := types.Document{ + It("with implicit numbering style", func() { + source := `. element` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Attributes: types.Attributes{ - types.AttrStyle: "lowerroman", // will be used during rendering - }, - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, // will be overridden during rendering - Elements: elements, - }, - { - Level: 1, - Style: types.Arabic, // will be overridden during rendering + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, Elements: elements, }, }, @@ -1099,19 +100,15 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list item with explicit start only", func() { - source := `[start=5] -. item` - expected := types.Document{ + It("with unnecessary level and numbering style adjustments", func() { + source := `.. element` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Attributes: types.Attributes{ - "start": "5", - }, - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerAlpha, Elements: elements, }, }, @@ -1121,20 +118,15 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list item with explicit quoted numbering and start", func() { - source := `["lowerroman", start="5"] -. item` - expected := types.Document{ + It("with arabic numbering style", func() { + source := `1. element` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Attributes: types.Attributes{ - types.AttrStyle: "lowerroman", // will be used during rendering - "start": "5", - }, - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, // will be overridden during rendering + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, Elements: elements, }, }, @@ -1144,126 +136,16 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("max level of ordered items - case 1", func() { - source := `.Ordered, max nesting -. level 1 -.. level 2 -... level 3 -.... level 4 -..... level 5 -. level 1` - expected := types.Document{ + It("with lower alpha numbering style", func() { + source := `b. element` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Attributes: types.Attributes{ - types.AttrTitle: "Ordered, max nesting", - }, - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, - }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", - }, - }, - }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 3, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", - }, - }, - }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 4, - Style: types.UpperAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", - }, - }, - }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 5, - Style: types.UpperRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, - }, - }, - }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerAlpha, + Elements: elements, }, }, }, @@ -1272,123 +154,73 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("max level of ordered items - case 2", func() { - source := `.Ordered, max nesting -. level 1 -.. level 2 -... level 3 -.... level 4 -..... level 5 -.. level 2b` - expected := types.Document{ + It("with upper alpha numbering style", func() { + source := `B. element` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Attributes: types.Attributes{ - types.AttrTitle: "Ordered, max nesting", - }, - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, - }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", - }, - }, - }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 3, - Style: types.LowerRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", - }, - }, - }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 4, - Style: types.UpperAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", - }, - }, - }, - }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 5, - Style: types.UpperRoman, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - Level: 2, - Style: types.LowerAlpha, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2b", - }, - }, - }, - }, - }, - }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.UpperAlpha, + Elements: elements, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("with lower roman numbering style", func() { + source := `i) element` + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerRoman, + Elements: elements, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("with upper roman numbering style", func() { + source := `I) element` + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.UpperRoman, + Elements: elements, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("with predefined attribute", func() { + source := `. {amp}` + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.PredefinedAttribute{Name: "amp"}, }, }, }, @@ -1399,40 +231,81 @@ print("two") } Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + + It("with explicit start only", func() { + source := `[start=5] +. element` + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Attributes: types.Attributes{ + "start": "5", + }, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: elements, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("with explicit quoted numbering and start", func() { + source := `["lowerroman", start="5"] +. element` + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Attributes: types.Attributes{ + types.AttrStyle: "lowerroman", // will be used during rendering + "start": "5", + }, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, // will be overridden during rendering + Elements: elements, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) - Context("items without numbers", func() { + Context("elements without numbers", func() { - It("ordered list with simple unnumbered items", func() { + It("ordered list with simple unnumbered elements", func() { source := `. a . b` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a"}, }, }, }, }, - { - Level: 1, + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "b"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "b"}, }, }, }, @@ -1444,36 +317,58 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list with unnumbered items", func() { - source := `. item 1 -. item 2` + It("with explicit numbering style", func() { + source := `[lowerroman] +. element +. element` + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Attributes: types.Attributes{ + types.AttrStyle: "lowerroman", // will be used during rendering + }, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, // will be overridden during rendering + Elements: elements, + }, + &types.OrderedListElement{ + Style: types.Arabic, // will be overridden during rendering + Elements: elements, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("ordered list with unnumbered elements", func() { + source := `. element 1 +. element 2` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "element 1"}, }, }, }, }, - { - Level: 1, + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "element 2"}, }, }, }, @@ -1485,72 +380,63 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list with custom numbering on child items with tabs ", func() { + It("ordered list with custom numbering on child elements with tabs ", func() { // note: the [upperroman] attribute must be at the beginning of the line - source := `. item 1 - .. item 1.1 + source := `. element 1 + .. element 1.1 [upperroman] - ... item 1.1.1 - ... item 1.1.2 - .. item 1.2 - . item 2 - .. item 2.1` + ... element 1.1.1 + ... element 1.1.2 + .. element 1.2 + . element 2 + .. element 2.1` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "element 1"}, }, }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.LowerAlpha, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "element 1.1"}, }, }, - types.OrderedList{ + &types.List{ + Kind: types.OrderedListKind, Attributes: types.Attributes{ types.AttrStyle: "upperroman", }, - Items: []types.OrderedListItem{ - { - Level: 3, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.LowerRoman, // will be overridden during rendering Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1.1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "element 1.1.1"}, }, }, }, }, - { - Level: 3, + &types.OrderedListElement{ Style: types.LowerRoman, // will be overridden during rendering Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1.2"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "element 1.1.2"}, }, }, }, @@ -1559,15 +445,12 @@ print("two") }, }, }, - { - Level: 2, + &types.OrderedListElement{ Style: types.LowerAlpha, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "element 1.2"}, }, }, }, @@ -1576,28 +459,23 @@ print("two") }, }, }, - { - Level: 1, + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "element 2"}, }, }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.LowerAlpha, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2.1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "element 2.1"}, }, }, }, @@ -1628,71 +506,150 @@ print("two") ` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "level 1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 1"}, }, }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.LowerAlpha, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "level 2"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 2"}, }, }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 3, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.LowerRoman, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "level 3"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 3"}, }, }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 4, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.UpperAlpha, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "level 4"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 4"}, + }, + }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.UpperRoman, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 5."}, + }, + }, + }, }, }, }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 5, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("ordered list with all default styles and no blank line", func() { + source := `. level 1 +.. level 2 +... level 3 +.... level 4 +..... level 5. +` + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 1"}, + }, + }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 2"}, + }, + }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerRoman, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 3"}, + }, + }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.UpperAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 4"}, + }, + }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.UpperRoman, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "level 5."}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 5."}, }, }, }, @@ -1721,37 +678,32 @@ print("two") }) }) - Context("numbered items", func() { + Context("numbered elements", func() { - It("ordered list with simple numbered items", func() { + It("ordered list with simple numbered elements", func() { source := `1. a 2. b` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a"}, }, }, }, }, - { - Level: 1, + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "b"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "b"}, }, }, }, @@ -1763,36 +715,93 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list with numbered items", func() { - source := `1. item 1 -a. item 1.a -2. item 2 -b. item 2.a` - expected := types.Document{ + It("max level of ordered elements - case 1", func() { + source := `.Ordered, max nesting +. level 1 +.. level 2 +... level 3 +.... level 4 +..... level 5 +. level 1` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Attributes: types.Attributes{ + types.AttrTitle: "Ordered, max nesting", + }, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "level 1", }, }, }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.LowerAlpha, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.a"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "level 2", + }, + }, + }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerRoman, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "level 3", + }, + }, + }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.UpperAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "level 4", + }, + }, + }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.UpperRoman, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "level 5", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, @@ -1802,28 +811,77 @@ b. item 2.a` }, }, }, - { - Level: 1, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "level 1", + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("ordered list with numbered elements", func() { + source := `1. element 1 +a. element 1.a +2. element 2 +b. element 2.a` + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "element 1"}, + }, + }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.LowerAlpha, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "element 1.a"}, + }, + }, + }, }, }, }, - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 2, + }, + }, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "element 2"}, + }, + }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.LowerAlpha, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2.a"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "element 2.a"}, }, }, }, @@ -1840,9 +898,9 @@ b. item 2.a` }) }) - Context("list item continuation", func() { + Context("list element continuation", func() { - It("ordered list with item continuation - case 1", func() { + It("ordered list with element continuation - case 1", func() { source := `. foo + ---- @@ -1854,50 +912,43 @@ another delimited block ---- . bar ` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "foo"}, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a delimited block", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "a delimited block", }, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "another delimited block", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "another delimited block", }, }, }, }, }, - { - Level: 1, + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "bar"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "bar"}, }, }, }, @@ -1909,7 +960,7 @@ another delimited block Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list with item continuation - case 2", func() { + It("ordered list with element continuation - case 2", func() { source := `. {blank} + ---- @@ -1920,49 +971,106 @@ print("one") ---- print("two") ----` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.PredefinedAttribute{Name: "blank"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.PredefinedAttribute{Name: "blank"}, + }, + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "print(\"one\")", }, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "print(\"one\")", - }, + }, + }, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.PredefinedAttribute{Name: "blank"}, + }, + }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "print(\"two\")", + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("ordered list with element continuation - case 3", func() { + // continuation with "continued element" being a list element (ie, kinda invalid/empty continuation in the middle of a list) + source := `. element 1 ++ +a paragraph +. element 2 ++ +. element 3 +` + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "element 1", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph", }, }, }, }, }, - { - Level: 1, + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.PredefinedAttribute{Name: "blank"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "element 2", }, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "print(\"two\")", - }, + }, + }, + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "element 3", }, }, }, diff --git a/pkg/parser/paragragh_debug_test.go b/pkg/parser/paragragh_debug_test.go new file mode 100644 index 00000000..83fbce31 --- /dev/null +++ b/pkg/parser/paragragh_debug_test.go @@ -0,0 +1,65 @@ +// +build stats + +package parser_test + +import ( + "encoding/json" + "fmt" + + "github.com/bytesparadise/libasciidoc/pkg/parser" + "github.com/bytesparadise/libasciidoc/pkg/types" + . "github.com/bytesparadise/libasciidoc/testsupport" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("paragraphs", func() { + + It("multiline paragraph with rich content", func() { + source := `:fds-version: 6.7.4 + +PyroSim is a graphical user interface for the https://github.com/firemodels/fds/releases/tag/FDS{fds-version}/[Fire Dynamics Simulator (FDS) version {fds-version}]. +FDS is closely integrated into PyroSim. +FDS models can predict smoke, temperature, carbon monoxide, and other substances during fires. +The results of these simulations are used to ensure the safety of buildings before construction, evaluate safety options of existing buildings, reconstruct fires for post-accident investigation, and assist in firefighter training. +` + expected := &types.Document{ + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "fds-version", + Value: string("6.7.4"), + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "PyroSim is a graphical user interface for the ", + }, + // https://github.com/firemodels/fds/releases/tag/FDS{fds-version}/[Fire Dynamics Simulator (FDS) version {fds-version}] + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "Fire Dynamics Simulator (FDS) version 6.7.4", + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com/firemodels/fds/releases/tag/FDS6.7.4/", + }, + }, + }, + }, + &types.StringElement{ + Content: ".\nFDS is closely integrated into PyroSim.\nFDS models can predict smoke, temperature, carbon monoxide, and other substances during fires.\nThe results of these simulations are used to ensure the safety of buildings before construction, evaluate safety options of existing buildings, reconstruct fires for post-accident investigation, and assist in firefighter training.", + }, + }, + }, + }, + } + stats := parser.Stats{} + Expect(ParseDocument(source, parser.Debug(true), parser.Statistics(&stats, "no match"))).To(MatchDocument(expected)) + fmt.Printf("ExprCnt: %d\n", stats.ExprCnt) + result, _ := json.MarshalIndent(stats.ChoiceAltCnt, " ", " ") + fmt.Printf("ChoiceAltCnt: \n%s\n", result) + }) +}) diff --git a/pkg/parser/paragragh_stats_test.go b/pkg/parser/paragragh_stats_test.go new file mode 100644 index 00000000..83fbce31 --- /dev/null +++ b/pkg/parser/paragragh_stats_test.go @@ -0,0 +1,65 @@ +// +build stats + +package parser_test + +import ( + "encoding/json" + "fmt" + + "github.com/bytesparadise/libasciidoc/pkg/parser" + "github.com/bytesparadise/libasciidoc/pkg/types" + . "github.com/bytesparadise/libasciidoc/testsupport" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("paragraphs", func() { + + It("multiline paragraph with rich content", func() { + source := `:fds-version: 6.7.4 + +PyroSim is a graphical user interface for the https://github.com/firemodels/fds/releases/tag/FDS{fds-version}/[Fire Dynamics Simulator (FDS) version {fds-version}]. +FDS is closely integrated into PyroSim. +FDS models can predict smoke, temperature, carbon monoxide, and other substances during fires. +The results of these simulations are used to ensure the safety of buildings before construction, evaluate safety options of existing buildings, reconstruct fires for post-accident investigation, and assist in firefighter training. +` + expected := &types.Document{ + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "fds-version", + Value: string("6.7.4"), + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "PyroSim is a graphical user interface for the ", + }, + // https://github.com/firemodels/fds/releases/tag/FDS{fds-version}/[Fire Dynamics Simulator (FDS) version {fds-version}] + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "Fire Dynamics Simulator (FDS) version 6.7.4", + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com/firemodels/fds/releases/tag/FDS6.7.4/", + }, + }, + }, + }, + &types.StringElement{ + Content: ".\nFDS is closely integrated into PyroSim.\nFDS models can predict smoke, temperature, carbon monoxide, and other substances during fires.\nThe results of these simulations are used to ensure the safety of buildings before construction, evaluate safety options of existing buildings, reconstruct fires for post-accident investigation, and assist in firefighter training.", + }, + }, + }, + }, + } + stats := parser.Stats{} + Expect(ParseDocument(source, parser.Debug(true), parser.Statistics(&stats, "no match"))).To(MatchDocument(expected)) + fmt.Printf("ExprCnt: %d\n", stats.ExprCnt) + result, _ := json.MarshalIndent(stats.ChoiceAltCnt, " ", " ") + fmt.Printf("ChoiceAltCnt: \n%s\n", result) + }) +}) diff --git a/pkg/parser/paragraph_test.go b/pkg/parser/paragraph_test.go index 0945d76d..57e8bc78 100644 --- a/pkg/parser/paragraph_test.go +++ b/pkg/parser/paragraph_test.go @@ -12,1022 +12,1460 @@ import ( var _ = Describe("paragraphs", func() { - Context("draft documents", func() { + Context("in raw documents", func() { Context("regular paragraphs", func() { - It("with explicit line break", func() { - source := `foo + -bar -baz` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - types.LineBreak{}, - }, - { - types.StringElement{Content: "bar"}, - }, - { - types.StringElement{Content: "baz"}, + It("with basic content", func() { + source := `cookie +chocolate +pasta` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("cookie"), + types.RawLine("chocolate"), + types.RawLine("pasta"), }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("with hardbreaks attribute", func() { source := `[%hardbreaks] -foo -bar -baz` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrOptions: []interface{}{"hardbreaks"}, +cookie +chocolate +pasta` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrOptions: []interface{}{"hardbreaks"}, + }, + Elements: []interface{}{ + types.RawLine("cookie"), + types.RawLine("chocolate"), + types.RawLine("pasta"), + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + It("with title attribute", func() { + source := `[title=my title] +cookie +pasta` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrTitle: "my title", + }, + Elements: []interface{}{ + types.RawLine("cookie"), + types.RawLine("pasta"), + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + It("with custom title attribute - explicit and unquoted", func() { + source := `:title: cookies + +[title=my {title}] +cookie +pasta` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "title", + Value: "cookies", + }, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrTitle: []interface{}{ + &types.StringElement{ + Content: "my ", + }, + &types.AttributeSubstitution{ + Name: "title", + }, + }, + }, + Elements: []interface{}{ + types.RawLine("cookie"), + types.RawLine("pasta"), + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + It("with multiple attributes and blanklines in-between", func() { + // attributes with blanklines in-between are dropped :/ + source := `[%hardbreaks.role1.role2] + +[#anchor] + +cookie +pasta` + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("cookie"), + types.RawLine("pasta"), + }, + }, + }, + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) + }) + + Context("with custom substitutions", func() { + + // using the same input for all substitution tests + source := `:github-url: https://github.com +:github-title: GitHub + +[subs="$SUBS"] +links to {github-title}: https://github.com[{github-title}] and ** +and another one using attribute substitution: {github-url}[{github-title}]... +// a single-line comment.` + + It("should read multiple lines", func() { + s := strings.ReplaceAll(source, "$SUBS", "normal") + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-url", + Value: "https://github.com", + }, + }, + }, + { + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "github-title", + Value: "GitHub", + }, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrSubstitutions: "normal", + }, + Elements: []interface{}{ + types.RawLine("links to {github-title}: https://github.com[{github-title}] and **"), + types.RawLine("and another one using attribute substitution: {github-url}[{github-title}]..."), + &types.SingleLineComment{ + Content: " a single-line comment.", + }, + }, + }, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, + }, + } + Expect(ParseDocumentFragments(s)).To(MatchDocumentFragments(expected)) + }) + + }) + }) + }) + + Context("in final documents", func() { + + Context("regular paragraphs", func() { + + It("3 with basic content", func() { + source := `cookie + +chocolate + +pasta` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie", }, - { - types.StringElement{Content: "bar"}, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "chocolate", }, - { - types.StringElement{Content: "baz"}, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "pasta", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + result, err := ParseDocument(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDocument(expected)) }) It("with title attribute", func() { - source := `[title=My Title] -foo -baz` - expected := types.DraftDocument{ + source := `[title=my title] +cookie +pasta` + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ - types.AttrTitle: "My Title", + types.AttrTitle: "my title", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - { - types.StringElement{Content: "baz"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie\npasta", }, }, }, }, } - result, err := ParseDraftDocument(source) + result, err := ParseDocument(source) Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(result).To(MatchDocument(expected)) }) It("with custom title attribute - explicit and unquoted", func() { source := `:title: cookies [title=my {title}] -foo -baz` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "title": "cookies", - }, +cookie +pasta` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "title": "cookies", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "title", Value: "cookies", }, - types.BlankLine{}, - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrTitle: "my cookies", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - { - types.StringElement{Content: "baz"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie\npasta", }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with custom title attribute - explicit and single quoted", func() { source := `:title: cookies [title='my {title}'] -foo -baz` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "title": "cookies", - }, +cookie +pasta` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "title": "cookies", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "title", Value: "cookies", }, - types.BlankLine{}, - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrTitle: "my cookies", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - { - types.StringElement{Content: "baz"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie\npasta", }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with custom title attribute - explicit and double quoted", func() { source := `:title: cookies [title="my {title}"] -foo -baz` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "title": "cookies", - }, +cookie +pasta` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "title": "cookies", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "title", Value: "cookies", }, - types.BlankLine{}, - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrTitle: "my cookies", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - { - types.StringElement{Content: "baz"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie\npasta", }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with custom title attribute - implicit", func() { source := `:title: cookies .my {title} -foo -baz` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "title": "cookies", - }, +cookie +pasta` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "title": "cookies", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "title", Value: "cookies", }, - types.BlankLine{}, - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrTitle: "my cookies", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - { - types.StringElement{Content: "baz"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie\npasta", }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with multiple attributes without blanklines in-between", func() { source := `[%hardbreaks.role1.role2] [#anchor] -foo -baz` - expected := types.DraftDocument{ +cookie +pasta` + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrID: "anchor", types.AttrRoles: []interface{}{"role1", "role2"}, types.AttrOptions: []interface{}{"hardbreaks"}, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - { - types.StringElement{Content: "baz"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie\npasta", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with multiple attributes and blanklines in-between", func() { + // attributes are not to paragraph because of blanklines source := `[%hardbreaks.role1.role2] [#anchor] -foo -baz` - expected := types.DraftDocument{ +cookie +pasta` + expected := &types.Document{ Elements: []interface{}{ - types.BlankLine{}, // attribute not retained in blankline - types.BlankLine{}, // attribute not retained in blankline - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - { - types.StringElement{Content: "baz"}, + &types.Paragraph{ + // Attributes: types.Attributes{ + // types.AttrID: "anchor", + // types.AttrRoles: []interface{}{string("role1"), string("role2")}, + // types.AttrOptions: []interface{}{string("hardbreaks")}, + // }, + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie\npasta", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with paragraph roles and attribute - case 1", func() { source := `[.role1%hardbreaks.role2] -foo -bar -baz` - expected := types.DraftDocument{ +cookie +pasta` + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrOptions: []interface{}{"hardbreaks"}, types.AttrRoles: []interface{}{"role1", "role2"}, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - { - types.StringElement{Content: "bar"}, - }, - { - types.StringElement{Content: "baz"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie\npasta", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with paragraph roles - case 2", func() { source := `[.role1%hardbreaks] [.role2] -foo -bar -baz` - expected := types.DraftDocument{ +cookie +pasta` + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrOptions: []interface{}{"hardbreaks"}, types.AttrRoles: []interface{}{"role1", "role2"}, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - { - types.StringElement{Content: "bar"}, - }, - { - types.StringElement{Content: "baz"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie\npasta", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("not treat plusplus as line break", func() { source := `C++ -foo` - expected := types.DraftDocument{ +cookie` + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "C++"}, - }, - { - types.StringElement{Content: "foo"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "C++\ncookie", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) Context("with counters", func() { It("default", func() { - source := `foo{counter:foo} bar{counter2:foo} baz{counter:foo} bob{counter:bob}` - expected := types.DraftDocument{ + source := `cookie{counter:cookie} chocolate{counter2:cookie} pasta{counter:cookie} bob{counter:bob}` + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo1 bar baz3 bob1"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie1 chocolate pasta3 bob1", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with numeric start", func() { - source := `foo{counter:foo:2} bar{counter2:foo} baz{counter:foo} bob{counter:bob:10}` - expected := types.DraftDocument{ + source := `cookie{counter:cookie:2} chocolate{counter2:cookie} pasta{counter:cookie} bob{counter:bob:10}` + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo2 bar baz4 bob10"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie2 chocolate pasta4 bob10", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("with alphanumeric start", func() { - source := `foo{counter:foo:b} bar{counter2:foo} baz{counter:foo} bob{counter:bob:z}` - expected := types.DraftDocument{ + source := `cookie{counter:cookie:b} chocolate{counter2:cookie} pasta{counter:cookie} bob{counter:bob:z}` + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foob bar bazd bobz"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "cookieb chocolate pastad bobz", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) + It("with custom id prefix and title", func() { + source := `:idprefix: bar_ + +.a title +a paragraph` + expected := &types.Document{ + // Attributes: types.Attributes{ + // types.AttrIDPrefix: "bar_", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "idprefix", + Value: "bar_", + }, + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrTitle: "a title", // there is no default ID. Only custom IDs + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a paragraph", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("empty paragraph", func() { + source := `{blank}` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.PredefinedAttribute{ + Name: "blank", + }, + }, + }, + }, + } + result, err := ParseDocument(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDocument(expected)) + }) + + It("paragraph with predefined attribute", func() { + source := "hello {plus} world" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "hello ", + }, + &types.PredefinedAttribute{Name: "plus"}, + &types.StringElement{ + Content: " world", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("2 paragraphs with list item continuation", func() { + source := `hello ++ +world` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "hello", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "+\nworld", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("2 paragraphs with list item continuation after blankline", func() { + source := `hello ++ +world` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "hello", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "+\nworld", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + Context("with custom substitutions", func() { // using the same input for all substitution tests source := `:github-url: https://github.com +:github-title: GitHub [subs="$SUBS"] -a link to https://github.com[] -another one using attribute substitution: {github-url}[]... +links to {github-title}: https://github.com[{github-title}] and ** +and another one using attribute substitution: {github-url}[{github-title}]... // a single-line comment.` - It("should apply the 'default' substitution on multiple lines", func() { + It("should apply the 'default' substitution", func() { // quoted text is parsed but inline link macro is not s := strings.ReplaceAll(source, "[subs=\"$SUBS\"]\n", "") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + // "github-title": "GitHub", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", + &types.AttributeDeclaration{ + Name: "github-title", + Value: "GitHub", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "links to GitHub: ", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "GitHub", }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", }, }, }, - types.StringElement{ - Content: " ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "using the ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "inline link macro", + }, + &types.StringElement{ + Content: " and ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.SpecialCharacter{ + Name: "<", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "GitHub", + }, + }, + }, + }, + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, }, }, - }, - types.SpecialCharacter{ - Name: ">", + &types.SpecialCharacter{ + Name: ">", + }, }, }, - { - types.StringElement{ - Content: "another one using attribute substitution: ", + &types.StringElement{ + Content: "\nand another one using attribute substitution: ", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "GitHub", }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", }, }, }, - types.StringElement{ - Content: "\u2026\u200b", // symbol for ellipsis, applied by the 'replacements' substitution - }, }, - { - types.SingleLineComment{ - Content: " a single-line comment.", - }, + &types.StringElement{ + Content: "\u2026\u200b", // symbol for ellipsis, applied by the 'replacements' substitution }, }, }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) - It("should apply the 'normal' substitution on multiple lines", func() { + It("should apply the 'normal' substitution", func() { // quoted text is parsed but inline link macro is not s := strings.ReplaceAll(source, "$SUBS", "normal") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + // "github-title": "GitHub", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.Paragraph{ + &types.AttributeDeclaration{ + Name: "github-title", + Value: "GitHub", + }, + &types.Paragraph{ Attributes: types.Attributes{ types.AttrSubstitutions: "normal", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", + Elements: []interface{}{ + &types.StringElement{ + Content: "links to GitHub: ", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "GitHub", }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", }, }, }, - types.StringElement{ - Content: " ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "using the ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "inline link macro", + }, + &types.StringElement{ + Content: " and ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.SpecialCharacter{ + Name: "<", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ // + Content: "GitHub", + }, + }, + }, + }, + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, }, }, + &types.SpecialCharacter{ + Name: ">", + }, }, - types.SpecialCharacter{ - Name: ">", - }, }, - { - types.StringElement{ - Content: "another one using attribute substitution: ", + &types.StringElement{ + Content: "\nand another one using attribute substitution: ", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "GitHub", }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", }, }, }, - types.StringElement{ - Content: "\u2026\u200b", // symbol for ellipsis, applied by the 'replacements' substitution - }, }, - { - types.SingleLineComment{ - Content: " a single-line comment.", - }, + &types.StringElement{ + Content: "\u2026\u200b", // symbol for ellipsis, applied by the 'replacements' substitution }, }, }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) - It("should apply the 'quotes' substitution on multiple lines", func() { - // quoted text is parsed but inline link macro is not - s := strings.ReplaceAll(source, "$SUBS", "quotes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + It("should apply the 'none' substitution", func() { + s := strings.ReplaceAll(source, "$SUBS", "none") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + // "github-title": "GitHub", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.Paragraph{ + &types.AttributeDeclaration{ + Name: "github-title", + Value: "GitHub", + }, + &types.Paragraph{ Attributes: types.Attributes{ - types.AttrSubstitutions: "quotes", + types.AttrSubstitutions: "none", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://github.com[] ", - }, - }, - { - types.StringElement{ - Content: "another one using attribute substitution: {github-url}[]...", - }, - }, - { - types.SingleLineComment{ - Content: " a single-line comment.", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "links to {github-title}: https://github.com[{github-title}] and **" + + "\nand another one using attribute substitution: {github-url}[{github-title}]...", }, }, }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) - It("should apply the 'macros' substitution on multiple lines", func() { - // quoted text is not parsed but inline link macro is - s := strings.ReplaceAll(source, "$SUBS", "macros") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + It("should apply the 'quotes' substitution", func() { + // quoted text is parsed but inline link macros are not + s := strings.ReplaceAll(source, "$SUBS", "quotes") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + // "github-title": "GitHub", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.Paragraph{ + &types.AttributeDeclaration{ + Name: "github-title", + Value: "GitHub", + }, + &types.Paragraph{ Attributes: types.Attributes{ - types.AttrSubstitutions: "macros", + types.AttrSubstitutions: "quotes", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", + Elements: []interface{}{ + &types.StringElement{ + Content: "links to {github-title}: https://github.com[{github-title}] and ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "", - }, - }, - { - types.StringElement{ - Content: "another one using attribute substitution: {github-url}[]...", + &types.StringElement{ + Content: "]>", + }, }, }, - { - types.SingleLineComment{ - Content: " a single-line comment.", - }, + &types.StringElement{ + Content: "\nand another one using attribute substitution: {github-url}[{github-title}]...", }, }, }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) - It("should apply the 'attributes' substitution on multiple lines", func() { + It("should apply the 'macros' substitution", func() { // quoted text is not parsed but inline link macro is - s := strings.ReplaceAll(source, "$SUBS", "attributes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + s := strings.ReplaceAll(source, "$SUBS", "macros") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + // "github-title": "GitHub", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.Paragraph{ + &types.AttributeDeclaration{ + Name: "github-title", + Value: "GitHub", + }, + &types.Paragraph{ Attributes: types.Attributes{ - types.AttrSubstitutions: "attributes", + types.AttrSubstitutions: "macros", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to https://github.com[] "}, + Elements: []interface{}{ + &types.StringElement{ + Content: "links to {github-title}: ", }, - { - types.StringElement{Content: "another one using attribute substitution: https://github.com[]..."}, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "{github-title}", + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, + }, }, - { - types.SingleLineComment{ - Content: " a single-line comment.", + &types.StringElement{ + Content: " and *<", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "_{github-title}_", + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, }, }, + &types.StringElement{ + Content: ">*\nand another one using attribute substitution: {github-url}[{github-title}]...", + }, }, }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) - It("should apply the 'attributes,macros' substitution on multiple lines", func() { + It("should apply the 'attributes' substitution", func() { // quoted text is not parsed but inline link macro is - s := strings.ReplaceAll(source, "$SUBS", "attributes,macros") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + s := strings.ReplaceAll(source, "$SUBS", "attributes") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + // "github-title": "GitHub", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.Paragraph{ + &types.AttributeDeclaration{ + Name: "github-title", + Value: "GitHub", + }, + &types.Paragraph{ Attributes: types.Attributes{ - types.AttrSubstitutions: "attributes,macros", + types.AttrSubstitutions: "attributes", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - types.StringElement{Content: " "}, - }, - { - types.StringElement{Content: "another one using attribute substitution: "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - types.StringElement{Content: "..."}, - }, - { - types.SingleLineComment{ - Content: " a single-line comment.", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "links to GitHub: https://github.com[GitHub] and **" + + "\nand another one using attribute substitution: https://github.com[GitHub]...", }, }, }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) - It("should apply the 'specialchars' substitution on multiple lines", func() { + It("should apply the 'specialchars' substitution", func() { // quoted text is not parsed but inline link macro is s := strings.ReplaceAll(source, "$SUBS", "specialchars") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + // "github-title": "GitHub", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.Paragraph{ + &types.AttributeDeclaration{ + Name: "github-title", + Value: "GitHub", + }, + &types.Paragraph{ Attributes: types.Attributes{ types.AttrSubstitutions: "specialchars", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to https://github.com[] "}, - types.SpecialCharacter{Name: "<"}, - types.StringElement{Content: "using the *inline link macro*"}, - types.SpecialCharacter{Name: ">"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "links to {github-title}: https://github.com[{github-title}] and *", }, - { - types.StringElement{Content: "another one using attribute substitution: {github-url}[]..."}, + &types.SpecialCharacter{ + Name: "<", }, - { - types.SingleLineComment{ - Content: " a single-line comment.", - }, + &types.StringElement{ + Content: "https://github.com[_{github-title}_]", + }, + &types.SpecialCharacter{ + Name: ">", + }, + &types.StringElement{ + Content: "*" + + "\nand another one using attribute substitution: {github-url}[{github-title}]...", }, }, }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) - It("should apply the 'replacements' substitution on multiple lines", func() { + It("should apply the 'replacements' substitution", func() { // quoted text is not parsed but inline link macro is s := strings.ReplaceAll(source, "$SUBS", "replacements") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + // "github-title": "GitHub", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.Paragraph{ + &types.AttributeDeclaration{ + Name: "github-title", + Value: "GitHub", + }, + &types.Paragraph{ Attributes: types.Attributes{ types.AttrSubstitutions: "replacements", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to https://github.com[] "}, - }, - { - types.StringElement{Content: "another one using attribute substitution: {github-url}[]\u2026\u200b"}, - }, - { - types.SingleLineComment{ - Content: " a single-line comment.", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "links to {github-title}: https://github.com[{github-title}] and **" + + "\nand another one using attribute substitution: {github-url}[{github-title}]\u2026\u200b", }, }, }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) It("should apply the 'quotes,macros' substitutions", func() { - // quoted text and inline link macro are both parsed + // quoted texts and macros are both parsed at the root of the paragraph content + // but and macros within quotes are, too + // Note: Asciidoctor 2.0.12 does not parse the macros within the quotes, so the + // 2nd link of the first line is not detected s := strings.ReplaceAll(source, "$SUBS", "quotes,macros") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + // "github-title": "GitHub", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.Paragraph{ + &types.AttributeDeclaration{ + Name: "github-title", + Value: "GitHub", + }, + &types.Paragraph{ Attributes: types.Attributes{ types.AttrSubstitutions: "quotes,macros", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", + Elements: []interface{}{ + &types.StringElement{ + Content: "links to {github-title}: ", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "{github-title}", }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", }, }, }, - types.StringElement{ - Content: " ", + }, }, - types.StringElement{ - Content: ">", - }, - }, - { - types.StringElement{Content: "another one using attribute substitution: {github-url}[]..."}, }, - { - types.SingleLineComment{ - Content: " a single-line comment.", - }, + &types.StringElement{ + Content: "\nand another one using attribute substitution: {github-url}[{github-title}]...", }, }, }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) It("should apply the 'macros,quotes' substitutions", func() { // quoted text and inline link macro are both parsed // (same as above, but with subs in reversed order) s := strings.ReplaceAll(source, "$SUBS", "macros,quotes") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + // "github-title": "GitHub", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.Paragraph{ + &types.AttributeDeclaration{ + Name: "github-title", + Value: "GitHub", + }, + &types.Paragraph{ Attributes: types.Attributes{ types.AttrSubstitutions: "macros,quotes", }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", + Elements: []interface{}{ + &types.StringElement{ + Content: "links to {github-title}: ", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "{github-title}", }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, + }, + }, + &types.StringElement{ + Content: " and ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "<", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "{github-title}", + }, + }, + }, + }, + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, }, }, }, + &types.StringElement{ + Content: ">", + }, }, - types.StringElement{ - Content: " ", + }, + &types.StringElement{ + Content: " and *<", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "_GitHub_", + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, }, }, - { - types.StringElement{Content: "another one using attribute substitution: {github-url}[]..."}, + &types.StringElement{ + Content: ">*\nand another one using attribute substitution: ", }, - { - types.SingleLineComment{ - Content: " a single-line comment.", + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "GitHub", + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, }, }, + &types.StringElement{ + Content: "...", // left as-is + }, }, }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) - It("should apply the 'none' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "none") - expected := types.DraftDocument{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, + It("should apply the 'macros,attributes' substitution", func() { + // inline links with URL coming from attribute susbtitutions are left as-is + // however, inline link 'text' attribute coming from attribute susbtitutions are replaced + s := strings.ReplaceAll(source, "$SUBS", "macros,attributes") + expected := &types.Document{ + // Attributes: types.Attributes{ + // "github-url": "https://github.com", + // "github-title": "GitHub", + // }, Elements: []interface{}{ - types.AttributeDeclaration{ + &types.AttributeDeclaration{ Name: "github-url", Value: "https://github.com", }, - types.BlankLine{}, - types.Paragraph{ + &types.AttributeDeclaration{ + Name: "github-title", + Value: "GitHub", + }, + &types.Paragraph{ Attributes: types.Attributes{ - types.AttrSubstitutions: "none", + types.AttrSubstitutions: "macros,attributes", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to https://github.com[] "}, + Elements: []interface{}{ + &types.StringElement{ + Content: "links to GitHub: ", }, - { - types.StringElement{Content: "another one using attribute substitution: {github-url}[]..."}, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "GitHub", + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, + }, }, - { - types.SingleLineComment{ - Content: " a single-line comment.", + &types.StringElement{ + Content: " and *<", + }, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "_GitHub_", + }, + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{ + Content: "github.com", + }, + }, }, }, + &types.StringElement{ + Content: ">*\nand another one using attribute substitution: https://github.com[GitHub]...", + }, }, }, }, } - Expect(ParseDraftDocument(s)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(s)).To(MatchDocument(expected)) }) }) }) @@ -1036,125 +1474,121 @@ another one using attribute substitution: {github-url}[]... It("note admonition paragraph", func() { source := `NOTE: this is a note.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Note, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "this is a note."}, + Elements: []interface{}{ + &types.StringElement{ + Content: "this is a note.", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("warning admonition paragraph", func() { source := `WARNING: this is a multiline warning!` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Warning, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "this is a multiline"}, - }, - { - types.StringElement{Content: "warning!"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "this is a multiline\nwarning!", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("admonition note paragraph with id and title", func() { - source := `[[foo]] -.bar + source := `[[cookie]] +.chocolate NOTE: this is a note.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Note, - types.AttrID: "foo", - types.AttrTitle: "bar", + types.AttrID: "cookie", + types.AttrTitle: "chocolate", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "this is a note."}, + Elements: []interface{}{ + &types.StringElement{ + Content: "this is a note.", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("caution admonition paragraph with single line", func() { source := `[CAUTION] this is a caution!` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Caution, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "this is a caution!"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "this is a caution!", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("multiline caution admonition paragraph with title and id", func() { - source := `[[foo]] + source := `[[cookie]] [CAUTION] -.bar +.chocolate this is a *caution*!` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Caution, - types.AttrID: "foo", - types.AttrTitle: "bar", + types.AttrID: "cookie", + types.AttrTitle: "chocolate", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "this is a "}, + Elements: []interface{}{ + // suffix spaces are trimmed on each line + &types.StringElement{ + Content: "this is a\n", }, - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "caution", - }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "caution", }, }, - types.StringElement{ - Content: "!", - }, + }, + &types.StringElement{ + Content: "!", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("multiple admonition paragraphs", func() { @@ -1163,905 +1597,239 @@ No space after the [NOTE]! [CAUTION] And no space after [CAUTION] either.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Note, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "No space after the [NOTE]!"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "No space after the [NOTE]!", }, }, }, - types.BlankLine{}, - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Caution, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "And no space after [CAUTION] either."}, + Elements: []interface{}{ + &types.StringElement{ + Content: "And no space after [CAUTION] either.", }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("not an admonition paragraph", func() { + source := `cookie +NOTE: a note` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie\nNOTE: a note", + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) + + Context("quote paragraphs", func() { + + It("inline image within a quote", func() { + source := `[quote, john doe, quote title] +a cookie image:cookie.png[]` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrStyle: types.Quote, + types.AttrQuoteAuthor: "john doe", + types.AttrQuoteTitle: "quote title", + }, + Elements: []interface{}{ + &types.StringElement{ + Content: "a cookie ", + }, + &types.InlineImage{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "cookie.png", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) Context("verse paragraphs", func() { - It("paragraph as a verse with author and title", func() { + It("with author and title", func() { source := `[verse, john doe, verse title] I am a verse paragraph.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "I am a verse paragraph."}, + Elements: []interface{}{ + &types.StringElement{ + Content: "I am a verse paragraph.", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("paragraph as a verse with author, title and other attributes", func() { + It("with author, title and other attributes", func() { source := `[[universal]] [verse, john doe, verse title] .universe I am a verse paragraph.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", types.AttrQuoteTitle: "verse title", types.AttrID: "universal", - // types.AttrCustomID: true, - types.AttrTitle: "universe", + types.AttrTitle: "universe", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "I am a verse paragraph."}, + Elements: []interface{}{ + &types.StringElement{ + Content: "I am a verse paragraph.", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("paragraph as a verse with empty title", func() { + It("with empty title", func() { source := `[verse, john doe, ] I am a verse paragraph.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "I am a verse paragraph."}, + Elements: []interface{}{ + &types.StringElement{ + Content: "I am a verse paragraph.", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("paragraph as a verse without title", func() { + It("without title", func() { source := `[verse, john doe ] I am a verse paragraph.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Verse, types.AttrQuoteAuthor: "john doe", }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "I am a verse paragraph."}, + Elements: []interface{}{ + &types.StringElement{ + Content: "I am a verse paragraph.", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + doc, err := ParseDocument(source) + Expect(err).NotTo(HaveOccurred()) + Expect(doc).To(MatchDocument(expected)) }) - It("paragraph as a verse with empty author", func() { + It("with empty author", func() { source := `[verse, ] I am a verse paragraph.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Verse, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "I am a verse paragraph."}, + Elements: []interface{}{ + &types.StringElement{ + Content: "I am a verse paragraph.", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("paragraph as a verse without author", func() { + It("without author", func() { source := `[verse] I am a verse paragraph.` - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Verse, }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "I am a verse paragraph."}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("image block as a verse", func() { - // assume that the author meant to use an image, so the `verse` attribute will be ignored during rendering - source := `[verse, john doe, verse title] -image::foo.png[]` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Verse, - types.AttrQuoteAuthor: "john doe", - types.AttrQuoteTitle: "verse title", - }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "image::foo.png[]"}, + Elements: []interface{}{ + &types.StringElement{ + Content: "I am a verse paragraph.", }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - }) - - Context("quote paragraphs", func() { - It("paragraph as a quote with author and title", func() { - source := `[quote, john doe, quote title] -I am a quote paragraph.` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Quote, - types.AttrQuoteAuthor: "john doe", - types.AttrQuoteTitle: "quote title", - }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "I am a quote paragraph."}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("paragraph as a quote with author, title and other attributes", func() { - source := `[[universal]] -[quote, john doe, quote title] -.universe -I am a quote paragraph.` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Quote, - types.AttrQuoteAuthor: "john doe", - types.AttrQuoteTitle: "quote title", - types.AttrID: "universal", - // types.AttrCustomID: true, - types.AttrTitle: "universe", - }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "I am a quote paragraph."}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("paragraph as a quote with empty title", func() { - source := `[quote, john doe, ] -I am a quote paragraph.` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Quote, - types.AttrQuoteAuthor: "john doe", - }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "I am a quote paragraph."}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("paragraph as a quote without title", func() { - source := `[quote, john doe ] -I am a quote paragraph.` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Quote, - types.AttrQuoteAuthor: "john doe", - }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "I am a quote paragraph."}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("paragraph as a quote with empty author", func() { - source := `[quote, ] -I am a quote paragraph.` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Quote, - }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "I am a quote paragraph."}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("paragraph as a quote without author", func() { - source := `[quote] -I am a quote paragraph.` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Quote, - }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "I am a quote paragraph."}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("image block is NOT a quote", func() { - Skip("needs clarification...") - source := `[quote, john doe, quote title] -image::foo.png[]` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ImageBlock{ - Location: types.Location{ - Scheme: "", - Path: []interface{}{types.StringElement{Content: "foo.png"}}, - }, - Attributes: types.Attributes{ - types.AttrImageAlt: "quote", - types.AttrWidth: "john doe", - types.AttrHeight: "quote title", - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("thematic breaks", func() { - - It("thematic break form1 by itself", func() { - source := "***" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ThematicBreak{}, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("thematic break form2 by itself", func() { - source := "* * *" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ThematicBreak{}, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("thematic break form3 by itself", func() { - source := "---" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ThematicBreak{}, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("thematic break form4 by itself", func() { - source := "- - -" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ThematicBreak{}, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("thematic break form5 by itself", func() { - source := "___" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ThematicBreak{}, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("thematic break form4 by itself", func() { - source := "_ _ _" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.ThematicBreak{}, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("thematic break with leading text", func() { - source := "text ***" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "text ***"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - // NB: three asterisks gets confused with bullets if with trailing text - It("thematic break with trailing text", func() { - source := "* * * text" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "* * * text"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("final documents", func() { - - Context("default paragraph", func() { - - It("paragraph with custom id prefix and title", func() { - source := `:idprefix: bar_ - -.a title -a paragraph` - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrIDPrefix: "bar_", - }, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrTitle: "a title", // there is no default ID. Only custom IDs - }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("empty paragraph", func() { - source := `{blank}` - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.PredefinedAttribute{ - Name: "blank", - }, - }, - }, - }, - }, - } - result, err := ParseDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDocument(expected)) - }) - - It("paragraph with predefined attribute", func() { - source := "hello {plus} world" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "hello "}, - types.PredefinedAttribute{Name: "plus"}, - types.StringElement{Content: " world"}, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - Context("with custom substitutions", func() { - - // using the same input for all substitution tests - source := `:github-url: https://github.com - -[subs="$SUBS"] -a link to https://github.com[] -another one using attribute substitution: {github-url}[]... -// a single-line comment` - - It("should apply the 'none' substitution", func() { - s := strings.ReplaceAll(source, "$SUBS", "none") - expected := types.Document{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "none", - }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to https://github.com[] "}, - }, - { - types.StringElement{Content: "another one using attribute substitution: {github-url}[]..."}, - }, - }, - }, - }, - } - Expect(ParseDocument(s)).To(MatchDocument(expected)) - }) - - It("should apply the 'quotes' substitution on multiple lines", func() { - // quoted text is parsed but inline link macro is not - s := strings.ReplaceAll(source, "$SUBS", "quotes") - expected := types.Document{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "quotes", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to https://github.com[] ", - }, - }, - { - types.StringElement{ - Content: "another one using attribute substitution: {github-url}[]...", - }, - }, - }, - }, - }, - } - Expect(ParseDocument(s)).To(MatchDocument(expected)) - }) - - It("should apply the 'macros' substitution on multiple lines", func() { - // quoted text is not parsed but inline link macro is - s := strings.ReplaceAll(source, "$SUBS", "macros") - expected := types.Document{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "macros", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - types.StringElement{ - Content: " ", - }, - }, - { - types.StringElement{ - Content: "another one using attribute substitution: {github-url}[]...", - }, - }, - }, - }, - }, - } - Expect(ParseDocument(s)).To(MatchDocument(expected)) - }) - - It("should apply the 'attributes' substitution on multiple lines", func() { - // quoted text is not parsed but inline link macro is - s := strings.ReplaceAll(source, "$SUBS", "attributes") - expected := types.Document{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "attributes", - }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to https://github.com[] "}, - }, - { - types.StringElement{Content: "another one using attribute substitution: https://github.com[]..."}, - }, - }, - }, - }, - } - Expect(ParseDocument(s)).To(MatchDocument(expected)) - }) - - It("should apply the 'attributes,macros' substitution on multiple lines", func() { - // quoted text is not parsed but inline link macro is - s := strings.ReplaceAll(source, "$SUBS", "attributes,macros") - expected := types.Document{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "attributes,macros", - }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - types.StringElement{Content: " "}, - }, - { - types.StringElement{Content: "another one using attribute substitution: "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - types.StringElement{Content: "..."}, - }, - }, - }, - }, - } - Expect(ParseDocument(s)).To(MatchDocument(expected)) - }) - - It("should apply the 'specialchars' substitution on multiple lines", func() { - // quoted text is not parsed but inline link macro is - s := strings.ReplaceAll(source, "$SUBS", "specialchars") - expected := types.Document{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "specialchars", - }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to https://github.com[] "}, - types.SpecialCharacter{Name: "<"}, - types.StringElement{Content: "using the *inline link macro*"}, - types.SpecialCharacter{Name: ">"}, - }, - { - types.StringElement{Content: "another one using attribute substitution: {github-url}[]..."}, - }, - }, - }, - }, - } - Expect(ParseDocument(s)).To(MatchDocument(expected)) - }) - - It("should apply the replacements substitution on multiple lines", func() { - // quoted text is not parsed but inline link macro is - s := strings.ReplaceAll(source, "$SUBS", "replacements") - expected := types.Document{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "replacements", - }, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a link to https://github.com[] "}, - }, - { - types.StringElement{Content: "another one using attribute substitution: {github-url}[]\u2026\u200b"}, - }, - }, - }, - }, - } - Expect(ParseDocument(s)).To(MatchDocument(expected)) - }) - - It("should apply the 'quotes' and 'macros' substitutions", func() { - // quoted text and inline link macro are both parsed - s := strings.ReplaceAll(source, "$SUBS", "quotes,macros") - expected := types.Document{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "quotes,macros", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - types.StringElement{ - Content: " ", - }, - }, - { - types.StringElement{Content: "another one using attribute substitution: {github-url}[]..."}, - }, - }, - }, - }, - } - Expect(ParseDocument(s)).To(MatchDocument(expected)) - }) - - It("should apply the 'macros' and 'quotes' substitutions", func() { - // quoted text and inline link macro are both parsed - // (same as above, but with subs in reversed order) - s := strings.ReplaceAll(source, "$SUBS", "macros,quotes") - expected := types.Document{ - Attributes: types.Attributes{ - "github-url": "https://github.com", - }, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrSubstitutions: "macros,quotes", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a link to ", - }, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "github.com", - }, - }, - }, - }, - types.StringElement{ - Content: " ", - }, - }, - { - types.StringElement{Content: "another one using attribute substitution: {github-url}[]..."}, - }, - }, - }, - }, - } - Expect(ParseDocument(s)).To(MatchDocument(expected)) - }) - }) - }) - - Context("quote paragraphs", func() { - - It("inline image within a quote", func() { - source := `[quote, john doe, quote title] -a foo image:foo.png[]` - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrStyle: types.Quote, - types.AttrQuoteAuthor: "john doe", - types.AttrQuoteTitle: "quote title", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a foo ", - }, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + // It("image block as a verse", func() { + // // assume that the author meant to use an image, so the `verse` attribute will be ignored during rendering + // source := `[verse, john doe, verse title] + // image::cookie.png[]` + // expected := &types.Document{ + // Elements: []interface{}{ + // &types.Paragraph{ + // Attributes: types.Attributes{ + // types.AttrStyle: types.Verse, + // types.AttrQuoteAuthor: "john doe", + // types.AttrQuoteTitle: "verse title", + // }, + // Elements: []interface{}{ + // &types.StringElement{Content: "image::cookie.png[]",}, + // }, + // }, + // }, + // } + // Expect(ParseDocument(source)).To(MatchDocument(expected)) + // }) }) }) diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index 8923b2ec..bd728170 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -18,766 +18,596 @@ import ( "unicode/utf8" "github.com/bytesparadise/libasciidoc/pkg/types" + + log "github.com/sirupsen/logrus" ) var g = &grammar{ rules: []*rule{ { - name: "RawSource", - pos: position{line: 20, col: 1, offset: 412}, + name: "DocumentFragment", + pos: position{line: 21, col: 1, offset: 424}, expr: &actionExpr{ - pos: position{line: 20, col: 14, offset: 425}, - run: (*parser).callonRawSource1, - expr: &labeledExpr{ - pos: position{line: 20, col: 14, offset: 425}, - label: "lines", - expr: &zeroOrMoreExpr{ - pos: position{line: 20, col: 20, offset: 431}, - expr: &choiceExpr{ - pos: position{line: 20, col: 21, offset: 432}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 182, col: 25, offset: 5755}, - run: (*parser).callonRawSource5, - expr: &seqExpr{ - pos: position{line: 182, col: 25, offset: 5755}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 182, col: 25, offset: 5755}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 182, col: 29, offset: 5759}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonRawSource9, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, + pos: position{line: 22, col: 5, offset: 448}, + run: (*parser).callonDocumentFragment1, + expr: &seqExpr{ + pos: position{line: 22, col: 5, offset: 448}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 22, col: 5, offset: 448}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &labeledExpr{ + pos: position{line: 23, col: 5, offset: 457}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 23, col: 16, offset: 468}, + expr: &ruleRefExpr{ + pos: position{line: 23, col: 17, offset: 469}, + name: "BlockAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 24, col: 5, offset: 491}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 25, col: 9, offset: 509}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 25, col: 9, offset: 509}, + name: "ImageBlock", + }, + &ruleRefExpr{ + pos: position{line: 26, col: 11, offset: 530}, + name: "UserMacroBlock", + }, + &ruleRefExpr{ + pos: position{line: 27, col: 11, offset: 555}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 1613, col: 5, offset: 53551}, + run: (*parser).callonDocumentFragment14, + expr: &seqExpr{ + pos: position{line: 1613, col: 5, offset: 53551}, + exprs: []interface{}{ + &andExpr{ + pos: position{line: 1613, col: 5, offset: 53551}, + expr: &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, - }, - &litMatcher{ - pos: position{line: 182, col: 50, offset: 5780}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 183, col: 9, offset: 5793}, - label: "value", - expr: &zeroOrOneExpr{ - pos: position{line: 183, col: 15, offset: 5799}, - expr: &actionExpr{ - pos: position{line: 194, col: 30, offset: 6206}, - run: (*parser).callonRawSource17, - expr: &seqExpr{ - pos: position{line: 194, col: 30, offset: 6206}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 194, col: 30, offset: 6206}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &andExpr{ + pos: position{line: 1614, col: 5, offset: 53662}, + expr: ¬Expr{ + pos: position{line: 1614, col: 7, offset: 53664}, + expr: &actionExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + run: (*parser).callonDocumentFragment20, + expr: &seqExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment23, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonRawSource22, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + inverted: false, }, }, }, - }, - &labeledExpr{ - pos: position{line: 194, col: 37, offset: 6213}, - label: "elements", - expr: &zeroOrMoreExpr{ - pos: position{line: 194, col: 46, offset: 6222}, + &labeledExpr{ + pos: position{line: 1441, col: 12, offset: 47833}, + label: "prefix", expr: &choiceExpr{ - pos: position{line: 195, col: 5, offset: 6228}, + pos: position{line: 1443, col: 9, offset: 47896}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 195, col: 6, offset: 6229}, - run: (*parser).callonRawSource27, - expr: &oneOrMoreExpr{ - pos: position{line: 195, col: 6, offset: 6229}, - expr: &charClassMatcher{ - pos: position{line: 195, col: 6, offset: 6229}, - val: "[^\\r\\n{]", - chars: []rune{'\r', '\n', '{'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - &actionExpr{ - pos: position{line: 221, col: 25, offset: 7126}, - run: (*parser).callonRawSource30, + pos: position{line: 1443, col: 9, offset: 47896}, + run: (*parser).callonDocumentFragment27, expr: &seqExpr{ - pos: position{line: 221, col: 25, offset: 7126}, + pos: position{line: 1443, col: 9, offset: 47896}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 221, col: 25, offset: 7126}, - val: "{counter:", - ignoreCase: false, - want: "\"{counter:\"", - }, &labeledExpr{ - pos: position{line: 221, col: 37, offset: 7138}, - label: "name", + pos: position{line: 1443, col: 9, offset: 47896}, + label: "depth", expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonRawSource34, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, + pos: position{line: 1443, col: 16, offset: 47903}, + run: (*parser).callonDocumentFragment30, + expr: &oneOrMoreExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + expr: &litMatcher{ + pos: position{line: 1443, col: 17, offset: 47904}, + val: ".", + ignoreCase: false, + want: "\".\"", }, }, }, }, - &labeledExpr{ - pos: position{line: 221, col: 56, offset: 7157}, - label: "start", - expr: &zeroOrOneExpr{ - pos: position{line: 221, col: 62, offset: 7163}, - expr: &actionExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - run: (*parser).callonRawSource41, - expr: &seqExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 229, col: 21, offset: 7430}, - label: "start", - expr: &choiceExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - run: (*parser).callonRawSource46, - expr: &charClassMatcher{ - pos: position{line: 229, col: 28, offset: 7437}, - val: "[A-Za-z]", - ranges: []rune{'A', 'Z', 'a', 'z'}, - ignoreCase: false, - inverted: false, - }, - }, - &actionExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - run: (*parser).callonRawSource48, - expr: &oneOrMoreExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - expr: &charClassMatcher{ - pos: position{line: 231, col: 9, offset: 7491}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - }, + &andCodeExpr{ + pos: position{line: 1447, col: 9, offset: 48004}, + run: (*parser).callonDocumentFragment33, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + run: (*parser).callonDocumentFragment34, + expr: &seqExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + expr: &charClassMatcher{ + pos: position{line: 1466, col: 12, offset: 48722}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, &litMatcher{ - pos: position{line: 221, col: 78, offset: 7179}, - val: "}", + pos: position{line: 1466, col: 20, offset: 48730}, + val: ".", ignoreCase: false, - want: "\"}\"", + want: "\".\"", }, }, }, }, &actionExpr{ - pos: position{line: 225, col: 25, offset: 7281}, - run: (*parser).callonRawSource52, + pos: position{line: 1468, col: 13, offset: 48847}, + run: (*parser).callonDocumentFragment39, expr: &seqExpr{ - pos: position{line: 225, col: 25, offset: 7281}, + pos: position{line: 1468, col: 13, offset: 48847}, exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1468, col: 14, offset: 48848}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, &litMatcher{ - pos: position{line: 225, col: 25, offset: 7281}, - val: "{counter2:", + pos: position{line: 1468, col: 21, offset: 48855}, + val: ".", ignoreCase: false, - want: "\"{counter2:\"", + want: "\".\"", }, - &labeledExpr{ - pos: position{line: 225, col: 38, offset: 7294}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonRawSource56, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + run: (*parser).callonDocumentFragment43, + expr: &seqExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1470, col: 14, offset: 48976}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, }, - &labeledExpr{ - pos: position{line: 225, col: 57, offset: 7313}, - label: "start", - expr: &zeroOrOneExpr{ - pos: position{line: 225, col: 63, offset: 7319}, - expr: &actionExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - run: (*parser).callonRawSource63, - expr: &seqExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 229, col: 21, offset: 7430}, - label: "start", - expr: &choiceExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - run: (*parser).callonRawSource68, - expr: &charClassMatcher{ - pos: position{line: 229, col: 28, offset: 7437}, - val: "[A-Za-z]", - ranges: []rune{'A', 'Z', 'a', 'z'}, - ignoreCase: false, - inverted: false, - }, - }, - &actionExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - run: (*parser).callonRawSource70, - expr: &oneOrMoreExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - expr: &charClassMatcher{ - pos: position{line: 231, col: 9, offset: 7491}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 1470, col: 21, offset: 48983}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + run: (*parser).callonDocumentFragment47, + expr: &seqExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + expr: &charClassMatcher{ + pos: position{line: 1472, col: 14, offset: 49104}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, }, }, &litMatcher{ - pos: position{line: 225, col: 79, offset: 7335}, - val: "}", + pos: position{line: 1472, col: 26, offset: 49116}, + val: ")", ignoreCase: false, - want: "\"}\"", + want: "\")\"", }, }, }, }, &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonRawSource74, + pos: position{line: 1474, col: 13, offset: 49236}, + run: (*parser).callonDocumentFragment52, expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, + pos: position{line: 1474, col: 13, offset: 49236}, exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + expr: &charClassMatcher{ + pos: position{line: 1474, col: 14, offset: 49237}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", + pos: position{line: 1474, col: 26, offset: 49249}, + val: ")", ignoreCase: false, - want: "\"{\"", + want: "\")\"", }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonDocumentFragment57, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 1615, col: 5, offset: 53695}, + expr: ¬Expr{ + pos: position{line: 1615, col: 7, offset: 53697}, + expr: &actionExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + run: (*parser).callonDocumentFragment62, + expr: &seqExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment65, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1491, col: 12, offset: 49795}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1491, col: 20, offset: 49803}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + run: (*parser).callonDocumentFragment69, + expr: &seqExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + exprs: []interface{}{ &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", + pos: position{line: 1493, col: 9, offset: 49860}, + label: "depth", expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonRawSource78, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, + pos: position{line: 1493, col: 16, offset: 49867}, + run: (*parser).callonDocumentFragment72, + expr: &oneOrMoreExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + expr: &litMatcher{ + pos: position{line: 1493, col: 17, offset: 49868}, + val: "*", + ignoreCase: false, + want: "\"*\"", }, }, }, }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", + &andCodeExpr{ + pos: position{line: 1497, col: 9, offset: 49968}, + run: (*parser).callonDocumentFragment75, }, }, }, }, - &actionExpr{ - pos: position{line: 199, col: 6, offset: 6337}, - run: (*parser).callonRawSource84, - expr: &litMatcher{ - pos: position{line: 199, col: 6, offset: 6337}, - val: "{", - ignoreCase: false, - want: "\"{\"", + &labeledExpr{ + pos: position{line: 1514, col: 14, offset: 50675}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1514, col: 21, offset: 50682}, + run: (*parser).callonDocumentFragment77, + expr: &litMatcher{ + pos: position{line: 1514, col: 22, offset: 50683}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, }, }, }, }, }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonDocumentFragment79, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 26, col: 5, offset: 648}, - run: (*parser).callonRawSource91, - expr: &seqExpr{ - pos: position{line: 26, col: 5, offset: 648}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 26, col: 5, offset: 648}, - label: "level", - expr: &actionExpr{ - pos: position{line: 26, col: 12, offset: 655}, - run: (*parser).callonRawSource94, - expr: &oneOrMoreExpr{ - pos: position{line: 26, col: 12, offset: 655}, - expr: &litMatcher{ - pos: position{line: 26, col: 13, offset: 656}, - val: "=", - ignoreCase: false, - want: "\"=\"", - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 30, col: 5, offset: 747}, - run: (*parser).callonRawSource97, - }, - &oneOrMoreExpr{ - pos: position{line: 34, col: 5, offset: 899}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonRawSource101, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &andExpr{ + pos: position{line: 1616, col: 5, offset: 53730}, + expr: ¬Expr{ + pos: position{line: 1616, col: 7, offset: 53732}, + expr: &choiceExpr{ + pos: position{line: 136, col: 19, offset: 3960}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 136, col: 19, offset: 3960}, + run: (*parser).callonDocumentFragment85, + expr: &litMatcher{ + pos: position{line: 136, col: 19, offset: 3960}, + val: "TIP", + ignoreCase: false, + want: "\"TIP\"", + }, + }, + &actionExpr{ + pos: position{line: 138, col: 5, offset: 3998}, + run: (*parser).callonDocumentFragment87, + expr: &litMatcher{ + pos: position{line: 138, col: 5, offset: 3998}, + val: "NOTE", + ignoreCase: false, + want: "\"NOTE\"", + }, + }, + &actionExpr{ + pos: position{line: 140, col: 5, offset: 4038}, + run: (*parser).callonDocumentFragment89, + expr: &litMatcher{ + pos: position{line: 140, col: 5, offset: 4038}, + val: "IMPORTANT", + ignoreCase: false, + want: "\"IMPORTANT\"", + }, + }, + &actionExpr{ + pos: position{line: 142, col: 5, offset: 4088}, + run: (*parser).callonDocumentFragment91, + expr: &litMatcher{ + pos: position{line: 142, col: 5, offset: 4088}, + val: "WARNING", + ignoreCase: false, + want: "\"WARNING\"", + }, + }, + &actionExpr{ + pos: position{line: 144, col: 5, offset: 4134}, + run: (*parser).callonDocumentFragment93, + expr: &litMatcher{ + pos: position{line: 144, col: 5, offset: 4134}, + val: "CAUTION", + ignoreCase: false, + want: "\"CAUTION\"", + }, + }, }, }, }, }, - }, - &labeledExpr{ - pos: position{line: 34, col: 12, offset: 906}, - label: "title", - expr: &actionExpr{ - pos: position{line: 38, col: 20, offset: 1019}, - run: (*parser).callonRawSource104, - expr: &zeroOrMoreExpr{ - pos: position{line: 38, col: 20, offset: 1019}, - expr: &charClassMatcher{ - pos: position{line: 38, col: 20, offset: 1019}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 1617, col: 5, offset: 53753}, + label: "firstLine", + expr: &actionExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + run: (*parser).callonDocumentFragment96, + expr: &seqExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + run: (*parser).callonDocumentFragment99, + expr: &oneOrMoreExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + expr: &charClassMatcher{ + pos: position{line: 1662, col: 14, offset: 55218}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1665, col: 5, offset: 55275}, + run: (*parser).callonDocumentFragment102, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment104, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, }, }, }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 20, col: 57, offset: 468}, - name: "FileInclusion", - }, - &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonRawSource113, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + &andCodeExpr{ + pos: position{line: 1618, col: 5, offset: 53787}, + run: (*parser).callonDocumentFragment111, }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonRawSource119, + &labeledExpr{ + pos: position{line: 1625, col: 5, offset: 54149}, + label: "otherLines", expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "RawDocument", - pos: position{line: 51, col: 1, offset: 1425}, - expr: &actionExpr{ - pos: position{line: 51, col: 16, offset: 1440}, - run: (*parser).callonRawDocument1, - expr: &seqExpr{ - pos: position{line: 51, col: 16, offset: 1440}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 51, col: 16, offset: 1440}, - label: "frontmatter", - expr: &zeroOrOneExpr{ - pos: position{line: 51, col: 29, offset: 1453}, - expr: &actionExpr{ - pos: position{line: 107, col: 20, offset: 3133}, - run: (*parser).callonRawDocument5, - expr: &seqExpr{ - pos: position{line: 107, col: 20, offset: 3133}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 111, col: 26, offset: 3293}, - val: "---", - ignoreCase: false, - want: "\"---\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 111, col: 32, offset: 3299}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonRawDocument11, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 107, col: 41, offset: 3154}, - label: "content", - expr: &zeroOrOneExpr{ - pos: position{line: 107, col: 49, offset: 3162}, - expr: &actionExpr{ - pos: position{line: 113, col: 27, offset: 3337}, - run: (*parser).callonRawDocument20, - expr: &zeroOrMoreExpr{ - pos: position{line: 113, col: 27, offset: 3337}, - expr: &oneOrMoreExpr{ - pos: position{line: 113, col: 28, offset: 3338}, - expr: &seqExpr{ - pos: position{line: 113, col: 29, offset: 3339}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 113, col: 29, offset: 3339}, + pos: position{line: 1625, col: 16, offset: 54160}, + expr: &actionExpr{ + pos: position{line: 1626, col: 9, offset: 54170}, + run: (*parser).callonDocumentFragment114, + expr: &seqExpr{ + pos: position{line: 1626, col: 9, offset: 54170}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1626, col: 9, offset: 54170}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + ¬Expr{ + pos: position{line: 1627, col: 9, offset: 54184}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonDocumentFragment120, expr: &seqExpr{ - pos: position{line: 111, col: 26, offset: 3293}, + pos: position{line: 526, col: 14, offset: 17058}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 111, col: 26, offset: 3293}, - val: "---", - ignoreCase: false, - want: "\"---\"", + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, &zeroOrMoreExpr{ - pos: position{line: 111, col: 32, offset: 3299}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonRawDocument30, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment126, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment129, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, @@ -785,258 +615,55 @@ var g = &grammar{ }, }, }, - &anyMatcher{ - line: 113, col: 51, offset: 3361, - }, }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 111, col: 26, offset: 3293}, - val: "---", - ignoreCase: false, - want: "\"---\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 111, col: 32, offset: 3299}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonRawDocument42, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 51, col: 43, offset: 1467}, - label: "blocks", - expr: &ruleRefExpr{ - pos: position{line: 51, col: 51, offset: 1475}, - name: "DocumentBlocks", - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - { - name: "DocumentBlocks", - pos: position{line: 58, col: 1, offset: 1680}, - expr: &actionExpr{ - pos: position{line: 58, col: 19, offset: 1698}, - run: (*parser).callonDocumentBlocks1, - expr: &seqExpr{ - pos: position{line: 58, col: 19, offset: 1698}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 58, col: 19, offset: 1698}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 58, col: 28, offset: 1707}, - label: "header", - expr: &zeroOrOneExpr{ - pos: position{line: 58, col: 36, offset: 1715}, - expr: &actionExpr{ - pos: position{line: 120, col: 19, offset: 3545}, - run: (*parser).callonDocumentBlocks9, - expr: &seqExpr{ - pos: position{line: 120, col: 19, offset: 3545}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 120, col: 19, offset: 3545}, - val: "=", - ignoreCase: false, - want: "\"=\"", - }, - &oneOrMoreExpr{ - pos: position{line: 120, col: 23, offset: 3549}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks15, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 120, col: 30, offset: 3556}, - label: "title", - expr: &actionExpr{ - pos: position{line: 504, col: 18, offset: 16057}, - run: (*parser).callonDocumentBlocks18, - expr: &labeledExpr{ - pos: position{line: 504, col: 18, offset: 16057}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 504, col: 27, offset: 16066}, - expr: &seqExpr{ - pos: position{line: 504, col: 28, offset: 16067}, - exprs: []interface{}{ ¬Expr{ - pos: position{line: 504, col: 28, offset: 16067}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ + pos: position{line: 1628, col: 9, offset: 54203}, + expr: &seqExpr{ + pos: position{line: 1392, col: 34, offset: 46323}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 1392, col: 34, offset: 46323}, + val: "+", ignoreCase: false, - inverted: false, + want: "\"+\"", }, - }, - }, - }, - ¬Expr{ - pos: position{line: 504, col: 37, offset: 16076}, - expr: &actionExpr{ - pos: position{line: 237, col: 20, offset: 7607}, - run: (*parser).callonDocumentBlocks27, - expr: &seqExpr{ - pos: position{line: 237, col: 20, offset: 7607}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 237, col: 20, offset: 7607}, - val: "[[", - ignoreCase: false, - want: "\"[[\"", - }, - &labeledExpr{ - pos: position{line: 237, col: 25, offset: 7612}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonDocumentBlocks31, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, - }, - }, + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 38, offset: 46327}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment140, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, - &litMatcher{ - pos: position{line: 237, col: 33, offset: 7620}, - val: "]]", - ignoreCase: false, - want: "\"]]\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 237, col: 38, offset: 7625}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks38, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment142, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -1044,263 +671,160 @@ var g = &grammar{ }, }, }, - &actionExpr{ - pos: position{line: 508, col: 17, offset: 16230}, - run: (*parser).callonDocumentBlocks40, - expr: &labeledExpr{ - pos: position{line: 508, col: 17, offset: 16230}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 508, col: 26, offset: 16239}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonDocumentBlocks43, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, + &labeledExpr{ + pos: position{line: 1629, col: 9, offset: 54242}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 1629, col: 15, offset: 54248}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + run: (*parser).callonDocumentFragment149, + expr: &seqExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2672, col: 31, offset: 89114}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2672, col: 36, offset: 89119}, + expr: &litMatcher{ + pos: position{line: 2672, col: 37, offset: 89120}, + val: "//", + ignoreCase: false, + want: "\"//\"", }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + }, + &labeledExpr{ + pos: position{line: 2667, col: 49, offset: 88920}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + run: (*parser).callonDocumentFragment155, + expr: &zeroOrMoreExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + expr: &charClassMatcher{ + pos: position{line: 2674, col: 29, offset: 89155}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonDocumentBlocks52, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment159, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - inverted: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, - &actionExpr{ - pos: position{line: 995, col: 14, offset: 32701}, - run: (*parser).callonDocumentBlocks61, - expr: &seqExpr{ - pos: position{line: 995, col: 14, offset: 32701}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + }, + &actionExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + run: (*parser).callonDocumentFragment166, + expr: &seqExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + run: (*parser).callonDocumentFragment169, + expr: &oneOrMoreExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + expr: &charClassMatcher{ + pos: position{line: 1662, col: 14, offset: 55218}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks65, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + inverted: true, }, }, }, - &litMatcher{ - pos: position{line: 995, col: 20, offset: 32707}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 995, col: 24, offset: 32711}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks71, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &andCodeExpr{ + pos: position{line: 1665, col: 5, offset: 55275}, + run: (*parser).callonDocumentFragment172, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment174, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\n\"", }, - }, - }, - }, - }, - &andExpr{ - pos: position{line: 995, col: 31, offset: 32718}, - expr: &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - }, - }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 510, col: 11, offset: 16299}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks82, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonDocumentBlocks84, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonDocumentBlocks88, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, }, }, }, - &actionExpr{ - pos: position{line: 2237, col: 12, offset: 79050}, - run: (*parser).callonDocumentBlocks92, - expr: &charClassMatcher{ - pos: position{line: 2237, col: 12, offset: 79050}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, }, }, }, @@ -1311,741 +835,464 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 120, col: 52, offset: 3578}, - label: "id", - expr: &zeroOrMoreExpr{ - pos: position{line: 120, col: 56, offset: 3582}, - expr: &actionExpr{ - pos: position{line: 237, col: 20, offset: 7607}, - run: (*parser).callonDocumentBlocks96, - expr: &seqExpr{ - pos: position{line: 237, col: 20, offset: 7607}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 237, col: 20, offset: 7607}, - val: "[[", - ignoreCase: false, - want: "\"[[\"", - }, - &labeledExpr{ - pos: position{line: 237, col: 25, offset: 7612}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonDocumentBlocks100, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 237, col: 33, offset: 7620}, - val: "]]", + }, + }, + &actionExpr{ + pos: position{line: 152, col: 5, offset: 4423}, + run: (*parser).callonDocumentFragment181, + expr: &seqExpr{ + pos: position{line: 152, col: 5, offset: 4423}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 152, col: 5, offset: 4423}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 152, col: 9, offset: 4427}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDocumentFragment185, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"]]\"", + inverted: false, }, &zeroOrMoreExpr{ - pos: position{line: 237, col: 38, offset: 7625}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks107, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &litMatcher{ + pos: position{line: 152, col: 30, offset: 4448}, + val: ":", + ignoreCase: false, + want: "\":\"", }, - }, - &zeroOrMoreExpr{ - pos: position{line: 121, col: 9, offset: 3612}, - expr: &choiceExpr{ - pos: position{line: 121, col: 10, offset: 3613}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 121, col: 10, offset: 3613}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 121, col: 10, offset: 3613}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks120, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonDocumentBlocks122, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks130, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonDocumentBlocks139, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, - run: (*parser).callonDocumentBlocks147, + &labeledExpr{ + pos: position{line: 153, col: 5, offset: 4457}, + label: "value", + expr: &zeroOrOneExpr{ + pos: position{line: 153, col: 11, offset: 4463}, + expr: &actionExpr{ + pos: position{line: 167, col: 5, offset: 4915}, + run: (*parser).callonDocumentFragment193, expr: &seqExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, + pos: position{line: 167, col: 5, offset: 4915}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1904, col: 31, offset: 67955}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1904, col: 38, offset: 67962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks153, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonDocumentFragment195, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, &labeledExpr{ - pos: position{line: 1908, col: 44, offset: 68072}, - label: "content", + pos: position{line: 167, col: 12, offset: 4922}, + label: "elements", expr: &zeroOrMoreExpr{ - pos: position{line: 1912, col: 27, offset: 68225}, + pos: position{line: 167, col: 21, offset: 4931}, expr: &actionExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - run: (*parser).callonDocumentBlocks162, + pos: position{line: 171, col: 37, offset: 5090}, + run: (*parser).callonDocumentFragment200, expr: &seqExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, + pos: position{line: 171, col: 37, offset: 5090}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1912, col: 28, offset: 68226}, + pos: position{line: 171, col: 37, offset: 5090}, expr: &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks171, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1912, col: 54, offset: 68252}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonDocumentBlocks181, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonDocumentBlocks187, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment204, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks201, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 122, col: 9, offset: 3663}, - label: "authors", - expr: &zeroOrOneExpr{ - pos: position{line: 122, col: 18, offset: 3672}, - expr: &choiceExpr{ - pos: position{line: 128, col: 20, offset: 3880}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 130, col: 30, offset: 3967}, - run: (*parser).callonDocumentBlocks213, - expr: &seqExpr{ - pos: position{line: 130, col: 30, offset: 3967}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 130, col: 30, offset: 3967}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks218, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 130, col: 37, offset: 3974}, - expr: &litMatcher{ - pos: position{line: 130, col: 38, offset: 3975}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - }, - &labeledExpr{ - pos: position{line: 130, col: 42, offset: 3979}, - label: "authors", - expr: &oneOrMoreExpr{ - pos: position{line: 130, col: 51, offset: 3988}, - expr: &actionExpr{ - pos: position{line: 138, col: 19, offset: 4246}, - run: (*parser).callonDocumentBlocks224, - expr: &seqExpr{ - pos: position{line: 138, col: 19, offset: 4246}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 138, col: 19, offset: 4246}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks229, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &labeledExpr{ + pos: position{line: 172, col: 5, offset: 5100}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 173, col: 9, offset: 5118}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 173, col: 10, offset: 5119}, + run: (*parser).callonDocumentFragment213, + expr: &oneOrMoreExpr{ + pos: position{line: 173, col: 10, offset: 5119}, + expr: &charClassMatcher{ + pos: position{line: 173, col: 10, offset: 5119}, + val: "[^\\r\\n{]", + chars: []rune{'\r', '\n', '{'}, ignoreCase: false, - want: "\"\\t\"", + inverted: true, }, }, }, - }, - }, - &labeledExpr{ - pos: position{line: 138, col: 26, offset: 4253}, - label: "fullname", - expr: &actionExpr{ - pos: position{line: 143, col: 23, offset: 4491}, - run: (*parser).callonDocumentBlocks232, - expr: &oneOrMoreExpr{ - pos: position{line: 143, col: 23, offset: 4491}, - expr: &charClassMatcher{ - pos: position{line: 143, col: 23, offset: 4491}, - val: "[^<;\\r\\n]", - chars: []rune{'<', ';', '\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 138, col: 56, offset: 4283}, - label: "email", - expr: &zeroOrOneExpr{ - pos: position{line: 138, col: 62, offset: 4289}, - expr: &actionExpr{ - pos: position{line: 147, col: 24, offset: 4561}, - run: (*parser).callonDocumentBlocks237, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDocumentFragment216, expr: &seqExpr{ - pos: position{line: 147, col: 24, offset: 4561}, + pos: position{line: 493, col: 5, offset: 15857}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 147, col: 24, offset: 4561}, - val: "<", - ignoreCase: false, - want: "\"<\"", + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDocumentFragment218, }, &labeledExpr{ - pos: position{line: 147, col: 28, offset: 4565}, - label: "email", - expr: &actionExpr{ - pos: position{line: 147, col: 35, offset: 4572}, - run: (*parser).callonDocumentBlocks241, - expr: &oneOrMoreExpr{ - pos: position{line: 147, col: 36, offset: 4573}, - expr: &charClassMatcher{ - pos: position{line: 147, col: 36, offset: 4573}, - val: "[^>\\r\\n]", - chars: []rune{'>', '\r', '\n'}, - ignoreCase: false, - inverted: true, + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonDocumentFragment221, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDocumentFragment225, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDocumentFragment232, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDocumentFragment237, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDocumentFragment239, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonDocumentFragment243, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDocumentFragment247, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDocumentFragment254, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDocumentFragment259, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDocumentFragment261, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonDocumentFragment265, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDocumentFragment269, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, }, }, }, }, - &litMatcher{ - pos: position{line: 149, col: 4, offset: 4620}, - val: ">", - ignoreCase: false, - want: "\">\"", - }, - }, - }, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 138, col: 85, offset: 4312}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks248, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", }, }, }, - }, - }, - &zeroOrOneExpr{ - pos: position{line: 138, col: 92, offset: 4319}, - expr: &litMatcher{ - pos: position{line: 138, col: 92, offset: 4319}, - val: ";", - ignoreCase: false, - want: "\";\"", - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 138, col: 97, offset: 4324}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &actionExpr{ + pos: position{line: 177, col: 12, offset: 5247}, + run: (*parser).callonDocumentFragment275, + expr: &litMatcher{ + pos: position{line: 177, col: 12, offset: 5247}, + val: "{", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks255, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + want: "\"{\"", }, }, }, @@ -2055,249 +1302,342 @@ var g = &grammar{ }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, }, }, }, - &actionExpr{ - pos: position{line: 134, col: 33, offset: 4107}, - run: (*parser).callonDocumentBlocks262, - expr: &seqExpr{ - pos: position{line: 134, col: 33, offset: 4107}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 134, col: 33, offset: 4107}, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment278, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 184, col: 19, offset: 5402}, + run: (*parser).callonDocumentFragment285, + expr: &seqExpr{ + pos: position{line: 184, col: 19, offset: 5402}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 184, col: 19, offset: 5402}, + val: ":!", + ignoreCase: false, + want: "\":!\"", + }, + &labeledExpr{ + pos: position{line: 184, col: 24, offset: 5407}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDocumentFragment289, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 184, col: 45, offset: 5428}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 184, col: 49, offset: 5432}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment296, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment299, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 186, col: 5, offset: 5499}, + run: (*parser).callonDocumentFragment306, + expr: &seqExpr{ + pos: position{line: 186, col: 5, offset: 5499}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 186, col: 5, offset: 5499}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 186, col: 9, offset: 5503}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDocumentFragment310, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 186, col: 30, offset: 5524}, + val: "!:", + ignoreCase: false, + want: "\"!:\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 186, col: 35, offset: 5529}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment317, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment320, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 879, col: 5, offset: 27679}, + run: (*parser).callonDocumentFragment327, + expr: &seqExpr{ + pos: position{line: 879, col: 5, offset: 27679}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 879, col: 5, offset: 27679}, + run: (*parser).callonDocumentFragment329, + }, + &zeroOrMoreExpr{ + pos: position{line: 882, col: 5, offset: 27740}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonDocumentFragment331, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment337, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment340, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks267, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, - }, - }, - }, - &litMatcher{ - pos: position{line: 134, col: 40, offset: 4114}, - val: ":author:", - ignoreCase: false, - want: "\":author:\"", - }, - &labeledExpr{ - pos: position{line: 134, col: 51, offset: 4125}, - label: "author", - expr: &actionExpr{ - pos: position{line: 138, col: 19, offset: 4246}, - run: (*parser).callonDocumentBlocks271, - expr: &seqExpr{ - pos: position{line: 138, col: 19, offset: 4246}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 138, col: 19, offset: 4246}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks276, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 138, col: 26, offset: 4253}, - label: "fullname", - expr: &actionExpr{ - pos: position{line: 143, col: 23, offset: 4491}, - run: (*parser).callonDocumentBlocks279, - expr: &oneOrMoreExpr{ - pos: position{line: 143, col: 23, offset: 4491}, - expr: &charClassMatcher{ - pos: position{line: 143, col: 23, offset: 4491}, - val: "[^<;\\r\\n]", - chars: []rune{'<', ';', '\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 138, col: 56, offset: 4283}, - label: "email", - expr: &zeroOrOneExpr{ - pos: position{line: 138, col: 62, offset: 4289}, - expr: &actionExpr{ - pos: position{line: 147, col: 24, offset: 4561}, - run: (*parser).callonDocumentBlocks284, - expr: &seqExpr{ - pos: position{line: 147, col: 24, offset: 4561}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 147, col: 24, offset: 4561}, - val: "<", - ignoreCase: false, - want: "\"<\"", - }, - &labeledExpr{ - pos: position{line: 147, col: 28, offset: 4565}, - label: "email", - expr: &actionExpr{ - pos: position{line: 147, col: 35, offset: 4572}, - run: (*parser).callonDocumentBlocks288, - expr: &oneOrMoreExpr{ - pos: position{line: 147, col: 36, offset: 4573}, - expr: &charClassMatcher{ - pos: position{line: 147, col: 36, offset: 4573}, - val: "[^>\\r\\n]", - chars: []rune{'>', '\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 149, col: 4, offset: 4620}, - val: ">", - ignoreCase: false, - want: "\">\"", - }, - }, - }, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 138, col: 85, offset: 4312}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks295, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &zeroOrOneExpr{ - pos: position{line: 138, col: 92, offset: 4319}, - expr: &litMatcher{ - pos: position{line: 138, col: 92, offset: 4319}, - val: ";", - ignoreCase: false, - want: "\";\"", - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 138, col: 97, offset: 4324}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks302, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -2306,364 +1646,581 @@ var g = &grammar{ }, }, }, - }, - &zeroOrMoreExpr{ - pos: position{line: 123, col: 9, offset: 3699}, - expr: &choiceExpr{ - pos: position{line: 123, col: 10, offset: 3700}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 123, col: 10, offset: 3700}, + &labeledExpr{ + pos: position{line: 883, col: 5, offset: 27790}, + label: "title", + expr: &actionExpr{ + pos: position{line: 897, col: 5, offset: 28323}, + run: (*parser).callonDocumentFragment348, + expr: &seqExpr{ + pos: position{line: 897, col: 5, offset: 28323}, exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 123, col: 10, offset: 3700}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks315, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + &litMatcher{ + pos: position{line: 897, col: 5, offset: 28323}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonDocumentFragment351, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonDocumentBlocks317, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks325, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", + &labeledExpr{ + pos: position{line: 897, col: 16, offset: 28334}, + label: "title", + expr: &actionExpr{ + pos: position{line: 2429, col: 20, offset: 81803}, + run: (*parser).callonDocumentFragment355, + expr: &oneOrMoreExpr{ + pos: position{line: 2429, col: 20, offset: 81803}, + expr: &charClassMatcher{ + pos: position{line: 2429, col: 20, offset: 81803}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonDocumentBlocks334, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, + inverted: true, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment359, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, - &actionExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, - run: (*parser).callonDocumentBlocks342, + }, + }, + &labeledExpr{ + pos: position{line: 884, col: 5, offset: 27814}, + label: "info", + expr: &zeroOrOneExpr{ + pos: position{line: 884, col: 10, offset: 27819}, + expr: &actionExpr{ + pos: position{line: 902, col: 5, offset: 28431}, + run: (*parser).callonDocumentFragment368, expr: &seqExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, + pos: position{line: 902, col: 5, offset: 28431}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1904, col: 31, offset: 67955}, - val: "////", - ignoreCase: false, - want: "\"////\"", + ¬Expr{ + pos: position{line: 902, col: 5, offset: 28431}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonDocumentFragment371, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment377, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment380, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, }, &zeroOrMoreExpr{ - pos: position{line: 1904, col: 38, offset: 67962}, + pos: position{line: 903, col: 5, offset: 28446}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 903, col: 6, offset: 28447}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks348, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1908, col: 44, offset: 68072}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1912, col: 27, offset: 68225}, - expr: &actionExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - run: (*parser).callonDocumentBlocks357, - expr: &seqExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1912, col: 28, offset: 68226}, - expr: &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, + pos: position{line: 2667, col: 22, offset: 88893}, + run: (*parser).callonDocumentFragment389, + expr: &seqExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2672, col: 31, offset: 89114}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2672, col: 36, offset: 89119}, + expr: &litMatcher{ + pos: position{line: 2672, col: 37, offset: 89120}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + }, + &labeledExpr{ + pos: position{line: 2667, col: 49, offset: 88920}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + run: (*parser).callonDocumentFragment395, + expr: &zeroOrMoreExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + expr: &charClassMatcher{ + pos: position{line: 2674, col: 29, offset: 89155}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks366, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment399, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - &labeledExpr{ - pos: position{line: 1912, col: 54, offset: 68252}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonDocumentBlocks376, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + }, + &actionExpr{ + pos: position{line: 613, col: 5, offset: 19612}, + run: (*parser).callonDocumentFragment406, + expr: &seqExpr{ + pos: position{line: 613, col: 5, offset: 19612}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 613, col: 5, offset: 19612}, + run: (*parser).callonDocumentFragment408, + }, + &litMatcher{ + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment411, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment414, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonDocumentBlocks382, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 618, col: 5, offset: 19795}, + run: (*parser).callonDocumentFragment421, + }, + &labeledExpr{ + pos: position{line: 623, col: 5, offset: 19996}, + label: "content", + expr: &zeroOrMoreExpr{ + pos: position{line: 634, col: 5, offset: 20320}, + expr: &actionExpr{ + pos: position{line: 634, col: 6, offset: 20321}, + run: (*parser).callonDocumentFragment424, + expr: &seqExpr{ + pos: position{line: 634, col: 6, offset: 20321}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 634, col: 6, offset: 20321}, + expr: &choiceExpr{ + pos: position{line: 631, col: 29, offset: 20263}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 585, col: 26, offset: 18950}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment431, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment434, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 635, col: 5, offset: 20351}, + label: "line", + expr: &actionExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + run: (*parser).callonDocumentFragment444, + expr: &seqExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 602, col: 5, offset: 19307}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &labeledExpr{ + pos: position{line: 603, col: 5, offset: 19380}, + label: "content", + expr: &actionExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + run: (*parser).callonDocumentFragment450, + expr: &zeroOrMoreExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + expr: &charClassMatcher{ + pos: position{line: 603, col: 14, offset: 19389}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment454, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + }, + }, + }, + &zeroOrOneExpr{ + pos: position{line: 624, col: 5, offset: 20030}, + expr: &choiceExpr{ + pos: position{line: 631, col: 29, offset: 20263}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 585, col: 26, offset: 18950}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"////\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment466, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment469, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, @@ -2673,306 +2230,620 @@ var g = &grammar{ }, }, }, - &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, + &labeledExpr{ + pos: position{line: 904, col: 5, offset: 28521}, + label: "authors", + expr: &actionExpr{ + pos: position{line: 910, col: 20, offset: 28771}, + run: (*parser).callonDocumentFragment479, + expr: &seqExpr{ + pos: position{line: 910, col: 20, offset: 28771}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks396, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 910, col: 20, offset: 28771}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment482, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 124, col: 9, offset: 3750}, - label: "revision", - expr: &zeroOrOneExpr{ - pos: position{line: 124, col: 19, offset: 3760}, - expr: &actionExpr{ - pos: position{line: 155, col: 21, offset: 4801}, - run: (*parser).callonDocumentBlocks407, - expr: &seqExpr{ - pos: position{line: 155, col: 21, offset: 4801}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 155, col: 21, offset: 4801}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks412, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 155, col: 28, offset: 4808}, - expr: &litMatcher{ - pos: position{line: 155, col: 29, offset: 4809}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - }, - &labeledExpr{ - pos: position{line: 155, col: 33, offset: 4813}, - label: "revision", - expr: &choiceExpr{ - pos: position{line: 156, col: 9, offset: 4832}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 156, col: 10, offset: 4833}, - run: (*parser).callonDocumentBlocks418, - expr: &seqExpr{ - pos: position{line: 156, col: 10, offset: 4833}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 156, col: 10, offset: 4833}, - label: "revnumber", - expr: &choiceExpr{ - pos: position{line: 165, col: 27, offset: 5350}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 165, col: 27, offset: 5350}, - run: (*parser).callonDocumentBlocks422, - expr: &seqExpr{ - pos: position{line: 165, col: 27, offset: 5350}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 165, col: 27, offset: 5350}, - val: "v", - ignoreCase: true, - want: "\"v\"i", - }, - &actionExpr{ - pos: position{line: 2263, col: 10, offset: 79843}, - run: (*parser).callonDocumentBlocks425, - expr: &charClassMatcher{ - pos: position{line: 2263, col: 10, offset: 79843}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, + &labeledExpr{ + pos: position{line: 910, col: 27, offset: 28778}, + label: "authors", + expr: &choiceExpr{ + pos: position{line: 910, col: 36, offset: 28787}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 914, col: 30, offset: 28907}, + run: (*parser).callonDocumentFragment486, + expr: &seqExpr{ + pos: position{line: 914, col: 30, offset: 28907}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 914, col: 30, offset: 28907}, + expr: &litMatcher{ + pos: position{line: 914, col: 31, offset: 28908}, + val: ":", + ignoreCase: false, + want: "\":\"", }, - &oneOrMoreExpr{ - pos: position{line: 165, col: 39, offset: 5362}, - expr: &charClassMatcher{ - pos: position{line: 165, col: 39, offset: 5362}, - val: "[^:,\\r\\n]", - chars: []rune{':', ',', '\r', '\n'}, - ignoreCase: false, - inverted: true, + }, + &labeledExpr{ + pos: position{line: 914, col: 35, offset: 28912}, + label: "authors", + expr: &oneOrMoreExpr{ + pos: position{line: 914, col: 44, offset: 28921}, + expr: &actionExpr{ + pos: position{line: 923, col: 5, offset: 29153}, + run: (*parser).callonDocumentFragment492, + expr: &seqExpr{ + pos: position{line: 923, col: 5, offset: 29153}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 923, col: 5, offset: 29153}, + label: "fullName", + expr: &zeroOrOneExpr{ + pos: position{line: 923, col: 14, offset: 29162}, + expr: &actionExpr{ + pos: position{line: 934, col: 5, offset: 29542}, + run: (*parser).callonDocumentFragment496, + expr: &seqExpr{ + pos: position{line: 934, col: 5, offset: 29542}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 934, col: 5, offset: 29542}, + label: "part1", + expr: &actionExpr{ + pos: position{line: 934, col: 12, offset: 29549}, + run: (*parser).callonDocumentFragment499, + expr: &oneOrMoreExpr{ + pos: position{line: 934, col: 12, offset: 29549}, + expr: &charClassMatcher{ + pos: position{line: 934, col: 12, offset: 29549}, + val: "[^<;\\r\\n ]", + chars: []rune{'<', ';', '\r', '\n', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 937, col: 5, offset: 29629}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment503, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 938, col: 5, offset: 29640}, + label: "part2", + expr: &zeroOrOneExpr{ + pos: position{line: 938, col: 11, offset: 29646}, + expr: &actionExpr{ + pos: position{line: 938, col: 12, offset: 29647}, + run: (*parser).callonDocumentFragment507, + expr: &oneOrMoreExpr{ + pos: position{line: 938, col: 12, offset: 29647}, + expr: &charClassMatcher{ + pos: position{line: 938, col: 12, offset: 29647}, + val: "[^<;\\r\\n ]", + chars: []rune{'<', ';', '\r', '\n', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 941, col: 5, offset: 29728}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment511, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 942, col: 5, offset: 29739}, + label: "part3", + expr: &zeroOrOneExpr{ + pos: position{line: 942, col: 11, offset: 29745}, + expr: &actionExpr{ + pos: position{line: 942, col: 12, offset: 29746}, + run: (*parser).callonDocumentFragment515, + expr: &oneOrMoreExpr{ + pos: position{line: 942, col: 12, offset: 29746}, + expr: &charClassMatcher{ + pos: position{line: 942, col: 12, offset: 29746}, + val: "[^<;\\r\\n]", + chars: []rune{'<', ';', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 945, col: 5, offset: 29825}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment519, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 923, col: 40, offset: 29188}, + label: "email", + expr: &zeroOrOneExpr{ + pos: position{line: 923, col: 46, offset: 29194}, + expr: &actionExpr{ + pos: position{line: 951, col: 5, offset: 29947}, + run: (*parser).callonDocumentFragment523, + expr: &seqExpr{ + pos: position{line: 951, col: 5, offset: 29947}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 951, col: 5, offset: 29947}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &litMatcher{ + pos: position{line: 952, col: 5, offset: 29957}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 953, col: 5, offset: 29966}, + label: "email", + expr: &actionExpr{ + pos: position{line: 953, col: 12, offset: 29973}, + run: (*parser).callonDocumentFragment530, + expr: &oneOrMoreExpr{ + pos: position{line: 953, col: 13, offset: 29974}, + expr: &charClassMatcher{ + pos: position{line: 953, col: 13, offset: 29974}, + val: "[^>\\r\\n]", + chars: []rune{'>', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 956, col: 5, offset: 30034}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 923, col: 69, offset: 29217}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment535, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &zeroOrOneExpr{ + pos: position{line: 923, col: 76, offset: 29224}, + expr: &litMatcher{ + pos: position{line: 923, col: 76, offset: 29224}, + val: ";", + ignoreCase: false, + want: "\";\"", + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 923, col: 81, offset: 29229}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment540, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 924, col: 5, offset: 29241}, + run: (*parser).callonDocumentFragment542, + }, + }, + }, }, }, }, }, }, - &actionExpr{ - pos: position{line: 167, col: 5, offset: 5410}, - run: (*parser).callonDocumentBlocks429, - expr: &seqExpr{ - pos: position{line: 167, col: 5, offset: 5410}, - exprs: []interface{}{ - &zeroOrOneExpr{ - pos: position{line: 167, col: 5, offset: 5410}, - expr: &litMatcher{ - pos: position{line: 167, col: 5, offset: 5410}, - val: "v", - ignoreCase: true, - want: "\"v\"i", - }, - }, - &actionExpr{ - pos: position{line: 2263, col: 10, offset: 79843}, - run: (*parser).callonDocumentBlocks433, + }, + &actionExpr{ + pos: position{line: 918, col: 33, offset: 29039}, + run: (*parser).callonDocumentFragment543, + expr: &seqExpr{ + pos: position{line: 918, col: 33, offset: 29039}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 918, col: 33, offset: 29039}, + val: ":author:", + ignoreCase: false, + want: "\":author:\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 918, col: 44, offset: 29050}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment547, expr: &charClassMatcher{ - pos: position{line: 2263, col: 10, offset: 79843}, - val: "[0-9]", - ranges: []rune{'0', '9'}, + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, }, - &oneOrMoreExpr{ - pos: position{line: 167, col: 18, offset: 5423}, - expr: &charClassMatcher{ - pos: position{line: 167, col: 18, offset: 5423}, - val: "[^:,\\r\\n]", - chars: []rune{':', ',', '\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 167, col: 29, offset: 5434}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + }, + &labeledExpr{ + pos: position{line: 918, col: 51, offset: 29057}, + label: "author", + expr: &actionExpr{ + pos: position{line: 923, col: 5, offset: 29153}, + run: (*parser).callonDocumentFragment550, + expr: &seqExpr{ + pos: position{line: 923, col: 5, offset: 29153}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 923, col: 5, offset: 29153}, + label: "fullName", + expr: &zeroOrOneExpr{ + pos: position{line: 923, col: 14, offset: 29162}, + expr: &actionExpr{ + pos: position{line: 934, col: 5, offset: 29542}, + run: (*parser).callonDocumentFragment554, + expr: &seqExpr{ + pos: position{line: 934, col: 5, offset: 29542}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 934, col: 5, offset: 29542}, + label: "part1", + expr: &actionExpr{ + pos: position{line: 934, col: 12, offset: 29549}, + run: (*parser).callonDocumentFragment557, + expr: &oneOrMoreExpr{ + pos: position{line: 934, col: 12, offset: 29549}, + expr: &charClassMatcher{ + pos: position{line: 934, col: 12, offset: 29549}, + val: "[^<;\\r\\n ]", + chars: []rune{'<', ';', '\r', '\n', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 937, col: 5, offset: 29629}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment561, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 938, col: 5, offset: 29640}, + label: "part2", + expr: &zeroOrOneExpr{ + pos: position{line: 938, col: 11, offset: 29646}, + expr: &actionExpr{ + pos: position{line: 938, col: 12, offset: 29647}, + run: (*parser).callonDocumentFragment565, + expr: &oneOrMoreExpr{ + pos: position{line: 938, col: 12, offset: 29647}, + expr: &charClassMatcher{ + pos: position{line: 938, col: 12, offset: 29647}, + val: "[^<;\\r\\n ]", + chars: []rune{'<', ';', '\r', '\n', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 941, col: 5, offset: 29728}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment569, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 942, col: 5, offset: 29739}, + label: "part3", + expr: &zeroOrOneExpr{ + pos: position{line: 942, col: 11, offset: 29745}, + expr: &actionExpr{ + pos: position{line: 942, col: 12, offset: 29746}, + run: (*parser).callonDocumentFragment573, + expr: &oneOrMoreExpr{ + pos: position{line: 942, col: 12, offset: 29746}, + expr: &charClassMatcher{ + pos: position{line: 942, col: 12, offset: 29746}, + val: "[^<;\\r\\n]", + chars: []rune{'<', ';', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 945, col: 5, offset: 29825}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment577, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks440, + &labeledExpr{ + pos: position{line: 923, col: 40, offset: 29188}, + label: "email", + expr: &zeroOrOneExpr{ + pos: position{line: 923, col: 46, offset: 29194}, + expr: &actionExpr{ + pos: position{line: 951, col: 5, offset: 29947}, + run: (*parser).callonDocumentFragment581, + expr: &seqExpr{ + pos: position{line: 951, col: 5, offset: 29947}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 951, col: 5, offset: 29947}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &litMatcher{ + pos: position{line: 952, col: 5, offset: 29957}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 953, col: 5, offset: 29966}, + label: "email", + expr: &actionExpr{ + pos: position{line: 953, col: 12, offset: 29973}, + run: (*parser).callonDocumentFragment588, + expr: &oneOrMoreExpr{ + pos: position{line: 953, col: 13, offset: 29974}, + expr: &charClassMatcher{ + pos: position{line: 953, col: 13, offset: 29974}, + val: "[^>\\r\\n]", + chars: []rune{'>', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 956, col: 5, offset: 30034}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 923, col: 69, offset: 29217}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment593, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &zeroOrOneExpr{ + pos: position{line: 923, col: 76, offset: 29224}, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 923, col: 76, offset: 29224}, + val: ";", ignoreCase: false, - want: "\"\\t\"", + want: "\";\"", + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 923, col: 81, offset: 29229}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment598, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, }, + &andCodeExpr{ + pos: position{line: 924, col: 5, offset: 29241}, + run: (*parser).callonDocumentFragment600, + }, }, }, }, - &andExpr{ - pos: position{line: 167, col: 36, offset: 5441}, - expr: &litMatcher{ - pos: position{line: 167, col: 37, offset: 5442}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - }, }, }, }, }, }, }, - &zeroOrOneExpr{ - pos: position{line: 156, col: 45, offset: 4868}, - expr: &litMatcher{ - pos: position{line: 156, col: 45, offset: 4868}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - }, - &labeledExpr{ - pos: position{line: 156, col: 50, offset: 4873}, - label: "revdate", - expr: &zeroOrOneExpr{ - pos: position{line: 156, col: 58, offset: 4881}, - expr: &actionExpr{ - pos: position{line: 171, col: 25, offset: 5506}, - run: (*parser).callonDocumentBlocks448, - expr: &oneOrMoreExpr{ - pos: position{line: 171, col: 25, offset: 5506}, - expr: &charClassMatcher{ - pos: position{line: 171, col: 25, offset: 5506}, - val: "[^:\\r\\n]", - chars: []rune{':', '\r', '\n'}, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment602, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - inverted: true, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - }, - &zeroOrOneExpr{ - pos: position{line: 156, col: 82, offset: 4905}, - expr: &litMatcher{ - pos: position{line: 156, col: 82, offset: 4905}, - val: ":", - ignoreCase: false, - want: "\":\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, - &labeledExpr{ - pos: position{line: 156, col: 87, offset: 4910}, - label: "revremark", - expr: &zeroOrOneExpr{ - pos: position{line: 156, col: 97, offset: 4920}, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 905, col: 5, offset: 28552}, + expr: &choiceExpr{ + pos: position{line: 905, col: 6, offset: 28553}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + run: (*parser).callonDocumentFragment611, + expr: &seqExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2672, col: 31, offset: 89114}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2672, col: 36, offset: 89119}, + expr: &litMatcher{ + pos: position{line: 2672, col: 37, offset: 89120}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + }, + &labeledExpr{ + pos: position{line: 2667, col: 49, offset: 88920}, + label: "content", expr: &actionExpr{ - pos: position{line: 175, col: 27, offset: 5578}, - run: (*parser).callonDocumentBlocks455, - expr: &oneOrMoreExpr{ - pos: position{line: 175, col: 27, offset: 5578}, + pos: position{line: 2674, col: 29, offset: 89155}, + run: (*parser).callonDocumentFragment617, + expr: &zeroOrMoreExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, expr: &charClassMatcher{ - pos: position{line: 175, col: 27, offset: 5578}, + pos: position{line: 2674, col: 29, offset: 89155}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -2981,229 +2852,282 @@ var g = &grammar{ }, }, }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 158, col: 15, offset: 5038}, - run: (*parser).callonDocumentBlocks458, - expr: &seqExpr{ - pos: position{line: 158, col: 15, offset: 5038}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 158, col: 15, offset: 5038}, - label: "revdate", - expr: &actionExpr{ - pos: position{line: 171, col: 25, offset: 5506}, - run: (*parser).callonDocumentBlocks461, - expr: &oneOrMoreExpr{ - pos: position{line: 171, col: 25, offset: 5506}, - expr: &charClassMatcher{ - pos: position{line: 171, col: 25, offset: 5506}, - val: "[^:\\r\\n]", - chars: []rune{':', '\r', '\n'}, - ignoreCase: false, - inverted: true, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment621, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, - &zeroOrOneExpr{ - pos: position{line: 158, col: 46, offset: 5069}, - expr: &litMatcher{ - pos: position{line: 158, col: 46, offset: 5069}, - val: ":", + }, + }, + &actionExpr{ + pos: position{line: 613, col: 5, offset: 19612}, + run: (*parser).callonDocumentFragment628, + expr: &seqExpr{ + pos: position{line: 613, col: 5, offset: 19612}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 613, col: 5, offset: 19612}, + run: (*parser).callonDocumentFragment630, + }, + &litMatcher{ + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", ignoreCase: false, - want: "\":\"", + want: "\"////\"", }, - }, - &labeledExpr{ - pos: position{line: 158, col: 51, offset: 5074}, - label: "revremark", - expr: &zeroOrOneExpr{ - pos: position{line: 158, col: 61, offset: 5084}, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, expr: &actionExpr{ - pos: position{line: 175, col: 27, offset: 5578}, - run: (*parser).callonDocumentBlocks468, - expr: &oneOrMoreExpr{ - pos: position{line: 175, col: 27, offset: 5578}, - expr: &charClassMatcher{ - pos: position{line: 175, col: 27, offset: 5578}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment633, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, - }, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 58, col: 53, offset: 1732}, - label: "blocks", - expr: &zeroOrMoreExpr{ - pos: position{line: 58, col: 61, offset: 1740}, - expr: &ruleRefExpr{ - pos: position{line: 58, col: 61, offset: 1740}, - name: "DocumentBlock", - }, - }, - }, - }, - }, - }, - }, - { - name: "DocumentBlock", - pos: position{line: 67, col: 1, offset: 1989}, - expr: &actionExpr{ - pos: position{line: 68, col: 5, offset: 2011}, - run: (*parser).callonDocumentBlock1, - expr: &seqExpr{ - pos: position{line: 68, col: 5, offset: 2011}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 68, col: 5, offset: 2011}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 69, col: 5, offset: 2020}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 69, col: 16, offset: 2031}, - expr: &ruleRefExpr{ - pos: position{line: 69, col: 17, offset: 2032}, - name: "BlockAttributes", - }, - }, - }, - &stateCodeExpr{ - pos: position{line: 70, col: 5, offset: 2054}, - run: (*parser).callonDocumentBlock9, - }, - &labeledExpr{ - pos: position{line: 74, col: 5, offset: 2136}, - label: "block", - expr: &choiceExpr{ - pos: position{line: 75, col: 9, offset: 2152}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 75, col: 9, offset: 2152}, - name: "LabeledListItem", - }, - &actionExpr{ - pos: position{line: 920, col: 5, offset: 29951}, - run: (*parser).callonDocumentBlock13, - expr: &seqExpr{ - pos: position{line: 920, col: 5, offset: 29951}, - exprs: []interface{}{ - ¬CodeExpr{ - pos: position{line: 920, col: 5, offset: 29951}, - run: (*parser).callonDocumentBlock15, - }, - &labeledExpr{ - pos: position{line: 923, col: 5, offset: 30081}, - label: "firstLine", - expr: &actionExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - run: (*parser).callonDocumentBlock17, - expr: &seqExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - label: "content", - expr: &actionExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - run: (*parser).callonDocumentBlock20, - expr: &seqExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - label: "elements", - expr: &choiceExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonDocumentBlock24, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment636, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 618, col: 5, offset: 19795}, + run: (*parser).callonDocumentFragment643, + }, + &labeledExpr{ + pos: position{line: 623, col: 5, offset: 19996}, + label: "content", + expr: &zeroOrMoreExpr{ + pos: position{line: 634, col: 5, offset: 20320}, + expr: &actionExpr{ + pos: position{line: 634, col: 6, offset: 20321}, + run: (*parser).callonDocumentFragment646, + expr: &seqExpr{ + pos: position{line: 634, col: 6, offset: 20321}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 634, col: 6, offset: 20321}, + expr: &choiceExpr{ + pos: position{line: 631, col: 29, offset: 20263}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 585, col: 26, offset: 18950}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment653, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment656, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + &labeledExpr{ + pos: position{line: 635, col: 5, offset: 20351}, + label: "line", + expr: &actionExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + run: (*parser).callonDocumentFragment666, + expr: &seqExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 602, col: 5, offset: 19307}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &labeledExpr{ + pos: position{line: 603, col: 5, offset: 19380}, + label: "content", + expr: &actionExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + run: (*parser).callonDocumentFragment672, + expr: &zeroOrMoreExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + expr: &charClassMatcher{ + pos: position{line: 603, col: 14, offset: 19389}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment676, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, }, }, }, @@ -3212,47 +3136,78 @@ var g = &grammar{ }, }, }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonDocumentBlock33, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, + &zeroOrOneExpr{ + pos: position{line: 624, col: 5, offset: 20030}, + expr: &choiceExpr{ + pos: position{line: 631, col: 29, offset: 20263}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 585, col: 26, offset: 18950}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment688, expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, }, }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment691, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -3261,117 +3216,319 @@ var g = &grammar{ }, }, }, - &zeroOrMoreExpr{ - pos: position{line: 929, col: 28, offset: 30362}, - expr: &charClassMatcher{ - pos: position{line: 929, col: 28, offset: 30362}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, }, }, }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 924, col: 5, offset: 30118}, - label: "otherLines", - expr: &zeroOrMoreExpr{ - pos: position{line: 924, col: 16, offset: 30129}, - expr: &choiceExpr{ - pos: position{line: 924, col: 17, offset: 30130}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonDocumentBlock52, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, + &labeledExpr{ + pos: position{line: 906, col: 5, offset: 28627}, + label: "revision", + expr: &zeroOrOneExpr{ + pos: position{line: 906, col: 14, offset: 28636}, + expr: &actionExpr{ + pos: position{line: 962, col: 21, offset: 30223}, + run: (*parser).callonDocumentFragment702, expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 962, col: 21, offset: 30223}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + pos: position{line: 962, col: 21, offset: 30223}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment705, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + ¬Expr{ + pos: position{line: 962, col: 28, offset: 30230}, + expr: &litMatcher{ + pos: position{line: 962, col: 29, offset: 30231}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + &labeledExpr{ + pos: position{line: 962, col: 33, offset: 30235}, + label: "revision", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 963, col: 9, offset: 30254}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &actionExpr{ + pos: position{line: 963, col: 10, offset: 30255}, + run: (*parser).callonDocumentFragment711, + expr: &seqExpr{ + pos: position{line: 963, col: 10, offset: 30255}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 963, col: 10, offset: 30255}, + label: "revnumber", + expr: &choiceExpr{ + pos: position{line: 972, col: 27, offset: 30772}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 972, col: 27, offset: 30772}, + run: (*parser).callonDocumentFragment715, + expr: &seqExpr{ + pos: position{line: 972, col: 27, offset: 30772}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 972, col: 27, offset: 30772}, + val: "v", + ignoreCase: true, + want: "\"v\"i", + }, + &actionExpr{ + pos: position{line: 2940, col: 10, offset: 97370}, + run: (*parser).callonDocumentFragment718, + expr: &charClassMatcher{ + pos: position{line: 2940, col: 10, offset: 97370}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 972, col: 39, offset: 30784}, + expr: &charClassMatcher{ + pos: position{line: 972, col: 39, offset: 30784}, + val: "[^:,\\r\\n]", + chars: []rune{':', ',', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 974, col: 5, offset: 30832}, + run: (*parser).callonDocumentFragment722, + expr: &seqExpr{ + pos: position{line: 974, col: 5, offset: 30832}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 974, col: 5, offset: 30832}, + expr: &litMatcher{ + pos: position{line: 974, col: 5, offset: 30832}, + val: "v", + ignoreCase: true, + want: "\"v\"i", + }, + }, + &actionExpr{ + pos: position{line: 2940, col: 10, offset: 97370}, + run: (*parser).callonDocumentFragment726, + expr: &charClassMatcher{ + pos: position{line: 2940, col: 10, offset: 97370}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 974, col: 18, offset: 30845}, + expr: &charClassMatcher{ + pos: position{line: 974, col: 18, offset: 30845}, + val: "[^:,\\r\\n]", + chars: []rune{':', ',', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 974, col: 29, offset: 30856}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment731, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &andExpr{ + pos: position{line: 974, col: 36, offset: 30863}, + expr: &litMatcher{ + pos: position{line: 974, col: 37, offset: 30864}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + }, + }, + }, + }, + }, + }, + }, + &zeroOrOneExpr{ + pos: position{line: 963, col: 45, offset: 30290}, + expr: &litMatcher{ + pos: position{line: 963, col: 45, offset: 30290}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + }, + &labeledExpr{ + pos: position{line: 963, col: 50, offset: 30295}, + label: "revdate", + expr: &zeroOrOneExpr{ + pos: position{line: 963, col: 58, offset: 30303}, + expr: &actionExpr{ + pos: position{line: 978, col: 25, offset: 30928}, + run: (*parser).callonDocumentFragment739, + expr: &oneOrMoreExpr{ + pos: position{line: 978, col: 25, offset: 30928}, + expr: &charClassMatcher{ + pos: position{line: 978, col: 25, offset: 30928}, + val: "[^:\\r\\n]", + chars: []rune{':', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &zeroOrOneExpr{ + pos: position{line: 963, col: 82, offset: 30327}, + expr: &litMatcher{ + pos: position{line: 963, col: 82, offset: 30327}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + &labeledExpr{ + pos: position{line: 963, col: 87, offset: 30332}, + label: "revremark", + expr: &zeroOrOneExpr{ + pos: position{line: 963, col: 97, offset: 30342}, + expr: &actionExpr{ + pos: position{line: 982, col: 27, offset: 31000}, + run: (*parser).callonDocumentFragment746, + expr: &oneOrMoreExpr{ + pos: position{line: 982, col: 27, offset: 31000}, + expr: &charClassMatcher{ + pos: position{line: 982, col: 27, offset: 31000}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock60, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 965, col: 15, offset: 30460}, + run: (*parser).callonDocumentFragment749, + expr: &seqExpr{ + pos: position{line: 965, col: 15, offset: 30460}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 965, col: 15, offset: 30460}, + label: "revdate", + expr: &actionExpr{ + pos: position{line: 978, col: 25, offset: 30928}, + run: (*parser).callonDocumentFragment752, + expr: &oneOrMoreExpr{ + pos: position{line: 978, col: 25, offset: 30928}, + expr: &charClassMatcher{ + pos: position{line: 978, col: 25, offset: 30928}, + val: "[^:\\r\\n]", + chars: []rune{':', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrOneExpr{ + pos: position{line: 965, col: 46, offset: 30491}, + expr: &litMatcher{ + pos: position{line: 965, col: 46, offset: 30491}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + &labeledExpr{ + pos: position{line: 965, col: 51, offset: 30496}, + label: "revremark", + expr: &zeroOrOneExpr{ + pos: position{line: 965, col: 61, offset: 30506}, + expr: &actionExpr{ + pos: position{line: 982, col: 27, offset: 31000}, + run: (*parser).callonDocumentFragment759, + expr: &oneOrMoreExpr{ + pos: position{line: 982, col: 27, offset: 31000}, + expr: &charClassMatcher{ + pos: position{line: 982, col: 27, offset: 31000}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, }, }, }, }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment763, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, @@ -3379,1036 +3536,740 @@ var g = &grammar{ }, }, }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonDocumentBlock69, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, }, }, }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 885, col: 5, offset: 27844}, + label: "extraAttrs", + expr: &zeroOrMoreExpr{ + pos: position{line: 885, col: 16, offset: 27855}, + expr: &choiceExpr{ + pos: position{line: 885, col: 17, offset: 27856}, + alternatives: []interface{}{ &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonDocumentBlock77, + pos: position{line: 152, col: 5, offset: 4423}, + run: (*parser).callonDocumentFragment773, expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, + pos: position{line: 152, col: 5, offset: 4423}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, + &litMatcher{ + pos: position{line: 152, col: 5, offset: 4423}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 152, col: 9, offset: 4427}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDocumentFragment777, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock90, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + inverted: false, }, }, }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, + }, + }, + }, + &litMatcher{ + pos: position{line: 152, col: 30, offset: 4448}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 153, col: 5, offset: 4457}, + label: "value", + expr: &zeroOrOneExpr{ + pos: position{line: 153, col: 11, offset: 4463}, + expr: &actionExpr{ + pos: position{line: 167, col: 5, offset: 4915}, + run: (*parser).callonDocumentFragment785, + expr: &seqExpr{ + pos: position{line: 167, col: 5, offset: 4915}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock102, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonDocumentFragment787, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock114, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 167, col: 12, offset: 4922}, + label: "elements", + expr: &zeroOrMoreExpr{ + pos: position{line: 167, col: 21, offset: 4931}, + expr: &actionExpr{ + pos: position{line: 171, col: 37, offset: 5090}, + run: (*parser).callonDocumentFragment792, + expr: &seqExpr{ + pos: position{line: 171, col: 37, offset: 5090}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 171, col: 37, offset: 5090}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment796, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 172, col: 5, offset: 5100}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 173, col: 9, offset: 5118}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 173, col: 10, offset: 5119}, + run: (*parser).callonDocumentFragment805, + expr: &oneOrMoreExpr{ + pos: position{line: 173, col: 10, offset: 5119}, + expr: &charClassMatcher{ + pos: position{line: 173, col: 10, offset: 5119}, + val: "[^\\r\\n{]", + chars: []rune{'\r', '\n', '{'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDocumentFragment808, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDocumentFragment810, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonDocumentFragment813, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDocumentFragment817, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDocumentFragment824, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDocumentFragment829, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDocumentFragment831, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonDocumentFragment835, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDocumentFragment839, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDocumentFragment846, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDocumentFragment851, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDocumentFragment853, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonDocumentFragment857, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDocumentFragment861, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 177, col: 12, offset: 5247}, + run: (*parser).callonDocumentFragment867, + expr: &litMatcher{ + pos: position{line: 177, col: 12, offset: 5247}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, }, }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment870, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock126, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + want: "\"\\n\"", }, - }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock138, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + want: "\"\\r\\n\"", }, - }, - }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock150, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + want: "\"\\r\"", }, }, }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 184, col: 19, offset: 5402}, + run: (*parser).callonDocumentFragment877, + expr: &seqExpr{ + pos: position{line: 184, col: 19, offset: 5402}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 184, col: 19, offset: 5402}, + val: ":!", + ignoreCase: false, + want: "\":!\"", + }, + &labeledExpr{ + pos: position{line: 184, col: 24, offset: 5407}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDocumentFragment881, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock162, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + inverted: false, }, }, }, }, }, }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", + &litMatcher{ + pos: position{line: 184, col: 45, offset: 5428}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 184, col: 49, offset: 5432}, expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonDocumentBlock170, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment888, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment891, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonDocumentBlock178, - }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonDocumentBlock179, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock187, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 492, col: 5, offset: 15613}, - run: (*parser).callonDocumentBlock194, - expr: &seqExpr{ - pos: position{line: 492, col: 5, offset: 15613}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 492, col: 5, offset: 15613}, - label: "level", - expr: &actionExpr{ - pos: position{line: 492, col: 12, offset: 15620}, - run: (*parser).callonDocumentBlock197, - expr: &oneOrMoreExpr{ - pos: position{line: 492, col: 12, offset: 15620}, - expr: &litMatcher{ - pos: position{line: 492, col: 13, offset: 15621}, - val: "=", - ignoreCase: false, - want: "\"=\"", - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 496, col: 5, offset: 15712}, - run: (*parser).callonDocumentBlock200, - }, - &oneOrMoreExpr{ - pos: position{line: 500, col: 5, offset: 15864}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock204, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 500, col: 12, offset: 15871}, - label: "title", - expr: &actionExpr{ - pos: position{line: 504, col: 18, offset: 16057}, - run: (*parser).callonDocumentBlock207, - expr: &labeledExpr{ - pos: position{line: 504, col: 18, offset: 16057}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 504, col: 27, offset: 16066}, - expr: &seqExpr{ - pos: position{line: 504, col: 28, offset: 16067}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 504, col: 28, offset: 16067}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, + &actionExpr{ + pos: position{line: 186, col: 5, offset: 5499}, + run: (*parser).callonDocumentFragment898, + expr: &seqExpr{ + pos: position{line: 186, col: 5, offset: 5499}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 186, col: 5, offset: 5499}, + val: ":", + ignoreCase: false, + want: "\":\"", }, - }, - ¬Expr{ - pos: position{line: 504, col: 37, offset: 16076}, - expr: &actionExpr{ - pos: position{line: 237, col: 20, offset: 7607}, - run: (*parser).callonDocumentBlock216, - expr: &seqExpr{ - pos: position{line: 237, col: 20, offset: 7607}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 237, col: 20, offset: 7607}, - val: "[[", - ignoreCase: false, - want: "\"[[\"", - }, - &labeledExpr{ - pos: position{line: 237, col: 25, offset: 7612}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonDocumentBlock220, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, - }, - }, + &labeledExpr{ + pos: position{line: 186, col: 9, offset: 5503}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDocumentFragment902, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, - }, - &litMatcher{ - pos: position{line: 237, col: 33, offset: 7620}, - val: "]]", - ignoreCase: false, - want: "\"]]\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 237, col: 38, offset: 7625}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock227, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, - }, - &actionExpr{ - pos: position{line: 508, col: 17, offset: 16230}, - run: (*parser).callonDocumentBlock229, - expr: &labeledExpr{ - pos: position{line: 508, col: 17, offset: 16230}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 508, col: 26, offset: 16239}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonDocumentBlock232, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonDocumentBlock241, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 995, col: 14, offset: 32701}, - run: (*parser).callonDocumentBlock250, - expr: &seqExpr{ - pos: position{line: 995, col: 14, offset: 32701}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock254, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 995, col: 20, offset: 32707}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 995, col: 24, offset: 32711}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock260, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &andExpr{ - pos: position{line: 995, col: 31, offset: 32718}, - expr: &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 186, col: 30, offset: 5524}, + val: "!:", + ignoreCase: false, + want: "\"!:\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 186, col: 35, offset: 5529}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment909, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment912, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 510, col: 11, offset: 16299}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock271, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonDocumentBlock273, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonDocumentBlock277, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, - &actionExpr{ - pos: position{line: 2237, col: 12, offset: 79050}, - run: (*parser).callonDocumentBlock281, - expr: &charClassMatcher{ - pos: position{line: 2237, col: 12, offset: 79050}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -4420,96 +4281,72 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 500, col: 34, offset: 15893}, - label: "id", - expr: &zeroOrMoreExpr{ - pos: position{line: 500, col: 38, offset: 15897}, - expr: &actionExpr{ - pos: position{line: 237, col: 20, offset: 7607}, - run: (*parser).callonDocumentBlock285, - expr: &seqExpr{ - pos: position{line: 237, col: 20, offset: 7607}, - exprs: []interface{}{ + }, + }, + }, + &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonDocumentFragment919, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment925, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment928, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 237, col: 20, offset: 7607}, - val: "[[", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\"[[\"", - }, - &labeledExpr{ - pos: position{line: 237, col: 25, offset: 7612}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonDocumentBlock289, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, - }, - }, - }, + want: "\"\\n\"", }, &litMatcher{ - pos: position{line: 237, col: 33, offset: 7620}, - val: "]]", + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", ignoreCase: false, - want: "\"]]\"", + want: "\"\\r\\n\"", }, - &zeroOrMoreExpr{ - pos: position{line: 237, col: 38, offset: 7625}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock296, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, @@ -4517,98 +4354,61 @@ var g = &grammar{ }, }, }, - &ruleRefExpr{ - pos: position{line: 79, col: 11, offset: 2316}, - name: "DelimitedBlock", - }, - &ruleRefExpr{ - pos: position{line: 80, col: 11, offset: 2341}, - name: "ImageBlock", - }, &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonDocumentBlock305, + pos: position{line: 2414, col: 5, offset: 81337}, + run: (*parser).callonDocumentFragment935, expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, + pos: position{line: 2414, col: 5, offset: 81337}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + &andCodeExpr{ + pos: position{line: 2414, col: 5, offset: 81337}, + run: (*parser).callonDocumentFragment937, + }, + &labeledExpr{ + pos: position{line: 2417, col: 5, offset: 81400}, + label: "level", + expr: &actionExpr{ + pos: position{line: 2417, col: 12, offset: 81407}, + run: (*parser).callonDocumentFragment939, + expr: &oneOrMoreExpr{ + pos: position{line: 2417, col: 12, offset: 81407}, + expr: &litMatcher{ + pos: position{line: 2417, col: 13, offset: 81408}, + val: "=", ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock313, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + want: "\"=\"", }, }, }, }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", + &andCodeExpr{ + pos: position{line: 2421, col: 5, offset: 81516}, + run: (*parser).callonDocumentFragment942, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonDocumentFragment943, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, }, &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", + pos: position{line: 2425, col: 12, offset: 81675}, + label: "title", expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonDocumentBlock322, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, + pos: position{line: 2429, col: 20, offset: 81803}, + run: (*parser).callonDocumentFragment947, + expr: &oneOrMoreExpr{ + pos: position{line: 2429, col: 20, offset: 81803}, expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, + pos: position{line: 2429, col: 20, offset: 81803}, val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, @@ -4618,25 +4418,39 @@ var g = &grammar{ }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment951, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, @@ -4645,181 +4459,201 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 82, col: 11, offset: 2390}, - name: "Table", + pos: position{line: 34, col: 11, offset: 860}, + name: "DelimitedBlock", }, &actionExpr{ - pos: position{line: 1632, col: 18, offset: 58455}, - run: (*parser).callonDocumentBlock331, + pos: position{line: 2818, col: 18, offset: 93317}, + run: (*parser).callonDocumentFragment959, expr: &seqExpr{ - pos: position{line: 1632, col: 18, offset: 58455}, + pos: position{line: 2818, col: 18, offset: 93317}, exprs: []interface{}{ &choiceExpr{ - pos: position{line: 1632, col: 19, offset: 58456}, + pos: position{line: 2818, col: 19, offset: 93318}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1632, col: 19, offset: 58456}, + pos: position{line: 2818, col: 19, offset: 93318}, val: "***", ignoreCase: false, want: "\"***\"", }, &litMatcher{ - pos: position{line: 1632, col: 27, offset: 58464}, + pos: position{line: 2818, col: 27, offset: 93326}, val: "* * *", ignoreCase: false, want: "\"* * *\"", }, &litMatcher{ - pos: position{line: 1632, col: 37, offset: 58474}, + pos: position{line: 2818, col: 37, offset: 93336}, val: "---", ignoreCase: false, want: "\"---\"", }, &litMatcher{ - pos: position{line: 1632, col: 45, offset: 58482}, + pos: position{line: 2818, col: 45, offset: 93344}, val: "- - -", ignoreCase: false, want: "\"- - -\"", }, &litMatcher{ - pos: position{line: 1632, col: 55, offset: 58492}, + pos: position{line: 2818, col: 55, offset: 93354}, val: "___", ignoreCase: false, want: "\"___\"", }, &litMatcher{ - pos: position{line: 1632, col: 63, offset: 58500}, + pos: position{line: 2818, col: 63, offset: 93362}, val: "_ _ _", ignoreCase: false, want: "\"_ _ _\"", }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, &ruleRefExpr{ - pos: position{line: 84, col: 11, offset: 2430}, - name: "OrderedListItem", - }, - &ruleRefExpr{ - pos: position{line: 85, col: 11, offset: 2456}, - name: "UnorderedListItem", - }, - &ruleRefExpr{ - pos: position{line: 86, col: 11, offset: 2485}, - name: "CalloutListItem", - }, - &ruleRefExpr{ - pos: position{line: 87, col: 11, offset: 2511}, - name: "ContinuedListItemElement", + pos: position{line: 36, col: 11, offset: 946}, + name: "ListElements", }, &actionExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - run: (*parser).callonDocumentBlock349, + pos: position{line: 2717, col: 5, offset: 90449}, + run: (*parser).callonDocumentFragment971, expr: &seqExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, + pos: position{line: 2717, col: 5, offset: 90449}, exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - run: (*parser).callonDocumentBlock351, + &litMatcher{ + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment975, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment978, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, }, &labeledExpr{ - pos: position{line: 2120, col: 5, offset: 75117}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 2120, col: 11, offset: 75123}, + pos: position{line: 2718, col: 5, offset: 90473}, + label: "header", + expr: &zeroOrOneExpr{ + pos: position{line: 2718, col: 12, offset: 90480}, expr: &actionExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - run: (*parser).callonDocumentBlock354, + pos: position{line: 2732, col: 5, offset: 90792}, + run: (*parser).callonDocumentFragment987, expr: &seqExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, + pos: position{line: 2732, col: 5, offset: 90792}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2128, col: 25, offset: 75365}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonDocumentBlock357, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + &labeledExpr{ + pos: position{line: 2732, col: 5, offset: 90792}, + label: "cells", + expr: &oneOrMoreExpr{ + pos: position{line: 2732, col: 11, offset: 90798}, + expr: &actionExpr{ + pos: position{line: 2738, col: 5, offset: 90915}, + run: (*parser).callonDocumentFragment991, + expr: &seqExpr{ + pos: position{line: 2738, col: 5, offset: 90915}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2738, col: 5, offset: 90915}, + val: "|", + ignoreCase: false, + want: "\"|\"", }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &zeroOrMoreExpr{ + pos: position{line: 2738, col: 9, offset: 90919}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment995, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock365, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + inverted: false, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 2739, col: 5, offset: 90931}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 2739, col: 14, offset: 90940}, + expr: &actionExpr{ + pos: position{line: 2771, col: 5, offset: 91728}, + run: (*parser).callonDocumentFragment999, + expr: &labeledExpr{ + pos: position{line: 2771, col: 5, offset: 91728}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2771, col: 14, offset: 91737}, + run: (*parser).callonDocumentFragment1001, + expr: &oneOrMoreExpr{ + pos: position{line: 2771, col: 14, offset: 91737}, + expr: &charClassMatcher{ + pos: position{line: 2771, col: 14, offset: 91737}, + val: "[^\\r\\n|]", + chars: []rune{'\r', '\n', '|'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, }, }, }, @@ -4828,274 +4662,115 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 2128, col: 36, offset: 75376}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - run: (*parser).callonDocumentBlock373, - expr: &oneOrMoreExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - expr: &charClassMatcher{ - pos: position{line: 2128, col: 45, offset: 75385}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1005, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2080, col: 31, offset: 73460}, - run: (*parser).callonDocumentBlock381, - expr: &labeledExpr{ - pos: position{line: 2080, col: 31, offset: 73460}, - label: "lines", - expr: &actionExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - run: (*parser).callonDocumentBlock383, - expr: &seqExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - label: "firstLine", - expr: &actionExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - run: (*parser).callonDocumentBlock386, - expr: &seqExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - label: "line", - expr: &actionExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - run: (*parser).callonDocumentBlock389, - expr: &seqExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock394, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + &oneOrMoreExpr{ + pos: position{line: 2733, col: 5, offset: 90820}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonDocumentFragment1013, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, - &oneOrMoreExpr{ - pos: position{line: 2091, col: 48, offset: 73971}, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1019, expr: &charClassMatcher{ - pos: position{line: 2091, col: 48, offset: 73971}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2087, col: 5, offset: 73803}, - label: "otherLines", - expr: &zeroOrMoreExpr{ - pos: position{line: 2087, col: 16, offset: 73814}, - expr: &actionExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - run: (*parser).callonDocumentBlock405, - expr: &seqExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2128, col: 25, offset: 75365}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonDocumentBlock408, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1022, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock416, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, }, - &labeledExpr{ - pos: position{line: 2128, col: 36, offset: 75376}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - run: (*parser).callonDocumentBlock424, - expr: &oneOrMoreExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - expr: &charClassMatcher{ - pos: position{line: 2128, col: 45, offset: 75385}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, }, }, }, @@ -5103,106 +4778,357 @@ var g = &grammar{ }, }, }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2098, col: 39, offset: 74215}, - run: (*parser).callonDocumentBlock432, - expr: &seqExpr{ - pos: position{line: 2098, col: 39, offset: 74215}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2098, col: 61, offset: 74237}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock438, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, &labeledExpr{ - pos: position{line: 2098, col: 76, offset: 74252}, - label: "lines", - expr: &actionExpr{ - pos: position{line: 2103, col: 44, offset: 74559}, - run: (*parser).callonDocumentBlock444, - expr: &labeledExpr{ - pos: position{line: 2103, col: 44, offset: 74559}, - label: "lines", - expr: &zeroOrMoreExpr{ - pos: position{line: 2103, col: 50, offset: 74565}, - expr: &actionExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - run: (*parser).callonDocumentBlock447, + pos: position{line: 2719, col: 5, offset: 90499}, + label: "rows", + expr: &zeroOrMoreExpr{ + pos: position{line: 2719, col: 10, offset: 90504}, + expr: &choiceExpr{ + pos: position{line: 2743, col: 13, offset: 91037}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2753, col: 5, offset: 91256}, + run: (*parser).callonDocumentFragment1032, expr: &seqExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, + pos: position{line: 2753, col: 5, offset: 91256}, exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - label: "line", - expr: &actionExpr{ - pos: position{line: 2108, col: 11, offset: 74711}, - run: (*parser).callonDocumentBlock450, - expr: &seqExpr{ - pos: position{line: 2108, col: 11, offset: 74711}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2108, col: 11, offset: 74711}, - expr: &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", + ¬Expr{ + pos: position{line: 2753, col: 5, offset: 91256}, + expr: &choiceExpr{ + pos: position{line: 2728, col: 22, offset: 90705}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2724, col: 19, offset: 90625}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", ignoreCase: false, - want: "\"....\"", + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1039, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1042, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, }, }, - &zeroOrMoreExpr{ - pos: position{line: 2108, col: 34, offset: 74734}, - expr: &charClassMatcher{ - pos: position{line: 2108, col: 34, offset: 74734}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2754, col: 5, offset: 91279}, + label: "cells", + expr: &oneOrMoreExpr{ + pos: position{line: 2754, col: 11, offset: 91285}, + expr: &actionExpr{ + pos: position{line: 2754, col: 12, offset: 91286}, + run: (*parser).callonDocumentFragment1053, + expr: &seqExpr{ + pos: position{line: 2754, col: 12, offset: 91286}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2754, col: 12, offset: 91286}, + label: "cell", + expr: &actionExpr{ + pos: position{line: 2763, col: 5, offset: 91527}, + run: (*parser).callonDocumentFragment1056, + expr: &seqExpr{ + pos: position{line: 2763, col: 5, offset: 91527}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2763, col: 5, offset: 91527}, + expr: &choiceExpr{ + pos: position{line: 2728, col: 22, offset: 90705}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2724, col: 19, offset: 90625}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1063, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1066, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2764, col: 5, offset: 91550}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonDocumentFragment1076, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1082, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1085, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2765, col: 5, offset: 91565}, + val: "|", + ignoreCase: false, + want: "\"|\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2765, col: 9, offset: 91569}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1094, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2765, col: 16, offset: 91576}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 2765, col: 25, offset: 91585}, + expr: &actionExpr{ + pos: position{line: 2771, col: 5, offset: 91728}, + run: (*parser).callonDocumentFragment1098, + expr: &labeledExpr{ + pos: position{line: 2771, col: 5, offset: 91728}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2771, col: 14, offset: 91737}, + run: (*parser).callonDocumentFragment1100, + expr: &oneOrMoreExpr{ + pos: position{line: 2771, col: 14, offset: 91737}, + expr: &charClassMatcher{ + pos: position{line: 2771, col: 14, offset: 91737}, + val: "[^\\r\\n|]", + chars: []rune{'\r', '\n', '|'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1104, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, }, }, }, @@ -5210,25 +5136,156 @@ var g = &grammar{ }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2757, col: 6, offset: 91348}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &oneOrMoreExpr{ + pos: position{line: 2757, col: 6, offset: 91348}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonDocumentFragment1113, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1119, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1122, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &andExpr{ + pos: position{line: 2757, col: 19, offset: 91361}, + expr: &choiceExpr{ + pos: position{line: 2728, col: 22, offset: 90705}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2724, col: 19, offset: 90625}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1134, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1137, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, }, }, }, @@ -5236,399 +5293,244 @@ var g = &grammar{ }, }, }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2098, col: 125, offset: 74301}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 2098, col: 126, offset: 74302}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2098, col: 148, offset: 74324}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock467, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 182, col: 25, offset: 5755}, - run: (*parser).callonDocumentBlock476, - expr: &seqExpr{ - pos: position{line: 182, col: 25, offset: 5755}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 182, col: 25, offset: 5755}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 182, col: 29, offset: 5759}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonDocumentBlock480, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 182, col: 50, offset: 5780}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 183, col: 9, offset: 5793}, - label: "value", - expr: &zeroOrOneExpr{ - pos: position{line: 183, col: 15, offset: 5799}, - expr: &actionExpr{ - pos: position{line: 194, col: 30, offset: 6206}, - run: (*parser).callonDocumentBlock488, - expr: &seqExpr{ - pos: position{line: 194, col: 30, offset: 6206}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 194, col: 30, offset: 6206}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock493, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 194, col: 37, offset: 6213}, - label: "elements", - expr: &zeroOrMoreExpr{ - pos: position{line: 194, col: 46, offset: 6222}, - expr: &choiceExpr{ - pos: position{line: 195, col: 5, offset: 6228}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 195, col: 6, offset: 6229}, - run: (*parser).callonDocumentBlock498, - expr: &oneOrMoreExpr{ - pos: position{line: 195, col: 6, offset: 6229}, - expr: &charClassMatcher{ - pos: position{line: 195, col: 6, offset: 6229}, - val: "[^\\r\\n{]", - chars: []rune{'\r', '\n', '{'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - &actionExpr{ - pos: position{line: 221, col: 25, offset: 7126}, - run: (*parser).callonDocumentBlock501, - expr: &seqExpr{ - pos: position{line: 221, col: 25, offset: 7126}, + &actionExpr{ + pos: position{line: 2746, col: 5, offset: 91104}, + run: (*parser).callonDocumentFragment1146, + expr: &seqExpr{ + pos: position{line: 2746, col: 5, offset: 91104}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2746, col: 5, offset: 91104}, + expr: &choiceExpr{ + pos: position{line: 2728, col: 22, offset: 90705}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2724, col: 19, offset: 90625}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 221, col: 25, offset: 7126}, - val: "{counter:", + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", ignoreCase: false, - want: "\"{counter:\"", + want: "\"|===\"", }, - &labeledExpr{ - pos: position{line: 221, col: 37, offset: 7138}, - label: "name", + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonDocumentBlock505, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1153, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1156, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - inverted: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, - &labeledExpr{ - pos: position{line: 221, col: 56, offset: 7157}, - label: "start", - expr: &zeroOrOneExpr{ - pos: position{line: 221, col: 62, offset: 7163}, - expr: &actionExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - run: (*parser).callonDocumentBlock512, - expr: &seqExpr{ - pos: position{line: 229, col: 17, offset: 7426}, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2747, col: 5, offset: 91127}, + label: "cells", + expr: &oneOrMoreExpr{ + pos: position{line: 2747, col: 11, offset: 91133}, + expr: &actionExpr{ + pos: position{line: 2763, col: 5, offset: 91527}, + run: (*parser).callonDocumentFragment1167, + expr: &seqExpr{ + pos: position{line: 2763, col: 5, offset: 91527}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2763, col: 5, offset: 91527}, + expr: &choiceExpr{ + pos: position{line: 2728, col: 22, offset: 90705}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2724, col: 19, offset: 90625}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", ignoreCase: false, - want: "\":\"", + want: "\"|===\"", }, - &labeledExpr{ - pos: position{line: 229, col: 21, offset: 7430}, - label: "start", - expr: &choiceExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - run: (*parser).callonDocumentBlock517, - expr: &charClassMatcher{ - pos: position{line: 229, col: 28, offset: 7437}, - val: "[A-Za-z]", - ranges: []rune{'A', 'Z', 'a', 'z'}, - ignoreCase: false, - inverted: false, - }, - }, - &actionExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - run: (*parser).callonDocumentBlock519, - expr: &oneOrMoreExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - expr: &charClassMatcher{ - pos: position{line: 231, col: 9, offset: 7491}, - val: "[0-9]", - ranges: []rune{'0', '9'}, + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1174, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1177, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - inverted: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, - &litMatcher{ - pos: position{line: 221, col: 78, offset: 7179}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 225, col: 25, offset: 7281}, - run: (*parser).callonDocumentBlock523, - expr: &seqExpr{ - pos: position{line: 225, col: 25, offset: 7281}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 225, col: 25, offset: 7281}, - val: "{counter2:", - ignoreCase: false, - want: "\"{counter2:\"", - }, - &labeledExpr{ - pos: position{line: 225, col: 38, offset: 7294}, - label: "name", + ¬Expr{ + pos: position{line: 2764, col: 5, offset: 91550}, expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonDocumentBlock527, + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonDocumentFragment1187, expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, + pos: position{line: 526, col: 14, offset: 17058}, exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1193, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 225, col: 57, offset: 7313}, - label: "start", - expr: &zeroOrOneExpr{ - pos: position{line: 225, col: 63, offset: 7319}, - expr: &actionExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - run: (*parser).callonDocumentBlock534, - expr: &seqExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 229, col: 21, offset: 7430}, - label: "start", - expr: &choiceExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - run: (*parser).callonDocumentBlock539, - expr: &charClassMatcher{ - pos: position{line: 229, col: 28, offset: 7437}, - val: "[A-Za-z]", - ranges: []rune{'A', 'Z', 'a', 'z'}, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1196, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - inverted: false, + want: "\"\\n\"", }, - }, - &actionExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - run: (*parser).callonDocumentBlock541, - expr: &oneOrMoreExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - expr: &charClassMatcher{ - pos: position{line: 231, col: 9, offset: 7491}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, @@ -5636,211 +5538,247 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 225, col: 79, offset: 7335}, - val: "}", + pos: position{line: 2765, col: 5, offset: 91565}, + val: "|", ignoreCase: false, - want: "\"}\"", + want: "\"|\"", }, - }, - }, - }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonDocumentBlock545, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", + &zeroOrMoreExpr{ + pos: position{line: 2765, col: 9, offset: 91569}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1205, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, }, &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonDocumentBlock549, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + pos: position{line: 2765, col: 16, offset: 91576}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 2765, col: 25, offset: 91585}, + expr: &actionExpr{ + pos: position{line: 2771, col: 5, offset: 91728}, + run: (*parser).callonDocumentFragment1209, + expr: &labeledExpr{ + pos: position{line: 2771, col: 5, offset: 91728}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2771, col: 14, offset: 91737}, + run: (*parser).callonDocumentFragment1211, + expr: &oneOrMoreExpr{ + pos: position{line: 2771, col: 14, offset: 91737}, + expr: &charClassMatcher{ + pos: position{line: 2771, col: 14, offset: 91737}, + val: "[^\\r\\n|]", + chars: []rune{'\r', '\n', '|'}, + ignoreCase: false, + inverted: true, + }, }, }, }, }, }, }, + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1215, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - want: "\"}\"", + want: "\"\\r\"", }, }, }, }, - &actionExpr{ - pos: position{line: 199, col: 6, offset: 6337}, - run: (*parser).callonDocumentBlock555, - expr: &litMatcher{ - pos: position{line: 199, col: 6, offset: 6337}, - val: "{", - ignoreCase: false, - want: "\"{\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 206, col: 19, offset: 6522}, - run: (*parser).callonDocumentBlock562, - expr: &seqExpr{ - pos: position{line: 206, col: 19, offset: 6522}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 206, col: 19, offset: 6522}, - val: ":!", - ignoreCase: false, - want: "\":!\"", - }, - &labeledExpr{ - pos: position{line: 206, col: 24, offset: 6527}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonDocumentBlock566, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &zeroOrMoreExpr{ + pos: position{line: 2748, col: 5, offset: 91154}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonDocumentFragment1223, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1229, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1232, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, }, }, - &litMatcher{ - pos: position{line: 206, col: 45, offset: 6548}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 206, col: 49, offset: 6552}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock575, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &choiceExpr{ + pos: position{line: 2728, col: 22, offset: 90705}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2724, col: 19, offset: 90625}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", ignoreCase: false, - want: "\"\\t\"", + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1243, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1246, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, @@ -5849,101 +5787,78 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 208, col: 5, offset: 6619}, - run: (*parser).callonDocumentBlock582, + pos: position{line: 2667, col: 22, offset: 88893}, + run: (*parser).callonDocumentFragment1255, expr: &seqExpr{ - pos: position{line: 208, col: 5, offset: 6619}, + pos: position{line: 2667, col: 22, offset: 88893}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 208, col: 5, offset: 6619}, - val: ":", + pos: position{line: 2672, col: 31, offset: 89114}, + val: "//", ignoreCase: false, - want: "\":\"", + want: "\"//\"", }, - &labeledExpr{ - pos: position{line: 208, col: 9, offset: 6623}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonDocumentBlock586, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, + ¬Expr{ + pos: position{line: 2672, col: 36, offset: 89119}, + expr: &litMatcher{ + pos: position{line: 2672, col: 37, offset: 89120}, + val: "//", + ignoreCase: false, + want: "\"//\"", }, }, - &litMatcher{ - pos: position{line: 208, col: 30, offset: 6644}, - val: "!:", - ignoreCase: false, - want: "\"!:\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 208, col: 35, offset: 6649}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &labeledExpr{ + pos: position{line: 2667, col: 49, offset: 88920}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + run: (*parser).callonDocumentFragment1261, + expr: &zeroOrMoreExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + expr: &charClassMatcher{ + pos: position{line: 2674, col: 29, offset: 89155}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock595, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + inverted: true, }, }, }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1265, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, @@ -5951,102 +5866,63 @@ var g = &grammar{ }, }, }, - &seqExpr{ - pos: position{line: 519, col: 31, offset: 16527}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 519, col: 31, offset: 16527}, - val: "toc::[]", - ignoreCase: false, - want: "\"toc::[]\"", - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 92, col: 11, offset: 2665}, - name: "UserMacroBlock", - }, &actionExpr{ - pos: position{line: 879, col: 6, offset: 28334}, - run: (*parser).callonDocumentBlock610, + pos: position{line: 1650, col: 5, offset: 54833}, + run: (*parser).callonDocumentFragment1272, expr: &seqExpr{ - pos: position{line: 879, col: 6, offset: 28334}, + pos: position{line: 1650, col: 5, offset: 54833}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 879, col: 6, offset: 28334}, - label: "t", + pos: position{line: 1650, col: 5, offset: 54833}, + label: "kind", expr: &choiceExpr{ - pos: position{line: 856, col: 19, offset: 27732}, + pos: position{line: 136, col: 19, offset: 3960}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 856, col: 19, offset: 27732}, - run: (*parser).callonDocumentBlock614, + pos: position{line: 136, col: 19, offset: 3960}, + run: (*parser).callonDocumentFragment1276, expr: &litMatcher{ - pos: position{line: 856, col: 19, offset: 27732}, + pos: position{line: 136, col: 19, offset: 3960}, val: "TIP", ignoreCase: false, want: "\"TIP\"", }, }, &actionExpr{ - pos: position{line: 858, col: 5, offset: 27770}, - run: (*parser).callonDocumentBlock616, + pos: position{line: 138, col: 5, offset: 3998}, + run: (*parser).callonDocumentFragment1278, expr: &litMatcher{ - pos: position{line: 858, col: 5, offset: 27770}, + pos: position{line: 138, col: 5, offset: 3998}, val: "NOTE", ignoreCase: false, want: "\"NOTE\"", }, }, &actionExpr{ - pos: position{line: 860, col: 5, offset: 27810}, - run: (*parser).callonDocumentBlock618, + pos: position{line: 140, col: 5, offset: 4038}, + run: (*parser).callonDocumentFragment1280, expr: &litMatcher{ - pos: position{line: 860, col: 5, offset: 27810}, + pos: position{line: 140, col: 5, offset: 4038}, val: "IMPORTANT", ignoreCase: false, want: "\"IMPORTANT\"", }, }, &actionExpr{ - pos: position{line: 862, col: 5, offset: 27860}, - run: (*parser).callonDocumentBlock620, + pos: position{line: 142, col: 5, offset: 4088}, + run: (*parser).callonDocumentFragment1282, expr: &litMatcher{ - pos: position{line: 862, col: 5, offset: 27860}, + pos: position{line: 142, col: 5, offset: 4088}, val: "WARNING", ignoreCase: false, want: "\"WARNING\"", }, }, &actionExpr{ - pos: position{line: 864, col: 5, offset: 27906}, - run: (*parser).callonDocumentBlock622, + pos: position{line: 144, col: 5, offset: 4134}, + run: (*parser).callonDocumentFragment1284, expr: &litMatcher{ - pos: position{line: 864, col: 5, offset: 27906}, + pos: position{line: 144, col: 5, offset: 4134}, val: "CAUTION", ignoreCase: false, want: "\"CAUTION\"", @@ -6056,579 +5932,298 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 879, col: 25, offset: 28353}, + pos: position{line: 1650, col: 27, offset: 54855}, val: ": ", ignoreCase: false, want: "\": \"", }, &labeledExpr{ - pos: position{line: 879, col: 30, offset: 28358}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 879, col: 36, offset: 28364}, - expr: &choiceExpr{ - pos: position{line: 879, col: 37, offset: 28365}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonDocumentBlock628, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock636, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", + pos: position{line: 1651, col: 5, offset: 54865}, + label: "firstLine", + expr: &actionExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + run: (*parser).callonDocumentFragment1288, + expr: &seqExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + run: (*parser).callonDocumentFragment1291, + expr: &oneOrMoreExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + expr: &charClassMatcher{ + pos: position{line: 1662, col: 14, offset: 55218}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonDocumentBlock645, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, + inverted: true, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1665, col: 5, offset: 55275}, + run: (*parser).callonDocumentFragment1294, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1296, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, + want: "\"\\r\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1652, col: 5, offset: 54899}, + label: "otherLines", + expr: &zeroOrMoreExpr{ + pos: position{line: 1652, col: 16, offset: 54910}, + expr: &actionExpr{ + pos: position{line: 1653, col: 9, offset: 54920}, + run: (*parser).callonDocumentFragment1305, + expr: &seqExpr{ + pos: position{line: 1653, col: 9, offset: 54920}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1653, col: 9, offset: 54920}, + expr: &seqExpr{ + pos: position{line: 1392, col: 34, offset: 46323}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1392, col: 34, offset: 46323}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 38, offset: 46327}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1311, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1313, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, }, }, }, - }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonDocumentBlock653, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", + &labeledExpr{ + pos: position{line: 1654, col: 9, offset: 54959}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 1654, col: 15, offset: 54965}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + run: (*parser).callonDocumentFragment1320, + expr: &seqExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2672, col: 31, offset: 89114}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2672, col: 36, offset: 89119}, + expr: &litMatcher{ + pos: position{line: 2672, col: 37, offset: 89120}, + val: "//", ignoreCase: false, - want: "\"....\"", + want: "\"//\"", }, }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", + &labeledExpr{ + pos: position{line: 2667, col: 49, offset: 88920}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + run: (*parser).callonDocumentFragment1326, + expr: &zeroOrMoreExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + expr: &charClassMatcher{ + pos: position{line: 2674, col: 29, offset: 89155}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock666, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1330, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\r\"", }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + run: (*parser).callonDocumentFragment1337, + expr: &seqExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + run: (*parser).callonDocumentFragment1340, + expr: &oneOrMoreExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + expr: &charClassMatcher{ + pos: position{line: 1662, col: 14, offset: 55218}, + val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + inverted: true, }, }, }, }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock678, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &andCodeExpr{ + pos: position{line: 1665, col: 5, offset: 55275}, + run: (*parser).callonDocumentFragment1343, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1345, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\r\"", }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock690, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock702, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock714, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock726, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock738, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -6637,51 +6232,106 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonDocumentBlock746, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1673, col: 5, offset: 55439}, + run: (*parser).callonDocumentFragment1352, + expr: &seqExpr{ + pos: position{line: 1673, col: 5, offset: 55439}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1673, col: 5, offset: 55439}, + label: "firstLine", + expr: &actionExpr{ + pos: position{line: 1680, col: 5, offset: 55724}, + run: (*parser).callonDocumentFragment1355, + expr: &seqExpr{ + pos: position{line: 1680, col: 5, offset: 55724}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1680, col: 5, offset: 55724}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1680, col: 14, offset: 55733}, + run: (*parser).callonDocumentFragment1358, + expr: &seqExpr{ + pos: position{line: 1680, col: 14, offset: 55733}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonDocumentFragment1360, expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, + pos: position{line: 2953, col: 11, offset: 97615}, expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, }, + &oneOrMoreExpr{ + pos: position{line: 1680, col: 21, offset: 55740}, + expr: &charClassMatcher{ + pos: position{line: 1680, col: 21, offset: 55740}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1683, col: 5, offset: 55797}, + run: (*parser).callonDocumentFragment1365, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1367, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonDocumentBlock754, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -6690,168 +6340,156 @@ var g = &grammar{ }, }, }, - }, - }, - }, - &actionExpr{ - pos: position{line: 884, col: 5, offset: 28625}, - run: (*parser).callonDocumentBlock755, - expr: &seqExpr{ - pos: position{line: 884, col: 5, offset: 28625}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 884, col: 5, offset: 28625}, - val: "> ", - ignoreCase: false, - want: "\"> \"", - }, &labeledExpr{ - pos: position{line: 884, col: 10, offset: 28630}, - label: "content", - expr: &oneOrMoreExpr{ - pos: position{line: 899, col: 33, offset: 29398}, - expr: &actionExpr{ - pos: position{line: 899, col: 34, offset: 29399}, - run: (*parser).callonDocumentBlock760, - expr: &seqExpr{ - pos: position{line: 899, col: 34, offset: 29399}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 899, col: 34, offset: 29399}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonDocumentBlock763, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + pos: position{line: 1674, col: 5, offset: 55480}, + label: "otherLines", + expr: &zeroOrMoreExpr{ + pos: position{line: 1674, col: 16, offset: 55491}, + expr: &choiceExpr{ + pos: position{line: 1674, col: 17, offset: 55492}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + run: (*parser).callonDocumentFragment1377, + expr: &seqExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2672, col: 31, offset: 89114}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2672, col: 36, offset: 89119}, + expr: &litMatcher{ + pos: position{line: 2672, col: 37, offset: 89120}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + }, + &labeledExpr{ + pos: position{line: 2667, col: 49, offset: 88920}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + run: (*parser).callonDocumentFragment1383, + expr: &zeroOrMoreExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + expr: &charClassMatcher{ + pos: position{line: 2674, col: 29, offset: 89155}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1387, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock771, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, }, - &zeroOrOneExpr{ - pos: position{line: 899, col: 45, offset: 29410}, - expr: &litMatcher{ - pos: position{line: 899, col: 45, offset: 29410}, - val: "> ", - ignoreCase: false, - want: "\"> \"", - }, - }, - &labeledExpr{ - pos: position{line: 899, col: 51, offset: 29416}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonDocumentBlock781, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + }, + &actionExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + run: (*parser).callonDocumentFragment1394, + expr: &seqExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + run: (*parser).callonDocumentFragment1397, + expr: &oneOrMoreExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + expr: &charClassMatcher{ + pos: position{line: 1662, col: 14, offset: 55218}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonDocumentBlock787, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + }, + }, + &andCodeExpr{ + pos: position{line: 1665, col: 5, offset: 55275}, + run: (*parser).callonDocumentFragment1400, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1402, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - inverted: true, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -6867,595 +6505,385 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - run: (*parser).callonDocumentBlock795, + pos: position{line: 1103, col: 5, offset: 35163}, + run: (*parser).callonDocumentFragment1409, expr: &seqExpr{ - pos: position{line: 888, col: 5, offset: 28831}, + pos: position{line: 1103, col: 5, offset: 35163}, exprs: []interface{}{ &andCodeExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - run: (*parser).callonDocumentBlock797, + pos: position{line: 1103, col: 5, offset: 35163}, + run: (*parser).callonDocumentFragment1411, }, &labeledExpr{ - pos: position{line: 891, col: 7, offset: 29028}, - label: "content", - expr: &oneOrMoreExpr{ - pos: position{line: 891, col: 15, offset: 29036}, - expr: &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonDocumentBlock800, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, + pos: position{line: 1106, col: 5, offset: 35221}, + label: "frontmatter", + expr: &actionExpr{ + pos: position{line: 1112, col: 20, offset: 35378}, + run: (*parser).callonDocumentFragment1413, + expr: &seqExpr{ + pos: position{line: 1112, col: 20, offset: 35378}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1116, col: 30, offset: 35550}, + val: "---", + ignoreCase: false, + want: "\"---\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1116, col: 36, offset: 35556}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1417, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1420, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock813, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1112, col: 45, offset: 35403}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 1112, col: 53, offset: 35411}, + expr: &actionExpr{ + pos: position{line: 1118, col: 27, offset: 35594}, + run: (*parser).callonDocumentFragment1429, + expr: &zeroOrMoreExpr{ + pos: position{line: 1118, col: 27, offset: 35594}, + expr: &oneOrMoreExpr{ + pos: position{line: 1118, col: 28, offset: 35595}, + expr: &seqExpr{ + pos: position{line: 1118, col: 29, offset: 35596}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1118, col: 29, offset: 35596}, + expr: &seqExpr{ + pos: position{line: 1116, col: 30, offset: 35550}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1116, col: 30, offset: 35550}, + val: "---", ignoreCase: false, - want: "\"\\t\"", + want: "\"---\"", }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock825, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock837, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &zeroOrMoreExpr{ + pos: position{line: 1116, col: 36, offset: 35556}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1437, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock849, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1440, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &anyMatcher{ + line: 1118, col: 55, offset: 35622, }, }, }, }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock861, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1116, col: 30, offset: 35550}, + val: "---", + ignoreCase: false, + want: "\"---\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1116, col: 36, offset: 35556}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1450, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1453, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock873, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock885, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonDocumentBlock893, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1637, col: 5, offset: 54463}, + run: (*parser).callonDocumentFragment1460, + expr: &seqExpr{ + pos: position{line: 1637, col: 5, offset: 54463}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1637, col: 5, offset: 54463}, + label: "firstLine", + expr: &actionExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + run: (*parser).callonDocumentFragment1463, + expr: &seqExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + run: (*parser).callonDocumentFragment1466, + expr: &oneOrMoreExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + expr: &charClassMatcher{ + pos: position{line: 1662, col: 14, offset: 55218}, + val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, - inverted: false, + inverted: true, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1665, col: 5, offset: 55275}, + run: (*parser).callonDocumentFragment1469, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1471, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, - }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonDocumentBlock901, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, }, }, - }, - }, - }, - &actionExpr{ - pos: position{line: 895, col: 5, offset: 29222}, - run: (*parser).callonDocumentBlock902, - expr: &labeledExpr{ - pos: position{line: 895, col: 5, offset: 29222}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 895, col: 11, offset: 29228}, - expr: &choiceExpr{ - pos: position{line: 895, col: 12, offset: 29229}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonDocumentBlock906, + &labeledExpr{ + pos: position{line: 1638, col: 5, offset: 54497}, + label: "otherLines", + expr: &zeroOrMoreExpr{ + pos: position{line: 1638, col: 16, offset: 54508}, + expr: &actionExpr{ + pos: position{line: 1639, col: 9, offset: 54518}, + run: (*parser).callonDocumentFragment1480, expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, + pos: position{line: 1639, col: 9, offset: 54518}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, + pos: position{line: 1639, col: 9, offset: 54518}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + ¬Expr{ + pos: position{line: 1640, col: 9, offset: 54531}, expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 1392, col: 34, offset: 46323}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + pos: position{line: 1392, col: 34, offset: 46323}, + val: "+", ignoreCase: false, - want: "\"////\"", + want: "\"+\"", }, &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + pos: position{line: 1392, col: 38, offset: 46327}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDocumentFragment1489, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1491, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock914, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -7463,633 +6891,418 @@ var g = &grammar{ }, }, }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonDocumentBlock923, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonDocumentBlock931, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, + pos: position{line: 1641, col: 9, offset: 54570}, + label: "line", expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, + pos: position{line: 1641, col: 15, offset: 54576}, alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &actionExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + run: (*parser).callonDocumentFragment1498, + expr: &seqExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2672, col: 31, offset: 89114}, + val: "//", ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock944, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + want: "\"//\"", }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + ¬Expr{ + pos: position{line: 2672, col: 36, offset: 89119}, + expr: &litMatcher{ + pos: position{line: 2672, col: 37, offset: 89120}, + val: "//", ignoreCase: false, - inverted: false, + want: "\"//\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + &labeledExpr{ + pos: position{line: 2667, col: 49, offset: 88920}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + run: (*parser).callonDocumentFragment1504, + expr: &zeroOrMoreExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + expr: &charClassMatcher{ + pos: position{line: 2674, col: 29, offset: 89155}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, }, }, }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock956, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock968, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1508, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock980, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, }, }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock992, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &actionExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + run: (*parser).callonDocumentFragment1515, + expr: &seqExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + run: (*parser).callonDocumentFragment1518, + expr: &oneOrMoreExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + expr: &charClassMatcher{ + pos: position{line: 1662, col: 14, offset: 55218}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, ignoreCase: false, - want: "\"\\t\"", + inverted: true, }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &andCodeExpr{ + pos: position{line: 1665, col: 5, offset: 55275}, + run: (*parser).callonDocumentFragment1521, }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock1004, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragment1523, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock1016, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, }, }, }, }, }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonDocumentBlock1024, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "DocumentFragmentWithinVerbatimBlock", + pos: position{line: 95, col: 1, offset: 2781}, + expr: &actionExpr{ + pos: position{line: 96, col: 5, offset: 2824}, + run: (*parser).callonDocumentFragmentWithinVerbatimBlock1, + expr: &seqExpr{ + pos: position{line: 96, col: 5, offset: 2824}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 96, col: 5, offset: 2824}, + label: "elements", + expr: &zeroOrMoreExpr{ + pos: position{line: 96, col: 14, offset: 2833}, + expr: &choiceExpr{ + pos: position{line: 97, col: 9, offset: 2843}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 97, col: 9, offset: 2843}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 104, col: 5, offset: 2940}, + run: (*parser).callonDocumentFragmentWithinVerbatimBlock7, + expr: &seqExpr{ + pos: position{line: 104, col: 5, offset: 2940}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 104, col: 5, offset: 2940}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &labeledExpr{ + pos: position{line: 105, col: 5, offset: 2949}, + label: "content", + expr: &actionExpr{ + pos: position{line: 105, col: 14, offset: 2958}, + run: (*parser).callonDocumentFragmentWithinVerbatimBlock13, + expr: &zeroOrMoreExpr{ + pos: position{line: 105, col: 14, offset: 2958}, + expr: &charClassMatcher{ + pos: position{line: 105, col: 14, offset: 2958}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDocumentFragmentWithinVerbatimBlock17, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, - }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonDocumentBlock1032, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, }, }, - &actionExpr{ - pos: position{line: 94, col: 11, offset: 2713}, - run: (*parser).callonDocumentBlock1033, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + { + name: "DelimitedBlockElements", + pos: position{line: 114, col: 1, offset: 3149}, + expr: &actionExpr{ + pos: position{line: 115, col: 5, offset: 3180}, + run: (*parser).callonDelimitedBlockElements1, + expr: &seqExpr{ + pos: position{line: 115, col: 5, offset: 3180}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 115, col: 5, offset: 3180}, + label: "elements", + expr: &zeroOrMoreExpr{ + pos: position{line: 115, col: 14, offset: 3189}, + expr: &choiceExpr{ + pos: position{line: 116, col: 9, offset: 3199}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonDelimitedBlockElements6, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonDelimitedBlockElements10, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, }, }, + &ruleRefExpr{ + pos: position{line: 117, col: 11, offset: 3261}, + name: "DocumentFragment", + }, }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, { name: "BlockAttributes", - pos: position{line: 248, col: 1, offset: 8058}, + pos: position{line: 193, col: 1, offset: 5804}, expr: &actionExpr{ - pos: position{line: 249, col: 5, offset: 8082}, + pos: position{line: 194, col: 5, offset: 5827}, run: (*parser).callonBlockAttributes1, expr: &labeledExpr{ - pos: position{line: 249, col: 5, offset: 8082}, + pos: position{line: 194, col: 5, offset: 5827}, label: "attributes", expr: &oneOrMoreExpr{ - pos: position{line: 249, col: 16, offset: 8093}, + pos: position{line: 194, col: 16, offset: 5838}, expr: &choiceExpr{ - pos: position{line: 251, col: 9, offset: 8160}, + pos: position{line: 196, col: 9, offset: 5905}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 251, col: 10, offset: 8161}, + pos: position{line: 196, col: 10, offset: 5906}, run: (*parser).callonBlockAttributes5, expr: &seqExpr{ - pos: position{line: 251, col: 10, offset: 8161}, + pos: position{line: 196, col: 10, offset: 5906}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 251, col: 10, offset: 8161}, + pos: position{line: 196, col: 10, offset: 5906}, label: "anchor", expr: &actionExpr{ - pos: position{line: 275, col: 4, offset: 8843}, + pos: position{line: 228, col: 4, offset: 6749}, run: (*parser).callonBlockAttributes8, expr: &seqExpr{ - pos: position{line: 275, col: 4, offset: 8843}, + pos: position{line: 228, col: 4, offset: 6749}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 275, col: 4, offset: 8843}, + pos: position{line: 228, col: 4, offset: 6749}, val: "[[", ignoreCase: false, want: "\"[[\"", }, &labeledExpr{ - pos: position{line: 276, col: 5, offset: 8853}, + pos: position{line: 229, col: 5, offset: 6759}, label: "id", expr: &actionExpr{ - pos: position{line: 277, col: 9, offset: 8866}, + pos: position{line: 230, col: 9, offset: 6772}, run: (*parser).callonBlockAttributes12, expr: &labeledExpr{ - pos: position{line: 277, col: 9, offset: 8866}, + pos: position{line: 230, col: 9, offset: 6772}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 277, col: 18, offset: 8875}, + pos: position{line: 230, col: 18, offset: 6781}, expr: &choiceExpr{ - pos: position{line: 278, col: 13, offset: 8889}, + pos: position{line: 231, col: 13, offset: 6795}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 278, col: 14, offset: 8890}, + pos: position{line: 231, col: 14, offset: 6796}, run: (*parser).callonBlockAttributes16, expr: &oneOrMoreExpr{ - pos: position{line: 278, col: 14, offset: 8890}, + pos: position{line: 231, col: 14, offset: 6796}, expr: &charClassMatcher{ - pos: position{line: 278, col: 14, offset: 8890}, + pos: position{line: 231, col: 14, offset: 6796}, val: "[^=\\r\\n�{]]", chars: []rune{'=', '\r', '\n', '�', '{', ']'}, ignoreCase: false, @@ -8098,27 +7311,27 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 991, col: 23, offset: 31310}, run: (*parser).callonBlockAttributes19, expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 991, col: 23, offset: 31310}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 989, col: 32, offset: 31278}, val: "�", ignoreCase: false, want: "\"�\"", }, &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, + pos: position{line: 991, col: 51, offset: 31338}, label: "ref", expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 991, col: 56, offset: 31343}, run: (*parser).callonBlockAttributes23, expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 991, col: 56, offset: 31343}, expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 991, col: 56, offset: 31343}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -8128,7 +7341,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, + pos: position{line: 989, col: 32, offset: 31278}, val: "�", ignoreCase: false, want: "\"�\"", @@ -8137,65 +7350,309 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, + pos: position{line: 493, col: 5, offset: 15857}, run: (*parser).callonBlockAttributes27, expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, + pos: position{line: 493, col: 5, offset: 15857}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonBlockAttributes29, }, &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonBlockAttributes31, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonBlockAttributes32, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonBlockAttributes36, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonBlockAttributes43, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonBlockAttributes48, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonBlockAttributes50, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonBlockAttributes54, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonBlockAttributes58, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonBlockAttributes65, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonBlockAttributes70, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonBlockAttributes72, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonBlockAttributes76, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonBlockAttributes80, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, }, }, }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, }, }, }, &actionExpr{ - pos: position{line: 283, col: 14, offset: 9113}, - run: (*parser).callonBlockAttributes37, + pos: position{line: 236, col: 16, offset: 7032}, + run: (*parser).callonBlockAttributes86, expr: &litMatcher{ - pos: position{line: 283, col: 14, offset: 9113}, + pos: position{line: 236, col: 16, offset: 7032}, val: "{", ignoreCase: false, want: "\"{\"", @@ -8208,7 +7665,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 289, col: 5, offset: 9299}, + pos: position{line: 242, col: 5, offset: 7218}, val: "]]", ignoreCase: false, want: "\"]]\"", @@ -8218,44 +7675,54 @@ var g = &grammar{ }, }, &zeroOrMoreExpr{ - pos: position{line: 251, col: 35, offset: 8186}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonBlockAttributes43, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + pos: position{line: 196, col: 35, offset: 5931}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonBlockAttributes90, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, }, &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonBlockAttributes93, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, @@ -8263,39 +7730,39 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 255, col: 12, offset: 8311}, - run: (*parser).callonBlockAttributes48, + pos: position{line: 200, col: 12, offset: 6052}, + run: (*parser).callonBlockAttributes100, expr: &seqExpr{ - pos: position{line: 255, col: 12, offset: 8311}, + pos: position{line: 200, col: 12, offset: 6052}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 255, col: 12, offset: 8311}, + pos: position{line: 200, col: 12, offset: 6052}, label: "title", expr: &actionExpr{ - pos: position{line: 294, col: 19, offset: 9418}, - run: (*parser).callonBlockAttributes51, + pos: position{line: 247, col: 19, offset: 7337}, + run: (*parser).callonBlockAttributes103, expr: &seqExpr{ - pos: position{line: 294, col: 19, offset: 9418}, + pos: position{line: 247, col: 19, offset: 7337}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 294, col: 19, offset: 9418}, + pos: position{line: 247, col: 19, offset: 7337}, val: ".", ignoreCase: false, want: "\".\"", }, &labeledExpr{ - pos: position{line: 294, col: 23, offset: 9422}, + pos: position{line: 247, col: 23, offset: 7341}, label: "title", expr: &actionExpr{ - pos: position{line: 295, col: 5, offset: 9434}, - run: (*parser).callonBlockAttributes55, + pos: position{line: 248, col: 5, offset: 7353}, + run: (*parser).callonBlockAttributes107, expr: &seqExpr{ - pos: position{line: 295, col: 5, offset: 9434}, + pos: position{line: 248, col: 5, offset: 7353}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 295, col: 5, offset: 9434}, + pos: position{line: 248, col: 5, offset: 7353}, expr: &charClassMatcher{ - pos: position{line: 295, col: 6, offset: 9435}, + pos: position{line: 248, col: 6, offset: 7354}, val: "[. ]", chars: []rune{'.', ' '}, ignoreCase: false, @@ -8303,20 +7770,20 @@ var g = &grammar{ }, }, &labeledExpr{ - pos: position{line: 296, col: 5, offset: 9547}, + pos: position{line: 249, col: 5, offset: 7466}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 296, col: 14, offset: 9556}, + pos: position{line: 249, col: 14, offset: 7475}, expr: &choiceExpr{ - pos: position{line: 297, col: 9, offset: 9566}, + pos: position{line: 250, col: 9, offset: 7485}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 297, col: 10, offset: 9567}, - run: (*parser).callonBlockAttributes62, + pos: position{line: 250, col: 10, offset: 7486}, + run: (*parser).callonBlockAttributes114, expr: &oneOrMoreExpr{ - pos: position{line: 297, col: 10, offset: 9567}, + pos: position{line: 250, col: 10, offset: 7486}, expr: &charClassMatcher{ - pos: position{line: 297, col: 10, offset: 9567}, + pos: position{line: 250, col: 10, offset: 7486}, val: "[^\\r\\n�{]", chars: []rune{'\r', '\n', '�', '{'}, ignoreCase: false, @@ -8325,27 +7792,27 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonBlockAttributes65, + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonBlockAttributes117, expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 991, col: 23, offset: 31310}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 989, col: 32, offset: 31278}, val: "�", ignoreCase: false, want: "\"�\"", }, &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, + pos: position{line: 991, col: 51, offset: 31338}, label: "ref", expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonBlockAttributes69, + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonBlockAttributes121, expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 991, col: 56, offset: 31343}, expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 991, col: 56, offset: 31343}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -8355,7 +7822,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, + pos: position{line: 989, col: 32, offset: 31278}, val: "�", ignoreCase: false, want: "\"�\"", @@ -8364,65 +7831,309 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonBlockAttributes73, + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonBlockAttributes125, expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, + pos: position{line: 493, col: 5, offset: 15857}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonBlockAttributes127, }, &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonBlockAttributes77, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonBlockAttributes130, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonBlockAttributes134, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonBlockAttributes141, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonBlockAttributes146, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonBlockAttributes148, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonBlockAttributes152, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonBlockAttributes156, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonBlockAttributes163, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonBlockAttributes168, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonBlockAttributes170, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonBlockAttributes174, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonBlockAttributes178, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, }, }, }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, }, }, }, &actionExpr{ - pos: position{line: 302, col: 10, offset: 9713}, - run: (*parser).callonBlockAttributes83, + pos: position{line: 255, col: 12, offset: 7645}, + run: (*parser).callonBlockAttributes184, expr: &litMatcher{ - pos: position{line: 302, col: 10, offset: 9713}, + pos: position{line: 255, col: 12, offset: 7645}, val: "{", ignoreCase: false, want: "\"{\"", @@ -8441,44 +8152,54 @@ var g = &grammar{ }, }, &zeroOrMoreExpr{ - pos: position{line: 255, col: 35, offset: 8334}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonBlockAttributes88, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + pos: position{line: 200, col: 35, offset: 6075}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonBlockAttributes187, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonBlockAttributes190, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, @@ -8486,58 +8207,68 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 259, col: 12, offset: 8429}, - run: (*parser).callonBlockAttributes93, + pos: position{line: 204, col: 12, offset: 6166}, + run: (*parser).callonBlockAttributes197, expr: &seqExpr{ - pos: position{line: 259, col: 12, offset: 8429}, + pos: position{line: 204, col: 12, offset: 6166}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 259, col: 12, offset: 8429}, + pos: position{line: 204, col: 12, offset: 6166}, label: "attributes", expr: &ruleRefExpr{ - pos: position{line: 259, col: 24, offset: 8441}, + pos: position{line: 204, col: 24, offset: 6178}, name: "LongHandAttributes", }, }, &zeroOrMoreExpr{ - pos: position{line: 259, col: 44, offset: 8461}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonBlockAttributes100, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + pos: position{line: 204, col: 44, offset: 6198}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonBlockAttributes202, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonBlockAttributes205, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, @@ -8552,41 +8283,63 @@ var g = &grammar{ }, { name: "InlineAttributes", - pos: position{line: 266, col: 1, offset: 8608}, + pos: position{line: 212, col: 1, offset: 6383}, expr: &actionExpr{ - pos: position{line: 267, col: 5, offset: 8632}, + pos: position{line: 213, col: 5, offset: 6407}, run: (*parser).callonInlineAttributes1, expr: &seqExpr{ - pos: position{line: 267, col: 5, offset: 8632}, + pos: position{line: 213, col: 5, offset: 6407}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 267, col: 5, offset: 8632}, + pos: position{line: 213, col: 5, offset: 6407}, val: "[", ignoreCase: false, want: "\"[\"", }, &labeledExpr{ - pos: position{line: 268, col: 5, offset: 8640}, + pos: position{line: 214, col: 5, offset: 6415}, label: "attributes", expr: &zeroOrMoreExpr{ - pos: position{line: 268, col: 16, offset: 8651}, - expr: &choiceExpr{ - pos: position{line: 268, col: 17, offset: 8652}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 268, col: 17, offset: 8652}, - name: "PositionalAttribute", - }, - &ruleRefExpr{ - pos: position{line: 268, col: 37, offset: 8672}, - name: "NamedAttribute", + pos: position{line: 214, col: 16, offset: 6426}, + expr: &actionExpr{ + pos: position{line: 215, col: 9, offset: 6436}, + run: (*parser).callonInlineAttributes6, + expr: &seqExpr{ + pos: position{line: 216, col: 13, offset: 6450}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 216, col: 13, offset: 6450}, + expr: &litMatcher{ + pos: position{line: 216, col: 14, offset: 6451}, + val: "]", + ignoreCase: false, + want: "\"]\"", + }, + }, + &labeledExpr{ + pos: position{line: 217, col: 13, offset: 6483}, + label: "attribute", + expr: &choiceExpr{ + pos: position{line: 217, col: 24, offset: 6494}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 217, col: 24, offset: 6494}, + name: "PositionalAttribute", + }, + &ruleRefExpr{ + pos: position{line: 217, col: 46, offset: 6516}, + name: "NamedAttribute", + }, + }, + }, + }, }, }, }, }, }, &litMatcher{ - pos: position{line: 269, col: 5, offset: 8693}, + pos: position{line: 222, col: 5, offset: 6599}, val: "]", ignoreCase: false, want: "\"]\"", @@ -8597,568 +8350,1343 @@ var g = &grammar{ }, { name: "LongHandAttributes", - pos: position{line: 313, col: 1, offset: 10113}, + pos: position{line: 266, col: 1, offset: 8045}, expr: &actionExpr{ - pos: position{line: 314, col: 5, offset: 10139}, + pos: position{line: 267, col: 5, offset: 8071}, run: (*parser).callonLongHandAttributes1, expr: &seqExpr{ - pos: position{line: 314, col: 5, offset: 10139}, + pos: position{line: 267, col: 5, offset: 8071}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 314, col: 5, offset: 10139}, + pos: position{line: 267, col: 5, offset: 8071}, val: "[", ignoreCase: false, want: "\"[\"", }, ¬Expr{ - pos: position{line: 314, col: 9, offset: 10143}, + pos: position{line: 267, col: 9, offset: 8075}, expr: &litMatcher{ - pos: position{line: 314, col: 10, offset: 10144}, + pos: position{line: 267, col: 10, offset: 8076}, val: "[", ignoreCase: false, want: "\"[\"", }, }, &labeledExpr{ - pos: position{line: 316, col: 5, offset: 10314}, + pos: position{line: 269, col: 5, offset: 8245}, label: "firstPositionalAttributes", expr: &zeroOrOneExpr{ - pos: position{line: 316, col: 31, offset: 10340}, - expr: &ruleRefExpr{ - pos: position{line: 316, col: 32, offset: 10341}, - name: "FirstPositionalAttributes", - }, - }, - }, - &labeledExpr{ - pos: position{line: 317, col: 5, offset: 10373}, - label: "otherAttributes", - expr: &zeroOrMoreExpr{ - pos: position{line: 317, col: 21, offset: 10389}, - expr: &choiceExpr{ - pos: position{line: 317, col: 22, offset: 10390}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 317, col: 22, offset: 10390}, - name: "PositionalAttribute", - }, - &ruleRefExpr{ - pos: position{line: 317, col: 44, offset: 10412}, - name: "NamedAttribute", - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 318, col: 5, offset: 10433}, - val: "]", - ignoreCase: false, - want: "\"]\"", - }, - }, - }, - }, - }, - { - name: "FirstPositionalAttributes", - pos: position{line: 329, col: 1, offset: 10893}, - expr: &actionExpr{ - pos: position{line: 330, col: 5, offset: 10927}, - run: (*parser).callonFirstPositionalAttributes1, - expr: &seqExpr{ - pos: position{line: 330, col: 5, offset: 10927}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 330, col: 5, offset: 10927}, - label: "main", - expr: &zeroOrOneExpr{ - pos: position{line: 330, col: 10, offset: 10932}, - expr: &ruleRefExpr{ - pos: position{line: 331, col: 9, offset: 10942}, - name: "ShortHandAttribute", - }, - }, - }, - &labeledExpr{ - pos: position{line: 333, col: 5, offset: 10972}, - label: "extras", - expr: &zeroOrMoreExpr{ - pos: position{line: 333, col: 12, offset: 10979}, - expr: &choiceExpr{ - pos: position{line: 334, col: 9, offset: 10990}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 334, col: 9, offset: 10990}, - name: "ShortHandIDAttribute", - }, - &ruleRefExpr{ - pos: position{line: 335, col: 11, offset: 11022}, - name: "ShortHandOptionAttribute", - }, - &ruleRefExpr{ - pos: position{line: 336, col: 11, offset: 11057}, - name: "ShortHandDotRoleAttribute", - }, - }, - }, - }, - }, - &zeroOrOneExpr{ - pos: position{line: 337, col: 8, offset: 11090}, - expr: &seqExpr{ - pos: position{line: 337, col: 9, offset: 11091}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 337, col: 9, offset: 11091}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 337, col: 13, offset: 11095}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonFirstPositionalAttributes18, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 338, col: 5, offset: 11109}, - run: (*parser).callonFirstPositionalAttributes20, - }, - }, - }, - }, - }, - { - name: "ShortHandIDAttribute", - pos: position{line: 352, col: 1, offset: 11466}, - expr: &actionExpr{ - pos: position{line: 352, col: 25, offset: 11490}, - run: (*parser).callonShortHandIDAttribute1, - expr: &seqExpr{ - pos: position{line: 352, col: 25, offset: 11490}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 352, col: 25, offset: 11490}, - val: "#", - ignoreCase: false, - want: "\"#\"", - }, - &labeledExpr{ - pos: position{line: 352, col: 29, offset: 11494}, - label: "id", - expr: &ruleRefExpr{ - pos: position{line: 352, col: 33, offset: 11498}, - name: "ShortHandAttributeValue", - }, - }, - }, - }, - }, - }, - { - name: "ShortHandAttribute", - pos: position{line: 356, col: 1, offset: 11564}, - expr: &actionExpr{ - pos: position{line: 356, col: 23, offset: 11586}, - run: (*parser).callonShortHandAttribute1, - expr: &labeledExpr{ - pos: position{line: 356, col: 23, offset: 11586}, - label: "value", - expr: &ruleRefExpr{ - pos: position{line: 356, col: 30, offset: 11593}, - name: "ShortHandAttributeValue", - }, - }, - }, - }, - { - name: "ShortHandDotRoleAttribute", - pos: position{line: 361, col: 1, offset: 11711}, - expr: &actionExpr{ - pos: position{line: 361, col: 30, offset: 11740}, - run: (*parser).callonShortHandDotRoleAttribute1, - expr: &seqExpr{ - pos: position{line: 361, col: 30, offset: 11740}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 361, col: 30, offset: 11740}, - val: ".", - ignoreCase: false, - want: "\".\"", - }, - &labeledExpr{ - pos: position{line: 361, col: 34, offset: 11744}, - label: "role", - expr: &ruleRefExpr{ - pos: position{line: 361, col: 40, offset: 11750}, - name: "ShortHandAttributeValue", - }, - }, - }, - }, - }, - }, - { - name: "ShortHandOptionAttribute", - pos: position{line: 366, col: 1, offset: 11864}, - expr: &actionExpr{ - pos: position{line: 366, col: 29, offset: 11892}, - run: (*parser).callonShortHandOptionAttribute1, - expr: &seqExpr{ - pos: position{line: 366, col: 29, offset: 11892}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 366, col: 29, offset: 11892}, - val: "%", - ignoreCase: false, - want: "\"%\"", - }, - &labeledExpr{ - pos: position{line: 366, col: 33, offset: 11896}, - label: "option", - expr: &ruleRefExpr{ - pos: position{line: 366, col: 41, offset: 11904}, - name: "ShortHandAttributeValue", - }, - }, - }, - }, - }, - }, - { - name: "ShortHandAttributeValue", - pos: position{line: 371, col: 1, offset: 12009}, - expr: &choiceExpr{ - pos: position{line: 372, col: 5, offset: 12041}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 372, col: 5, offset: 12041}, - name: "SingleQuotedAttributeValue", - }, - &ruleRefExpr{ - pos: position{line: 373, col: 7, offset: 12075}, - name: "DoubleQuotedAttributeValue", - }, - &actionExpr{ - pos: position{line: 374, col: 7, offset: 12109}, - run: (*parser).callonShortHandAttributeValue4, - expr: &seqExpr{ - pos: position{line: 374, col: 7, offset: 12109}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 374, col: 7, offset: 12109}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 374, col: 16, offset: 12118}, - expr: &choiceExpr{ - pos: position{line: 377, col: 5, offset: 12288}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 377, col: 6, offset: 12289}, - run: (*parser).callonShortHandAttributeValue9, - expr: &oneOrMoreExpr{ - pos: position{line: 377, col: 6, offset: 12289}, - expr: &charClassMatcher{ - pos: position{line: 377, col: 6, offset: 12289}, - val: "[^,=.%# \\r\\n�{]]", - chars: []rune{',', '=', '.', '%', '#', ' ', '\r', '\n', '�', '{', ']'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 380, col: 5, offset: 12383}, - name: "QuotedText", - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonShortHandAttributeValue13, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonShortHandAttributeValue17, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonShortHandAttributeValue21, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonShortHandAttributeValue25, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + pos: position{line: 269, col: 31, offset: 8271}, + expr: &actionExpr{ + pos: position{line: 285, col: 5, offset: 8926}, + run: (*parser).callonLongHandAttributes8, + expr: &seqExpr{ + pos: position{line: 285, col: 5, offset: 8926}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 285, col: 5, offset: 8926}, + label: "main", + expr: &zeroOrOneExpr{ + pos: position{line: 285, col: 10, offset: 8931}, + expr: &actionExpr{ + pos: position{line: 317, col: 23, offset: 9741}, + run: (*parser).callonLongHandAttributes12, + expr: &labeledExpr{ + pos: position{line: 317, col: 23, offset: 9741}, + label: "value", + expr: &choiceExpr{ + pos: position{line: 333, col: 5, offset: 10220}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 388, col: 5, offset: 12181}, + run: (*parser).callonLongHandAttributes15, + expr: &seqExpr{ + pos: position{line: 388, col: 5, offset: 12181}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 388, col: 5, offset: 12181}, + val: "'", ignoreCase: false, - inverted: false, + want: "\"'\"", }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 383, col: 6, offset: 12440}, - run: (*parser).callonShortHandAttributeValue31, - expr: &litMatcher{ - pos: position{line: 383, col: 6, offset: 12440}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - }, - }, - }, - }, - }, - &andExpr{ - pos: position{line: 385, col: 10, offset: 12510}, - expr: &charClassMatcher{ - pos: position{line: 385, col: 11, offset: 12511}, - val: "[^=]", - chars: []rune{'='}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "PositionalAttribute", - pos: position{line: 389, col: 1, offset: 12587}, - expr: &choiceExpr{ - pos: position{line: 389, col: 24, offset: 12610}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 390, col: 5, offset: 12616}, - run: (*parser).callonPositionalAttribute2, - expr: &seqExpr{ - pos: position{line: 390, col: 5, offset: 12616}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 390, col: 5, offset: 12616}, - label: "value", - expr: &ruleRefExpr{ - pos: position{line: 390, col: 12, offset: 12623}, - name: "AttributeValue", - }, - }, - &choiceExpr{ - pos: position{line: 390, col: 29, offset: 12640}, - alternatives: []interface{}{ - &zeroOrOneExpr{ - pos: position{line: 390, col: 29, offset: 12640}, - expr: &seqExpr{ - pos: position{line: 390, col: 30, offset: 12641}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 390, col: 30, offset: 12641}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 390, col: 34, offset: 12645}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonPositionalAttribute13, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + ¬Expr{ + pos: position{line: 388, col: 9, offset: 12185}, + expr: &litMatcher{ + pos: position{line: 388, col: 10, offset: 12186}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 389, col: 5, offset: 12265}, + label: "content", + expr: &actionExpr{ + pos: position{line: 400, col: 5, offset: 12528}, + run: (*parser).callonLongHandAttributes21, + expr: &labeledExpr{ + pos: position{line: 400, col: 5, offset: 12528}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 400, col: 14, offset: 12537}, + expr: &choiceExpr{ + pos: position{line: 401, col: 9, offset: 12547}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonLongHandAttributes25, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes28, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes30, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes32, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonLongHandAttributes35, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes39, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes46, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes51, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes53, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonLongHandAttributes57, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes61, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes68, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes73, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes75, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonLongHandAttributes79, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes83, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 404, col: 12, offset: 12616}, + run: (*parser).callonLongHandAttributes89, + expr: &litMatcher{ + pos: position{line: 404, col: 12, offset: 12616}, + val: "\\'", + ignoreCase: false, + want: "\"\\\\'\"", + }, + }, + &litMatcher{ + pos: position{line: 407, col: 13, offset: 12718}, + val: "'`", + ignoreCase: false, + want: "\"'`\"", + }, + &litMatcher{ + pos: position{line: 407, col: 20, offset: 12725}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &actionExpr{ + pos: position{line: 407, col: 27, offset: 12732}, + run: (*parser).callonLongHandAttributes93, + expr: &litMatcher{ + pos: position{line: 407, col: 27, offset: 12732}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &actionExpr{ + pos: position{line: 410, col: 12, offset: 12892}, + run: (*parser).callonLongHandAttributes95, + expr: &oneOrMoreExpr{ + pos: position{line: 410, col: 12, offset: 12892}, + expr: &charClassMatcher{ + pos: position{line: 410, col: 12, offset: 12892}, + val: "[^\\r\\n\\\\\\ ]", + chars: []rune{'\r', '\n', '\\', '\'', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 390, col: 5, offset: 12316}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + }, + }, }, - }, - }, - }, - }, - }, - }, - }, - &andExpr{ - pos: position{line: 390, col: 45, offset: 12656}, - expr: &litMatcher{ - pos: position{line: 390, col: 46, offset: 12657}, - val: "]", - ignoreCase: false, - want: "\"]\"", - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 395, col: 6, offset: 12894}, - run: (*parser).callonPositionalAttribute17, - expr: &seqExpr{ - pos: position{line: 395, col: 6, offset: 12894}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 395, col: 6, offset: 12894}, - label: "value", - expr: &seqExpr{ - pos: position{line: 395, col: 13, offset: 12901}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 395, col: 13, offset: 12901}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonPositionalAttribute24, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 395, col: 21, offset: 12909}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 395, col: 22, offset: 12910}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 395, col: 22, offset: 12910}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 395, col: 26, offset: 12914}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &actionExpr{ + pos: position{line: 418, col: 5, offset: 13127}, + run: (*parser).callonLongHandAttributes99, + expr: &seqExpr{ + pos: position{line: 418, col: 5, offset: 13127}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 418, col: 5, offset: 13127}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + ¬Expr{ + pos: position{line: 418, col: 10, offset: 13132}, + expr: &litMatcher{ + pos: position{line: 418, col: 11, offset: 13133}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 419, col: 5, offset: 13212}, + label: "content", + expr: &actionExpr{ + pos: position{line: 429, col: 5, offset: 13492}, + run: (*parser).callonLongHandAttributes105, + expr: &labeledExpr{ + pos: position{line: 429, col: 5, offset: 13492}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 429, col: 14, offset: 13501}, + expr: &choiceExpr{ + pos: position{line: 430, col: 9, offset: 13511}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonLongHandAttributes109, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes112, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes114, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes116, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonLongHandAttributes119, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes123, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes130, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes135, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes137, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonLongHandAttributes141, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes145, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes152, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes157, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes159, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonLongHandAttributes163, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes167, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 433, col: 12, offset: 13580}, + run: (*parser).callonLongHandAttributes173, + expr: &litMatcher{ + pos: position{line: 433, col: 12, offset: 13580}, + val: "\\\"", + ignoreCase: false, + want: "\"\\\\\\\"\"", + }, + }, + &litMatcher{ + pos: position{line: 436, col: 13, offset: 13682}, + val: "\"`", + ignoreCase: false, + want: "\"\\\"`\"", + }, + &litMatcher{ + pos: position{line: 436, col: 21, offset: 13690}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + &litMatcher{ + pos: position{line: 436, col: 29, offset: 13698}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + &actionExpr{ + pos: position{line: 436, col: 35, offset: 13704}, + run: (*parser).callonLongHandAttributes178, + expr: &litMatcher{ + pos: position{line: 436, col: 35, offset: 13704}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &actionExpr{ + pos: position{line: 439, col: 12, offset: 13887}, + run: (*parser).callonLongHandAttributes180, + expr: &oneOrMoreExpr{ + pos: position{line: 439, col: 12, offset: 13887}, + expr: &charClassMatcher{ + pos: position{line: 439, col: 12, offset: 13887}, + val: "[^\\r\\n\\\\\"` ]", + chars: []rune{'\r', '\n', '\\', '"', '`', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 420, col: 5, offset: 13263}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + &andExpr{ + pos: position{line: 420, col: 10, offset: 13268}, + expr: ¬Expr{ + pos: position{line: 420, col: 12, offset: 13270}, + expr: &seqExpr{ + pos: position{line: 420, col: 14, offset: 13272}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 420, col: 14, offset: 13272}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes188, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 420, col: 21, offset: 13279}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, + }, + }, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonPositionalAttribute32, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + }, + &actionExpr{ + pos: position{line: 335, col: 7, offset: 10294}, + run: (*parser).callonLongHandAttributes191, + expr: &seqExpr{ + pos: position{line: 335, col: 7, offset: 10294}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 335, col: 7, offset: 10294}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 335, col: 16, offset: 10303}, + expr: &choiceExpr{ + pos: position{line: 338, col: 9, offset: 10485}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 338, col: 10, offset: 10486}, + run: (*parser).callonLongHandAttributes196, + expr: &oneOrMoreExpr{ + pos: position{line: 338, col: 10, offset: 10486}, + expr: &charClassMatcher{ + pos: position{line: 338, col: 10, offset: 10486}, + val: "[^,=.%# \\r\\n�{]]", + chars: []rune{',', '=', '.', '%', '#', ' ', '\r', '\n', '�', '{', ']'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonLongHandAttributes199, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonLongHandAttributes203, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes207, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes209, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonLongHandAttributes212, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes216, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes223, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes228, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes230, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonLongHandAttributes234, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes238, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes245, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes250, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes252, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonLongHandAttributes256, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes260, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 344, col: 12, offset: 10674}, + run: (*parser).callonLongHandAttributes266, + expr: &litMatcher{ + pos: position{line: 344, col: 12, offset: 10674}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 347, col: 8, offset: 10757}, + expr: ¬Expr{ + pos: position{line: 347, col: 10, offset: 10759}, + expr: &seqExpr{ + pos: position{line: 347, col: 12, offset: 10761}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 347, col: 12, offset: 10761}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes272, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 347, col: 19, offset: 10768}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, + }, + }, + }, }, }, }, @@ -9166,1776 +9694,2670 @@ var g = &grammar{ }, }, }, - &andExpr{ - pos: position{line: 395, col: 36, offset: 12924}, - expr: &litMatcher{ - pos: position{line: 395, col: 37, offset: 12925}, - val: "]", - ignoreCase: false, - want: "\"]\"", - }, - }, - }, - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 396, col: 5, offset: 12935}, - run: (*parser).callonPositionalAttribute36, - }, - }, - }, - }, - }, - }, - }, - { - name: "NamedAttribute", - pos: position{line: 407, col: 1, offset: 13248}, - expr: &actionExpr{ - pos: position{line: 407, col: 19, offset: 13266}, - run: (*parser).callonNamedAttribute1, - expr: &seqExpr{ - pos: position{line: 407, col: 19, offset: 13266}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 407, col: 19, offset: 13266}, - label: "key", - expr: &actionExpr{ - pos: position{line: 412, col: 22, offset: 13566}, - run: (*parser).callonNamedAttribute4, - expr: &seqExpr{ - pos: position{line: 412, col: 22, offset: 13566}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 412, col: 22, offset: 13566}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonNamedAttribute9, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, }, }, - }, - &oneOrMoreExpr{ - pos: position{line: 412, col: 29, offset: 13573}, - expr: &charClassMatcher{ - pos: position{line: 412, col: 29, offset: 13573}, - val: "[^\\r\\n=,]]", - chars: []rune{'\r', '\n', '=', ',', ']'}, - ignoreCase: false, - inverted: true, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 412, col: 42, offset: 13586}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonNamedAttribute16, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 407, col: 43, offset: 13290}, - val: "=", - ignoreCase: false, - want: "\"=\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 407, col: 47, offset: 13294}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonNamedAttribute22, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 407, col: 54, offset: 13301}, - label: "value", - expr: &ruleRefExpr{ - pos: position{line: 407, col: 61, offset: 13308}, - name: "AttributeValue", - }, - }, - &zeroOrOneExpr{ - pos: position{line: 407, col: 77, offset: 13324}, - expr: &seqExpr{ - pos: position{line: 407, col: 78, offset: 13325}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 407, col: 78, offset: 13325}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 407, col: 82, offset: 13329}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonNamedAttribute32, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "AttributeValue", - pos: position{line: 416, col: 1, offset: 13648}, - expr: &actionExpr{ - pos: position{line: 417, col: 5, offset: 13671}, - run: (*parser).callonAttributeValue1, - expr: &seqExpr{ - pos: position{line: 417, col: 5, offset: 13671}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 417, col: 5, offset: 13671}, - label: "value", - expr: &choiceExpr{ - pos: position{line: 418, col: 9, offset: 13687}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 418, col: 9, offset: 13687}, - name: "SingleQuotedAttributeValue", - }, - &ruleRefExpr{ - pos: position{line: 419, col: 11, offset: 13725}, - name: "DoubleQuotedAttributeValue", - }, - &ruleRefExpr{ - pos: position{line: 420, col: 11, offset: 13763}, - name: "UnquotedAttributeValue", - }, - }, - }, - }, - &andExpr{ - pos: position{line: 422, col: 5, offset: 13797}, - expr: ¬Expr{ - pos: position{line: 422, col: 7, offset: 13799}, - expr: &seqExpr{ - pos: position{line: 422, col: 9, offset: 13801}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 422, col: 9, offset: 13801}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonAttributeValue14, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 422, col: 16, offset: 13808}, - val: "=", - ignoreCase: false, - want: "\"=\"", - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "SingleQuotedAttributeValue", - pos: position{line: 426, col: 1, offset: 13849}, - expr: &actionExpr{ - pos: position{line: 427, col: 5, offset: 13884}, - run: (*parser).callonSingleQuotedAttributeValue1, - expr: &seqExpr{ - pos: position{line: 427, col: 5, offset: 13884}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 427, col: 5, offset: 13884}, - val: "'", - ignoreCase: false, - want: "\"'\"", - }, - &labeledExpr{ - pos: position{line: 428, col: 5, offset: 13893}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 428, col: 14, offset: 13902}, - expr: &choiceExpr{ - pos: position{line: 429, col: 9, offset: 13912}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 429, col: 9, offset: 13912}, - name: "QuotedText", - }, - &actionExpr{ - pos: position{line: 430, col: 12, offset: 13935}, - run: (*parser).callonSingleQuotedAttributeValue8, - expr: &oneOrMoreExpr{ - pos: position{line: 430, col: 12, offset: 13935}, - expr: &charClassMatcher{ - pos: position{line: 430, col: 12, offset: 13935}, - val: "[^\\\\r\\n�\\\\{]", - chars: []rune{'\'', '\r', '\n', '�', '\\', '{'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonSingleQuotedAttributeValue11, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonSingleQuotedAttributeValue15, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonSingleQuotedAttributeValue19, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonSingleQuotedAttributeValue23, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 435, col: 12, offset: 14129}, - run: (*parser).callonSingleQuotedAttributeValue29, - expr: &litMatcher{ - pos: position{line: 435, col: 12, offset: 14129}, - val: "\\'", - ignoreCase: false, - want: "\"\\\\'\"", - }, - }, - &litMatcher{ - pos: position{line: 438, col: 11, offset: 14221}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &actionExpr{ - pos: position{line: 438, col: 17, offset: 14227}, - run: (*parser).callonSingleQuotedAttributeValue32, - expr: &litMatcher{ - pos: position{line: 438, col: 17, offset: 14227}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 442, col: 5, offset: 14316}, - val: "'", - ignoreCase: false, - want: "\"'\"", - }, - }, - }, - }, - }, - { - name: "DoubleQuotedAttributeValue", - pos: position{line: 446, col: 1, offset: 14372}, - expr: &actionExpr{ - pos: position{line: 447, col: 5, offset: 14407}, - run: (*parser).callonDoubleQuotedAttributeValue1, - expr: &seqExpr{ - pos: position{line: 447, col: 5, offset: 14407}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 447, col: 5, offset: 14407}, - val: "\"", - ignoreCase: false, - want: "\"\\\"\"", - }, - &labeledExpr{ - pos: position{line: 448, col: 5, offset: 14417}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 448, col: 14, offset: 14426}, - expr: &choiceExpr{ - pos: position{line: 449, col: 9, offset: 14436}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 449, col: 9, offset: 14436}, - name: "QuotedText", - }, - &actionExpr{ - pos: position{line: 450, col: 12, offset: 14459}, - run: (*parser).callonDoubleQuotedAttributeValue8, - expr: &oneOrMoreExpr{ - pos: position{line: 450, col: 12, offset: 14459}, - expr: &charClassMatcher{ - pos: position{line: 450, col: 12, offset: 14459}, - val: "[^\\r\\n�\"\\\\{]", - chars: []rune{'\r', '\n', '�', '"', '\\', '{'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonDoubleQuotedAttributeValue11, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonDoubleQuotedAttributeValue15, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonDoubleQuotedAttributeValue19, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonDoubleQuotedAttributeValue23, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &labeledExpr{ + pos: position{line: 288, col: 5, offset: 8971}, + label: "extras", + expr: &zeroOrMoreExpr{ + pos: position{line: 288, col: 12, offset: 8978}, + expr: &actionExpr{ + pos: position{line: 289, col: 9, offset: 8989}, + run: (*parser).callonLongHandAttributes277, + expr: &seqExpr{ + pos: position{line: 289, col: 9, offset: 8989}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 289, col: 9, offset: 8989}, + expr: &litMatcher{ + pos: position{line: 289, col: 10, offset: 8990}, + val: ",", ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, + want: "\",\"", }, }, - }, - }, - }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 455, col: 12, offset: 14653}, - run: (*parser).callonDoubleQuotedAttributeValue29, - expr: &litMatcher{ - pos: position{line: 455, col: 12, offset: 14653}, - val: "\\\"", - ignoreCase: false, - want: "\"\\\\\\\"\"", - }, - }, - &litMatcher{ - pos: position{line: 458, col: 11, offset: 14745}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &actionExpr{ - pos: position{line: 458, col: 17, offset: 14751}, - run: (*parser).callonDoubleQuotedAttributeValue32, - expr: &litMatcher{ - pos: position{line: 458, col: 17, offset: 14751}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 462, col: 5, offset: 14840}, - val: "\"", - ignoreCase: false, - want: "\"\\\"\"", - }, - }, - }, - }, - }, - { - name: "UnquotedAttributeValue", - pos: position{line: 467, col: 1, offset: 14975}, - expr: &actionExpr{ - pos: position{line: 468, col: 5, offset: 15006}, - run: (*parser).callonUnquotedAttributeValue1, - expr: &seqExpr{ - pos: position{line: 468, col: 5, offset: 15006}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 468, col: 5, offset: 15006}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonUnquotedAttributeValue6, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 469, col: 5, offset: 15017}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 469, col: 14, offset: 15026}, - expr: &choiceExpr{ - pos: position{line: 470, col: 9, offset: 15036}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 470, col: 9, offset: 15036}, - name: "QuotedText", - }, - &actionExpr{ - pos: position{line: 471, col: 12, offset: 15058}, - run: (*parser).callonUnquotedAttributeValue12, - expr: &oneOrMoreExpr{ - pos: position{line: 471, col: 12, offset: 15058}, - expr: &charClassMatcher{ - pos: position{line: 471, col: 12, offset: 15058}, - val: "[^,=\\r\\n�{]]", - chars: []rune{',', '=', '\r', '\n', '�', '{', ']'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonUnquotedAttributeValue15, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonUnquotedAttributeValue19, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonUnquotedAttributeValue23, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonUnquotedAttributeValue27, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + ¬Expr{ + pos: position{line: 289, col: 14, offset: 8994}, + expr: &litMatcher{ + pos: position{line: 289, col: 15, offset: 8995}, + val: "]", ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, + want: "\"]\"", }, }, - }, - }, - }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 476, col: 12, offset: 15208}, - run: (*parser).callonUnquotedAttributeValue33, - expr: &litMatcher{ - pos: position{line: 476, col: 12, offset: 15208}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - }, - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 480, col: 5, offset: 15296}, - run: (*parser).callonUnquotedAttributeValue35, - }, - }, - }, - }, - }, - { - name: "UserMacroBlock", - pos: position{line: 524, col: 1, offset: 16648}, - expr: &actionExpr{ - pos: position{line: 525, col: 5, offset: 16671}, - run: (*parser).callonUserMacroBlock1, - expr: &seqExpr{ - pos: position{line: 525, col: 5, offset: 16671}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 525, col: 5, offset: 16671}, - label: "name", - expr: &actionExpr{ - pos: position{line: 548, col: 18, offset: 17418}, - run: (*parser).callonUserMacroBlock4, - expr: &oneOrMoreExpr{ - pos: position{line: 548, col: 19, offset: 17419}, - expr: &charClassMatcher{ - pos: position{line: 548, col: 19, offset: 17419}, - val: "[_-0-9\\pL]", - chars: []rune{'_', '-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 526, col: 5, offset: 16697}, - run: (*parser).callonUserMacroBlock7, - }, - &litMatcher{ - pos: position{line: 530, col: 5, offset: 16837}, - val: "::", - ignoreCase: false, - want: "\"::\"", - }, - &labeledExpr{ - pos: position{line: 531, col: 5, offset: 16847}, - label: "value", - expr: &actionExpr{ - pos: position{line: 552, col: 19, offset: 17486}, - run: (*parser).callonUserMacroBlock10, - expr: &zeroOrMoreExpr{ - pos: position{line: 552, col: 19, offset: 17486}, - expr: &charClassMatcher{ - pos: position{line: 552, col: 19, offset: 17486}, - val: "[^:[ \\r\\n]", - chars: []rune{':', '[', ' ', '\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 532, col: 5, offset: 16875}, - label: "inlineAttributes", - expr: &ruleRefExpr{ - pos: position{line: 532, col: 23, offset: 16893}, - name: "InlineAttributes", - }, - }, - }, - }, - }, - }, - { - name: "InlineUserMacro", - pos: position{line: 536, col: 1, offset: 17024}, - expr: &actionExpr{ - pos: position{line: 537, col: 5, offset: 17048}, - run: (*parser).callonInlineUserMacro1, - expr: &seqExpr{ - pos: position{line: 537, col: 5, offset: 17048}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 537, col: 5, offset: 17048}, - label: "name", - expr: &actionExpr{ - pos: position{line: 548, col: 18, offset: 17418}, - run: (*parser).callonInlineUserMacro4, - expr: &oneOrMoreExpr{ - pos: position{line: 548, col: 19, offset: 17419}, - expr: &charClassMatcher{ - pos: position{line: 548, col: 19, offset: 17419}, - val: "[_-0-9\\pL]", - chars: []rune{'_', '-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 538, col: 5, offset: 17074}, - run: (*parser).callonInlineUserMacro7, - }, - &litMatcher{ - pos: position{line: 542, col: 5, offset: 17214}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 543, col: 5, offset: 17223}, - label: "value", - expr: &actionExpr{ - pos: position{line: 552, col: 19, offset: 17486}, - run: (*parser).callonInlineUserMacro10, - expr: &zeroOrMoreExpr{ - pos: position{line: 552, col: 19, offset: 17486}, - expr: &charClassMatcher{ - pos: position{line: 552, col: 19, offset: 17486}, - val: "[^:[ \\r\\n]", - chars: []rune{':', '[', ' ', '\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 544, col: 5, offset: 17251}, - label: "inlineAttributes", - expr: &ruleRefExpr{ - pos: position{line: 544, col: 23, offset: 17269}, - name: "InlineAttributes", - }, - }, - }, - }, - }, - }, - { - name: "FileInclusion", - pos: position{line: 559, col: 1, offset: 17645}, - expr: &actionExpr{ - pos: position{line: 560, col: 5, offset: 17667}, - run: (*parser).callonFileInclusion1, - expr: &seqExpr{ - pos: position{line: 560, col: 5, offset: 17667}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 560, col: 5, offset: 17667}, - label: "incl", - expr: &actionExpr{ - pos: position{line: 561, col: 9, offset: 17682}, - run: (*parser).callonFileInclusion4, - expr: &seqExpr{ - pos: position{line: 561, col: 9, offset: 17682}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 561, col: 9, offset: 17682}, - val: "include::", - ignoreCase: false, - want: "\"include::\"", - }, - &labeledExpr{ - pos: position{line: 562, col: 9, offset: 17703}, - label: "path", - expr: &actionExpr{ - pos: position{line: 2241, col: 17, offset: 79131}, - run: (*parser).callonFileInclusion8, - expr: &labeledExpr{ - pos: position{line: 2241, col: 17, offset: 79131}, - label: "path", - expr: &oneOrMoreExpr{ - pos: position{line: 2241, col: 22, offset: 79136}, - expr: &choiceExpr{ - pos: position{line: 2241, col: 23, offset: 79137}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - run: (*parser).callonFileInclusion12, - expr: &oneOrMoreExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - expr: &charClassMatcher{ - pos: position{line: 2253, col: 14, offset: 79513}, - val: "[^\\r\\n[]� ]", - chars: []rune{'\r', '\n', '[', ']', '�', ' '}, - ignoreCase: false, - inverted: true, - }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonFileInclusion15, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonFileInclusion19, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 563, col: 9, offset: 17732}, - label: "inlineAttributes", - expr: &ruleRefExpr{ - pos: position{line: 563, col: 27, offset: 17750}, - name: "InlineAttributes", - }, - }, - }, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 567, col: 5, offset: 17910}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonFileInclusion28, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "LineRanges", - pos: position{line: 574, col: 1, offset: 18042}, - expr: &actionExpr{ - pos: position{line: 574, col: 15, offset: 18056}, - run: (*parser).callonLineRanges1, - expr: &seqExpr{ - pos: position{line: 574, col: 15, offset: 18056}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 574, col: 15, offset: 18056}, - label: "value", - expr: &choiceExpr{ - pos: position{line: 574, col: 22, offset: 18063}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 581, col: 23, offset: 18250}, - run: (*parser).callonLineRanges5, - expr: &seqExpr{ - pos: position{line: 581, col: 23, offset: 18250}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 581, col: 23, offset: 18250}, - label: "first", - expr: &choiceExpr{ - pos: position{line: 581, col: 30, offset: 18257}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 590, col: 19, offset: 18615}, - run: (*parser).callonLineRanges9, - expr: &seqExpr{ - pos: position{line: 590, col: 19, offset: 18615}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 590, col: 19, offset: 18615}, - label: "start", - expr: &actionExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - run: (*parser).callonLineRanges12, - expr: &seqExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - exprs: []interface{}{ - &zeroOrOneExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - expr: &litMatcher{ - pos: position{line: 2267, col: 11, offset: 79895}, - val: "-", - ignoreCase: false, - want: "\"-\"", - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2267, col: 16, offset: 79900}, - expr: &actionExpr{ - pos: position{line: 2263, col: 10, offset: 79843}, - run: (*parser).callonLineRanges17, - expr: &charClassMatcher{ - pos: position{line: 2263, col: 10, offset: 79843}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 590, col: 34, offset: 18630}, - val: "..", - ignoreCase: false, - want: "\"..\"", - }, - &labeledExpr{ - pos: position{line: 590, col: 39, offset: 18635}, - label: "end", - expr: &actionExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - run: (*parser).callonLineRanges21, + &labeledExpr{ + pos: position{line: 290, col: 9, offset: 9007}, + label: "extra", + expr: &choiceExpr{ + pos: position{line: 291, col: 13, offset: 9027}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 313, col: 25, offset: 9637}, + run: (*parser).callonLongHandAttributes285, expr: &seqExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, + pos: position{line: 313, col: 25, offset: 9637}, exprs: []interface{}{ - &zeroOrOneExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - expr: &litMatcher{ - pos: position{line: 2267, col: 11, offset: 79895}, - val: "-", - ignoreCase: false, - want: "\"-\"", - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2267, col: 16, offset: 79900}, - expr: &actionExpr{ - pos: position{line: 2263, col: 10, offset: 79843}, - run: (*parser).callonLineRanges26, - expr: &charClassMatcher{ - pos: position{line: 2263, col: 10, offset: 79843}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 594, col: 20, offset: 18747}, - run: (*parser).callonLineRanges28, - expr: &labeledExpr{ - pos: position{line: 594, col: 20, offset: 18747}, - label: "singleline", - expr: &actionExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - run: (*parser).callonLineRanges30, - expr: &seqExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - exprs: []interface{}{ - &zeroOrOneExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - expr: &litMatcher{ - pos: position{line: 2267, col: 11, offset: 79895}, - val: "-", - ignoreCase: false, - want: "\"-\"", - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2267, col: 16, offset: 79900}, - expr: &actionExpr{ - pos: position{line: 2263, col: 10, offset: 79843}, - run: (*parser).callonLineRanges35, - expr: &charClassMatcher{ - pos: position{line: 2263, col: 10, offset: 79843}, - val: "[0-9]", - ranges: []rune{'0', '9'}, + &litMatcher{ + pos: position{line: 313, col: 25, offset: 9637}, + val: "#", ignoreCase: false, - inverted: false, + want: "\"#\"", }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 582, col: 5, offset: 18296}, - label: "others", - expr: &oneOrMoreExpr{ - pos: position{line: 582, col: 12, offset: 18303}, - expr: &actionExpr{ - pos: position{line: 583, col: 9, offset: 18313}, - run: (*parser).callonLineRanges39, - expr: &seqExpr{ - pos: position{line: 583, col: 9, offset: 18313}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 583, col: 10, offset: 18314}, - val: "[,;]", - chars: []rune{',', ';'}, - ignoreCase: false, - inverted: false, - }, - &labeledExpr{ - pos: position{line: 584, col: 9, offset: 18431}, - label: "other", - expr: &choiceExpr{ - pos: position{line: 584, col: 16, offset: 18438}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 590, col: 19, offset: 18615}, - run: (*parser).callonLineRanges44, - expr: &seqExpr{ - pos: position{line: 590, col: 19, offset: 18615}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 590, col: 19, offset: 18615}, - label: "start", - expr: &actionExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - run: (*parser).callonLineRanges47, - expr: &seqExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - exprs: []interface{}{ - &zeroOrOneExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - expr: &litMatcher{ - pos: position{line: 2267, col: 11, offset: 79895}, - val: "-", + &labeledExpr{ + pos: position{line: 313, col: 29, offset: 9641}, + label: "id", + expr: &choiceExpr{ + pos: position{line: 333, col: 5, offset: 10220}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 388, col: 5, offset: 12181}, + run: (*parser).callonLongHandAttributes290, + expr: &seqExpr{ + pos: position{line: 388, col: 5, offset: 12181}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 388, col: 5, offset: 12181}, + val: "'", ignoreCase: false, - want: "\"-\"", + want: "\"'\"", }, - }, - &oneOrMoreExpr{ - pos: position{line: 2267, col: 16, offset: 79900}, - expr: &actionExpr{ - pos: position{line: 2263, col: 10, offset: 79843}, - run: (*parser).callonLineRanges52, - expr: &charClassMatcher{ - pos: position{line: 2263, col: 10, offset: 79843}, - val: "[0-9]", - ranges: []rune{'0', '9'}, + ¬Expr{ + pos: position{line: 388, col: 9, offset: 12185}, + expr: &litMatcher{ + pos: position{line: 388, col: 10, offset: 12186}, + val: "`", ignoreCase: false, - inverted: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 389, col: 5, offset: 12265}, + label: "content", + expr: &actionExpr{ + pos: position{line: 400, col: 5, offset: 12528}, + run: (*parser).callonLongHandAttributes296, + expr: &labeledExpr{ + pos: position{line: 400, col: 5, offset: 12528}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 400, col: 14, offset: 12537}, + expr: &choiceExpr{ + pos: position{line: 401, col: 9, offset: 12547}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonLongHandAttributes300, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes303, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes305, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes307, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonLongHandAttributes310, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes314, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes321, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes326, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes328, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonLongHandAttributes332, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes336, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes343, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes348, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes350, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonLongHandAttributes354, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes358, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 404, col: 12, offset: 12616}, + run: (*parser).callonLongHandAttributes364, + expr: &litMatcher{ + pos: position{line: 404, col: 12, offset: 12616}, + val: "\\'", + ignoreCase: false, + want: "\"\\\\'\"", + }, + }, + &litMatcher{ + pos: position{line: 407, col: 13, offset: 12718}, + val: "'`", + ignoreCase: false, + want: "\"'`\"", + }, + &litMatcher{ + pos: position{line: 407, col: 20, offset: 12725}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &actionExpr{ + pos: position{line: 407, col: 27, offset: 12732}, + run: (*parser).callonLongHandAttributes368, + expr: &litMatcher{ + pos: position{line: 407, col: 27, offset: 12732}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &actionExpr{ + pos: position{line: 410, col: 12, offset: 12892}, + run: (*parser).callonLongHandAttributes370, + expr: &oneOrMoreExpr{ + pos: position{line: 410, col: 12, offset: 12892}, + expr: &charClassMatcher{ + pos: position{line: 410, col: 12, offset: 12892}, + val: "[^\\r\\n\\\\\\ ]", + chars: []rune{'\r', '\n', '\\', '\'', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, }, }, + &litMatcher{ + pos: position{line: 390, col: 5, offset: 12316}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, }, }, }, - }, - }, - &litMatcher{ - pos: position{line: 590, col: 34, offset: 18630}, - val: "..", - ignoreCase: false, - want: "\"..\"", - }, - &labeledExpr{ - pos: position{line: 590, col: 39, offset: 18635}, - label: "end", - expr: &actionExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - run: (*parser).callonLineRanges56, - expr: &seqExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - exprs: []interface{}{ - &zeroOrOneExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - expr: &litMatcher{ - pos: position{line: 2267, col: 11, offset: 79895}, - val: "-", + &actionExpr{ + pos: position{line: 418, col: 5, offset: 13127}, + run: (*parser).callonLongHandAttributes374, + expr: &seqExpr{ + pos: position{line: 418, col: 5, offset: 13127}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 418, col: 5, offset: 13127}, + val: "\"", ignoreCase: false, - want: "\"-\"", + want: "\"\\\"\"", }, - }, - &oneOrMoreExpr{ - pos: position{line: 2267, col: 16, offset: 79900}, - expr: &actionExpr{ - pos: position{line: 2263, col: 10, offset: 79843}, - run: (*parser).callonLineRanges61, - expr: &charClassMatcher{ - pos: position{line: 2263, col: 10, offset: 79843}, - val: "[0-9]", - ranges: []rune{'0', '9'}, + ¬Expr{ + pos: position{line: 418, col: 10, offset: 13132}, + expr: &litMatcher{ + pos: position{line: 418, col: 11, offset: 13133}, + val: "`", ignoreCase: false, - inverted: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 419, col: 5, offset: 13212}, + label: "content", + expr: &actionExpr{ + pos: position{line: 429, col: 5, offset: 13492}, + run: (*parser).callonLongHandAttributes380, + expr: &labeledExpr{ + pos: position{line: 429, col: 5, offset: 13492}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 429, col: 14, offset: 13501}, + expr: &choiceExpr{ + pos: position{line: 430, col: 9, offset: 13511}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonLongHandAttributes384, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes387, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes389, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes391, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonLongHandAttributes394, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes398, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes405, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes410, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes412, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonLongHandAttributes416, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes420, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes427, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes432, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes434, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonLongHandAttributes438, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes442, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 433, col: 12, offset: 13580}, + run: (*parser).callonLongHandAttributes448, + expr: &litMatcher{ + pos: position{line: 433, col: 12, offset: 13580}, + val: "\\\"", + ignoreCase: false, + want: "\"\\\\\\\"\"", + }, + }, + &litMatcher{ + pos: position{line: 436, col: 13, offset: 13682}, + val: "\"`", + ignoreCase: false, + want: "\"\\\"`\"", + }, + &litMatcher{ + pos: position{line: 436, col: 21, offset: 13690}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + &litMatcher{ + pos: position{line: 436, col: 29, offset: 13698}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + &actionExpr{ + pos: position{line: 436, col: 35, offset: 13704}, + run: (*parser).callonLongHandAttributes453, + expr: &litMatcher{ + pos: position{line: 436, col: 35, offset: 13704}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &actionExpr{ + pos: position{line: 439, col: 12, offset: 13887}, + run: (*parser).callonLongHandAttributes455, + expr: &oneOrMoreExpr{ + pos: position{line: 439, col: 12, offset: 13887}, + expr: &charClassMatcher{ + pos: position{line: 439, col: 12, offset: 13887}, + val: "[^\\r\\n\\\\\"` ]", + chars: []rune{'\r', '\n', '\\', '"', '`', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 420, col: 5, offset: 13263}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + &andExpr{ + pos: position{line: 420, col: 10, offset: 13268}, + expr: ¬Expr{ + pos: position{line: 420, col: 12, offset: 13270}, + expr: &seqExpr{ + pos: position{line: 420, col: 14, offset: 13272}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 420, col: 14, offset: 13272}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes463, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 420, col: 21, offset: 13279}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, + }, }, }, }, }, }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 594, col: 20, offset: 18747}, - run: (*parser).callonLineRanges63, - expr: &labeledExpr{ - pos: position{line: 594, col: 20, offset: 18747}, - label: "singleline", - expr: &actionExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - run: (*parser).callonLineRanges65, - expr: &seqExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - exprs: []interface{}{ - &zeroOrOneExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - expr: &litMatcher{ - pos: position{line: 2267, col: 11, offset: 79895}, - val: "-", - ignoreCase: false, - want: "\"-\"", - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2267, col: 16, offset: 79900}, - expr: &actionExpr{ - pos: position{line: 2263, col: 10, offset: 79843}, - run: (*parser).callonLineRanges70, - expr: &charClassMatcher{ - pos: position{line: 2263, col: 10, offset: 79843}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 590, col: 19, offset: 18615}, - run: (*parser).callonLineRanges72, - expr: &seqExpr{ - pos: position{line: 590, col: 19, offset: 18615}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 590, col: 19, offset: 18615}, - label: "start", - expr: &actionExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - run: (*parser).callonLineRanges75, - expr: &seqExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - exprs: []interface{}{ - &zeroOrOneExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - expr: &litMatcher{ - pos: position{line: 2267, col: 11, offset: 79895}, - val: "-", - ignoreCase: false, - want: "\"-\"", - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2267, col: 16, offset: 79900}, - expr: &actionExpr{ - pos: position{line: 2263, col: 10, offset: 79843}, - run: (*parser).callonLineRanges80, - expr: &charClassMatcher{ - pos: position{line: 2263, col: 10, offset: 79843}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 590, col: 34, offset: 18630}, - val: "..", - ignoreCase: false, - want: "\"..\"", - }, - &labeledExpr{ - pos: position{line: 590, col: 39, offset: 18635}, - label: "end", - expr: &actionExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - run: (*parser).callonLineRanges84, - expr: &seqExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - exprs: []interface{}{ - &zeroOrOneExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - expr: &litMatcher{ - pos: position{line: 2267, col: 11, offset: 79895}, - val: "-", - ignoreCase: false, - want: "\"-\"", - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2267, col: 16, offset: 79900}, - expr: &actionExpr{ - pos: position{line: 2263, col: 10, offset: 79843}, - run: (*parser).callonLineRanges89, - expr: &charClassMatcher{ - pos: position{line: 2263, col: 10, offset: 79843}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 594, col: 20, offset: 18747}, - run: (*parser).callonLineRanges91, - expr: &labeledExpr{ - pos: position{line: 594, col: 20, offset: 18747}, - label: "singleline", - expr: &actionExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - run: (*parser).callonLineRanges93, - expr: &seqExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - exprs: []interface{}{ - &zeroOrOneExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - expr: &litMatcher{ - pos: position{line: 2267, col: 11, offset: 79895}, - val: "-", - ignoreCase: false, - want: "\"-\"", - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2267, col: 16, offset: 79900}, - expr: &actionExpr{ - pos: position{line: 2263, col: 10, offset: 79843}, - run: (*parser).callonLineRanges98, - expr: &charClassMatcher{ - pos: position{line: 2263, col: 10, offset: 79843}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - { - name: "TagRanges", - pos: position{line: 599, col: 1, offset: 18874}, - expr: &actionExpr{ - pos: position{line: 599, col: 14, offset: 18887}, - run: (*parser).callonTagRanges1, - expr: &seqExpr{ - pos: position{line: 599, col: 14, offset: 18887}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 599, col: 14, offset: 18887}, - label: "value", - expr: &actionExpr{ - pos: position{line: 603, col: 22, offset: 19016}, - run: (*parser).callonTagRanges4, - expr: &seqExpr{ - pos: position{line: 603, col: 22, offset: 19016}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 603, col: 22, offset: 19016}, - label: "first", - expr: &choiceExpr{ - pos: position{line: 612, col: 13, offset: 19326}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 612, col: 13, offset: 19326}, - run: (*parser).callonTagRanges8, - expr: &labeledExpr{ - pos: position{line: 612, col: 13, offset: 19326}, - label: "tag", - expr: &choiceExpr{ - pos: position{line: 612, col: 18, offset: 19331}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonTagRanges11, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - &actionExpr{ - pos: position{line: 618, col: 16, offset: 19515}, - run: (*parser).callonTagRanges14, - expr: &seqExpr{ - pos: position{line: 618, col: 16, offset: 19515}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 618, col: 16, offset: 19515}, - label: "stars", - expr: &actionExpr{ - pos: position{line: 618, col: 23, offset: 19522}, - run: (*parser).callonTagRanges17, - expr: &oneOrMoreExpr{ - pos: position{line: 618, col: 23, offset: 19522}, - expr: &litMatcher{ - pos: position{line: 618, col: 24, offset: 19523}, - val: "*", - ignoreCase: false, - want: "\"*\"", + &actionExpr{ + pos: position{line: 335, col: 7, offset: 10294}, + run: (*parser).callonLongHandAttributes466, + expr: &seqExpr{ + pos: position{line: 335, col: 7, offset: 10294}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 335, col: 7, offset: 10294}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 335, col: 16, offset: 10303}, + expr: &choiceExpr{ + pos: position{line: 338, col: 9, offset: 10485}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 338, col: 10, offset: 10486}, + run: (*parser).callonLongHandAttributes471, + expr: &oneOrMoreExpr{ + pos: position{line: 338, col: 10, offset: 10486}, + expr: &charClassMatcher{ + pos: position{line: 338, col: 10, offset: 10486}, + val: "[^,=.%# \\r\\n�{]]", + chars: []rune{',', '=', '.', '%', '#', ' ', '\r', '\n', '�', '{', ']'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonLongHandAttributes474, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonLongHandAttributes478, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes482, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes484, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonLongHandAttributes487, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes491, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes498, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes503, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes505, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonLongHandAttributes509, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes513, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes520, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes525, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes527, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonLongHandAttributes531, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes535, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 344, col: 12, offset: 10674}, + run: (*parser).callonLongHandAttributes541, + expr: &litMatcher{ + pos: position{line: 344, col: 12, offset: 10674}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 347, col: 8, offset: 10757}, + expr: ¬Expr{ + pos: position{line: 347, col: 10, offset: 10759}, + expr: &seqExpr{ + pos: position{line: 347, col: 12, offset: 10761}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 347, col: 12, offset: 10761}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes547, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 347, col: 19, offset: 10768}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, - &andCodeExpr{ - pos: position{line: 621, col: 5, offset: 19577}, - run: (*parser).callonTagRanges20, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 614, col: 5, offset: 19411}, - run: (*parser).callonTagRanges21, - expr: &seqExpr{ - pos: position{line: 614, col: 5, offset: 19411}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 614, col: 5, offset: 19411}, - val: "!", - ignoreCase: false, - want: "\"!\"", - }, - &labeledExpr{ - pos: position{line: 614, col: 9, offset: 19415}, - label: "tag", - expr: &choiceExpr{ - pos: position{line: 614, col: 14, offset: 19420}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonTagRanges26, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, }, &actionExpr{ - pos: position{line: 618, col: 16, offset: 19515}, - run: (*parser).callonTagRanges29, + pos: position{line: 327, col: 29, offset: 10063}, + run: (*parser).callonLongHandAttributes550, expr: &seqExpr{ - pos: position{line: 618, col: 16, offset: 19515}, + pos: position{line: 327, col: 29, offset: 10063}, exprs: []interface{}{ + &litMatcher{ + pos: position{line: 327, col: 29, offset: 10063}, + val: "%", + ignoreCase: false, + want: "\"%\"", + }, &labeledExpr{ - pos: position{line: 618, col: 16, offset: 19515}, - label: "stars", - expr: &actionExpr{ - pos: position{line: 618, col: 23, offset: 19522}, - run: (*parser).callonTagRanges32, - expr: &oneOrMoreExpr{ - pos: position{line: 618, col: 23, offset: 19522}, - expr: &litMatcher{ - pos: position{line: 618, col: 24, offset: 19523}, - val: "*", - ignoreCase: false, - want: "\"*\"", + pos: position{line: 327, col: 33, offset: 10067}, + label: "option", + expr: &choiceExpr{ + pos: position{line: 333, col: 5, offset: 10220}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 388, col: 5, offset: 12181}, + run: (*parser).callonLongHandAttributes555, + expr: &seqExpr{ + pos: position{line: 388, col: 5, offset: 12181}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 388, col: 5, offset: 12181}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + ¬Expr{ + pos: position{line: 388, col: 9, offset: 12185}, + expr: &litMatcher{ + pos: position{line: 388, col: 10, offset: 12186}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 389, col: 5, offset: 12265}, + label: "content", + expr: &actionExpr{ + pos: position{line: 400, col: 5, offset: 12528}, + run: (*parser).callonLongHandAttributes561, + expr: &labeledExpr{ + pos: position{line: 400, col: 5, offset: 12528}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 400, col: 14, offset: 12537}, + expr: &choiceExpr{ + pos: position{line: 401, col: 9, offset: 12547}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonLongHandAttributes565, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes568, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes570, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes572, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonLongHandAttributes575, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes579, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes586, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes591, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes593, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonLongHandAttributes597, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes601, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes608, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes613, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes615, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonLongHandAttributes619, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes623, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 404, col: 12, offset: 12616}, + run: (*parser).callonLongHandAttributes629, + expr: &litMatcher{ + pos: position{line: 404, col: 12, offset: 12616}, + val: "\\'", + ignoreCase: false, + want: "\"\\\\'\"", + }, + }, + &litMatcher{ + pos: position{line: 407, col: 13, offset: 12718}, + val: "'`", + ignoreCase: false, + want: "\"'`\"", + }, + &litMatcher{ + pos: position{line: 407, col: 20, offset: 12725}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &actionExpr{ + pos: position{line: 407, col: 27, offset: 12732}, + run: (*parser).callonLongHandAttributes633, + expr: &litMatcher{ + pos: position{line: 407, col: 27, offset: 12732}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &actionExpr{ + pos: position{line: 410, col: 12, offset: 12892}, + run: (*parser).callonLongHandAttributes635, + expr: &oneOrMoreExpr{ + pos: position{line: 410, col: 12, offset: 12892}, + expr: &charClassMatcher{ + pos: position{line: 410, col: 12, offset: 12892}, + val: "[^\\r\\n\\\\\\ ]", + chars: []rune{'\r', '\n', '\\', '\'', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 390, col: 5, offset: 12316}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + }, + }, }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 621, col: 5, offset: 19577}, - run: (*parser).callonTagRanges35, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 604, col: 5, offset: 19037}, - label: "others", - expr: &zeroOrMoreExpr{ - pos: position{line: 604, col: 12, offset: 19044}, - expr: &actionExpr{ - pos: position{line: 605, col: 9, offset: 19054}, - run: (*parser).callonTagRanges38, - expr: &seqExpr{ - pos: position{line: 605, col: 9, offset: 19054}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 605, col: 10, offset: 19055}, - val: "[,;]", - chars: []rune{',', ';'}, - ignoreCase: false, - inverted: false, - }, - &labeledExpr{ - pos: position{line: 606, col: 9, offset: 19172}, - label: "other", - expr: &choiceExpr{ - pos: position{line: 612, col: 13, offset: 19326}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 612, col: 13, offset: 19326}, - run: (*parser).callonTagRanges43, - expr: &labeledExpr{ - pos: position{line: 612, col: 13, offset: 19326}, - label: "tag", - expr: &choiceExpr{ - pos: position{line: 612, col: 18, offset: 19331}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonTagRanges46, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - &actionExpr{ - pos: position{line: 618, col: 16, offset: 19515}, - run: (*parser).callonTagRanges49, - expr: &seqExpr{ - pos: position{line: 618, col: 16, offset: 19515}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 618, col: 16, offset: 19515}, - label: "stars", - expr: &actionExpr{ - pos: position{line: 618, col: 23, offset: 19522}, - run: (*parser).callonTagRanges52, - expr: &oneOrMoreExpr{ - pos: position{line: 618, col: 23, offset: 19522}, - expr: &litMatcher{ - pos: position{line: 618, col: 24, offset: 19523}, - val: "*", + &actionExpr{ + pos: position{line: 418, col: 5, offset: 13127}, + run: (*parser).callonLongHandAttributes639, + expr: &seqExpr{ + pos: position{line: 418, col: 5, offset: 13127}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 418, col: 5, offset: 13127}, + val: "\"", ignoreCase: false, - want: "\"*\"", + want: "\"\\\"\"", + }, + ¬Expr{ + pos: position{line: 418, col: 10, offset: 13132}, + expr: &litMatcher{ + pos: position{line: 418, col: 11, offset: 13133}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 419, col: 5, offset: 13212}, + label: "content", + expr: &actionExpr{ + pos: position{line: 429, col: 5, offset: 13492}, + run: (*parser).callonLongHandAttributes645, + expr: &labeledExpr{ + pos: position{line: 429, col: 5, offset: 13492}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 429, col: 14, offset: 13501}, + expr: &choiceExpr{ + pos: position{line: 430, col: 9, offset: 13511}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonLongHandAttributes649, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes652, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes654, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes656, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonLongHandAttributes659, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes663, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes670, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes675, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes677, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonLongHandAttributes681, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes685, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes692, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes697, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes699, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonLongHandAttributes703, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes707, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 433, col: 12, offset: 13580}, + run: (*parser).callonLongHandAttributes713, + expr: &litMatcher{ + pos: position{line: 433, col: 12, offset: 13580}, + val: "\\\"", + ignoreCase: false, + want: "\"\\\\\\\"\"", + }, + }, + &litMatcher{ + pos: position{line: 436, col: 13, offset: 13682}, + val: "\"`", + ignoreCase: false, + want: "\"\\\"`\"", + }, + &litMatcher{ + pos: position{line: 436, col: 21, offset: 13690}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + &litMatcher{ + pos: position{line: 436, col: 29, offset: 13698}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + &actionExpr{ + pos: position{line: 436, col: 35, offset: 13704}, + run: (*parser).callonLongHandAttributes718, + expr: &litMatcher{ + pos: position{line: 436, col: 35, offset: 13704}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &actionExpr{ + pos: position{line: 439, col: 12, offset: 13887}, + run: (*parser).callonLongHandAttributes720, + expr: &oneOrMoreExpr{ + pos: position{line: 439, col: 12, offset: 13887}, + expr: &charClassMatcher{ + pos: position{line: 439, col: 12, offset: 13887}, + val: "[^\\r\\n\\\\\"` ]", + chars: []rune{'\r', '\n', '\\', '"', '`', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 420, col: 5, offset: 13263}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + &andExpr{ + pos: position{line: 420, col: 10, offset: 13268}, + expr: ¬Expr{ + pos: position{line: 420, col: 12, offset: 13270}, + expr: &seqExpr{ + pos: position{line: 420, col: 14, offset: 13272}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 420, col: 14, offset: 13272}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes728, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 420, col: 21, offset: 13279}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, + }, + }, }, }, }, }, - &andCodeExpr{ - pos: position{line: 621, col: 5, offset: 19577}, - run: (*parser).callonTagRanges55, + &actionExpr{ + pos: position{line: 335, col: 7, offset: 10294}, + run: (*parser).callonLongHandAttributes731, + expr: &seqExpr{ + pos: position{line: 335, col: 7, offset: 10294}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 335, col: 7, offset: 10294}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 335, col: 16, offset: 10303}, + expr: &choiceExpr{ + pos: position{line: 338, col: 9, offset: 10485}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 338, col: 10, offset: 10486}, + run: (*parser).callonLongHandAttributes736, + expr: &oneOrMoreExpr{ + pos: position{line: 338, col: 10, offset: 10486}, + expr: &charClassMatcher{ + pos: position{line: 338, col: 10, offset: 10486}, + val: "[^,=.%# \\r\\n�{]]", + chars: []rune{',', '=', '.', '%', '#', ' ', '\r', '\n', '�', '{', ']'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonLongHandAttributes739, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonLongHandAttributes743, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes747, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes749, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonLongHandAttributes752, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes756, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes763, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes768, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes770, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonLongHandAttributes774, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes778, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes785, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes790, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes792, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonLongHandAttributes796, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes800, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 344, col: 12, offset: 10674}, + run: (*parser).callonLongHandAttributes806, + expr: &litMatcher{ + pos: position{line: 344, col: 12, offset: 10674}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 347, col: 8, offset: 10757}, + expr: ¬Expr{ + pos: position{line: 347, col: 10, offset: 10759}, + expr: &seqExpr{ + pos: position{line: 347, col: 12, offset: 10761}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 347, col: 12, offset: 10761}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes812, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 347, col: 19, offset: 10768}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, + }, + }, + }, + }, + }, }, }, }, @@ -10943,66 +12365,1314 @@ var g = &grammar{ }, }, }, - }, - &actionExpr{ - pos: position{line: 614, col: 5, offset: 19411}, - run: (*parser).callonTagRanges56, - expr: &seqExpr{ - pos: position{line: 614, col: 5, offset: 19411}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 614, col: 5, offset: 19411}, - val: "!", - ignoreCase: false, - want: "\"!\"", - }, - &labeledExpr{ - pos: position{line: 614, col: 9, offset: 19415}, - label: "tag", - expr: &choiceExpr{ - pos: position{line: 614, col: 14, offset: 19420}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonTagRanges61, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 322, col: 30, offset: 9903}, + run: (*parser).callonLongHandAttributes815, + expr: &seqExpr{ + pos: position{line: 322, col: 30, offset: 9903}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 322, col: 30, offset: 9903}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + &labeledExpr{ + pos: position{line: 322, col: 34, offset: 9907}, + label: "role", + expr: &choiceExpr{ + pos: position{line: 333, col: 5, offset: 10220}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 388, col: 5, offset: 12181}, + run: (*parser).callonLongHandAttributes820, + expr: &seqExpr{ + pos: position{line: 388, col: 5, offset: 12181}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 388, col: 5, offset: 12181}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + ¬Expr{ + pos: position{line: 388, col: 9, offset: 12185}, + expr: &litMatcher{ + pos: position{line: 388, col: 10, offset: 12186}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 389, col: 5, offset: 12265}, + label: "content", + expr: &actionExpr{ + pos: position{line: 400, col: 5, offset: 12528}, + run: (*parser).callonLongHandAttributes826, + expr: &labeledExpr{ + pos: position{line: 400, col: 5, offset: 12528}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 400, col: 14, offset: 12537}, + expr: &choiceExpr{ + pos: position{line: 401, col: 9, offset: 12547}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonLongHandAttributes830, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes833, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes835, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes837, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonLongHandAttributes840, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes844, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes851, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes856, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes858, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonLongHandAttributes862, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes866, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes873, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes878, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes880, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonLongHandAttributes884, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes888, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 404, col: 12, offset: 12616}, + run: (*parser).callonLongHandAttributes894, + expr: &litMatcher{ + pos: position{line: 404, col: 12, offset: 12616}, + val: "\\'", + ignoreCase: false, + want: "\"\\\\'\"", + }, + }, + &litMatcher{ + pos: position{line: 407, col: 13, offset: 12718}, + val: "'`", + ignoreCase: false, + want: "\"'`\"", + }, + &litMatcher{ + pos: position{line: 407, col: 20, offset: 12725}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &actionExpr{ + pos: position{line: 407, col: 27, offset: 12732}, + run: (*parser).callonLongHandAttributes898, + expr: &litMatcher{ + pos: position{line: 407, col: 27, offset: 12732}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &actionExpr{ + pos: position{line: 410, col: 12, offset: 12892}, + run: (*parser).callonLongHandAttributes900, + expr: &oneOrMoreExpr{ + pos: position{line: 410, col: 12, offset: 12892}, + expr: &charClassMatcher{ + pos: position{line: 410, col: 12, offset: 12892}, + val: "[^\\r\\n\\\\\\ ]", + chars: []rune{'\r', '\n', '\\', '\'', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 390, col: 5, offset: 12316}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + }, }, }, - }, - &actionExpr{ - pos: position{line: 618, col: 16, offset: 19515}, - run: (*parser).callonTagRanges64, - expr: &seqExpr{ - pos: position{line: 618, col: 16, offset: 19515}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 618, col: 16, offset: 19515}, - label: "stars", - expr: &actionExpr{ - pos: position{line: 618, col: 23, offset: 19522}, - run: (*parser).callonTagRanges67, - expr: &oneOrMoreExpr{ - pos: position{line: 618, col: 23, offset: 19522}, - expr: &litMatcher{ - pos: position{line: 618, col: 24, offset: 19523}, - val: "*", - ignoreCase: false, - want: "\"*\"", + &actionExpr{ + pos: position{line: 418, col: 5, offset: 13127}, + run: (*parser).callonLongHandAttributes904, + expr: &seqExpr{ + pos: position{line: 418, col: 5, offset: 13127}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 418, col: 5, offset: 13127}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + ¬Expr{ + pos: position{line: 418, col: 10, offset: 13132}, + expr: &litMatcher{ + pos: position{line: 418, col: 11, offset: 13133}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 419, col: 5, offset: 13212}, + label: "content", + expr: &actionExpr{ + pos: position{line: 429, col: 5, offset: 13492}, + run: (*parser).callonLongHandAttributes910, + expr: &labeledExpr{ + pos: position{line: 429, col: 5, offset: 13492}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 429, col: 14, offset: 13501}, + expr: &choiceExpr{ + pos: position{line: 430, col: 9, offset: 13511}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonLongHandAttributes914, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes917, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes919, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes921, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonLongHandAttributes924, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes928, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes935, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes940, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes942, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonLongHandAttributes946, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes950, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes957, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes962, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes964, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonLongHandAttributes968, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes972, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 433, col: 12, offset: 13580}, + run: (*parser).callonLongHandAttributes978, + expr: &litMatcher{ + pos: position{line: 433, col: 12, offset: 13580}, + val: "\\\"", + ignoreCase: false, + want: "\"\\\\\\\"\"", + }, + }, + &litMatcher{ + pos: position{line: 436, col: 13, offset: 13682}, + val: "\"`", + ignoreCase: false, + want: "\"\\\"`\"", + }, + &litMatcher{ + pos: position{line: 436, col: 21, offset: 13690}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + &litMatcher{ + pos: position{line: 436, col: 29, offset: 13698}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + &actionExpr{ + pos: position{line: 436, col: 35, offset: 13704}, + run: (*parser).callonLongHandAttributes983, + expr: &litMatcher{ + pos: position{line: 436, col: 35, offset: 13704}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &actionExpr{ + pos: position{line: 439, col: 12, offset: 13887}, + run: (*parser).callonLongHandAttributes985, + expr: &oneOrMoreExpr{ + pos: position{line: 439, col: 12, offset: 13887}, + expr: &charClassMatcher{ + pos: position{line: 439, col: 12, offset: 13887}, + val: "[^\\r\\n\\\\\"` ]", + chars: []rune{'\r', '\n', '\\', '"', '`', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 420, col: 5, offset: 13263}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + &andExpr{ + pos: position{line: 420, col: 10, offset: 13268}, + expr: ¬Expr{ + pos: position{line: 420, col: 12, offset: 13270}, + expr: &seqExpr{ + pos: position{line: 420, col: 14, offset: 13272}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 420, col: 14, offset: 13272}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes993, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 420, col: 21, offset: 13279}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, }, }, }, }, - &andCodeExpr{ - pos: position{line: 621, col: 5, offset: 19577}, - run: (*parser).callonTagRanges70, + }, + }, + &actionExpr{ + pos: position{line: 335, col: 7, offset: 10294}, + run: (*parser).callonLongHandAttributes996, + expr: &seqExpr{ + pos: position{line: 335, col: 7, offset: 10294}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 335, col: 7, offset: 10294}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 335, col: 16, offset: 10303}, + expr: &choiceExpr{ + pos: position{line: 338, col: 9, offset: 10485}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 338, col: 10, offset: 10486}, + run: (*parser).callonLongHandAttributes1001, + expr: &oneOrMoreExpr{ + pos: position{line: 338, col: 10, offset: 10486}, + expr: &charClassMatcher{ + pos: position{line: 338, col: 10, offset: 10486}, + val: "[^,=.%# \\r\\n�{]]", + chars: []rune{',', '=', '.', '%', '#', ' ', '\r', '\n', '�', '{', ']'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonLongHandAttributes1004, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonLongHandAttributes1008, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes1012, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonLongHandAttributes1014, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonLongHandAttributes1017, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes1021, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes1028, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes1033, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes1035, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonLongHandAttributes1039, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes1043, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonLongHandAttributes1050, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonLongHandAttributes1055, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonLongHandAttributes1057, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonLongHandAttributes1061, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonLongHandAttributes1065, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 344, col: 12, offset: 10674}, + run: (*parser).callonLongHandAttributes1071, + expr: &litMatcher{ + pos: position{line: 344, col: 12, offset: 10674}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 347, col: 8, offset: 10757}, + expr: ¬Expr{ + pos: position{line: 347, col: 10, offset: 10759}, + expr: &seqExpr{ + pos: position{line: 347, col: 12, offset: 10761}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 347, col: 12, offset: 10761}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes1077, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 347, col: 19, offset: 10768}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, + }, + }, + }, }, }, }, @@ -11020,309 +13690,209 @@ var g = &grammar{ }, }, }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - { - name: "IncludedFileLine", - pos: position{line: 631, col: 1, offset: 19871}, - expr: &actionExpr{ - pos: position{line: 631, col: 21, offset: 19891}, - run: (*parser).callonIncludedFileLine1, - expr: &seqExpr{ - pos: position{line: 631, col: 21, offset: 19891}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 631, col: 21, offset: 19891}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 631, col: 29, offset: 19899}, - expr: &choiceExpr{ - pos: position{line: 631, col: 30, offset: 19900}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 635, col: 25, offset: 20072}, - run: (*parser).callonIncludedFileLine6, - expr: &seqExpr{ - pos: position{line: 635, col: 25, offset: 20072}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 635, col: 25, offset: 20072}, - val: "tag::", - ignoreCase: false, - want: "\"tag::\"", - }, - &labeledExpr{ - pos: position{line: 635, col: 33, offset: 20080}, - label: "tag", - expr: &actionExpr{ - pos: position{line: 635, col: 38, offset: 20085}, - run: (*parser).callonIncludedFileLine10, - expr: &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonIncludedFileLine11, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, + &zeroOrOneExpr{ + pos: position{line: 296, col: 8, offset: 9178}, + expr: &seqExpr{ + pos: position{line: 296, col: 9, offset: 9179}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 296, col: 9, offset: 9179}, + val: ",", + ignoreCase: false, + want: "\",\"", }, - }, - &litMatcher{ - pos: position{line: 635, col: 78, offset: 20125}, - val: "[]", - ignoreCase: false, - want: "\"[]\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 639, col: 23, offset: 20212}, - run: (*parser).callonIncludedFileLine15, - expr: &seqExpr{ - pos: position{line: 639, col: 23, offset: 20212}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 639, col: 23, offset: 20212}, - val: "end::", - ignoreCase: false, - want: "\"end::\"", - }, - &labeledExpr{ - pos: position{line: 639, col: 31, offset: 20220}, - label: "tag", - expr: &actionExpr{ - pos: position{line: 639, col: 36, offset: 20225}, - run: (*parser).callonIncludedFileLine19, + &zeroOrMoreExpr{ + pos: position{line: 296, col: 13, offset: 9183}, expr: &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonIncludedFileLine20, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLongHandAttributes1084, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, }, - &litMatcher{ - pos: position{line: 639, col: 76, offset: 20265}, - val: "[]", - ignoreCase: false, - want: "\"[]\"", - }, }, }, - }, - &actionExpr{ - pos: position{line: 631, col: 74, offset: 19944}, - run: (*parser).callonIncludedFileLine24, - expr: &anyMatcher{ - line: 631, col: 74, offset: 19944, + &andCodeExpr{ + pos: position{line: 297, col: 5, offset: 9197}, + run: (*parser).callonLongHandAttributes1086, }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 270, col: 5, offset: 8304}, + label: "otherAttributes", + expr: &zeroOrMoreExpr{ + pos: position{line: 270, col: 21, offset: 8320}, + expr: &choiceExpr{ + pos: position{line: 270, col: 22, offset: 8321}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 270, col: 22, offset: 8321}, + name: "PositionalAttribute", + }, + &ruleRefExpr{ + pos: position{line: 270, col: 44, offset: 8343}, + name: "NamedAttribute", + }, }, }, }, }, + &litMatcher{ + pos: position{line: 271, col: 5, offset: 8364}, + val: "]", + ignoreCase: false, + want: "\"]\"", + }, }, }, }, }, { - name: "ListParagraph", - pos: position{line: 646, col: 1, offset: 20429}, + name: "PositionalAttribute", + pos: position{line: 351, col: 1, offset: 10845}, expr: &choiceExpr{ - pos: position{line: 646, col: 18, offset: 20446}, + pos: position{line: 351, col: 24, offset: 10868}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 646, col: 18, offset: 20446}, - run: (*parser).callonListParagraph2, - expr: &labeledExpr{ - pos: position{line: 646, col: 18, offset: 20446}, - label: "comment", - expr: &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonListParagraph4, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, + pos: position{line: 352, col: 5, offset: 10874}, + run: (*parser).callonPositionalAttribute2, + expr: &seqExpr{ + pos: position{line: 352, col: 5, offset: 10874}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 352, col: 5, offset: 10874}, + label: "value", + expr: &ruleRefExpr{ + pos: position{line: 352, col: 12, offset: 10881}, + name: "AttributeRawValue", + }, + }, + &choiceExpr{ + pos: position{line: 352, col: 32, offset: 10901}, + alternatives: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 352, col: 32, offset: 10901}, expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 352, col: 33, offset: 10902}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + pos: position{line: 352, col: 33, offset: 10902}, + val: ",", ignoreCase: false, - want: "\"////\"", + want: "\",\"", }, &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraph12, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 352, col: 37, offset: 10906}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonPositionalAttribute11, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, }, }, }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", + &andExpr{ + pos: position{line: 352, col: 48, offset: 10917}, + expr: &litMatcher{ + pos: position{line: 352, col: 49, offset: 10918}, + val: "]", + ignoreCase: false, + want: "\"]\"", + }, }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonListParagraph21, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 357, col: 6, offset: 11155}, + run: (*parser).callonPositionalAttribute15, + expr: &seqExpr{ + pos: position{line: 357, col: 6, offset: 11155}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 357, col: 6, offset: 11155}, + label: "value", + expr: &seqExpr{ + pos: position{line: 357, col: 13, offset: 11162}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 357, col: 13, offset: 11162}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonPositionalAttribute20, expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &choiceExpr{ + pos: position{line: 357, col: 21, offset: 11170}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 357, col: 22, offset: 11171}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 357, col: 22, offset: 11171}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 357, col: 26, offset: 11175}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonPositionalAttribute26, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 357, col: 36, offset: 11185}, + expr: &litMatcher{ + pos: position{line: 357, col: 37, offset: 11186}, + val: "]", + ignoreCase: false, + want: "\"]\"", + }, }, }, }, }, }, }, - }, - }, - }, - &actionExpr{ - pos: position{line: 648, col: 9, offset: 20512}, - run: (*parser).callonListParagraph29, - expr: &labeledExpr{ - pos: position{line: 648, col: 9, offset: 20512}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 648, col: 15, offset: 20518}, - expr: &ruleRefExpr{ - pos: position{line: 648, col: 16, offset: 20519}, - name: "ListParagraphLine", + &andCodeExpr{ + pos: position{line: 358, col: 5, offset: 11196}, + run: (*parser).callonPositionalAttribute30, }, }, }, @@ -11331,85 +13901,58 @@ var g = &grammar{ }, }, { - name: "ListParagraphLine", - pos: position{line: 652, col: 1, offset: 20611}, + name: "NamedAttribute", + pos: position{line: 368, col: 1, offset: 11511}, expr: &actionExpr{ - pos: position{line: 652, col: 22, offset: 20632}, - run: (*parser).callonListParagraphLine1, + pos: position{line: 368, col: 19, offset: 11529}, + run: (*parser).callonNamedAttribute1, expr: &seqExpr{ - pos: position{line: 652, col: 22, offset: 20632}, + pos: position{line: 368, col: 19, offset: 11529}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 652, col: 22, offset: 20632}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - ¬Expr{ - pos: position{line: 653, col: 5, offset: 20641}, + &labeledExpr{ + pos: position{line: 368, col: 19, offset: 11529}, + label: "key", expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonListParagraphLine7, + pos: position{line: 373, col: 22, offset: 11840}, + run: (*parser).callonNamedAttribute4, expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, + pos: position{line: 373, col: 22, offset: 11840}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + pos: position{line: 373, col: 22, offset: 11840}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonNamedAttribute7, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine15, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + &oneOrMoreExpr{ + pos: position{line: 373, col: 29, offset: 11847}, + expr: &charClassMatcher{ + pos: position{line: 373, col: 29, offset: 11847}, + val: "[^\\r\\n=,]]", + chars: []rune{'\r', '\n', '=', ',', ']'}, + ignoreCase: false, + inverted: true, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + &zeroOrMoreExpr{ + pos: position{line: 373, col: 42, offset: 11860}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonNamedAttribute12, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + inverted: false, }, }, }, @@ -11417,1987 +13960,1805 @@ var g = &grammar{ }, }, }, - ¬Expr{ - pos: position{line: 654, col: 5, offset: 20656}, + &litMatcher{ + pos: position{line: 368, col: 43, offset: 11553}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 368, col: 47, offset: 11557}, expr: &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonListParagraphLine23, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine31, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonListParagraphLine40, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonNamedAttribute16, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 368, col: 54, offset: 11564}, + label: "value", + expr: &ruleRefExpr{ + pos: position{line: 368, col: 61, offset: 11571}, + name: "AttributeRawValue", + }, + }, + &zeroOrOneExpr{ + pos: position{line: 368, col: 80, offset: 11590}, + expr: &seqExpr{ + pos: position{line: 368, col: 81, offset: 11591}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 368, col: 81, offset: 11591}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 368, col: 85, offset: 11595}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonNamedAttribute24, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, - ¬Expr{ - pos: position{line: 655, col: 5, offset: 20679}, - expr: &actionExpr{ - pos: position{line: 701, col: 5, offset: 22141}, - run: (*parser).callonListParagraphLine49, - expr: &seqExpr{ - pos: position{line: 701, col: 5, offset: 22141}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 701, col: 5, offset: 22141}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + }, + }, + }, + }, + { + name: "AttributeRawValue", + pos: position{line: 377, col: 1, offset: 11930}, + expr: &actionExpr{ + pos: position{line: 378, col: 5, offset: 11956}, + run: (*parser).callonAttributeRawValue1, + expr: &seqExpr{ + pos: position{line: 378, col: 5, offset: 11956}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 378, col: 5, offset: 11956}, + label: "value", + expr: &choiceExpr{ + pos: position{line: 379, col: 9, offset: 11972}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 388, col: 5, offset: 12181}, + run: (*parser).callonAttributeRawValue5, + expr: &seqExpr{ + pos: position{line: 388, col: 5, offset: 12181}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 388, col: 5, offset: 12181}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + ¬Expr{ + pos: position{line: 388, col: 9, offset: 12185}, + expr: &litMatcher{ + pos: position{line: 388, col: 10, offset: 12186}, + val: "`", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine54, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + want: "\"`\"", }, }, - }, - }, - &labeledExpr{ - pos: position{line: 701, col: 12, offset: 22148}, - label: "prefix", - expr: &choiceExpr{ - pos: position{line: 703, col: 9, offset: 22211}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 703, col: 9, offset: 22211}, - run: (*parser).callonListParagraphLine58, - expr: &seqExpr{ - pos: position{line: 703, col: 9, offset: 22211}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 703, col: 9, offset: 22211}, - label: "depth", - expr: &actionExpr{ - pos: position{line: 703, col: 16, offset: 22218}, - run: (*parser).callonListParagraphLine61, - expr: &oneOrMoreExpr{ - pos: position{line: 703, col: 16, offset: 22218}, + &labeledExpr{ + pos: position{line: 389, col: 5, offset: 12265}, + label: "content", + expr: &actionExpr{ + pos: position{line: 400, col: 5, offset: 12528}, + run: (*parser).callonAttributeRawValue11, + expr: &labeledExpr{ + pos: position{line: 400, col: 5, offset: 12528}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 400, col: 14, offset: 12537}, + expr: &choiceExpr{ + pos: position{line: 401, col: 9, offset: 12547}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonAttributeRawValue15, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonAttributeRawValue18, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonAttributeRawValue20, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonAttributeRawValue22, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonAttributeRawValue25, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonAttributeRawValue29, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonAttributeRawValue36, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonAttributeRawValue41, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonAttributeRawValue43, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonAttributeRawValue47, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonAttributeRawValue51, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonAttributeRawValue58, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonAttributeRawValue63, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonAttributeRawValue65, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonAttributeRawValue69, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonAttributeRawValue73, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 404, col: 12, offset: 12616}, + run: (*parser).callonAttributeRawValue79, expr: &litMatcher{ - pos: position{line: 703, col: 17, offset: 22219}, - val: ".", + pos: position{line: 404, col: 12, offset: 12616}, + val: "\\'", ignoreCase: false, - want: "\".\"", + want: "\"\\\\'\"", + }, + }, + &litMatcher{ + pos: position{line: 407, col: 13, offset: 12718}, + val: "'`", + ignoreCase: false, + want: "\"'`\"", + }, + &litMatcher{ + pos: position{line: 407, col: 20, offset: 12725}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &actionExpr{ + pos: position{line: 407, col: 27, offset: 12732}, + run: (*parser).callonAttributeRawValue83, + expr: &litMatcher{ + pos: position{line: 407, col: 27, offset: 12732}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &actionExpr{ + pos: position{line: 410, col: 12, offset: 12892}, + run: (*parser).callonAttributeRawValue85, + expr: &oneOrMoreExpr{ + pos: position{line: 410, col: 12, offset: 12892}, + expr: &charClassMatcher{ + pos: position{line: 410, col: 12, offset: 12892}, + val: "[^\\r\\n\\\\\\ ]", + chars: []rune{'\r', '\n', '\\', '\'', ' '}, + ignoreCase: false, + inverted: true, + }, }, }, }, }, - &andCodeExpr{ - pos: position{line: 707, col: 9, offset: 22319}, - run: (*parser).callonListParagraphLine64, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 726, col: 11, offset: 23036}, - run: (*parser).callonListParagraphLine65, - expr: &seqExpr{ - pos: position{line: 726, col: 11, offset: 23036}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 726, col: 11, offset: 23036}, - expr: &charClassMatcher{ - pos: position{line: 726, col: 12, offset: 23037}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 726, col: 20, offset: 23045}, - val: ".", - ignoreCase: false, - want: "\".\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 728, col: 13, offset: 23156}, - run: (*parser).callonListParagraphLine70, - expr: &seqExpr{ - pos: position{line: 728, col: 13, offset: 23156}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 728, col: 14, offset: 23157}, - val: "[a-z]", - ranges: []rune{'a', 'z'}, - ignoreCase: false, - inverted: false, - }, - &litMatcher{ - pos: position{line: 728, col: 21, offset: 23164}, - val: ".", - ignoreCase: false, - want: "\".\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 730, col: 13, offset: 23278}, - run: (*parser).callonListParagraphLine74, - expr: &seqExpr{ - pos: position{line: 730, col: 13, offset: 23278}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 730, col: 14, offset: 23279}, - val: "[A-Z]", - ranges: []rune{'A', 'Z'}, - ignoreCase: false, - inverted: false, - }, - &litMatcher{ - pos: position{line: 730, col: 21, offset: 23286}, - val: ".", - ignoreCase: false, - want: "\".\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 732, col: 13, offset: 23400}, - run: (*parser).callonListParagraphLine78, - expr: &seqExpr{ - pos: position{line: 732, col: 13, offset: 23400}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 732, col: 13, offset: 23400}, - expr: &charClassMatcher{ - pos: position{line: 732, col: 14, offset: 23401}, - val: "[ivxdlcm]", - chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 732, col: 26, offset: 23413}, - val: ")", - ignoreCase: false, - want: "\")\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 734, col: 13, offset: 23527}, - run: (*parser).callonListParagraphLine83, - expr: &seqExpr{ - pos: position{line: 734, col: 13, offset: 23527}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 734, col: 13, offset: 23527}, - expr: &charClassMatcher{ - pos: position{line: 734, col: 14, offset: 23528}, - val: "[IVXDLCM]", - chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 734, col: 26, offset: 23540}, - val: ")", - ignoreCase: false, - want: "\")\"", - }, }, }, }, }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 736, col: 12, offset: 23653}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine91, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + &litMatcher{ + pos: position{line: 390, col: 5, offset: 12316}, + val: "'", + ignoreCase: false, + want: "\"'\"", }, }, }, }, - }, - }, - }, - ¬Expr{ - pos: position{line: 656, col: 5, offset: 20706}, - expr: &actionExpr{ - pos: position{line: 755, col: 5, offset: 24261}, - run: (*parser).callonListParagraphLine94, - expr: &seqExpr{ - pos: position{line: 755, col: 5, offset: 24261}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 755, col: 5, offset: 24261}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &actionExpr{ + pos: position{line: 418, col: 5, offset: 13127}, + run: (*parser).callonAttributeRawValue89, + expr: &seqExpr{ + pos: position{line: 418, col: 5, offset: 13127}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 418, col: 5, offset: 13127}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + ¬Expr{ + pos: position{line: 418, col: 10, offset: 13132}, + expr: &litMatcher{ + pos: position{line: 418, col: 11, offset: 13133}, + val: "`", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine99, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + want: "\"`\"", }, }, - }, - }, - &labeledExpr{ - pos: position{line: 755, col: 12, offset: 24268}, - label: "prefix", - expr: &choiceExpr{ - pos: position{line: 755, col: 20, offset: 24276}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 757, col: 9, offset: 24333}, - run: (*parser).callonListParagraphLine103, - expr: &seqExpr{ - pos: position{line: 757, col: 9, offset: 24333}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 757, col: 9, offset: 24333}, - label: "depth", - expr: &actionExpr{ - pos: position{line: 757, col: 16, offset: 24340}, - run: (*parser).callonListParagraphLine106, - expr: &oneOrMoreExpr{ - pos: position{line: 757, col: 16, offset: 24340}, - expr: &litMatcher{ - pos: position{line: 757, col: 17, offset: 24341}, - val: "*", + &labeledExpr{ + pos: position{line: 419, col: 5, offset: 13212}, + label: "content", + expr: &actionExpr{ + pos: position{line: 429, col: 5, offset: 13492}, + run: (*parser).callonAttributeRawValue95, + expr: &labeledExpr{ + pos: position{line: 429, col: 5, offset: 13492}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 429, col: 14, offset: 13501}, + expr: &choiceExpr{ + pos: position{line: 430, col: 9, offset: 13511}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonAttributeRawValue99, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonAttributeRawValue102, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\"*\"", + inverted: false, }, }, - }, - }, - &andCodeExpr{ - pos: position{line: 761, col: 9, offset: 24441}, - run: (*parser).callonListParagraphLine109, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonAttributeRawValue104, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonAttributeRawValue106, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonAttributeRawValue109, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonAttributeRawValue113, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonAttributeRawValue120, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonAttributeRawValue125, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonAttributeRawValue127, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonAttributeRawValue131, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonAttributeRawValue135, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonAttributeRawValue142, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonAttributeRawValue147, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonAttributeRawValue149, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonAttributeRawValue153, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonAttributeRawValue157, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 433, col: 12, offset: 13580}, + run: (*parser).callonAttributeRawValue163, + expr: &litMatcher{ + pos: position{line: 433, col: 12, offset: 13580}, + val: "\\\"", + ignoreCase: false, + want: "\"\\\\\\\"\"", + }, + }, + &litMatcher{ + pos: position{line: 436, col: 13, offset: 13682}, + val: "\"`", + ignoreCase: false, + want: "\"\\\"`\"", + }, + &litMatcher{ + pos: position{line: 436, col: 21, offset: 13690}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + &litMatcher{ + pos: position{line: 436, col: 29, offset: 13698}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + &actionExpr{ + pos: position{line: 436, col: 35, offset: 13704}, + run: (*parser).callonAttributeRawValue168, + expr: &litMatcher{ + pos: position{line: 436, col: 35, offset: 13704}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &actionExpr{ + pos: position{line: 439, col: 12, offset: 13887}, + run: (*parser).callonAttributeRawValue170, + expr: &oneOrMoreExpr{ + pos: position{line: 439, col: 12, offset: 13887}, + expr: &charClassMatcher{ + pos: position{line: 439, col: 12, offset: 13887}, + val: "[^\\r\\n\\\\\"` ]", + chars: []rune{'\r', '\n', '\\', '"', '`', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, }, }, }, }, - &labeledExpr{ - pos: position{line: 778, col: 14, offset: 25148}, - label: "depth", - expr: &actionExpr{ - pos: position{line: 778, col: 21, offset: 25155}, - run: (*parser).callonListParagraphLine111, - expr: &litMatcher{ - pos: position{line: 778, col: 22, offset: 25156}, - val: "-", - ignoreCase: false, - want: "\"-\"", - }, - }, - }, }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 780, col: 13, offset: 25242}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine116, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &litMatcher{ + pos: position{line: 420, col: 5, offset: 13263}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + &andExpr{ + pos: position{line: 420, col: 10, offset: 13268}, + expr: ¬Expr{ + pos: position{line: 420, col: 12, offset: 13270}, + expr: &seqExpr{ + pos: position{line: 420, col: 14, offset: 13272}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 420, col: 14, offset: 13272}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonAttributeRawValue178, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 420, col: 21, offset: 13279}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, }, }, }, }, }, }, + &ruleRefExpr{ + pos: position{line: 381, col: 11, offset: 12054}, + name: "UnquotedAttributeRawValue", + }, }, }, }, - ¬Expr{ - pos: position{line: 657, col: 5, offset: 20735}, - expr: &actionExpr{ - pos: position{line: 1623, col: 26, offset: 58130}, - run: (*parser).callonListParagraphLine119, + &andExpr{ + pos: position{line: 383, col: 5, offset: 12091}, + expr: ¬Expr{ + pos: position{line: 383, col: 7, offset: 12093}, expr: &seqExpr{ - pos: position{line: 1623, col: 26, offset: 58130}, + pos: position{line: 383, col: 9, offset: 12095}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1623, col: 26, offset: 58130}, - val: "<", - ignoreCase: false, - want: "\"<\"", - }, - &labeledExpr{ - pos: position{line: 1623, col: 30, offset: 58134}, - label: "ref", + &zeroOrMoreExpr{ + pos: position{line: 383, col: 9, offset: 12095}, expr: &actionExpr{ - pos: position{line: 1623, col: 35, offset: 58139}, - run: (*parser).callonListParagraphLine123, - expr: &oneOrMoreExpr{ - pos: position{line: 1623, col: 35, offset: 58139}, - expr: &charClassMatcher{ - pos: position{line: 1623, col: 35, offset: 58139}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonAttributeRawValue186, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, &litMatcher{ - pos: position{line: 1623, col: 83, offset: 58187}, - val: ">", + pos: position{line: 383, col: 16, offset: 12102}, + val: "=", ignoreCase: false, - want: "\">\"", - }, - &oneOrMoreExpr{ - pos: position{line: 1623, col: 87, offset: 58191}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine130, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + want: "\"=\"", }, }, }, }, }, + }, + }, + }, + }, + { + name: "UnquotedAttributeRawValue", + pos: position{line: 447, col: 1, offset: 14161}, + expr: &actionExpr{ + pos: position{line: 450, col: 5, offset: 14348}, + run: (*parser).callonUnquotedAttributeRawValue1, + expr: &seqExpr{ + pos: position{line: 450, col: 5, offset: 14348}, + exprs: []interface{}{ ¬Expr{ - pos: position{line: 658, col: 5, offset: 20762}, - expr: &seqExpr{ - pos: position{line: 668, col: 25, offset: 21042}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 668, col: 25, offset: 21042}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 668, col: 29, offset: 21046}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine138, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, + pos: position{line: 450, col: 5, offset: 14348}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonUnquotedAttributeRawValue4, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, - ¬Expr{ - pos: position{line: 659, col: 5, offset: 20788}, - expr: &ruleRefExpr{ - pos: position{line: 659, col: 6, offset: 20789}, - name: "BlockAttributes", - }, - }, - ¬Expr{ - pos: position{line: 660, col: 5, offset: 20809}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &labeledExpr{ + pos: position{line: 451, col: 5, offset: 14417}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 451, col: 14, offset: 14426}, + expr: &choiceExpr{ + pos: position{line: 452, col: 9, offset: 14436}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 452, col: 10, offset: 14437}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 452, col: 10, offset: 14437}, + val: "[", ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine156, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + want: "\"[\"", }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine168, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + &ruleRefExpr{ + pos: position{line: 452, col: 14, offset: 14441}, + name: "UnquotedAttributeRawValue", }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &litMatcher{ + pos: position{line: 452, col: 40, offset: 14467}, + val: "]", + ignoreCase: false, + want: "\"]\"", }, }, }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine180, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonUnquotedAttributeRawValue13, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"�\"", }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine192, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonUnquotedAttributeRawValue17, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"�\"", }, }, }, }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine204, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonUnquotedAttributeRawValue21, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonUnquotedAttributeRawValue23, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine216, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine228, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 661, col: 5, offset: 20829}, - expr: &seqExpr{ - pos: position{line: 803, col: 26, offset: 26148}, - exprs: []interface{}{ - &actionExpr{ - pos: position{line: 806, col: 32, offset: 26286}, - run: (*parser).callonListParagraphLine237, - expr: &labeledExpr{ - pos: position{line: 806, col: 32, offset: 26286}, - label: "content", - expr: &actionExpr{ - pos: position{line: 806, col: 42, offset: 26296}, - run: (*parser).callonListParagraphLine239, - expr: &oneOrMoreExpr{ - pos: position{line: 806, col: 42, offset: 26296}, - expr: &choiceExpr{ - pos: position{line: 805, col: 33, offset: 26234}, - alternatives: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 805, col: 33, offset: 26234}, - expr: &charClassMatcher{ - pos: position{line: 805, col: 33, offset: 26234}, - val: "[^:\\r\\n]", - chars: []rune{':', '\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - &seqExpr{ - pos: position{line: 805, col: 45, offset: 26246}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 805, col: 45, offset: 26246}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - ¬Expr{ - pos: position{line: 805, col: 49, offset: 26250}, - expr: &litMatcher{ - pos: position{line: 805, col: 50, offset: 26251}, - val: ":", - ignoreCase: false, - want: "\":\"", + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonUnquotedAttributeRawValue26, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonUnquotedAttributeRawValue30, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonUnquotedAttributeRawValue37, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonUnquotedAttributeRawValue42, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonUnquotedAttributeRawValue44, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 838, col: 5, offset: 27176}, - run: (*parser).callonListParagraphLine248, - expr: &seqExpr{ - pos: position{line: 838, col: 5, offset: 27176}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 838, col: 5, offset: 27176}, - label: "separator", - expr: &actionExpr{ - pos: position{line: 838, col: 16, offset: 27187}, - run: (*parser).callonListParagraphLine251, - expr: &oneOrMoreExpr{ - pos: position{line: 838, col: 16, offset: 27187}, - expr: &litMatcher{ - pos: position{line: 838, col: 17, offset: 27188}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 841, col: 5, offset: 27246}, - run: (*parser).callonListParagraphLine254, - }, - &choiceExpr{ - pos: position{line: 845, col: 6, offset: 27422}, - alternatives: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 845, col: 6, offset: 27422}, - expr: &choiceExpr{ - pos: position{line: 845, col: 7, offset: 27423}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine259, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonUnquotedAttributeRawValue48, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonUnquotedAttributeRawValue52, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonUnquotedAttributeRawValue59, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonUnquotedAttributeRawValue64, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonUnquotedAttributeRawValue66, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonUnquotedAttributeRawValue70, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonUnquotedAttributeRawValue74, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, }, }, }, }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, }, }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 662, col: 5, offset: 20857}, - label: "line", - expr: &actionExpr{ - pos: position{line: 662, col: 11, offset: 20863}, - run: (*parser).callonListParagraphLine268, - expr: &seqExpr{ - pos: position{line: 662, col: 11, offset: 20863}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 662, col: 11, offset: 20863}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine273, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + &actionExpr{ + pos: position{line: 455, col: 12, offset: 14575}, + run: (*parser).callonUnquotedAttributeRawValue80, + expr: &oneOrMoreExpr{ + pos: position{line: 455, col: 12, offset: 14575}, + expr: &charClassMatcher{ + pos: position{line: 455, col: 12, offset: 14575}, + val: "[^=,\\r\\n�] ]", + chars: []rune{'=', ',', '\r', '\n', '�', ']', ' '}, + ignoreCase: false, + inverted: true, }, }, }, - &labeledExpr{ - pos: position{line: 662, col: 18, offset: 20870}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 662, col: 27, offset: 20879}, - expr: &ruleRefExpr{ - pos: position{line: 662, col: 28, offset: 20880}, - name: "InlineElement", - }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonUnquotedAttributeRawValue83, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, }, }, }, }, { - name: "ContinuedListItemElement", - pos: position{line: 670, col: 1, offset: 21125}, - expr: &actionExpr{ - pos: position{line: 670, col: 29, offset: 21153}, - run: (*parser).callonContinuedListItemElement1, - expr: &seqExpr{ - pos: position{line: 670, col: 29, offset: 21153}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 668, col: 25, offset: 21042}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 668, col: 29, offset: 21046}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + name: "CrossReference", + pos: position{line: 533, col: 1, offset: 17317}, + expr: &choiceExpr{ + pos: position{line: 533, col: 19, offset: 17335}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonCrossReference2, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonCrossReference6, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemElement7, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonCrossReference10, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", ignoreCase: false, - inverted: false, - }, - }, - }, - &labeledExpr{ - pos: position{line: 670, col: 50, offset: 21174}, - label: "element", - expr: &ruleRefExpr{ - pos: position{line: 670, col: 58, offset: 21182}, - name: "ContinuedListItemContent", - }, - }, - }, - }, - }, - }, - { - name: "ContinuedListItemContent", - pos: position{line: 674, col: 1, offset: 21288}, - expr: &actionExpr{ - pos: position{line: 674, col: 29, offset: 21316}, - run: (*parser).callonContinuedListItemContent1, - expr: &seqExpr{ - pos: position{line: 674, col: 29, offset: 21316}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 674, col: 29, offset: 21316}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + want: "\",\"", }, - }, - }, - &labeledExpr{ - pos: position{line: 675, col: 5, offset: 21326}, - label: "content", - expr: &choiceExpr{ - pos: position{line: 675, col: 14, offset: 21335}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 675, col: 14, offset: 21335}, - name: "DelimitedBlock", - }, - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonContinuedListItemContent9, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonCrossReference16, expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 546, col: 6, offset: 17855}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"////\"", + inverted: false, }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent17, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonContinuedListItemContent26, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 677, col: 11, offset: 21388}, - name: "Table", - }, - &ruleRefExpr{ - pos: position{line: 678, col: 11, offset: 21404}, - name: "ImageBlock", - }, - &actionExpr{ - pos: position{line: 1632, col: 18, offset: 58455}, - run: (*parser).callonContinuedListItemContent36, - expr: &seqExpr{ - pos: position{line: 1632, col: 18, offset: 58455}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 1632, col: 19, offset: 58456}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 1632, col: 19, offset: 58456}, - val: "***", - ignoreCase: false, - want: "\"***\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 27, offset: 58464}, - val: "* * *", - ignoreCase: false, - want: "\"* * *\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 37, offset: 58474}, - val: "---", - ignoreCase: false, - want: "\"---\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 45, offset: 58482}, - val: "- - -", - ignoreCase: false, - want: "\"- - -\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 55, offset: 58492}, - val: "___", - ignoreCase: false, - want: "\"___\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 63, offset: 58500}, - val: "_ _ _", - ignoreCase: false, - want: "\"_ _ _\"", - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 680, col: 11, offset: 21449}, - name: "OrderedListItem", - }, - &ruleRefExpr{ - pos: position{line: 681, col: 11, offset: 21476}, - name: "UnorderedListItem", - }, - &ruleRefExpr{ - pos: position{line: 682, col: 11, offset: 21505}, - name: "LabeledListItem", - }, - &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonContinuedListItemContent53, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent61, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonCrossReference21, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonCrossReference23, }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - run: (*parser).callonContinuedListItemContent68, - expr: &seqExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - run: (*parser).callonContinuedListItemContent70, - }, - &labeledExpr{ - pos: position{line: 2120, col: 5, offset: 75117}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 2120, col: 11, offset: 75123}, - expr: &actionExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - run: (*parser).callonContinuedListItemContent73, - expr: &seqExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2128, col: 25, offset: 75365}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonContinuedListItemContent76, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonCrossReference26, expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, + pos: position{line: 507, col: 25, offset: 16392}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent84, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonCrossReference30, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonCrossReference37, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonCrossReference42, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonCrossReference44, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, - }, - &labeledExpr{ - pos: position{line: 2128, col: 36, offset: 75376}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - run: (*parser).callonContinuedListItemContent92, - expr: &oneOrMoreExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - expr: &charClassMatcher{ - pos: position{line: 2128, col: 45, offset: 75385}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2080, col: 31, offset: 73460}, - run: (*parser).callonContinuedListItemContent100, - expr: &labeledExpr{ - pos: position{line: 2080, col: 31, offset: 73460}, - label: "lines", - expr: &actionExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - run: (*parser).callonContinuedListItemContent102, - expr: &seqExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - label: "firstLine", - expr: &actionExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - run: (*parser).callonContinuedListItemContent105, - expr: &seqExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - label: "line", - expr: &actionExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - run: (*parser).callonContinuedListItemContent108, - expr: &seqExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonCrossReference48, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonCrossReference52, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent113, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, }, - &oneOrMoreExpr{ - pos: position{line: 2091, col: 48, offset: 73971}, - expr: &charClassMatcher{ - pos: position{line: 2091, col: 48, offset: 73971}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2087, col: 5, offset: 73803}, - label: "otherLines", - expr: &zeroOrMoreExpr{ - pos: position{line: 2087, col: 16, offset: 73814}, - expr: &actionExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - run: (*parser).callonContinuedListItemContent124, - expr: &seqExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2128, col: 25, offset: 75365}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonContinuedListItemContent127, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonCrossReference59, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", ignoreCase: false, - want: "\" \"", + want: "\":\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent135, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonCrossReference64, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonCrossReference66, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonCrossReference70, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonCrossReference74, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, - }, - }, - &labeledExpr{ - pos: position{line: 2128, col: 36, offset: 75376}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - run: (*parser).callonContinuedListItemContent143, - expr: &oneOrMoreExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - expr: &charClassMatcher{ - pos: position{line: 2128, col: 45, offset: 75385}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"}\"", }, }, }, @@ -13408,416 +15769,238 @@ var g = &grammar{ }, }, }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonCrossReference80, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, }, }, }, - &actionExpr{ - pos: position{line: 2098, col: 39, offset: 74215}, - run: (*parser).callonContinuedListItemContent151, - expr: &seqExpr{ - pos: position{line: 2098, col: 39, offset: 74215}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2098, col: 61, offset: 74237}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent157, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2098, col: 76, offset: 74252}, - label: "lines", - expr: &actionExpr{ - pos: position{line: 2103, col: 44, offset: 74559}, - run: (*parser).callonContinuedListItemContent163, - expr: &labeledExpr{ - pos: position{line: 2103, col: 44, offset: 74559}, - label: "lines", - expr: &zeroOrMoreExpr{ - pos: position{line: 2103, col: 50, offset: 74565}, - expr: &actionExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - run: (*parser).callonContinuedListItemContent166, - expr: &seqExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - label: "line", - expr: &actionExpr{ - pos: position{line: 2108, col: 11, offset: 74711}, - run: (*parser).callonContinuedListItemContent169, - expr: &seqExpr{ - pos: position{line: 2108, col: 11, offset: 74711}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2108, col: 11, offset: 74711}, - expr: &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2108, col: 34, offset: 74734}, - expr: &charClassMatcher{ - pos: position{line: 2108, col: 34, offset: 74734}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2098, col: 125, offset: 74301}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 2098, col: 126, offset: 74302}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2098, col: 148, offset: 74324}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent186, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, + }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonCrossReference83, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonCrossReference87, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, }, }, }, - &actionExpr{ - pos: position{line: 182, col: 25, offset: 5755}, - run: (*parser).callonContinuedListItemContent195, - expr: &seqExpr{ - pos: position{line: 182, col: 25, offset: 5755}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 182, col: 25, offset: 5755}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 182, col: 29, offset: 5759}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonContinuedListItemContent199, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 182, col: 50, offset: 5780}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 183, col: 9, offset: 5793}, - label: "value", - expr: &zeroOrOneExpr{ - pos: position{line: 183, col: 15, offset: 5799}, - expr: &actionExpr{ - pos: position{line: 194, col: 30, offset: 6206}, - run: (*parser).callonContinuedListItemContent207, - expr: &seqExpr{ - pos: position{line: 194, col: 30, offset: 6206}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 194, col: 30, offset: 6206}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent212, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 533, col: 44, offset: 17360}, + name: "ExternalCrossReference", + }, + }, + }, + }, + { + name: "ExternalCrossReference", + pos: position{line: 541, col: 1, offset: 17620}, + expr: &actionExpr{ + pos: position{line: 541, col: 27, offset: 17646}, + run: (*parser).callonExternalCrossReference1, + expr: &seqExpr{ + pos: position{line: 541, col: 27, offset: 17646}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 541, col: 27, offset: 17646}, + val: "xref:", + ignoreCase: false, + want: "\"xref:\"", + }, + &labeledExpr{ + pos: position{line: 541, col: 35, offset: 17654}, + label: "url", + expr: &actionExpr{ + pos: position{line: 2909, col: 17, offset: 96362}, + run: (*parser).callonExternalCrossReference5, + expr: &labeledExpr{ + pos: position{line: 2909, col: 17, offset: 96362}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 2909, col: 22, offset: 96367}, + expr: &choiceExpr{ + pos: position{line: 2909, col: 23, offset: 96368}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2921, col: 13, offset: 96772}, + run: (*parser).callonExternalCrossReference9, + expr: &labeledExpr{ + pos: position{line: 2921, col: 13, offset: 96772}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2921, col: 22, offset: 96781}, + expr: &choiceExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + run: (*parser).callonExternalCrossReference13, + expr: &oneOrMoreExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + expr: &charClassMatcher{ + pos: position{line: 2922, col: 6, offset: 96788}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, + ignoreCase: false, + inverted: true, }, }, }, - &labeledExpr{ - pos: position{line: 194, col: 37, offset: 6213}, - label: "elements", - expr: &zeroOrMoreExpr{ - pos: position{line: 194, col: 46, offset: 6222}, - expr: &choiceExpr{ - pos: position{line: 195, col: 5, offset: 6228}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 195, col: 6, offset: 6229}, - run: (*parser).callonContinuedListItemContent217, - expr: &oneOrMoreExpr{ - pos: position{line: 195, col: 6, offset: 6229}, - expr: &charClassMatcher{ - pos: position{line: 195, col: 6, offset: 6229}, - val: "[^\\r\\n{]", - chars: []rune{'\r', '\n', '{'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - &actionExpr{ - pos: position{line: 221, col: 25, offset: 7126}, - run: (*parser).callonContinuedListItemContent220, - expr: &seqExpr{ - pos: position{line: 221, col: 25, offset: 7126}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 221, col: 25, offset: 7126}, - val: "{counter:", - ignoreCase: false, - want: "\"{counter:\"", - }, - &labeledExpr{ - pos: position{line: 221, col: 37, offset: 7138}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonContinuedListItemContent224, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonExternalCrossReference16, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonExternalCrossReference18, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonExternalCrossReference21, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonExternalCrossReference25, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, - }, - }, - &labeledExpr{ - pos: position{line: 221, col: 56, offset: 7157}, - label: "start", - expr: &zeroOrOneExpr{ - pos: position{line: 221, col: 62, offset: 7163}, - expr: &actionExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - run: (*parser).callonContinuedListItemContent231, - expr: &seqExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 229, col: 21, offset: 7430}, - label: "start", - expr: &choiceExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - run: (*parser).callonContinuedListItemContent236, - expr: &charClassMatcher{ - pos: position{line: 229, col: 28, offset: 7437}, - val: "[A-Za-z]", - ranges: []rune{'A', 'Z', 'a', 'z'}, - ignoreCase: false, - inverted: false, - }, - }, - &actionExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - run: (*parser).callonContinuedListItemContent238, - expr: &oneOrMoreExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - expr: &charClassMatcher{ - pos: position{line: 231, col: 9, offset: 7491}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonExternalCrossReference32, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonExternalCrossReference37, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonExternalCrossReference39, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, @@ -13827,108 +16010,108 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, - &litMatcher{ - pos: position{line: 221, col: 78, offset: 7179}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, }, - }, - }, - &actionExpr{ - pos: position{line: 225, col: 25, offset: 7281}, - run: (*parser).callonContinuedListItemContent242, - expr: &seqExpr{ - pos: position{line: 225, col: 25, offset: 7281}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 225, col: 25, offset: 7281}, - val: "{counter2:", - ignoreCase: false, - want: "\"{counter2:\"", - }, - &labeledExpr{ - pos: position{line: 225, col: 38, offset: 7294}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonContinuedListItemContent246, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonExternalCrossReference43, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonExternalCrossReference47, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, - }, - }, - &labeledExpr{ - pos: position{line: 225, col: 57, offset: 7313}, - label: "start", - expr: &zeroOrOneExpr{ - pos: position{line: 225, col: 63, offset: 7319}, - expr: &actionExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - run: (*parser).callonContinuedListItemContent253, - expr: &seqExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 229, col: 21, offset: 7430}, - label: "start", - expr: &choiceExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - run: (*parser).callonContinuedListItemContent258, - expr: &charClassMatcher{ - pos: position{line: 229, col: 28, offset: 7437}, - val: "[A-Za-z]", - ranges: []rune{'A', 'Z', 'a', 'z'}, - ignoreCase: false, - inverted: false, - }, - }, - &actionExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - run: (*parser).callonContinuedListItemContent260, - expr: &oneOrMoreExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - expr: &charClassMatcher{ - pos: position{line: 231, col: 9, offset: 7491}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonExternalCrossReference54, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonExternalCrossReference59, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonExternalCrossReference61, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, @@ -13938,1290 +16121,1214 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, - &litMatcher{ - pos: position{line: 225, col: 79, offset: 7335}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, }, - }, - }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonContinuedListItemContent264, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonContinuedListItemContent268, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonExternalCrossReference65, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonExternalCrossReference69, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, }, }, }, - &actionExpr{ - pos: position{line: 199, col: 6, offset: 6337}, - run: (*parser).callonContinuedListItemContent274, - expr: &litMatcher{ - pos: position{line: 199, col: 6, offset: 6337}, - val: "{", - ignoreCase: false, - want: "\"{\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonExternalCrossReference75, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonExternalCrossReference77, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonExternalCrossReference80, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonExternalCrossReference82, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonExternalCrossReference86, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExternalCrossReference90, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonExternalCrossReference96, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonExternalCrossReference101, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonExternalCrossReference103, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonExternalCrossReference106, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonExternalCrossReference110, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonExternalCrossReference117, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonExternalCrossReference122, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonExternalCrossReference124, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonExternalCrossReference128, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonExternalCrossReference132, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonExternalCrossReference139, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonExternalCrossReference144, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonExternalCrossReference146, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonExternalCrossReference150, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonExternalCrossReference154, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonExternalCrossReference160, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonExternalCrossReference163, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonExternalCrossReference167, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonExternalCrossReference171, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, }, }, + &actionExpr{ + pos: position{line: 2928, col: 7, offset: 97012}, + run: (*parser).callonExternalCrossReference173, + expr: &litMatcher{ + pos: position{line: 2928, col: 7, offset: 97012}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonExternalCrossReference175, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 206, col: 19, offset: 6522}, - run: (*parser).callonContinuedListItemContent281, - expr: &seqExpr{ - pos: position{line: 206, col: 19, offset: 6522}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 206, col: 19, offset: 6522}, - val: ":!", - ignoreCase: false, - want: "\":!\"", - }, - &labeledExpr{ - pos: position{line: 206, col: 24, offset: 6527}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonContinuedListItemContent285, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonExternalCrossReference179, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, - }, - }, - }, - &litMatcher{ - pos: position{line: 206, col: 45, offset: 6548}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 206, col: 49, offset: 6552}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent294, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + want: "\"�\"", }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 541, col: 54, offset: 17673}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 541, col: 72, offset: 17691}, + name: "InlineAttributes", + }, + }, + }, + }, + }, + }, + { + name: "DelimitedBlock", + pos: position{line: 559, col: 1, offset: 18362}, + expr: &choiceExpr{ + pos: position{line: 560, col: 5, offset: 18384}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 613, col: 5, offset: 19612}, + run: (*parser).callonDelimitedBlock2, + expr: &seqExpr{ + pos: position{line: 613, col: 5, offset: 19612}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 613, col: 5, offset: 19612}, + run: (*parser).callonDelimitedBlock4, + }, + &litMatcher{ + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDelimitedBlock7, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDelimitedBlock10, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, - &actionExpr{ - pos: position{line: 208, col: 5, offset: 6619}, - run: (*parser).callonContinuedListItemContent301, - expr: &seqExpr{ - pos: position{line: 208, col: 5, offset: 6619}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 208, col: 5, offset: 6619}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 208, col: 9, offset: 6623}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonContinuedListItemContent305, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + }, + &andCodeExpr{ + pos: position{line: 618, col: 5, offset: 19795}, + run: (*parser).callonDelimitedBlock17, + }, + &labeledExpr{ + pos: position{line: 623, col: 5, offset: 19996}, + label: "content", + expr: &zeroOrMoreExpr{ + pos: position{line: 634, col: 5, offset: 20320}, + expr: &actionExpr{ + pos: position{line: 634, col: 6, offset: 20321}, + run: (*parser).callonDelimitedBlock20, + expr: &seqExpr{ + pos: position{line: 634, col: 6, offset: 20321}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 634, col: 6, offset: 20321}, + expr: &choiceExpr{ + pos: position{line: 631, col: 29, offset: 20263}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 585, col: 26, offset: 18950}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDelimitedBlock27, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDelimitedBlock30, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - }, - &litMatcher{ - pos: position{line: 208, col: 30, offset: 6644}, - val: "!:", - ignoreCase: false, - want: "\"!:\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 208, col: 35, offset: 6649}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent314, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 635, col: 5, offset: 20351}, + label: "line", + expr: &actionExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + run: (*parser).callonDelimitedBlock40, + expr: &seqExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 602, col: 5, offset: 19307}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &labeledExpr{ + pos: position{line: 603, col: 5, offset: 19380}, + label: "content", + expr: &actionExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + run: (*parser).callonDelimitedBlock46, + expr: &zeroOrMoreExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + expr: &charClassMatcher{ + pos: position{line: 603, col: 14, offset: 19389}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDelimitedBlock50, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, }, }, }, - &seqExpr{ - pos: position{line: 519, col: 31, offset: 16527}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 519, col: 31, offset: 16527}, - val: "toc::[]", - ignoreCase: false, - want: "\"toc::[]\"", - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + }, + &zeroOrOneExpr{ + pos: position{line: 624, col: 5, offset: 20030}, + expr: &choiceExpr{ + pos: position{line: 631, col: 29, offset: 20263}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 585, col: 26, offset: 18950}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", ignoreCase: false, - inverted: false, + want: "\"////\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDelimitedBlock62, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 688, col: 11, offset: 21702}, - name: "UserMacroBlock", - }, - &actionExpr{ - pos: position{line: 942, col: 5, offset: 30713}, - run: (*parser).callonContinuedListItemContent329, - expr: &seqExpr{ - pos: position{line: 942, col: 5, offset: 30713}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 942, col: 5, offset: 30713}, - label: "t", - expr: &choiceExpr{ - pos: position{line: 856, col: 19, offset: 27732}, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 856, col: 19, offset: 27732}, - run: (*parser).callonContinuedListItemContent333, - expr: &litMatcher{ - pos: position{line: 856, col: 19, offset: 27732}, - val: "TIP", - ignoreCase: false, - want: "\"TIP\"", - }, - }, - &actionExpr{ - pos: position{line: 858, col: 5, offset: 27770}, - run: (*parser).callonContinuedListItemContent335, - expr: &litMatcher{ - pos: position{line: 858, col: 5, offset: 27770}, - val: "NOTE", - ignoreCase: false, - want: "\"NOTE\"", + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDelimitedBlock65, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, - &actionExpr{ - pos: position{line: 860, col: 5, offset: 27810}, - run: (*parser).callonContinuedListItemContent337, - expr: &litMatcher{ - pos: position{line: 860, col: 5, offset: 27810}, - val: "IMPORTANT", - ignoreCase: false, - want: "\"IMPORTANT\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, - &actionExpr{ - pos: position{line: 862, col: 5, offset: 27860}, - run: (*parser).callonContinuedListItemContent339, - expr: &litMatcher{ - pos: position{line: 862, col: 5, offset: 27860}, - val: "WARNING", - ignoreCase: false, - want: "\"WARNING\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 561, col: 7, offset: 18403}, + name: "ExampleBlock", + }, + &ruleRefExpr{ + pos: position{line: 562, col: 7, offset: 18422}, + name: "FencedBlock", + }, + &ruleRefExpr{ + pos: position{line: 563, col: 7, offset: 18440}, + name: "ListingBlock", + }, + &ruleRefExpr{ + pos: position{line: 564, col: 7, offset: 18459}, + name: "LiteralBlock", + }, + &actionExpr{ + pos: position{line: 763, col: 5, offset: 24142}, + run: (*parser).callonDelimitedBlock78, + expr: &seqExpr{ + pos: position{line: 763, col: 5, offset: 24142}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 763, col: 5, offset: 24142}, + label: "firstLine", + expr: &actionExpr{ + pos: position{line: 770, col: 5, offset: 24401}, + run: (*parser).callonDelimitedBlock81, + expr: &seqExpr{ + pos: position{line: 770, col: 5, offset: 24401}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 770, col: 5, offset: 24401}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonDelimitedBlock84, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, - }, - &actionExpr{ - pos: position{line: 864, col: 5, offset: 27906}, - run: (*parser).callonContinuedListItemContent341, - expr: &litMatcher{ - pos: position{line: 864, col: 5, offset: 27906}, - val: "CAUTION", - ignoreCase: false, - want: "\"CAUTION\"", + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDelimitedBlock90, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDelimitedBlock93, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, }, }, }, }, }, &litMatcher{ - pos: position{line: 942, col: 24, offset: 30732}, - val: ": ", + pos: position{line: 771, col: 5, offset: 24416}, + val: "> ", ignoreCase: false, - want: "\": \"", + want: "\"> \"", }, &labeledExpr{ - pos: position{line: 942, col: 29, offset: 30737}, - label: "lines", + pos: position{line: 772, col: 5, offset: 24426}, + label: "content", expr: &actionExpr{ - pos: position{line: 950, col: 31, offset: 31112}, - run: (*parser).callonContinuedListItemContent345, - expr: &seqExpr{ - pos: position{line: 950, col: 31, offset: 31112}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 950, col: 31, offset: 31112}, - label: "firstLine", - expr: &actionExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - run: (*parser).callonContinuedListItemContent348, - expr: &seqExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - label: "content", - expr: &actionExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - run: (*parser).callonContinuedListItemContent351, - expr: &seqExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - label: "elements", - expr: &choiceExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonContinuedListItemContent355, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonContinuedListItemContent364, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 929, col: 28, offset: 30362}, - expr: &charClassMatcher{ - pos: position{line: 929, col: 28, offset: 30362}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, + pos: position{line: 772, col: 14, offset: 24435}, + run: (*parser).callonDelimitedBlock102, + expr: &oneOrMoreExpr{ + pos: position{line: 772, col: 15, offset: 24436}, + expr: &charClassMatcher{ + pos: position{line: 772, col: 15, offset: 24436}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDelimitedBlock106, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 764, col: 5, offset: 24179}, + label: "otherLines", + expr: &zeroOrMoreExpr{ + pos: position{line: 764, col: 16, offset: 24190}, + expr: &choiceExpr{ + pos: position{line: 764, col: 17, offset: 24191}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 770, col: 5, offset: 24401}, + run: (*parser).callonDelimitedBlock116, + expr: &seqExpr{ + pos: position{line: 770, col: 5, offset: 24401}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 770, col: 5, offset: 24401}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonDelimitedBlock119, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDelimitedBlock125, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 950, col: 65, offset: 31146}, - label: "otherLines", - expr: &zeroOrMoreExpr{ - pos: position{line: 950, col: 76, offset: 31157}, - expr: &actionExpr{ - pos: position{line: 950, col: 77, offset: 31158}, - run: (*parser).callonContinuedListItemContent382, - expr: &seqExpr{ - pos: position{line: 950, col: 77, offset: 31158}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 950, col: 77, offset: 31158}, - expr: &seqExpr{ - pos: position{line: 668, col: 25, offset: 21042}, - exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDelimitedBlock128, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 668, col: 25, offset: 21042}, - val: "+", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\"+\"", + want: "\"\\n\"", }, - &zeroOrMoreExpr{ - pos: position{line: 668, col: 29, offset: 21046}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent390, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &labeledExpr{ - pos: position{line: 950, col: 99, offset: 31180}, - label: "line", - expr: &choiceExpr{ - pos: position{line: 950, col: 105, offset: 31186}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonContinuedListItemContent397, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent405, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonContinuedListItemContent414, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonContinuedListItemContent422, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent435, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent447, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent459, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent471, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent483, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent495, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent507, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonContinuedListItemContent515, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonContinuedListItemContent523, - }, - }, - }, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -15230,875 +17337,135 @@ var g = &grammar{ }, }, }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 946, col: 5, offset: 30952}, - run: (*parser).callonContinuedListItemContent524, - expr: &labeledExpr{ - pos: position{line: 946, col: 5, offset: 30952}, - label: "lines", - expr: &actionExpr{ - pos: position{line: 950, col: 31, offset: 31112}, - run: (*parser).callonContinuedListItemContent526, - expr: &seqExpr{ - pos: position{line: 950, col: 31, offset: 31112}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 950, col: 31, offset: 31112}, - label: "firstLine", - expr: &actionExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - run: (*parser).callonContinuedListItemContent529, - expr: &seqExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - label: "content", - expr: &actionExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - run: (*parser).callonContinuedListItemContent532, - expr: &seqExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - label: "elements", - expr: &choiceExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonContinuedListItemContent536, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonContinuedListItemContent545, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 929, col: 28, offset: 30362}, - expr: &charClassMatcher{ - pos: position{line: 929, col: 28, offset: 30362}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 771, col: 5, offset: 24416}, + val: "> ", + ignoreCase: false, + want: "\"> \"", + }, + &labeledExpr{ + pos: position{line: 772, col: 5, offset: 24426}, + label: "content", + expr: &actionExpr{ + pos: position{line: 772, col: 14, offset: 24435}, + run: (*parser).callonDelimitedBlock137, + expr: &oneOrMoreExpr{ + pos: position{line: 772, col: 15, offset: 24436}, + expr: &charClassMatcher{ + pos: position{line: 772, col: 15, offset: 24436}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDelimitedBlock141, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, - &labeledExpr{ - pos: position{line: 950, col: 65, offset: 31146}, - label: "otherLines", - expr: &zeroOrMoreExpr{ - pos: position{line: 950, col: 76, offset: 31157}, + }, + }, + &actionExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + run: (*parser).callonDelimitedBlock148, + expr: &seqExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + label: "content", expr: &actionExpr{ - pos: position{line: 950, col: 77, offset: 31158}, - run: (*parser).callonContinuedListItemContent563, - expr: &seqExpr{ - pos: position{line: 950, col: 77, offset: 31158}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 950, col: 77, offset: 31158}, - expr: &seqExpr{ - pos: position{line: 668, col: 25, offset: 21042}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 668, col: 25, offset: 21042}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 668, col: 29, offset: 21046}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent571, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 950, col: 99, offset: 31180}, - label: "line", - expr: &choiceExpr{ - pos: position{line: 950, col: 105, offset: 31186}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonContinuedListItemContent578, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent586, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonContinuedListItemContent595, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonContinuedListItemContent603, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent616, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent628, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent640, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent652, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent664, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent676, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent688, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonContinuedListItemContent696, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonContinuedListItemContent704, - }, - }, - }, - }, - }, + pos: position{line: 1662, col: 14, offset: 55218}, + run: (*parser).callonDelimitedBlock151, + expr: &oneOrMoreExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + expr: &charClassMatcher{ + pos: position{line: 1662, col: 14, offset: 55218}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1665, col: 5, offset: 55275}, + run: (*parser).callonDelimitedBlock154, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDelimitedBlock156, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, @@ -16111,202 +17478,347 @@ var g = &grammar{ }, }, }, + &ruleRefExpr{ + pos: position{line: 566, col: 7, offset: 18503}, + name: "PassthroughBlock", + }, + &ruleRefExpr{ + pos: position{line: 567, col: 7, offset: 18526}, + name: "QuoteBlock", + }, + &ruleRefExpr{ + pos: position{line: 568, col: 7, offset: 18543}, + name: "SidebarBlock", + }, }, }, }, { - name: "OrderedListItem", - pos: position{line: 696, col: 1, offset: 21893}, + name: "ExampleBlock", + pos: position{line: 642, col: 1, offset: 20484}, expr: &actionExpr{ - pos: position{line: 696, col: 20, offset: 21912}, - run: (*parser).callonOrderedListItem1, + pos: position{line: 643, col: 5, offset: 20504}, + run: (*parser).callonExampleBlock1, expr: &seqExpr{ - pos: position{line: 696, col: 20, offset: 21912}, + pos: position{line: 643, col: 5, offset: 20504}, exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 696, col: 20, offset: 21912}, - label: "prefix", + &andCodeExpr{ + pos: position{line: 643, col: 5, offset: 20504}, + run: (*parser).callonExampleBlock3, + }, + &litMatcher{ + pos: position{line: 587, col: 26, offset: 18994}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 587, col: 33, offset: 19001}, expr: &actionExpr{ - pos: position{line: 701, col: 5, offset: 22141}, - run: (*parser).callonOrderedListItem4, - expr: &seqExpr{ - pos: position{line: 701, col: 5, offset: 22141}, + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExampleBlock6, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExampleBlock9, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 648, col: 5, offset: 20687}, + run: (*parser).callonExampleBlock16, + }, + &labeledExpr{ + pos: position{line: 653, col: 5, offset: 20888}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 653, col: 14, offset: 20897}, + name: "ExampleBlockContent", + }, + }, + &choiceExpr{ + pos: position{line: 661, col: 29, offset: 21154}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 587, col: 26, offset: 18994}, exprs: []interface{}{ + &litMatcher{ + pos: position{line: 587, col: 26, offset: 18994}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, &zeroOrMoreExpr{ - pos: position{line: 701, col: 5, offset: 22141}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonOrderedListItem9, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 587, col: 33, offset: 19001}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExampleBlock23, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExampleBlock26, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, - &labeledExpr{ - pos: position{line: 701, col: 12, offset: 22148}, - label: "prefix", - expr: &choiceExpr{ - pos: position{line: 703, col: 9, offset: 22211}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 703, col: 9, offset: 22211}, - run: (*parser).callonOrderedListItem13, - expr: &seqExpr{ - pos: position{line: 703, col: 9, offset: 22211}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 703, col: 9, offset: 22211}, - label: "depth", - expr: &actionExpr{ - pos: position{line: 703, col: 16, offset: 22218}, - run: (*parser).callonOrderedListItem16, - expr: &oneOrMoreExpr{ - pos: position{line: 703, col: 16, offset: 22218}, - expr: &litMatcher{ - pos: position{line: 703, col: 17, offset: 22219}, - val: ".", - ignoreCase: false, - want: "\".\"", - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 707, col: 9, offset: 22319}, - run: (*parser).callonOrderedListItem19, - }, - }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "ExampleBlockContent", + pos: position{line: 663, col: 1, offset: 21183}, + expr: &zeroOrMoreExpr{ + pos: position{line: 664, col: 4, offset: 21210}, + expr: &actionExpr{ + pos: position{line: 664, col: 5, offset: 21211}, + run: (*parser).callonExampleBlockContent2, + expr: &seqExpr{ + pos: position{line: 664, col: 5, offset: 21211}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 664, col: 5, offset: 21211}, + expr: &choiceExpr{ + pos: position{line: 661, col: 29, offset: 21154}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 587, col: 26, offset: 18994}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 587, col: 26, offset: 18994}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 587, col: 33, offset: 19001}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExampleBlockContent9, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, - &actionExpr{ - pos: position{line: 726, col: 11, offset: 23036}, - run: (*parser).callonOrderedListItem20, - expr: &seqExpr{ - pos: position{line: 726, col: 11, offset: 23036}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 726, col: 11, offset: 23036}, - expr: &charClassMatcher{ - pos: position{line: 726, col: 12, offset: 23037}, - val: "[0-9]", - ranges: []rune{'0', '9'}, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExampleBlockContent12, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - inverted: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, - &litMatcher{ - pos: position{line: 726, col: 20, offset: 23045}, - val: ".", - ignoreCase: false, - want: "\".\"", - }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, - &actionExpr{ - pos: position{line: 728, col: 13, offset: 23156}, - run: (*parser).callonOrderedListItem25, - expr: &seqExpr{ - pos: position{line: 728, col: 13, offset: 23156}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 728, col: 14, offset: 23157}, - val: "[a-z]", - ranges: []rune{'a', 'z'}, - ignoreCase: false, - inverted: false, - }, - &litMatcher{ - pos: position{line: 728, col: 21, offset: 23164}, - val: ".", - ignoreCase: false, - want: "\".\"", - }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 665, col: 5, offset: 21241}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 665, col: 11, offset: 21247}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 665, col: 11, offset: 21247}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + run: (*parser).callonExampleBlockContent24, + expr: &seqExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 602, col: 5, offset: 19307}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, - &actionExpr{ - pos: position{line: 730, col: 13, offset: 23278}, - run: (*parser).callonOrderedListItem29, - expr: &seqExpr{ - pos: position{line: 730, col: 13, offset: 23278}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 730, col: 14, offset: 23279}, - val: "[A-Z]", - ranges: []rune{'A', 'Z'}, - ignoreCase: false, - inverted: false, - }, - &litMatcher{ - pos: position{line: 730, col: 21, offset: 23286}, - val: ".", + &labeledExpr{ + pos: position{line: 603, col: 5, offset: 19380}, + label: "content", + expr: &actionExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + run: (*parser).callonExampleBlockContent30, + expr: &zeroOrMoreExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + expr: &charClassMatcher{ + pos: position{line: 603, col: 14, offset: 19389}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, ignoreCase: false, - want: "\".\"", + inverted: true, }, }, }, }, - &actionExpr{ - pos: position{line: 732, col: 13, offset: 23400}, - run: (*parser).callonOrderedListItem33, - expr: &seqExpr{ - pos: position{line: 732, col: 13, offset: 23400}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 732, col: 13, offset: 23400}, - expr: &charClassMatcher{ - pos: position{line: 732, col: 14, offset: 23401}, - val: "[ivxdlcm]", - chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, - ignoreCase: false, - inverted: false, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExampleBlockContent34, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, - &litMatcher{ - pos: position{line: 732, col: 26, offset: 23413}, - val: ")", - ignoreCase: false, - want: "\")\"", - }, }, - }, - }, - &actionExpr{ - pos: position{line: 734, col: 13, offset: 23527}, - run: (*parser).callonOrderedListItem38, - expr: &seqExpr{ - pos: position{line: 734, col: 13, offset: 23527}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 734, col: 13, offset: 23527}, - expr: &charClassMatcher{ - pos: position{line: 734, col: 14, offset: 23528}, - val: "[IVXDLCM]", - chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 734, col: 26, offset: 23540}, - val: ")", - ignoreCase: false, - want: "\")\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -16314,266 +17826,341 @@ var g = &grammar{ }, }, }, - &oneOrMoreExpr{ - pos: position{line: 736, col: 12, offset: 23653}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonOrderedListItem46, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, }, }, }, }, - &labeledExpr{ - pos: position{line: 696, col: 51, offset: 21943}, - label: "content", - expr: &ruleRefExpr{ - pos: position{line: 696, col: 60, offset: 21952}, - name: "OrderedListItemContent", - }, - }, - }, - }, - }, - }, - { - name: "OrderedListItemContent", - pos: position{line: 740, col: 1, offset: 23688}, - expr: &actionExpr{ - pos: position{line: 740, col: 27, offset: 23714}, - run: (*parser).callonOrderedListItemContent1, - expr: &labeledExpr{ - pos: position{line: 740, col: 27, offset: 23714}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 740, col: 37, offset: 23724}, - expr: &ruleRefExpr{ - pos: position{line: 740, col: 37, offset: 23724}, - name: "ListParagraph", - }, }, }, }, }, { - name: "UnorderedListItem", - pos: position{line: 747, col: 1, offset: 23924}, + name: "FencedBlock", + pos: position{line: 672, col: 1, offset: 21389}, expr: &actionExpr{ - pos: position{line: 748, col: 5, offset: 23950}, - run: (*parser).callonUnorderedListItem1, + pos: position{line: 673, col: 5, offset: 21408}, + run: (*parser).callonFencedBlock1, expr: &seqExpr{ - pos: position{line: 748, col: 5, offset: 23950}, + pos: position{line: 673, col: 5, offset: 21408}, exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 748, col: 5, offset: 23950}, - label: "prefix", + &andCodeExpr{ + pos: position{line: 673, col: 5, offset: 21408}, + run: (*parser).callonFencedBlock3, + }, + &litMatcher{ + pos: position{line: 589, col: 25, offset: 19037}, + val: "```", + ignoreCase: false, + want: "\"```\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 589, col: 31, offset: 19043}, expr: &actionExpr{ - pos: position{line: 755, col: 5, offset: 24261}, - run: (*parser).callonUnorderedListItem4, - expr: &seqExpr{ - pos: position{line: 755, col: 5, offset: 24261}, + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonFencedBlock6, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonFencedBlock9, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 678, col: 5, offset: 21589}, + run: (*parser).callonFencedBlock16, + }, + &labeledExpr{ + pos: position{line: 683, col: 5, offset: 21789}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 683, col: 14, offset: 21798}, + name: "FencedBlockContent", + }, + }, + &choiceExpr{ + pos: position{line: 691, col: 28, offset: 22054}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 589, col: 25, offset: 19037}, exprs: []interface{}{ + &litMatcher{ + pos: position{line: 589, col: 25, offset: 19037}, + val: "```", + ignoreCase: false, + want: "\"```\"", + }, &zeroOrMoreExpr{ - pos: position{line: 755, col: 5, offset: 24261}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonUnorderedListItem9, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + pos: position{line: 589, col: 31, offset: 19043}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonFencedBlock23, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, - &labeledExpr{ - pos: position{line: 755, col: 12, offset: 24268}, - label: "prefix", - expr: &choiceExpr{ - pos: position{line: 755, col: 20, offset: 24276}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 757, col: 9, offset: 24333}, - run: (*parser).callonUnorderedListItem13, - expr: &seqExpr{ - pos: position{line: 757, col: 9, offset: 24333}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 757, col: 9, offset: 24333}, - label: "depth", - expr: &actionExpr{ - pos: position{line: 757, col: 16, offset: 24340}, - run: (*parser).callonUnorderedListItem16, - expr: &oneOrMoreExpr{ - pos: position{line: 757, col: 16, offset: 24340}, - expr: &litMatcher{ - pos: position{line: 757, col: 17, offset: 24341}, - val: "*", - ignoreCase: false, - want: "\"*\"", - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 761, col: 9, offset: 24441}, - run: (*parser).callonUnorderedListItem19, - }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonFencedBlock26, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - }, - }, - &labeledExpr{ - pos: position{line: 778, col: 14, offset: 25148}, - label: "depth", - expr: &actionExpr{ - pos: position{line: 778, col: 21, offset: 25155}, - run: (*parser).callonUnorderedListItem21, - expr: &litMatcher{ - pos: position{line: 778, col: 22, offset: 25156}, - val: "-", + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", ignoreCase: false, - want: "\"-\"", + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 780, col: 13, offset: 25242}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonUnorderedListItem26, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, - &labeledExpr{ - pos: position{line: 749, col: 5, offset: 23988}, - label: "checkstyle", - expr: &zeroOrOneExpr{ - pos: position{line: 749, col: 16, offset: 23999}, - expr: &actionExpr{ - pos: position{line: 784, col: 32, offset: 25309}, - run: (*parser).callonUnorderedListItem30, - expr: &seqExpr{ - pos: position{line: 784, col: 32, offset: 25309}, - exprs: []interface{}{ - &andExpr{ - pos: position{line: 784, col: 32, offset: 25309}, - expr: &litMatcher{ - pos: position{line: 784, col: 33, offset: 25310}, - val: "[", + }, + }, + }, + }, + { + name: "FencedBlockContent", + pos: position{line: 693, col: 1, offset: 22082}, + expr: &zeroOrMoreExpr{ + pos: position{line: 694, col: 5, offset: 22109}, + expr: &actionExpr{ + pos: position{line: 694, col: 6, offset: 22110}, + run: (*parser).callonFencedBlockContent2, + expr: &seqExpr{ + pos: position{line: 694, col: 6, offset: 22110}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 694, col: 6, offset: 22110}, + expr: &choiceExpr{ + pos: position{line: 691, col: 28, offset: 22054}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 589, col: 25, offset: 19037}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 589, col: 25, offset: 19037}, + val: "```", ignoreCase: false, - want: "\"[\"", + want: "\"```\"", }, - }, - &labeledExpr{ - pos: position{line: 784, col: 37, offset: 25314}, - label: "style", - expr: &choiceExpr{ - pos: position{line: 785, col: 7, offset: 25328}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 785, col: 7, offset: 25328}, - run: (*parser).callonUnorderedListItem36, - expr: &litMatcher{ - pos: position{line: 785, col: 7, offset: 25328}, - val: "[ ]", - ignoreCase: false, - want: "\"[ ]\"", - }, + &zeroOrMoreExpr{ + pos: position{line: 589, col: 31, offset: 19043}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonFencedBlockContent9, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ &actionExpr{ - pos: position{line: 786, col: 7, offset: 25373}, - run: (*parser).callonUnorderedListItem38, - expr: &litMatcher{ - pos: position{line: 786, col: 7, offset: 25373}, - val: "[*]", - ignoreCase: false, - want: "\"[*]\"", + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonFencedBlockContent12, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, - &actionExpr{ - pos: position{line: 787, col: 7, offset: 25416}, - run: (*parser).callonUnorderedListItem40, - expr: &litMatcher{ - pos: position{line: 787, col: 7, offset: 25416}, - val: "[x]", - ignoreCase: false, - want: "\"[x]\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - &oneOrMoreExpr{ - pos: position{line: 788, col: 7, offset: 25458}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 695, col: 5, offset: 22139}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 695, col: 11, offset: 22145}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 695, col: 11, offset: 22145}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + run: (*parser).callonFencedBlockContent24, + expr: &seqExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 602, col: 5, offset: 19307}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonUnorderedListItem45, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + }, + &labeledExpr{ + pos: position{line: 603, col: 5, offset: 19380}, + label: "content", + expr: &actionExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + run: (*parser).callonFencedBlockContent30, + expr: &zeroOrMoreExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + expr: &charClassMatcher{ + pos: position{line: 603, col: 14, offset: 19389}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonFencedBlockContent34, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, @@ -16584,203 +18171,164 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 750, col: 5, offset: 24035}, - label: "content", - expr: &ruleRefExpr{ - pos: position{line: 750, col: 14, offset: 24044}, - name: "UnorderedListItemContent", - }, - }, - }, - }, - }, - }, - { - name: "UnorderedListItemContent", - pos: position{line: 792, col: 1, offset: 25500}, - expr: &actionExpr{ - pos: position{line: 792, col: 29, offset: 25528}, - run: (*parser).callonUnorderedListItemContent1, - expr: &labeledExpr{ - pos: position{line: 792, col: 29, offset: 25528}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 792, col: 39, offset: 25538}, - expr: &ruleRefExpr{ - pos: position{line: 792, col: 39, offset: 25538}, - name: "ListParagraph", - }, }, }, }, }, { - name: "LabeledListItem", - pos: position{line: 799, col: 1, offset: 25854}, + name: "ListingBlock", + pos: position{line: 702, col: 1, offset: 22288}, expr: &actionExpr{ - pos: position{line: 799, col: 20, offset: 25873}, - run: (*parser).callonLabeledListItem1, + pos: position{line: 703, col: 5, offset: 22308}, + run: (*parser).callonListingBlock1, expr: &seqExpr{ - pos: position{line: 799, col: 20, offset: 25873}, + pos: position{line: 703, col: 5, offset: 22308}, exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 799, col: 20, offset: 25873}, - label: "term", + &andCodeExpr{ + pos: position{line: 703, col: 5, offset: 22308}, + run: (*parser).callonListingBlock3, + }, + &litMatcher{ + pos: position{line: 591, col: 26, offset: 19080}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 591, col: 33, offset: 19087}, expr: &actionExpr{ - pos: position{line: 806, col: 32, offset: 26286}, - run: (*parser).callonLabeledListItem4, - expr: &labeledExpr{ - pos: position{line: 806, col: 32, offset: 26286}, - label: "content", - expr: &actionExpr{ - pos: position{line: 806, col: 42, offset: 26296}, - run: (*parser).callonLabeledListItem6, - expr: &oneOrMoreExpr{ - pos: position{line: 806, col: 42, offset: 26296}, - expr: &choiceExpr{ - pos: position{line: 805, col: 33, offset: 26234}, - alternatives: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 805, col: 33, offset: 26234}, - expr: &charClassMatcher{ - pos: position{line: 805, col: 33, offset: 26234}, - val: "[^:\\r\\n]", - chars: []rune{':', '\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - &seqExpr{ - pos: position{line: 805, col: 45, offset: 26246}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 805, col: 45, offset: 26246}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - ¬Expr{ - pos: position{line: 805, col: 49, offset: 26250}, - expr: &litMatcher{ - pos: position{line: 805, col: 50, offset: 26251}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - }, - }, - }, - }, + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListingBlock6, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListingBlock9, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, + &andCodeExpr{ + pos: position{line: 708, col: 5, offset: 22491}, + run: (*parser).callonListingBlock16, + }, &labeledExpr{ - pos: position{line: 799, col: 55, offset: 25908}, - label: "separator", - expr: &actionExpr{ - pos: position{line: 838, col: 5, offset: 27176}, - run: (*parser).callonLabeledListItem16, - expr: &seqExpr{ - pos: position{line: 838, col: 5, offset: 27176}, + pos: position{line: 713, col: 5, offset: 22692}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 713, col: 14, offset: 22701}, + name: "ListingBlockContent", + }, + }, + &choiceExpr{ + pos: position{line: 721, col: 29, offset: 22963}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 591, col: 26, offset: 19080}, exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 838, col: 5, offset: 27176}, - label: "separator", + &litMatcher{ + pos: position{line: 591, col: 26, offset: 19080}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 591, col: 33, offset: 19087}, expr: &actionExpr{ - pos: position{line: 838, col: 16, offset: 27187}, - run: (*parser).callonLabeledListItem19, - expr: &oneOrMoreExpr{ - pos: position{line: 838, col: 16, offset: 27187}, - expr: &litMatcher{ - pos: position{line: 838, col: 17, offset: 27188}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListingBlock23, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, - &andCodeExpr{ - pos: position{line: 841, col: 5, offset: 27246}, - run: (*parser).callonLabeledListItem22, - }, &choiceExpr{ - pos: position{line: 845, col: 6, offset: 27422}, + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 845, col: 6, offset: 27422}, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListingBlock26, expr: &choiceExpr{ - pos: position{line: 845, col: 7, offset: 27423}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItem27, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + want: "\"\\n\"", }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, + want: "\"\\r\"", }, }, }, }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, }, }, }, - }, - }, - &labeledExpr{ - pos: position{line: 799, col: 92, offset: 25945}, - label: "description", - expr: &zeroOrOneExpr{ - pos: position{line: 799, col: 104, offset: 25957}, - expr: &ruleRefExpr{ - pos: position{line: 799, col: 105, offset: 25958}, - name: "LabeledListItemDescription", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, @@ -16789,418 +18337,170 @@ var g = &grammar{ }, }, { - name: "LabeledListItemTerm", - pos: position{line: 813, col: 1, offset: 26471}, - expr: &actionExpr{ - pos: position{line: 813, col: 24, offset: 26494}, - run: (*parser).callonLabeledListItemTerm1, - expr: &labeledExpr{ - pos: position{line: 813, col: 24, offset: 26494}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 813, col: 33, offset: 26503}, - expr: &seqExpr{ - pos: position{line: 813, col: 34, offset: 26504}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 813, col: 34, offset: 26504}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 813, col: 43, offset: 26513}, - expr: &litMatcher{ - pos: position{line: 813, col: 44, offset: 26514}, - val: "::", - ignoreCase: false, - want: "\"::\"", - }, - }, - &ruleRefExpr{ - pos: position{line: 813, col: 49, offset: 26519}, - name: "LabeledListItemTermElement", - }, - }, - }, - }, - }, - }, - }, - { - name: "LabeledListItemTermElement", - pos: position{line: 817, col: 1, offset: 26616}, - expr: &actionExpr{ - pos: position{line: 817, col: 31, offset: 26646}, - run: (*parser).callonLabeledListItemTermElement1, - expr: &labeledExpr{ - pos: position{line: 817, col: 31, offset: 26646}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 817, col: 40, offset: 26655}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonLabeledListItemTermElement4, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + name: "ListingBlockContent", + pos: position{line: 723, col: 1, offset: 22992}, + expr: &zeroOrMoreExpr{ + pos: position{line: 724, col: 5, offset: 23020}, + expr: &actionExpr{ + pos: position{line: 724, col: 6, offset: 23021}, + run: (*parser).callonListingBlockContent2, + expr: &seqExpr{ + pos: position{line: 724, col: 6, offset: 23021}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 724, col: 6, offset: 23021}, + expr: &choiceExpr{ + pos: position{line: 721, col: 29, offset: 22963}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 591, col: 26, offset: 19080}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 591, col: 26, offset: 19080}, + val: "----", + ignoreCase: false, + want: "\"----\"", }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonLabeledListItemTermElement13, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, + &zeroOrMoreExpr{ + pos: position{line: 591, col: 33, offset: 19087}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListingBlockContent9, expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, }, }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 995, col: 14, offset: 32701}, - run: (*parser).callonLabeledListItemTermElement22, - expr: &seqExpr{ - pos: position{line: 995, col: 14, offset: 32701}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement26, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 995, col: 20, offset: 32707}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 995, col: 24, offset: 32711}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement32, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListingBlockContent12, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, }, - &andExpr{ - pos: position{line: 995, col: 31, offset: 32718}, - expr: &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - &oneOrMoreExpr{ - pos: position{line: 819, col: 11, offset: 26719}, + &labeledExpr{ + pos: position{line: 725, col: 5, offset: 23051}, + label: "line", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 725, col: 11, offset: 23057}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &ruleRefExpr{ + pos: position{line: 725, col: 11, offset: 23057}, + name: "FileInclusion", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement43, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 820, col: 11, offset: 26737}, - name: "CrossReference", - }, - &actionExpr{ - pos: position{line: 2147, col: 23, offset: 75975}, - run: (*parser).callonLabeledListItemTermElement46, - expr: &seqExpr{ - pos: position{line: 2147, col: 23, offset: 75975}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2147, col: 23, offset: 75975}, - val: "(((", - ignoreCase: false, - want: "\"(((\"", - }, - &labeledExpr{ - pos: position{line: 2147, col: 29, offset: 75981}, - label: "term1", - expr: &actionExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - run: (*parser).callonLabeledListItemTermElement50, - expr: &oneOrMoreExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - expr: &choiceExpr{ - pos: position{line: 2154, col: 31, offset: 76313}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[ 0-9\\pL]", - chars: []rune{' '}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + pos: position{line: 602, col: 5, offset: 19307}, + run: (*parser).callonListingBlockContent24, + expr: &seqExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 602, col: 5, offset: 19307}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement54, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + }, + &labeledExpr{ + pos: position{line: 603, col: 5, offset: 19380}, + label: "content", + expr: &actionExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + run: (*parser).callonListingBlockContent30, + expr: &zeroOrMoreExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + expr: &charClassMatcher{ + pos: position{line: 603, col: 14, offset: 19389}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, ignoreCase: false, - want: "\"\\t\"", + inverted: true, }, }, }, }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2148, col: 5, offset: 76020}, - label: "term2", - expr: &zeroOrOneExpr{ - pos: position{line: 2148, col: 11, offset: 76026}, - expr: &actionExpr{ - pos: position{line: 2148, col: 12, offset: 76027}, - run: (*parser).callonLabeledListItemTermElement58, - expr: &seqExpr{ - pos: position{line: 2148, col: 12, offset: 76027}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 2148, col: 12, offset: 76027}, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListingBlockContent34, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement63, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + want: "\"\\n\"", }, - }, - }, - }, - &litMatcher{ - pos: position{line: 2148, col: 19, offset: 76034}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2148, col: 23, offset: 76038}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", ignoreCase: false, - want: "\" \"", + want: "\"\\r\\n\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement69, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &labeledExpr{ - pos: position{line: 2148, col: 30, offset: 76045}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - run: (*parser).callonLabeledListItemTermElement72, - expr: &oneOrMoreExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - expr: &choiceExpr{ - pos: position{line: 2154, col: 31, offset: 76313}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[ 0-9\\pL]", - chars: []rune{' '}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement76, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -17208,999 +18508,1105 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 2149, col: 5, offset: 76112}, - label: "term3", - expr: &zeroOrOneExpr{ - pos: position{line: 2149, col: 11, offset: 76118}, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "LiteralBlock", + pos: position{line: 732, col: 1, offset: 23200}, + expr: &actionExpr{ + pos: position{line: 733, col: 5, offset: 23220}, + run: (*parser).callonLiteralBlock1, + expr: &seqExpr{ + pos: position{line: 733, col: 5, offset: 23220}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 593, col: 26, offset: 19124}, + val: "....", + ignoreCase: false, + want: "\"....\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 593, col: 33, offset: 19131}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLiteralBlock5, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonLiteralBlock8, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 734, col: 5, offset: 23251}, + run: (*parser).callonLiteralBlock15, + }, + &labeledExpr{ + pos: position{line: 738, col: 5, offset: 23403}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 738, col: 14, offset: 23412}, + name: "LiteralBlockContent", + }, + }, + &andCodeExpr{ + pos: position{line: 739, col: 5, offset: 23437}, + run: (*parser).callonLiteralBlock18, + }, + &zeroOrOneExpr{ + pos: position{line: 744, col: 5, offset: 23638}, + expr: &choiceExpr{ + pos: position{line: 751, col: 29, offset: 23871}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 593, col: 26, offset: 19124}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 593, col: 26, offset: 19124}, + val: "....", + ignoreCase: false, + want: "\"....\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 593, col: 33, offset: 19131}, expr: &actionExpr{ - pos: position{line: 2149, col: 12, offset: 76119}, - run: (*parser).callonLabeledListItemTermElement80, - expr: &seqExpr{ - pos: position{line: 2149, col: 12, offset: 76119}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 2149, col: 12, offset: 76119}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement85, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLiteralBlock24, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonLiteralBlock27, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - }, - &litMatcher{ - pos: position{line: 2149, col: 19, offset: 76126}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2149, col: 23, offset: 76130}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement91, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, - &labeledExpr{ - pos: position{line: 2149, col: 30, offset: 76137}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - run: (*parser).callonLabeledListItemTermElement94, - expr: &oneOrMoreExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - expr: &choiceExpr{ - pos: position{line: 2154, col: 31, offset: 76313}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[ 0-9\\pL]", - chars: []rune{' '}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement98, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "LiteralBlockContent", + pos: position{line: 753, col: 1, offset: 23900}, + expr: &zeroOrMoreExpr{ + pos: position{line: 754, col: 5, offset: 23928}, + expr: &actionExpr{ + pos: position{line: 754, col: 6, offset: 23929}, + run: (*parser).callonLiteralBlockContent2, + expr: &seqExpr{ + pos: position{line: 754, col: 6, offset: 23929}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 754, col: 6, offset: 23929}, + expr: &choiceExpr{ + pos: position{line: 751, col: 29, offset: 23871}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 593, col: 26, offset: 19124}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 593, col: 26, offset: 19124}, + val: "....", + ignoreCase: false, + want: "\"....\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 593, col: 33, offset: 19131}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonLiteralBlockContent9, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonLiteralBlockContent12, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, - &litMatcher{ - pos: position{line: 2150, col: 5, offset: 76204}, - val: ")))", - ignoreCase: false, - want: "\")))\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, - &ruleRefExpr{ - pos: position{line: 822, col: 11, offset: 26791}, - name: "IndexTerm", - }, - &ruleRefExpr{ - pos: position{line: 823, col: 11, offset: 26811}, - name: "InlinePassthrough", - }, - &ruleRefExpr{ - pos: position{line: 824, col: 11, offset: 26900}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 825, col: 11, offset: 26921}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 826, col: 11, offset: 26944}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 827, col: 11, offset: 26959}, - name: "InlineFootnote", - }, - &ruleRefExpr{ - pos: position{line: 828, col: 11, offset: 26984}, - name: "QuotedString", - }, - &ruleRefExpr{ - pos: position{line: 829, col: 11, offset: 27007}, - name: "QuotedText", - }, - &actionExpr{ - pos: position{line: 2203, col: 21, offset: 77750}, - run: (*parser).callonLabeledListItemTermElement109, + &labeledExpr{ + pos: position{line: 755, col: 5, offset: 23959}, + label: "line", expr: &choiceExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, + pos: position{line: 755, col: 11, offset: 23965}, alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 755, col: 11, offset: 23965}, + name: "FileInclusion", + }, &actionExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, - run: (*parser).callonLabeledListItemTermElement111, + pos: position{line: 602, col: 5, offset: 19307}, + run: (*parser).callonLiteralBlockContent24, expr: &seqExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, + pos: position{line: 602, col: 5, offset: 19307}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1538, col: 27, offset: 54613}, - val: "<<", - ignoreCase: false, - want: "\"<<\"", + ¬Expr{ + pos: position{line: 602, col: 5, offset: 19307}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, &labeledExpr{ - pos: position{line: 1538, col: 32, offset: 54618}, - label: "id", + pos: position{line: 603, col: 5, offset: 19380}, + label: "content", expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonLabeledListItemTermElement115, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, + pos: position{line: 603, col: 14, offset: 19389}, + run: (*parser).callonLiteralBlockContent30, + expr: &zeroOrMoreExpr{ + pos: position{line: 603, col: 14, offset: 19389}, expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, + pos: position{line: 603, col: 14, offset: 19389}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, ignoreCase: false, inverted: true, }, }, }, }, - &zeroOrMoreExpr{ - pos: position{line: 1538, col: 40, offset: 54626}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement121, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonLiteralBlockContent34, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, - &litMatcher{ - pos: position{line: 1538, col: 47, offset: 54633}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - &labeledExpr{ - pos: position{line: 1538, col: 51, offset: 54637}, - label: "label", - expr: &oneOrMoreExpr{ - pos: position{line: 1548, col: 24, offset: 55025}, - expr: &choiceExpr{ - pos: position{line: 1549, col: 5, offset: 55031}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, - run: (*parser).callonLabeledListItemTermElement127, - expr: &seqExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 1549, col: 6, offset: 55032}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 1549, col: 14, offset: 55040}, - expr: &charClassMatcher{ - pos: position{line: 1549, col: 14, offset: 55040}, - val: "[^\\r\\n{<>]", - chars: []rune{'\r', '\n', '{', '<', '>'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonLabeledListItemTermElement132, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonLabeledListItemTermElement136, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1553, col: 6, offset: 55250}, - run: (*parser).callonLabeledListItemTermElement142, - expr: &litMatcher{ - pos: position{line: 1553, col: 6, offset: 55250}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1538, col: 79, offset: 54665}, - val: ">>", - ignoreCase: false, - want: "\">>\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1540, col: 5, offset: 54730}, - run: (*parser).callonLabeledListItemTermElement145, - expr: &seqExpr{ - pos: position{line: 1540, col: 5, offset: 54730}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1540, col: 5, offset: 54730}, - val: "<<", - ignoreCase: false, - want: "\"<<\"", - }, - &labeledExpr{ - pos: position{line: 1540, col: 10, offset: 54735}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonLabeledListItemTermElement149, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1540, col: 18, offset: 54743}, - val: ">>", - ignoreCase: false, - want: "\">>\"", - }, }, }, }, }, }, }, - &actionExpr{ - pos: position{line: 2206, col: 9, offset: 77913}, - run: (*parser).callonLabeledListItemTermElement153, - expr: &charClassMatcher{ - pos: position{line: 2206, col: 10, offset: 77914}, - val: "[<>&]", - chars: []rune{'<', '>', '&'}, - ignoreCase: false, - inverted: false, - }, - }, - &actionExpr{ - pos: position{line: 2171, col: 15, offset: 76747}, - run: (*parser).callonLabeledListItemTermElement155, - expr: &litMatcher{ - pos: position{line: 2171, col: 15, offset: 76747}, - val: "`'", - ignoreCase: false, - want: "\"`'\"", - }, - }, - &actionExpr{ - pos: position{line: 2177, col: 14, offset: 76854}, - run: (*parser).callonLabeledListItemTermElement157, - expr: &litMatcher{ - pos: position{line: 2177, col: 14, offset: 76854}, - val: "(C)", - ignoreCase: false, - want: "\"(C)\"", + }, + }, + }, + }, + }, + { + name: "MarkdownQuoteAttribution", + pos: position{line: 778, col: 1, offset: 24554}, + expr: &actionExpr{ + pos: position{line: 779, col: 5, offset: 24587}, + run: (*parser).callonMarkdownQuoteAttribution1, + expr: &seqExpr{ + pos: position{line: 779, col: 5, offset: 24587}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 779, col: 5, offset: 24587}, + val: "-- ", + ignoreCase: false, + want: "\"-- \"", + }, + &labeledExpr{ + pos: position{line: 779, col: 11, offset: 24593}, + label: "author", + expr: &actionExpr{ + pos: position{line: 779, col: 19, offset: 24601}, + run: (*parser).callonMarkdownQuoteAttribution5, + expr: &oneOrMoreExpr{ + pos: position{line: 779, col: 20, offset: 24602}, + expr: &charClassMatcher{ + pos: position{line: 779, col: 20, offset: 24602}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, }, }, - &actionExpr{ - pos: position{line: 2180, col: 14, offset: 76921}, - run: (*parser).callonLabeledListItemTermElement159, - expr: &litMatcher{ - pos: position{line: 2180, col: 14, offset: 76921}, - val: "(TM)", - ignoreCase: false, - want: "\"(TM)\"", + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonMarkdownQuoteAttribution9, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, - }, - &actionExpr{ - pos: position{line: 2183, col: 15, offset: 76990}, - run: (*parser).callonLabeledListItemTermElement161, - expr: &litMatcher{ - pos: position{line: 2183, col: 15, offset: 76990}, - val: "(R)", - ignoreCase: false, - want: "\"(R)\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, - &actionExpr{ - pos: position{line: 2186, col: 13, offset: 77056}, - run: (*parser).callonLabeledListItemTermElement163, - expr: &litMatcher{ - pos: position{line: 2186, col: 13, offset: 77056}, - val: "...", + }, + }, + }, + }, + }, + { + name: "PassthroughBlock", + pos: position{line: 788, col: 1, offset: 24770}, + expr: &actionExpr{ + pos: position{line: 789, col: 5, offset: 24794}, + run: (*parser).callonPassthroughBlock1, + expr: &seqExpr{ + pos: position{line: 789, col: 5, offset: 24794}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 789, col: 5, offset: 24794}, + run: (*parser).callonPassthroughBlock3, + }, + &litMatcher{ + pos: position{line: 595, col: 30, offset: 19172}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 595, col: 37, offset: 19179}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonPassthroughBlock6, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\"...\"", + inverted: false, }, }, - &actionExpr{ - pos: position{line: 2194, col: 22, offset: 77354}, - run: (*parser).callonLabeledListItemTermElement165, - expr: &seqExpr{ - pos: position{line: 2194, col: 22, offset: 77354}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &litMatcher{ - pos: position{line: 2194, col: 31, offset: 77363}, - val: "'", - ignoreCase: false, - want: "\"'\"", - }, - &andExpr{ - pos: position{line: 2194, col: 35, offset: 77367}, - expr: &charClassMatcher{ - pos: position{line: 2194, col: 36, offset: 77368}, - val: "[\\pL]", - classes: []*unicode.RangeTable{rangeTable("L")}, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonPassthroughBlock9, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - inverted: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, - &actionExpr{ - pos: position{line: 221, col: 25, offset: 7126}, - run: (*parser).callonLabeledListItemTermElement171, - expr: &seqExpr{ - pos: position{line: 221, col: 25, offset: 7126}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 221, col: 25, offset: 7126}, - val: "{counter:", - ignoreCase: false, - want: "\"{counter:\"", - }, - &labeledExpr{ - pos: position{line: 221, col: 37, offset: 7138}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonLabeledListItemTermElement175, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, + }, + &andCodeExpr{ + pos: position{line: 794, col: 5, offset: 24985}, + run: (*parser).callonPassthroughBlock16, + }, + &labeledExpr{ + pos: position{line: 799, col: 5, offset: 25190}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 799, col: 14, offset: 25199}, + name: "PassthroughBlockContent", + }, + }, + &zeroOrOneExpr{ + pos: position{line: 800, col: 5, offset: 25228}, + expr: &choiceExpr{ + pos: position{line: 807, col: 33, offset: 25481}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 595, col: 30, offset: 19172}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 595, col: 30, offset: 19172}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 595, col: 37, offset: 19179}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonPassthroughBlock24, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, - }, - &labeledExpr{ - pos: position{line: 221, col: 56, offset: 7157}, - label: "start", - expr: &zeroOrOneExpr{ - pos: position{line: 221, col: 62, offset: 7163}, - expr: &actionExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - run: (*parser).callonLabeledListItemTermElement182, - expr: &seqExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 229, col: 21, offset: 7430}, - label: "start", - expr: &choiceExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - run: (*parser).callonLabeledListItemTermElement187, - expr: &charClassMatcher{ - pos: position{line: 229, col: 28, offset: 7437}, - val: "[A-Za-z]", - ranges: []rune{'A', 'Z', 'a', 'z'}, - ignoreCase: false, - inverted: false, - }, - }, - &actionExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - run: (*parser).callonLabeledListItemTermElement189, - expr: &oneOrMoreExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - expr: &charClassMatcher{ - pos: position{line: 231, col: 9, offset: 7491}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonPassthroughBlock27, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, - &litMatcher{ - pos: position{line: 221, col: 78, offset: 7179}, - val: "}", - ignoreCase: false, - want: "\"}\"", + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, - &actionExpr{ - pos: position{line: 225, col: 25, offset: 7281}, - run: (*parser).callonLabeledListItemTermElement193, - expr: &seqExpr{ - pos: position{line: 225, col: 25, offset: 7281}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 225, col: 25, offset: 7281}, - val: "{counter2:", - ignoreCase: false, - want: "\"{counter2:\"", - }, - &labeledExpr{ - pos: position{line: 225, col: 38, offset: 7294}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonLabeledListItemTermElement197, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + }, + }, + }, + }, + }, + { + name: "PassthroughBlockContent", + pos: position{line: 809, col: 1, offset: 25514}, + expr: &zeroOrMoreExpr{ + pos: position{line: 810, col: 5, offset: 25546}, + expr: &actionExpr{ + pos: position{line: 810, col: 6, offset: 25547}, + run: (*parser).callonPassthroughBlockContent2, + expr: &seqExpr{ + pos: position{line: 810, col: 6, offset: 25547}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 810, col: 6, offset: 25547}, + expr: &choiceExpr{ + pos: position{line: 807, col: 33, offset: 25481}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 595, col: 30, offset: 19172}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 595, col: 30, offset: 19172}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 595, col: 37, offset: 19179}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonPassthroughBlockContent9, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, }, }, - }, - }, - &labeledExpr{ - pos: position{line: 225, col: 57, offset: 7313}, - label: "start", - expr: &zeroOrOneExpr{ - pos: position{line: 225, col: 63, offset: 7319}, - expr: &actionExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - run: (*parser).callonLabeledListItemTermElement204, - expr: &seqExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 229, col: 21, offset: 7430}, - label: "start", - expr: &choiceExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - run: (*parser).callonLabeledListItemTermElement209, - expr: &charClassMatcher{ - pos: position{line: 229, col: 28, offset: 7437}, - val: "[A-Za-z]", - ranges: []rune{'A', 'Z', 'a', 'z'}, - ignoreCase: false, - inverted: false, - }, - }, - &actionExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - run: (*parser).callonLabeledListItemTermElement211, - expr: &oneOrMoreExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - expr: &charClassMatcher{ - pos: position{line: 231, col: 9, offset: 7491}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonPassthroughBlockContent12, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, - &litMatcher{ - pos: position{line: 225, col: 79, offset: 7335}, - val: "}", - ignoreCase: false, - want: "\"}\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonLabeledListItemTermElement215, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", + &labeledExpr{ + pos: position{line: 811, col: 5, offset: 25581}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 811, col: 11, offset: 25587}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 811, col: 11, offset: 25587}, + name: "FileInclusion", }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonLabeledListItemTermElement219, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + run: (*parser).callonPassthroughBlockContent24, + expr: &seqExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 602, col: 5, offset: 19307}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + }, + &labeledExpr{ + pos: position{line: 603, col: 5, offset: 19380}, + label: "content", + expr: &actionExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + run: (*parser).callonPassthroughBlockContent30, + expr: &zeroOrMoreExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + expr: &charClassMatcher{ + pos: position{line: 603, col: 14, offset: 19389}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonPassthroughBlockContent34, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, }, }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, }, }, }, - &actionExpr{ - pos: position{line: 2237, col: 12, offset: 79050}, - run: (*parser).callonLabeledListItemTermElement225, - expr: &charClassMatcher{ - pos: position{line: 2237, col: 12, offset: 79050}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, }, }, }, }, }, { - name: "LabeledListItemDescription", - pos: position{line: 849, col: 1, offset: 27483}, + name: "QuoteBlock", + pos: position{line: 818, col: 1, offset: 25728}, expr: &actionExpr{ - pos: position{line: 849, col: 31, offset: 27513}, - run: (*parser).callonLabeledListItemDescription1, - expr: &labeledExpr{ - pos: position{line: 849, col: 31, offset: 27513}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 849, col: 40, offset: 27522}, - expr: &ruleRefExpr{ - pos: position{line: 849, col: 41, offset: 27523}, - name: "ListParagraph", + pos: position{line: 819, col: 5, offset: 25746}, + run: (*parser).callonQuoteBlock1, + expr: &seqExpr{ + pos: position{line: 819, col: 5, offset: 25746}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 819, col: 5, offset: 25746}, + run: (*parser).callonQuoteBlock3, }, - }, - }, - }, - }, - { - name: "InlineElement", - pos: position{line: 967, col: 1, offset: 31735}, - expr: &actionExpr{ - pos: position{line: 968, col: 5, offset: 31758}, - run: (*parser).callonInlineElement1, - expr: &labeledExpr{ - pos: position{line: 968, col: 5, offset: 31758}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 968, col: 14, offset: 31767}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - run: (*parser).callonInlineElement4, - expr: &seqExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - expr: &charClassMatcher{ - pos: position{line: 2232, col: 5, offset: 78844}, - val: "[,?!;0-9\\pL]", - chars: []rune{',', '?', '!', ';'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &litMatcher{ + pos: position{line: 597, col: 24, offset: 19214}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 597, col: 31, offset: 19221}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonQuoteBlock6, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonQuoteBlock9, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - inverted: false, + want: "\"\\n\"", }, - }, - &andExpr{ - pos: position{line: 2232, col: 19, offset: 78858}, - expr: &choiceExpr{ - pos: position{line: 2232, col: 21, offset: 78860}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2232, col: 21, offset: 78860}, - val: "[\\r\\n ]", - chars: []rune{'\r', '\n', ' '}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonInlineElement13, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, + }, + &andCodeExpr{ + pos: position{line: 824, col: 5, offset: 25925}, + run: (*parser).callonQuoteBlock16, + }, + &labeledExpr{ + pos: position{line: 829, col: 5, offset: 26124}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 829, col: 14, offset: 26133}, + name: "QuoteBlockContent", + }, + }, + &choiceExpr{ + pos: position{line: 837, col: 27, offset: 26378}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 597, col: 24, offset: 19214}, exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &litMatcher{ + pos: position{line: 597, col: 24, offset: 19214}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 597, col: 31, offset: 19221}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonQuoteBlock23, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonQuoteBlock26, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonInlineElement22, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, + }, + }, + }, + }, + }, + { + name: "QuoteBlockContent", + pos: position{line: 839, col: 1, offset: 26405}, + expr: &zeroOrMoreExpr{ + pos: position{line: 840, col: 4, offset: 26430}, + expr: &actionExpr{ + pos: position{line: 840, col: 5, offset: 26431}, + run: (*parser).callonQuoteBlockContent2, + expr: &seqExpr{ + pos: position{line: 840, col: 5, offset: 26431}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 840, col: 5, offset: 26431}, + expr: &choiceExpr{ + pos: position{line: 837, col: 27, offset: 26378}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 597, col: 24, offset: 19214}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 597, col: 24, offset: 19214}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 597, col: 31, offset: 19221}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonQuoteBlockContent9, expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, }, }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonQuoteBlockContent12, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - &actionExpr{ - pos: position{line: 995, col: 14, offset: 32701}, - run: (*parser).callonInlineElement31, - expr: &seqExpr{ - pos: position{line: 995, col: 14, offset: 32701}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineElement35, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 995, col: 20, offset: 32707}, - val: "+", - ignoreCase: false, - want: "\"+\"", + &labeledExpr{ + pos: position{line: 841, col: 5, offset: 26459}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 841, col: 11, offset: 26465}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 841, col: 11, offset: 26465}, + name: "FileInclusion", }, - &zeroOrMoreExpr{ - pos: position{line: 995, col: 24, offset: 32711}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineElement41, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + run: (*parser).callonQuoteBlockContent24, + expr: &seqExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 602, col: 5, offset: 19307}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, - }, - }, - }, - &andExpr{ - pos: position{line: 995, col: 31, offset: 32718}, - expr: &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 603, col: 5, offset: 19380}, + label: "content", + expr: &actionExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + run: (*parser).callonQuoteBlockContent30, + expr: &zeroOrMoreExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + expr: &charClassMatcher{ + pos: position{line: 603, col: 14, offset: 19389}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonQuoteBlockContent34, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, @@ -18209,612 +19615,1438 @@ var g = &grammar{ }, }, }, - &oneOrMoreExpr{ - pos: position{line: 970, col: 11, offset: 31873}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineElement52, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + }, + }, + }, + }, + { + name: "SidebarBlock", + pos: position{line: 848, col: 1, offset: 26608}, + expr: &actionExpr{ + pos: position{line: 849, col: 5, offset: 26628}, + run: (*parser).callonSidebarBlock1, + expr: &seqExpr{ + pos: position{line: 849, col: 5, offset: 26628}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 849, col: 5, offset: 26628}, + run: (*parser).callonSidebarBlock3, + }, + &litMatcher{ + pos: position{line: 599, col: 26, offset: 19258}, + val: "****", + ignoreCase: false, + want: "\"****\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 599, col: 33, offset: 19265}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSidebarBlock6, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSidebarBlock9, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, - &seqExpr{ - pos: position{line: 971, col: 11, offset: 31891}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 971, col: 11, offset: 31891}, - expr: &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + }, + &andCodeExpr{ + pos: position{line: 854, col: 5, offset: 26811}, + run: (*parser).callonSidebarBlock16, + }, + &labeledExpr{ + pos: position{line: 859, col: 5, offset: 27012}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 859, col: 14, offset: 27021}, + name: "SidebarBlockContent", + }, + }, + &choiceExpr{ + pos: position{line: 867, col: 29, offset: 27279}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 599, col: 26, offset: 19258}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 599, col: 26, offset: 19258}, + val: "****", + ignoreCase: false, + want: "\"****\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 599, col: 33, offset: 19265}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSidebarBlock23, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSidebarBlock26, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 972, col: 13, offset: 31910}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 972, col: 13, offset: 31910}, - name: "QuotedString", - }, - &ruleRefExpr{ - pos: position{line: 973, col: 15, offset: 31937}, - name: "QuotedText", - }, - &ruleRefExpr{ - pos: position{line: 974, col: 15, offset: 31962}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 975, col: 15, offset: 31987}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 976, col: 15, offset: 32014}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 977, col: 15, offset: 32034}, - name: "InlinePassthrough", - }, - &ruleRefExpr{ - pos: position{line: 978, col: 15, offset: 32127}, - name: "InlineFootnote", - }, - &ruleRefExpr{ - pos: position{line: 979, col: 15, offset: 32157}, - name: "CrossReference", - }, - &actionExpr{ - pos: position{line: 2203, col: 21, offset: 77750}, - run: (*parser).callonInlineElement70, - expr: &choiceExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "SidebarBlockContent", + pos: position{line: 869, col: 1, offset: 27309}, + expr: &zeroOrMoreExpr{ + pos: position{line: 870, col: 4, offset: 27336}, + expr: &actionExpr{ + pos: position{line: 870, col: 5, offset: 27337}, + run: (*parser).callonSidebarBlockContent2, + expr: &seqExpr{ + pos: position{line: 870, col: 5, offset: 27337}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 870, col: 5, offset: 27337}, + expr: &choiceExpr{ + pos: position{line: 867, col: 29, offset: 27279}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 599, col: 26, offset: 19258}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 599, col: 26, offset: 19258}, + val: "****", + ignoreCase: false, + want: "\"****\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 599, col: 33, offset: 19265}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSidebarBlockContent9, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, - run: (*parser).callonInlineElement72, - expr: &seqExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, - exprs: []interface{}{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSidebarBlockContent12, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1538, col: 27, offset: 54613}, - val: "<<", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\"<<\"", - }, - &labeledExpr{ - pos: position{line: 1538, col: 32, offset: 54618}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonInlineElement76, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, - }, - }, - }, + want: "\"\\n\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1538, col: 40, offset: 54626}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineElement82, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, &litMatcher{ - pos: position{line: 1538, col: 47, offset: 54633}, - val: ",", + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - want: "\",\"", - }, - &labeledExpr{ - pos: position{line: 1538, col: 51, offset: 54637}, - label: "label", - expr: &oneOrMoreExpr{ - pos: position{line: 1548, col: 24, offset: 55025}, - expr: &choiceExpr{ - pos: position{line: 1549, col: 5, offset: 55031}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, - run: (*parser).callonInlineElement88, - expr: &seqExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 1549, col: 6, offset: 55032}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 1549, col: 14, offset: 55040}, - expr: &charClassMatcher{ - pos: position{line: 1549, col: 14, offset: 55040}, - val: "[^\\r\\n{<>]", - chars: []rune{'\r', '\n', '{', '<', '>'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonInlineElement93, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonInlineElement97, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1553, col: 6, offset: 55250}, - run: (*parser).callonInlineElement103, - expr: &litMatcher{ - pos: position{line: 1553, col: 6, offset: 55250}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1538, col: 79, offset: 54665}, - val: ">>", - ignoreCase: false, - want: "\">>\"", + want: "\"\\r\"", }, }, }, }, - &actionExpr{ - pos: position{line: 1540, col: 5, offset: 54730}, - run: (*parser).callonInlineElement106, - expr: &seqExpr{ - pos: position{line: 1540, col: 5, offset: 54730}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1540, col: 5, offset: 54730}, - val: "<<", - ignoreCase: false, - want: "\"<<\"", - }, - &labeledExpr{ - pos: position{line: 1540, col: 10, offset: 54735}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonInlineElement110, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1540, col: 18, offset: 54743}, - val: ">>", - ignoreCase: false, - want: "\">>\"", - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - &actionExpr{ - pos: position{line: 2206, col: 9, offset: 77913}, - run: (*parser).callonInlineElement114, - expr: &charClassMatcher{ - pos: position{line: 2206, col: 10, offset: 77914}, - val: "[<>&]", - chars: []rune{'<', '>', '&'}, - ignoreCase: false, - inverted: false, - }, - }, - &actionExpr{ - pos: position{line: 2171, col: 15, offset: 76747}, - run: (*parser).callonInlineElement116, - expr: &litMatcher{ - pos: position{line: 2171, col: 15, offset: 76747}, - val: "`'", - ignoreCase: false, - want: "\"`'\"", - }, - }, - &actionExpr{ - pos: position{line: 2177, col: 14, offset: 76854}, - run: (*parser).callonInlineElement118, - expr: &litMatcher{ - pos: position{line: 2177, col: 14, offset: 76854}, - val: "(C)", - ignoreCase: false, - want: "\"(C)\"", - }, - }, - &actionExpr{ - pos: position{line: 2180, col: 14, offset: 76921}, - run: (*parser).callonInlineElement120, - expr: &litMatcher{ - pos: position{line: 2180, col: 14, offset: 76921}, - val: "(TM)", - ignoreCase: false, - want: "\"(TM)\"", - }, - }, - &actionExpr{ - pos: position{line: 2183, col: 15, offset: 76990}, - run: (*parser).callonInlineElement122, - expr: &litMatcher{ - pos: position{line: 2183, col: 15, offset: 76990}, - val: "(R)", - ignoreCase: false, - want: "\"(R)\"", - }, - }, - &actionExpr{ - pos: position{line: 2186, col: 13, offset: 77056}, - run: (*parser).callonInlineElement124, - expr: &litMatcher{ - pos: position{line: 2186, col: 13, offset: 77056}, - val: "...", - ignoreCase: false, - want: "\"...\"", - }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, - &actionExpr{ - pos: position{line: 2194, col: 22, offset: 77354}, - run: (*parser).callonInlineElement126, - expr: &seqExpr{ - pos: position{line: 2194, col: 22, offset: 77354}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &litMatcher{ - pos: position{line: 2194, col: 31, offset: 77363}, - val: "'", - ignoreCase: false, - want: "\"'\"", - }, - &andExpr{ - pos: position{line: 2194, col: 35, offset: 77367}, - expr: &charClassMatcher{ - pos: position{line: 2194, col: 36, offset: 77368}, - val: "[\\pL]", - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 871, col: 5, offset: 27367}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 871, col: 11, offset: 27373}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 871, col: 11, offset: 27373}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + run: (*parser).callonSidebarBlockContent24, + expr: &seqExpr{ + pos: position{line: 602, col: 5, offset: 19307}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 602, col: 5, offset: 19307}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, - }, - }, - &ruleRefExpr{ - pos: position{line: 982, col: 15, offset: 32277}, - name: "InlineUserMacro", - }, - &actionExpr{ - pos: position{line: 221, col: 25, offset: 7126}, - run: (*parser).callonInlineElement133, - expr: &seqExpr{ - pos: position{line: 221, col: 25, offset: 7126}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 221, col: 25, offset: 7126}, - val: "{counter:", - ignoreCase: false, - want: "\"{counter:\"", + &labeledExpr{ + pos: position{line: 603, col: 5, offset: 19380}, + label: "content", + expr: &actionExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + run: (*parser).callonSidebarBlockContent30, + expr: &zeroOrMoreExpr{ + pos: position{line: 603, col: 14, offset: 19389}, + expr: &charClassMatcher{ + pos: position{line: 603, col: 14, offset: 19389}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, }, - &labeledExpr{ - pos: position{line: 221, col: 37, offset: 7138}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonInlineElement137, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSidebarBlockContent34, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - inverted: false, + want: "\"\\n\"", }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, - &labeledExpr{ - pos: position{line: 221, col: 56, offset: 7157}, - label: "start", - expr: &zeroOrOneExpr{ - pos: position{line: 221, col: 62, offset: 7163}, - expr: &actionExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - run: (*parser).callonInlineElement144, - expr: &seqExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 229, col: 21, offset: 7430}, - label: "start", - expr: &choiceExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - run: (*parser).callonInlineElement149, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "FileInclusion", + pos: position{line: 1009, col: 1, offset: 32077}, + expr: &actionExpr{ + pos: position{line: 1010, col: 5, offset: 32099}, + run: (*parser).callonFileInclusion1, + expr: &seqExpr{ + pos: position{line: 1010, col: 5, offset: 32099}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 1010, col: 5, offset: 32099}, + run: (*parser).callonFileInclusion3, + }, + &stateCodeExpr{ + pos: position{line: 1014, col: 5, offset: 32186}, + run: (*parser).callonFileInclusion4, + }, + &labeledExpr{ + pos: position{line: 1019, col: 5, offset: 32353}, + label: "incl", + expr: &actionExpr{ + pos: position{line: 1020, col: 9, offset: 32368}, + run: (*parser).callonFileInclusion6, + expr: &seqExpr{ + pos: position{line: 1020, col: 9, offset: 32368}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1020, col: 9, offset: 32368}, + val: "include::", + ignoreCase: false, + want: "\"include::\"", + }, + &labeledExpr{ + pos: position{line: 1021, col: 9, offset: 32389}, + label: "path", + expr: &actionExpr{ + pos: position{line: 2909, col: 17, offset: 96362}, + run: (*parser).callonFileInclusion10, + expr: &labeledExpr{ + pos: position{line: 2909, col: 17, offset: 96362}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 2909, col: 22, offset: 96367}, + expr: &choiceExpr{ + pos: position{line: 2909, col: 23, offset: 96368}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2921, col: 13, offset: 96772}, + run: (*parser).callonFileInclusion14, + expr: &labeledExpr{ + pos: position{line: 2921, col: 13, offset: 96772}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2921, col: 22, offset: 96781}, + expr: &choiceExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + run: (*parser).callonFileInclusion18, + expr: &oneOrMoreExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, expr: &charClassMatcher{ - pos: position{line: 229, col: 28, offset: 7437}, - val: "[A-Za-z]", - ranges: []rune{'A', 'Z', 'a', 'z'}, + pos: position{line: 2922, col: 6, offset: 96788}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, ignoreCase: false, - inverted: false, + inverted: true, }, }, - &actionExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - run: (*parser).callonInlineElement151, - expr: &oneOrMoreExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - expr: &charClassMatcher{ - pos: position{line: 231, col: 9, offset: 7491}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonFileInclusion21, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonFileInclusion23, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonFileInclusion26, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonFileInclusion30, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonFileInclusion37, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonFileInclusion42, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonFileInclusion44, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonFileInclusion48, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonFileInclusion52, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonFileInclusion59, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonFileInclusion64, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonFileInclusion66, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonFileInclusion70, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonFileInclusion74, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonFileInclusion80, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonFileInclusion82, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonFileInclusion85, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonFileInclusion87, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonFileInclusion91, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonFileInclusion95, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonFileInclusion101, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonFileInclusion106, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonFileInclusion108, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonFileInclusion111, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonFileInclusion115, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonFileInclusion122, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonFileInclusion127, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonFileInclusion129, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonFileInclusion133, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonFileInclusion137, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonFileInclusion144, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonFileInclusion149, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonFileInclusion151, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonFileInclusion155, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonFileInclusion159, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonFileInclusion165, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonFileInclusion168, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonFileInclusion172, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonFileInclusion176, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, }, }, + &actionExpr{ + pos: position{line: 2928, col: 7, offset: 97012}, + run: (*parser).callonFileInclusion178, + expr: &litMatcher{ + pos: position{line: 2928, col: 7, offset: 97012}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, }, }, }, }, }, - }, - }, - &litMatcher{ - pos: position{line: 221, col: 78, offset: 7179}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 225, col: 25, offset: 7281}, - run: (*parser).callonInlineElement155, - expr: &seqExpr{ - pos: position{line: 225, col: 25, offset: 7281}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 225, col: 25, offset: 7281}, - val: "{counter2:", - ignoreCase: false, - want: "\"{counter2:\"", - }, - &labeledExpr{ - pos: position{line: 225, col: 38, offset: 7294}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonInlineElement159, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonFileInclusion180, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", ignoreCase: false, - inverted: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonFileInclusion184, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", }, }, }, }, }, }, - &labeledExpr{ - pos: position{line: 225, col: 57, offset: 7313}, - label: "start", - expr: &zeroOrOneExpr{ - pos: position{line: 225, col: 63, offset: 7319}, - expr: &actionExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - run: (*parser).callonInlineElement166, - expr: &seqExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", - ignoreCase: false, - want: "\":\"", + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1022, col: 9, offset: 32418}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 1022, col: 27, offset: 32436}, + name: "InlineAttributes", + }, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 1026, col: 5, offset: 32597}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonFileInclusion191, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonFileInclusion194, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "LineRanges", + pos: position{line: 1033, col: 1, offset: 32730}, + expr: &actionExpr{ + pos: position{line: 1033, col: 15, offset: 32744}, + run: (*parser).callonLineRanges1, + expr: &seqExpr{ + pos: position{line: 1033, col: 15, offset: 32744}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1033, col: 15, offset: 32744}, + label: "value", + expr: &choiceExpr{ + pos: position{line: 1033, col: 22, offset: 32751}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1040, col: 23, offset: 32934}, + run: (*parser).callonLineRanges5, + expr: &seqExpr{ + pos: position{line: 1040, col: 23, offset: 32934}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1040, col: 23, offset: 32934}, + label: "first", + expr: &choiceExpr{ + pos: position{line: 1040, col: 30, offset: 32941}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1049, col: 19, offset: 33299}, + run: (*parser).callonLineRanges9, + expr: &seqExpr{ + pos: position{line: 1049, col: 19, offset: 33299}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1049, col: 19, offset: 33299}, + label: "start", + expr: &actionExpr{ + pos: position{line: 2944, col: 11, offset: 97430}, + run: (*parser).callonLineRanges12, + expr: &seqExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + expr: &litMatcher{ + pos: position{line: 2944, col: 12, offset: 97431}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2944, col: 17, offset: 97436}, + expr: &actionExpr{ + pos: position{line: 2940, col: 10, offset: 97370}, + run: (*parser).callonLineRanges17, + expr: &charClassMatcher{ + pos: position{line: 2940, col: 10, offset: 97370}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, }, - &labeledExpr{ - pos: position{line: 229, col: 21, offset: 7430}, - label: "start", - expr: &choiceExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - run: (*parser).callonInlineElement171, - expr: &charClassMatcher{ - pos: position{line: 229, col: 28, offset: 7437}, - val: "[A-Za-z]", - ranges: []rune{'A', 'Z', 'a', 'z'}, + }, + &litMatcher{ + pos: position{line: 1049, col: 34, offset: 33314}, + val: "..", + ignoreCase: false, + want: "\"..\"", + }, + &labeledExpr{ + pos: position{line: 1049, col: 39, offset: 33319}, + label: "end", + expr: &actionExpr{ + pos: position{line: 2944, col: 11, offset: 97430}, + run: (*parser).callonLineRanges21, + expr: &seqExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + expr: &litMatcher{ + pos: position{line: 2944, col: 12, offset: 97431}, + val: "-", ignoreCase: false, - inverted: false, + want: "\"-\"", }, }, - &actionExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - run: (*parser).callonInlineElement173, - expr: &oneOrMoreExpr{ - pos: position{line: 231, col: 9, offset: 7491}, + &oneOrMoreExpr{ + pos: position{line: 2944, col: 17, offset: 97436}, + expr: &actionExpr{ + pos: position{line: 2940, col: 10, offset: 97370}, + run: (*parser).callonLineRanges26, expr: &charClassMatcher{ - pos: position{line: 231, col: 9, offset: 7491}, + pos: position{line: 2940, col: 10, offset: 97370}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -18829,126 +21061,288 @@ var g = &grammar{ }, }, }, - }, - &litMatcher{ - pos: position{line: 225, col: 79, offset: 7335}, - val: "}", - ignoreCase: false, - want: "\"}\"", + &actionExpr{ + pos: position{line: 1053, col: 20, offset: 33439}, + run: (*parser).callonLineRanges28, + expr: &labeledExpr{ + pos: position{line: 1053, col: 20, offset: 33439}, + label: "singleline", + expr: &actionExpr{ + pos: position{line: 2944, col: 11, offset: 97430}, + run: (*parser).callonLineRanges30, + expr: &seqExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + expr: &litMatcher{ + pos: position{line: 2944, col: 12, offset: 97431}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2944, col: 17, offset: 97436}, + expr: &actionExpr{ + pos: position{line: 2940, col: 10, offset: 97370}, + run: (*parser).callonLineRanges35, + expr: &charClassMatcher{ + pos: position{line: 2940, col: 10, offset: 97370}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, - }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonInlineElement177, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonInlineElement181, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 1041, col: 5, offset: 32980}, + label: "others", + expr: &oneOrMoreExpr{ + pos: position{line: 1041, col: 12, offset: 32987}, + expr: &actionExpr{ + pos: position{line: 1042, col: 9, offset: 32997}, + run: (*parser).callonLineRanges39, + expr: &seqExpr{ + pos: position{line: 1042, col: 9, offset: 32997}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1042, col: 10, offset: 32998}, + val: "[,;]", + chars: []rune{',', ';'}, + ignoreCase: false, + inverted: false, + }, + &labeledExpr{ + pos: position{line: 1043, col: 9, offset: 33115}, + label: "other", + expr: &choiceExpr{ + pos: position{line: 1043, col: 16, offset: 33122}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1049, col: 19, offset: 33299}, + run: (*parser).callonLineRanges44, + expr: &seqExpr{ + pos: position{line: 1049, col: 19, offset: 33299}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1049, col: 19, offset: 33299}, + label: "start", + expr: &actionExpr{ + pos: position{line: 2944, col: 11, offset: 97430}, + run: (*parser).callonLineRanges47, + expr: &seqExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + expr: &litMatcher{ + pos: position{line: 2944, col: 12, offset: 97431}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2944, col: 17, offset: 97436}, + expr: &actionExpr{ + pos: position{line: 2940, col: 10, offset: 97370}, + run: (*parser).callonLineRanges52, + expr: &charClassMatcher{ + pos: position{line: 2940, col: 10, offset: 97370}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1049, col: 34, offset: 33314}, + val: "..", + ignoreCase: false, + want: "\"..\"", + }, + &labeledExpr{ + pos: position{line: 1049, col: 39, offset: 33319}, + label: "end", + expr: &actionExpr{ + pos: position{line: 2944, col: 11, offset: 97430}, + run: (*parser).callonLineRanges56, + expr: &seqExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + expr: &litMatcher{ + pos: position{line: 2944, col: 12, offset: 97431}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2944, col: 17, offset: 97436}, + expr: &actionExpr{ + pos: position{line: 2940, col: 10, offset: 97370}, + run: (*parser).callonLineRanges61, + expr: &charClassMatcher{ + pos: position{line: 2940, col: 10, offset: 97370}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1053, col: 20, offset: 33439}, + run: (*parser).callonLineRanges63, + expr: &labeledExpr{ + pos: position{line: 1053, col: 20, offset: 33439}, + label: "singleline", + expr: &actionExpr{ + pos: position{line: 2944, col: 11, offset: 97430}, + run: (*parser).callonLineRanges65, + expr: &seqExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + expr: &litMatcher{ + pos: position{line: 2944, col: 12, offset: 97431}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2944, col: 17, offset: 97436}, + expr: &actionExpr{ + pos: position{line: 2940, col: 10, offset: 97370}, + run: (*parser).callonLineRanges70, + expr: &charClassMatcher{ + pos: position{line: 2940, col: 10, offset: 97370}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, }, }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, }, }, }, - &actionExpr{ - pos: position{line: 237, col: 20, offset: 7607}, - run: (*parser).callonInlineElement187, - expr: &seqExpr{ - pos: position{line: 237, col: 20, offset: 7607}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 237, col: 20, offset: 7607}, - val: "[[", - ignoreCase: false, - want: "\"[[\"", - }, - &labeledExpr{ - pos: position{line: 237, col: 25, offset: 7612}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonInlineElement191, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, + }, + }, + &actionExpr{ + pos: position{line: 1049, col: 19, offset: 33299}, + run: (*parser).callonLineRanges72, + expr: &seqExpr{ + pos: position{line: 1049, col: 19, offset: 33299}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1049, col: 19, offset: 33299}, + label: "start", + expr: &actionExpr{ + pos: position{line: 2944, col: 11, offset: 97430}, + run: (*parser).callonLineRanges75, + expr: &seqExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + expr: &litMatcher{ + pos: position{line: 2944, col: 12, offset: 97431}, + val: "-", ignoreCase: false, - inverted: true, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2944, col: 17, offset: 97436}, + expr: &actionExpr{ + pos: position{line: 2940, col: 10, offset: 97370}, + run: (*parser).callonLineRanges80, + expr: &charClassMatcher{ + pos: position{line: 2940, col: 10, offset: 97370}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, }, - &litMatcher{ - pos: position{line: 237, col: 33, offset: 7620}, - val: "]]", - ignoreCase: false, - want: "\"]]\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 237, col: 38, offset: 7625}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + }, + }, + &litMatcher{ + pos: position{line: 1049, col: 34, offset: 33314}, + val: "..", + ignoreCase: false, + want: "\"..\"", + }, + &labeledExpr{ + pos: position{line: 1049, col: 39, offset: 33319}, + label: "end", + expr: &actionExpr{ + pos: position{line: 2944, col: 11, offset: 97430}, + run: (*parser).callonLineRanges84, + expr: &seqExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + expr: &litMatcher{ + pos: position{line: 2944, col: 12, offset: 97431}, + val: "-", ignoreCase: false, - want: "\" \"", + want: "\"-\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineElement198, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &oneOrMoreExpr{ + pos: position{line: 2944, col: 17, offset: 97436}, + expr: &actionExpr{ + pos: position{line: 2940, col: 10, offset: 97370}, + run: (*parser).callonLineRanges89, + expr: &charClassMatcher{ + pos: position{line: 2940, col: 10, offset: 97370}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, @@ -18957,150 +21351,203 @@ var g = &grammar{ }, }, }, - &actionExpr{ - pos: position{line: 2147, col: 23, offset: 75975}, - run: (*parser).callonInlineElement200, + }, + }, + &actionExpr{ + pos: position{line: 1053, col: 20, offset: 33439}, + run: (*parser).callonLineRanges91, + expr: &labeledExpr{ + pos: position{line: 1053, col: 20, offset: 33439}, + label: "singleline", + expr: &actionExpr{ + pos: position{line: 2944, col: 11, offset: 97430}, + run: (*parser).callonLineRanges93, expr: &seqExpr{ - pos: position{line: 2147, col: 23, offset: 75975}, + pos: position{line: 2944, col: 12, offset: 97431}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2147, col: 23, offset: 75975}, - val: "(((", - ignoreCase: false, - want: "\"(((\"", + &zeroOrOneExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + expr: &litMatcher{ + pos: position{line: 2944, col: 12, offset: 97431}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, }, - &labeledExpr{ - pos: position{line: 2147, col: 29, offset: 75981}, - label: "term1", + &oneOrMoreExpr{ + pos: position{line: 2944, col: 17, offset: 97436}, expr: &actionExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - run: (*parser).callonInlineElement204, - expr: &oneOrMoreExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - expr: &choiceExpr{ - pos: position{line: 2154, col: 31, offset: 76313}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[ 0-9\\pL]", - chars: []rune{' '}, + pos: position{line: 2940, col: 10, offset: 97370}, + run: (*parser).callonLineRanges98, + expr: &charClassMatcher{ + pos: position{line: 2940, col: 10, offset: 97370}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + { + name: "TagRanges", + pos: position{line: 1058, col: 1, offset: 33574}, + expr: &actionExpr{ + pos: position{line: 1058, col: 14, offset: 33587}, + run: (*parser).callonTagRanges1, + expr: &seqExpr{ + pos: position{line: 1058, col: 14, offset: 33587}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1058, col: 14, offset: 33587}, + label: "value", + expr: &actionExpr{ + pos: position{line: 1062, col: 22, offset: 33724}, + run: (*parser).callonTagRanges4, + expr: &seqExpr{ + pos: position{line: 1062, col: 22, offset: 33724}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1062, col: 22, offset: 33724}, + label: "first", + expr: &choiceExpr{ + pos: position{line: 1071, col: 13, offset: 34034}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1071, col: 13, offset: 34034}, + run: (*parser).callonTagRanges8, + expr: &labeledExpr{ + pos: position{line: 1071, col: 13, offset: 34034}, + label: "tag", + expr: &choiceExpr{ + pos: position{line: 1071, col: 18, offset: 34039}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonTagRanges11, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineElement208, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, }, }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2148, col: 5, offset: 76020}, - label: "term2", - expr: &zeroOrOneExpr{ - pos: position{line: 2148, col: 11, offset: 76026}, - expr: &actionExpr{ - pos: position{line: 2148, col: 12, offset: 76027}, - run: (*parser).callonInlineElement212, - expr: &seqExpr{ - pos: position{line: 2148, col: 12, offset: 76027}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 2148, col: 12, offset: 76027}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineElement217, + &actionExpr{ + pos: position{line: 1077, col: 16, offset: 34239}, + run: (*parser).callonTagRanges14, + expr: &seqExpr{ + pos: position{line: 1077, col: 16, offset: 34239}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1077, col: 16, offset: 34239}, + label: "stars", + expr: &actionExpr{ + pos: position{line: 1077, col: 23, offset: 34246}, + run: (*parser).callonTagRanges17, + expr: &oneOrMoreExpr{ + pos: position{line: 1077, col: 23, offset: 34246}, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 1077, col: 24, offset: 34247}, + val: "*", ignoreCase: false, - want: "\"\\t\"", + want: "\"*\"", }, }, }, }, + &andCodeExpr{ + pos: position{line: 1080, col: 5, offset: 34301}, + run: (*parser).callonTagRanges20, + }, }, - &litMatcher{ - pos: position{line: 2148, col: 19, offset: 76034}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2148, col: 23, offset: 76038}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineElement223, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1073, col: 9, offset: 34127}, + run: (*parser).callonTagRanges21, + expr: &seqExpr{ + pos: position{line: 1073, col: 9, offset: 34127}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1073, col: 9, offset: 34127}, + val: "!", + ignoreCase: false, + want: "\"!\"", + }, + &labeledExpr{ + pos: position{line: 1073, col: 13, offset: 34131}, + label: "tag", + expr: &choiceExpr{ + pos: position{line: 1073, col: 18, offset: 34136}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonTagRanges26, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, - &labeledExpr{ - pos: position{line: 2148, col: 30, offset: 76045}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - run: (*parser).callonInlineElement226, - expr: &oneOrMoreExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - expr: &choiceExpr{ - pos: position{line: 2154, col: 31, offset: 76313}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[ 0-9\\pL]", - chars: []rune{' '}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineElement230, + &actionExpr{ + pos: position{line: 1077, col: 16, offset: 34239}, + run: (*parser).callonTagRanges29, + expr: &seqExpr{ + pos: position{line: 1077, col: 16, offset: 34239}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1077, col: 16, offset: 34239}, + label: "stars", + expr: &actionExpr{ + pos: position{line: 1077, col: 23, offset: 34246}, + run: (*parser).callonTagRanges32, + expr: &oneOrMoreExpr{ + pos: position{line: 1077, col: 23, offset: 34246}, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 1077, col: 24, offset: 34247}, + val: "*", ignoreCase: false, - want: "\"\\t\"", + want: "\"*\"", }, }, }, }, + &andCodeExpr{ + pos: position{line: 1080, col: 5, offset: 34301}, + run: (*parser).callonTagRanges35, + }, }, }, }, @@ -19109,99 +21556,153 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 2149, col: 5, offset: 76112}, - label: "term3", - expr: &zeroOrOneExpr{ - pos: position{line: 2149, col: 11, offset: 76118}, - expr: &actionExpr{ - pos: position{line: 2149, col: 12, offset: 76119}, - run: (*parser).callonInlineElement234, - expr: &seqExpr{ - pos: position{line: 2149, col: 12, offset: 76119}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 2149, col: 12, offset: 76119}, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1063, col: 5, offset: 33745}, + label: "others", + expr: &zeroOrMoreExpr{ + pos: position{line: 1063, col: 12, offset: 33752}, + expr: &actionExpr{ + pos: position{line: 1064, col: 9, offset: 33762}, + run: (*parser).callonTagRanges38, + expr: &seqExpr{ + pos: position{line: 1064, col: 9, offset: 33762}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1064, col: 10, offset: 33763}, + val: "[,;]", + chars: []rune{',', ';'}, + ignoreCase: false, + inverted: false, + }, + &labeledExpr{ + pos: position{line: 1065, col: 9, offset: 33880}, + label: "other", + expr: &choiceExpr{ + pos: position{line: 1071, col: 13, offset: 34034}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1071, col: 13, offset: 34034}, + run: (*parser).callonTagRanges43, + expr: &labeledExpr{ + pos: position{line: 1071, col: 13, offset: 34034}, + label: "tag", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 1071, col: 18, offset: 34039}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineElement239, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonTagRanges46, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, }, }, - }, - }, - }, - &litMatcher{ - pos: position{line: 2149, col: 19, offset: 76126}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2149, col: 23, offset: 76130}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineElement245, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 1077, col: 16, offset: 34239}, + run: (*parser).callonTagRanges49, + expr: &seqExpr{ + pos: position{line: 1077, col: 16, offset: 34239}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1077, col: 16, offset: 34239}, + label: "stars", + expr: &actionExpr{ + pos: position{line: 1077, col: 23, offset: 34246}, + run: (*parser).callonTagRanges52, + expr: &oneOrMoreExpr{ + pos: position{line: 1077, col: 23, offset: 34246}, + expr: &litMatcher{ + pos: position{line: 1077, col: 24, offset: 34247}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1080, col: 5, offset: 34301}, + run: (*parser).callonTagRanges55, + }, + }, }, }, }, }, }, - &labeledExpr{ - pos: position{line: 2149, col: 30, offset: 76137}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - run: (*parser).callonInlineElement248, - expr: &oneOrMoreExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, + }, + &actionExpr{ + pos: position{line: 1073, col: 9, offset: 34127}, + run: (*parser).callonTagRanges56, + expr: &seqExpr{ + pos: position{line: 1073, col: 9, offset: 34127}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1073, col: 9, offset: 34127}, + val: "!", + ignoreCase: false, + want: "\"!\"", + }, + &labeledExpr{ + pos: position{line: 1073, col: 13, offset: 34131}, + label: "tag", expr: &choiceExpr{ - pos: position{line: 2154, col: 31, offset: 76313}, + pos: position{line: 1073, col: 18, offset: 34136}, alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[ 0-9\\pL]", - chars: []rune{' '}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonTagRanges61, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineElement252, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 1077, col: 16, offset: 34239}, + run: (*parser).callonTagRanges64, + expr: &seqExpr{ + pos: position{line: 1077, col: 16, offset: 34239}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1077, col: 16, offset: 34239}, + label: "stars", + expr: &actionExpr{ + pos: position{line: 1077, col: 23, offset: 34246}, + run: (*parser).callonTagRanges67, + expr: &oneOrMoreExpr{ + pos: position{line: 1077, col: 23, offset: 34246}, + expr: &litMatcher{ + pos: position{line: 1077, col: 24, offset: 34247}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1080, col: 5, offset: 34301}, + run: (*parser).callonTagRanges70, + }, + }, }, }, }, @@ -19214,383 +21715,269 @@ var g = &grammar{ }, }, }, - &litMatcher{ - pos: position{line: 2150, col: 5, offset: 76204}, - val: ")))", - ignoreCase: false, - want: "\")))\"", - }, }, }, }, - &ruleRefExpr{ - pos: position{line: 986, col: 15, offset: 32408}, - name: "IndexTerm", - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonInlineElement256, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + { + name: "IncludedFileLine", + pos: position{line: 1087, col: 1, offset: 34468}, + expr: &actionExpr{ + pos: position{line: 1087, col: 21, offset: 34488}, + run: (*parser).callonIncludedFileLine1, + expr: &seqExpr{ + pos: position{line: 1087, col: 21, offset: 34488}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1087, col: 21, offset: 34488}, + label: "content", + expr: &zeroOrMoreExpr{ + pos: position{line: 1087, col: 29, offset: 34496}, + expr: &choiceExpr{ + pos: position{line: 1087, col: 30, offset: 34497}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1091, col: 25, offset: 34677}, + run: (*parser).callonIncludedFileLine6, + expr: &seqExpr{ + pos: position{line: 1091, col: 25, offset: 34677}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1091, col: 25, offset: 34677}, + val: "tag::", + ignoreCase: false, + want: "\"tag::\"", + }, + &labeledExpr{ + pos: position{line: 1091, col: 33, offset: 34685}, + label: "tag", + expr: &actionExpr{ + pos: position{line: 1091, col: 38, offset: 34690}, + run: (*parser).callonIncludedFileLine10, expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonInlineElement260, + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonIncludedFileLine11, expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 2864, col: 14, offset: 94865}, expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, + }, + &litMatcher{ + pos: position{line: 1091, col: 78, offset: 34730}, + val: "[]", + ignoreCase: false, + want: "\"[]\"", }, }, }, - &actionExpr{ - pos: position{line: 2237, col: 12, offset: 79050}, - run: (*parser).callonInlineElement264, - expr: &charClassMatcher{ - pos: position{line: 2237, col: 12, offset: 79050}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, + }, + &actionExpr{ + pos: position{line: 1095, col: 23, offset: 34825}, + run: (*parser).callonIncludedFileLine15, + expr: &seqExpr{ + pos: position{line: 1095, col: 23, offset: 34825}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1095, col: 23, offset: 34825}, + val: "end::", + ignoreCase: false, + want: "\"end::\"", + }, + &labeledExpr{ + pos: position{line: 1095, col: 31, offset: 34833}, + label: "tag", + expr: &actionExpr{ + pos: position{line: 1095, col: 36, offset: 34838}, + run: (*parser).callonIncludedFileLine19, + expr: &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonIncludedFileLine20, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1095, col: 76, offset: 34878}, + val: "[]", + ignoreCase: false, + want: "\"[]\"", + }, }, }, }, + &actionExpr{ + pos: position{line: 1087, col: 74, offset: 34541}, + run: (*parser).callonIncludedFileLine24, + expr: &anyMatcher{ + line: 1087, col: 74, offset: 34541, + }, + }, }, }, }, }, - }, - }, - }, - }, - { - name: "QuotedText", - pos: position{line: 1002, col: 1, offset: 33003}, - expr: &choiceExpr{ - pos: position{line: 1003, col: 5, offset: 33022}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1004, col: 9, offset: 33032}, - run: (*parser).callonQuotedText2, - expr: &seqExpr{ - pos: position{line: 1004, col: 9, offset: 33032}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1004, col: 9, offset: 33032}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1004, col: 20, offset: 33043}, - expr: &ruleRefExpr{ - pos: position{line: 1004, col: 21, offset: 33044}, - name: "LongHandAttributes", - }, - }, - }, - &labeledExpr{ - pos: position{line: 1005, col: 9, offset: 33074}, - label: "text", + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonIncludedFileLine27, expr: &choiceExpr{ - pos: position{line: 1005, col: 15, offset: 33080}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1005, col: 15, offset: 33080}, - name: "UnconstrainedQuotedText", + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - &ruleRefExpr{ - pos: position{line: 1005, col: 41, offset: 33106}, - name: "ConstrainedQuotedText", + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1009, col: 7, offset: 33224}, - name: "EscapedQuotedText", - }, - }, - }, - }, - { - name: "ConstrainedQuotedText", - pos: position{line: 1015, col: 1, offset: 33389}, - expr: &choiceExpr{ - pos: position{line: 1016, col: 5, offset: 33419}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1016, col: 5, offset: 33419}, - name: "SingleQuoteBoldText", - }, - &ruleRefExpr{ - pos: position{line: 1017, col: 7, offset: 33446}, - name: "SingleQuoteItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1018, col: 7, offset: 33474}, - name: "SingleQuoteMarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1019, col: 7, offset: 33502}, - name: "SingleQuoteMonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1020, col: 7, offset: 33534}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1021, col: 7, offset: 33555}, - name: "SuperscriptText", - }, - }, - }, - }, - { - name: "UnconstrainedQuotedText", - pos: position{line: 1023, col: 1, offset: 33573}, - expr: &choiceExpr{ - pos: position{line: 1024, col: 5, offset: 33605}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1024, col: 5, offset: 33605}, - name: "DoubleQuoteBoldText", - }, - &ruleRefExpr{ - pos: position{line: 1025, col: 7, offset: 33631}, - name: "DoubleQuoteItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1026, col: 7, offset: 33659}, - name: "DoubleQuoteMarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1027, col: 7, offset: 33687}, - name: "DoubleQuoteMonospaceText", - }, - }, - }, - }, - { - name: "EscapedQuotedText", - pos: position{line: 1029, col: 1, offset: 33713}, - expr: &choiceExpr{ - pos: position{line: 1030, col: 5, offset: 33739}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1030, col: 5, offset: 33739}, - name: "EscapedBoldText", - }, - &ruleRefExpr{ - pos: position{line: 1031, col: 7, offset: 33762}, - name: "EscapedItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1032, col: 7, offset: 33786}, - name: "EscapedMarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1033, col: 7, offset: 33810}, - name: "EscapedMonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1034, col: 7, offset: 33838}, - name: "EscapedSubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1035, col: 7, offset: 33866}, - name: "EscapedSuperscriptText", - }, - }, - }, - }, - { - name: "BoldText", - pos: position{line: 1053, col: 1, offset: 34253}, - expr: &choiceExpr{ - pos: position{line: 1053, col: 13, offset: 34265}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1053, col: 13, offset: 34265}, - name: "DoubleQuoteBoldText", - }, - &ruleRefExpr{ - pos: position{line: 1053, col: 35, offset: 34287}, - name: "SingleQuoteBoldText", - }, - }, - }, - }, - { - name: "DoubleQuoteBoldText", - pos: position{line: 1055, col: 1, offset: 34354}, - expr: &actionExpr{ - pos: position{line: 1055, col: 24, offset: 34377}, - run: (*parser).callonDoubleQuoteBoldText1, - expr: &seqExpr{ - pos: position{line: 1055, col: 24, offset: 34377}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1055, col: 24, offset: 34377}, - val: "**", - ignoreCase: false, - want: "\"**\"", - }, - &labeledExpr{ - pos: position{line: 1055, col: 29, offset: 34382}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1055, col: 39, offset: 34392}, - name: "DoubleQuoteBoldTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1055, col: 68, offset: 34421}, - val: "**", - ignoreCase: false, - want: "\"**\"", - }, - }, - }, - }, - }, - { - name: "DoubleQuoteBoldTextElements", - pos: position{line: 1059, col: 1, offset: 34512}, - expr: &zeroOrMoreExpr{ - pos: position{line: 1059, col: 32, offset: 34543}, - expr: &ruleRefExpr{ - pos: position{line: 1059, col: 32, offset: 34543}, - name: "DoubleQuoteBoldTextElement", }, }, }, { - name: "DoubleQuoteBoldTextElement", - pos: position{line: 1061, col: 1, offset: 34574}, + name: "InlineElement", + pos: position{line: 1153, col: 1, offset: 36570}, expr: &actionExpr{ - pos: position{line: 1061, col: 31, offset: 34604}, - run: (*parser).callonDoubleQuoteBoldTextElement1, - expr: &seqExpr{ - pos: position{line: 1061, col: 31, offset: 34604}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1061, col: 31, offset: 34604}, - expr: &litMatcher{ - pos: position{line: 1061, col: 33, offset: 34606}, - val: "**", - ignoreCase: false, - want: "\"**\"", - }, - }, - &labeledExpr{ - pos: position{line: 1061, col: 39, offset: 34612}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 1061, col: 48, offset: 34621}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonDoubleQuoteBoldTextElement7, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, + pos: position{line: 1154, col: 5, offset: 36593}, + run: (*parser).callonInlineElement1, + expr: &labeledExpr{ + pos: position{line: 1154, col: 5, offset: 36593}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1155, col: 9, offset: 36611}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + run: (*parser).callonInlineElement4, + expr: &seqExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + expr: &charClassMatcher{ + pos: position{line: 2893, col: 5, offset: 95917}, + val: "[,;!?0-9\\pL]", + chars: []rune{',', ';', '!', '?'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &choiceExpr{ + pos: position{line: 2894, col: 6, offset: 95937}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlineElement9, expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, }, &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, + pos: position{line: 2894, col: 14, offset: 95945}, expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, + pos: position{line: 2894, col: 16, offset: 95947}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, + pos: position{line: 2894, col: 16, offset: 95947}, + val: "[.�]", + chars: []rune{'.', '�'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonDoubleQuoteBoldTextElement16, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonInlineElement14, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -19599,622 +21986,1067 @@ var g = &grammar{ }, }, }, - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonInlineElement21, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDoubleQuoteBoldTextElement26, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + }, + &actionExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + run: (*parser).callonInlineElement24, + expr: &seqExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + run: (*parser).callonInlineElement26, + }, + &litMatcher{ + pos: position{line: 1002, col: 5, offset: 31813}, + val: "+", ignoreCase: false, - want: "\"\\t\"", + want: "\"+\"", }, - }, - &seqExpr{ - pos: position{line: 1063, col: 7, offset: 34677}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, + &zeroOrMoreExpr{ + pos: position{line: 1002, col: 9, offset: 31817}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlineElement29, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, - ¬Expr{ - pos: position{line: 1063, col: 15, offset: 34685}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", + }, + &andExpr{ + pos: position{line: 1002, col: 16, offset: 31824}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonInlineElement33, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1064, col: 7, offset: 34700}, - name: "QuotedString", - }, - &ruleRefExpr{ - pos: position{line: 1065, col: 7, offset: 34719}, - name: "QuotedTextInDoubleQuoteBoldText", - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonDoubleQuoteBoldTextElement38, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonDoubleQuoteBoldTextElement42, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, + }, + }, + &seqExpr{ + pos: position{line: 1158, col: 11, offset: 36710}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1158, col: 11, offset: 36710}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonInlineElement43, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - inverted: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, - &charClassMatcher{ - pos: position{line: 1083, col: 5, offset: 35205}, - val: "[^\\r\\n*]", - chars: []rune{'\r', '\n', '*'}, - ignoreCase: false, - inverted: true, - }, - &actionExpr{ - pos: position{line: 1084, col: 7, offset: 35302}, - run: (*parser).callonDoubleQuoteBoldTextElement47, - expr: &seqExpr{ - pos: position{line: 1084, col: 7, offset: 35302}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1084, col: 7, offset: 35302}, - val: "**", - ignoreCase: false, - want: "\"**\"", - }, - &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonDoubleQuoteBoldTextElement50, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &choiceExpr{ + pos: position{line: 1159, col: 13, offset: 36729}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonInlineElement51, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonInlineElement53, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonInlineElement56, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonInlineElement58, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonInlineElement62, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlineElement66, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonInlineElement72, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonInlineElement77, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonInlineElement79, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonInlineElement82, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonInlineElement86, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonInlineElement93, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonInlineElement98, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonInlineElement100, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonInlineElement104, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonInlineElement108, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonInlineElement115, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonInlineElement120, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonInlineElement122, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonInlineElement126, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonInlineElement130, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonInlineElement136, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonInlineElement139, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonInlineElement143, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonInlineElement147, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "QuotedTextInDoubleQuoteBoldText", - pos: position{line: 1071, col: 1, offset: 34857}, - expr: &actionExpr{ - pos: position{line: 1072, col: 5, offset: 34897}, - run: (*parser).callonQuotedTextInDoubleQuoteBoldText1, - expr: &seqExpr{ - pos: position{line: 1072, col: 5, offset: 34897}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1072, col: 5, offset: 34897}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1072, col: 16, offset: 34908}, - expr: &ruleRefExpr{ - pos: position{line: 1072, col: 17, offset: 34909}, - name: "LongHandAttributes", - }, - }, - }, - &labeledExpr{ - pos: position{line: 1073, col: 5, offset: 34935}, - label: "text", - expr: &choiceExpr{ - pos: position{line: 1073, col: 11, offset: 34941}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1073, col: 11, offset: 34941}, - name: "SingleQuoteBoldText", - }, - &ruleRefExpr{ - pos: position{line: 1074, col: 11, offset: 34971}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1075, col: 11, offset: 34992}, - name: "MarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1076, col: 11, offset: 35013}, - name: "MonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1077, col: 11, offset: 35037}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1078, col: 11, offset: 35061}, - name: "SuperscriptText", - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "SingleQuoteBoldText", - pos: position{line: 1088, col: 1, offset: 35478}, - expr: &choiceExpr{ - pos: position{line: 1089, col: 5, offset: 35506}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1089, col: 5, offset: 35506}, - run: (*parser).callonSingleQuoteBoldText2, - expr: &seqExpr{ - pos: position{line: 1089, col: 5, offset: 35506}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1089, col: 6, offset: 35507}, - val: "*", - ignoreCase: false, - want: "\"*\"", - }, - ¬Expr{ - pos: position{line: 1089, col: 10, offset: 35511}, - expr: &litMatcher{ - pos: position{line: 1089, col: 11, offset: 35512}, - val: "*", - ignoreCase: false, - want: "\"*\"", - }, - }, - &labeledExpr{ - pos: position{line: 1089, col: 16, offset: 35517}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1089, col: 26, offset: 35527}, - name: "SingleQuoteBoldTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1089, col: 55, offset: 35556}, - val: "*", - ignoreCase: false, - want: "\"*\"", - }, - &andExpr{ - pos: position{line: 1089, col: 59, offset: 35560}, - expr: ¬Expr{ - pos: position{line: 1089, col: 61, offset: 35562}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1091, col: 9, offset: 35769}, - run: (*parser).callonSingleQuoteBoldText13, - expr: &seqExpr{ - pos: position{line: 1091, col: 9, offset: 35769}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1091, col: 9, offset: 35769}, - val: "*", - ignoreCase: false, - want: "\"*\"", - }, - &labeledExpr{ - pos: position{line: 1091, col: 13, offset: 35773}, - label: "elements", - expr: &seqExpr{ - pos: position{line: 1091, col: 23, offset: 35783}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1091, col: 23, offset: 35783}, - val: "*", - ignoreCase: false, - want: "\"*\"", - }, &ruleRefExpr{ - pos: position{line: 1091, col: 27, offset: 35787}, - name: "SingleQuoteBoldTextElements", - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1091, col: 56, offset: 35816}, - val: "*", - ignoreCase: false, - want: "\"*\"", - }, - }, - }, - }, - }, - }, - }, - { - name: "SingleQuoteBoldTextElements", - pos: position{line: 1095, col: 1, offset: 36034}, - expr: &seqExpr{ - pos: position{line: 1095, col: 32, offset: 36065}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1095, col: 32, offset: 36065}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSingleQuoteBoldTextElements5, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 1095, col: 39, offset: 36072}, - expr: &ruleRefExpr{ - pos: position{line: 1095, col: 39, offset: 36072}, - name: "SingleQuoteBoldTextElement", - }, - }, - }, - }, - }, - { - name: "SingleQuoteBoldTextElement", - pos: position{line: 1097, col: 1, offset: 36101}, - expr: &choiceExpr{ - pos: position{line: 1098, col: 5, offset: 36136}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonSingleQuoteBoldTextElement2, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + pos: position{line: 1160, col: 15, offset: 36760}, + name: "Quote", }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonSingleQuoteBoldTextElement11, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonInlineElement150, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonInlineElement152, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonInlineElement155, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonInlineElement159, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonInlineElement166, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonInlineElement171, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonInlineElement173, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonInlineElement177, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonInlineElement181, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonInlineElement188, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonInlineElement193, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonInlineElement195, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonInlineElement199, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonInlineElement203, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &ruleRefExpr{ + pos: position{line: 1162, col: 15, offset: 36817}, + name: "InlineMacro", + }, + &actionExpr{ + pos: position{line: 2683, col: 15, offset: 89501}, + run: (*parser).callonInlineElement210, + expr: &litMatcher{ + pos: position{line: 2683, col: 15, offset: 89501}, + val: "`'", ignoreCase: false, - inverted: false, + want: "\"`'\"", }, }, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1099, col: 7, offset: 36147}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - ¬Expr{ - pos: position{line: 1099, col: 15, offset: 36155}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1100, col: 7, offset: 36170}, - name: "QuotedString", - }, - &seqExpr{ - pos: position{line: 1101, col: 7, offset: 36189}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 1101, col: 7, offset: 36189}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSingleQuoteBoldTextElement33, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 2689, col: 14, offset: 89616}, + run: (*parser).callonInlineElement212, + expr: &litMatcher{ + pos: position{line: 2689, col: 14, offset: 89616}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, }, - }, - }, - }, - }, - &zeroOrOneExpr{ - pos: position{line: 1101, col: 14, offset: 36196}, - expr: &seqExpr{ - pos: position{line: 1101, col: 15, offset: 36197}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1101, col: 15, offset: 36197}, - val: "*", - ignoreCase: false, - want: "\"*\"", - }, - ¬Expr{ - pos: position{line: 1101, col: 19, offset: 36201}, - expr: &litMatcher{ - pos: position{line: 1101, col: 20, offset: 36202}, - val: "*", - ignoreCase: false, - want: "\"*\"", + &actionExpr{ + pos: position{line: 2693, col: 14, offset: 89692}, + run: (*parser).callonInlineElement214, + expr: &litMatcher{ + pos: position{line: 2693, col: 14, offset: 89692}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, }, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1102, col: 7, offset: 36214}, - name: "QuotedTextInSingleQuoteBoldText", - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonSingleQuoteBoldTextElement41, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonSingleQuoteBoldTextElement45, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2697, col: 15, offset: 89770}, + run: (*parser).callonInlineElement216, + expr: &litMatcher{ + pos: position{line: 2697, col: 15, offset: 89770}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2701, col: 13, offset: 89845}, + run: (*parser).callonInlineElement218, + expr: &litMatcher{ + pos: position{line: 2701, col: 13, offset: 89845}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + run: (*parser).callonInlineElement220, + expr: &seqExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2709, col: 31, offset: 90160}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2709, col: 35, offset: 90164}, + expr: &charClassMatcher{ + pos: position{line: 2709, col: 36, offset: 90165}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonInlineElement226, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonInlineElement230, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2905, col: 12, offset: 96279}, + run: (*parser).callonInlineElement234, + expr: &anyMatcher{ + line: 2905, col: 12, offset: 96279, + }, }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &charClassMatcher{ - pos: position{line: 1117, col: 5, offset: 36662}, - val: "[^\\r\\n*]", - chars: []rune{'\r', '\n', '*'}, - ignoreCase: false, - inverted: true, - }, - &actionExpr{ - pos: position{line: 1118, col: 7, offset: 36759}, - run: (*parser).callonSingleQuoteBoldTextElement50, - expr: &seqExpr{ - pos: position{line: 1118, col: 7, offset: 36759}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1118, col: 7, offset: 36759}, - val: "*", - ignoreCase: false, - want: "\"*\"", - }, - &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonSingleQuoteBoldTextElement53, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, }, }, }, @@ -20225,214 +23057,706 @@ var g = &grammar{ }, }, { - name: "QuotedTextInSingleQuoteBoldText", - pos: position{line: 1106, col: 1, offset: 36315}, + name: "IndexTerm", + pos: position{line: 1181, col: 1, offset: 37602}, expr: &actionExpr{ - pos: position{line: 1107, col: 5, offset: 36355}, - run: (*parser).callonQuotedTextInSingleQuoteBoldText1, + pos: position{line: 1181, col: 14, offset: 37615}, + run: (*parser).callonIndexTerm1, expr: &seqExpr{ - pos: position{line: 1107, col: 5, offset: 36355}, + pos: position{line: 1181, col: 14, offset: 37615}, exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1107, col: 5, offset: 36355}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1107, col: 16, offset: 36366}, - expr: &ruleRefExpr{ - pos: position{line: 1107, col: 17, offset: 36367}, - name: "LongHandAttributes", - }, - }, + &litMatcher{ + pos: position{line: 1181, col: 14, offset: 37615}, + val: "((", + ignoreCase: false, + want: "\"((\"", }, &labeledExpr{ - pos: position{line: 1108, col: 5, offset: 36393}, - label: "text", - expr: &choiceExpr{ - pos: position{line: 1108, col: 11, offset: 36399}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1108, col: 11, offset: 36399}, - name: "DoubleQuoteBoldText", - }, - &ruleRefExpr{ - pos: position{line: 1109, col: 11, offset: 36429}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1110, col: 11, offset: 36450}, - name: "MarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1111, col: 11, offset: 36471}, - name: "MonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1112, col: 11, offset: 36495}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1113, col: 11, offset: 36519}, - name: "SuperscriptText", - }, - }, + pos: position{line: 1181, col: 19, offset: 37620}, + label: "term", + expr: &ruleRefExpr{ + pos: position{line: 1181, col: 25, offset: 37626}, + name: "IndexTermContent", }, }, + &litMatcher{ + pos: position{line: 1181, col: 43, offset: 37644}, + val: "))", + ignoreCase: false, + want: "\"))\"", + }, }, }, }, }, { - name: "EscapedBoldText", - pos: position{line: 1122, col: 1, offset: 36934}, - expr: &choiceExpr{ - pos: position{line: 1123, col: 5, offset: 36958}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1123, col: 5, offset: 36958}, - run: (*parser).callonEscapedBoldText2, - expr: &seqExpr{ - pos: position{line: 1123, col: 5, offset: 36958}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1123, col: 5, offset: 36958}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1045, col: 25, offset: 34151}, - run: (*parser).callonEscapedBoldText5, - expr: &seqExpr{ - pos: position{line: 1045, col: 25, offset: 34151}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1045, col: 25, offset: 34151}, - val: "\\\\", - ignoreCase: false, - want: "\"\\\\\\\\\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1045, col: 30, offset: 34156}, - expr: &litMatcher{ - pos: position{line: 1045, col: 30, offset: 34156}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", + name: "IndexTermContent", + pos: position{line: 1185, col: 1, offset: 37709}, + expr: &actionExpr{ + pos: position{line: 1185, col: 21, offset: 37729}, + run: (*parser).callonIndexTermContent1, + expr: &labeledExpr{ + pos: position{line: 1185, col: 21, offset: 37729}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 1185, col: 30, offset: 37738}, + expr: &choiceExpr{ + pos: position{line: 1185, col: 31, offset: 37739}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2872, col: 5, offset: 95246}, + run: (*parser).callonIndexTermContent5, + expr: &seqExpr{ + pos: position{line: 2872, col: 5, offset: 95246}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2872, col: 5, offset: 95246}, + expr: &charClassMatcher{ + pos: position{line: 2872, col: 5, offset: 95246}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2872, col: 15, offset: 95256}, + expr: &choiceExpr{ + pos: position{line: 2872, col: 17, offset: 95258}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2872, col: 17, offset: 95258}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, }, }, - &litMatcher{ - pos: position{line: 1123, col: 40, offset: 36993}, - val: "**", - ignoreCase: false, - want: "\"**\"", - }, - &labeledExpr{ - pos: position{line: 1123, col: 45, offset: 36998}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1123, col: 55, offset: 37008}, - name: "DoubleQuoteBoldTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1123, col: 84, offset: 37037}, - val: "**", - ignoreCase: false, - want: "\"**\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1125, col: 9, offset: 37194}, - run: (*parser).callonEscapedBoldText14, - expr: &seqExpr{ - pos: position{line: 1125, col: 9, offset: 37194}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1125, col: 9, offset: 37194}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - run: (*parser).callonEscapedBoldText17, - expr: &oneOrMoreExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - expr: &litMatcher{ - pos: position{line: 1041, col: 25, offset: 34086}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", + &actionExpr{ + pos: position{line: 2874, col: 9, offset: 95340}, + run: (*parser).callonIndexTermContent14, + expr: &seqExpr{ + pos: position{line: 2874, col: 9, offset: 95340}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2874, col: 9, offset: 95340}, + expr: &charClassMatcher{ + pos: position{line: 2874, col: 9, offset: 95340}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 19, offset: 95350}, + expr: &seqExpr{ + pos: position{line: 2874, col: 20, offset: 95351}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2874, col: 20, offset: 95351}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 27, offset: 95358}, + expr: &charClassMatcher{ + pos: position{line: 2874, col: 27, offset: 95358}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, }, }, - &litMatcher{ - pos: position{line: 1125, col: 44, offset: 37229}, - val: "**", - ignoreCase: false, - want: "\"**\"", + &ruleRefExpr{ + pos: position{line: 1185, col: 38, offset: 37746}, + name: "QuotedString", }, - &labeledExpr{ - pos: position{line: 1125, col: 49, offset: 37234}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1125, col: 59, offset: 37244}, - name: "SingleQuoteBoldTextElements", + &ruleRefExpr{ + pos: position{line: 1185, col: 53, offset: 37761}, + name: "QuotedText", + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonIndexTermContent25, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, - &litMatcher{ - pos: position{line: 1125, col: 88, offset: 37273}, - val: "*", - ignoreCase: false, - want: "\"*\"", + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonIndexTermContent27, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonIndexTermContent29, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonIndexTermContent32, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonIndexTermContent34, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonIndexTermContent38, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonIndexTermContent42, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonIndexTermContent48, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonIndexTermContent53, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonIndexTermContent55, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonIndexTermContent58, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonIndexTermContent62, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonIndexTermContent69, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonIndexTermContent74, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonIndexTermContent76, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonIndexTermContent80, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonIndexTermContent84, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonIndexTermContent91, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonIndexTermContent96, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonIndexTermContent98, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonIndexTermContent102, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonIndexTermContent106, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonIndexTermContent112, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonIndexTermContent115, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonIndexTermContent119, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonIndexTermContent123, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1128, col: 9, offset: 37473}, - run: (*parser).callonEscapedBoldText24, - expr: &seqExpr{ - pos: position{line: 1128, col: 9, offset: 37473}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1128, col: 9, offset: 37473}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - run: (*parser).callonEscapedBoldText27, - expr: &oneOrMoreExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - expr: &litMatcher{ - pos: position{line: 1041, col: 25, offset: 34086}, - val: "\\", + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonIndexTermContent125, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", ignoreCase: false, - want: "\"\\\\\"", + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonIndexTermContent129, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", }, }, }, }, - &litMatcher{ - pos: position{line: 1128, col: 44, offset: 37508}, - val: "*", - ignoreCase: false, - want: "\"*\"", - }, - &labeledExpr{ - pos: position{line: 1128, col: 48, offset: 37512}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1128, col: 58, offset: 37522}, - name: "SingleQuoteBoldTextElements", + &actionExpr{ + pos: position{line: 1185, col: 114, offset: 37822}, + run: (*parser).callonIndexTermContent133, + expr: &seqExpr{ + pos: position{line: 1185, col: 115, offset: 37823}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1185, col: 115, offset: 37823}, + expr: &litMatcher{ + pos: position{line: 1185, col: 116, offset: 37824}, + val: "))", + ignoreCase: false, + want: "\"))\"", + }, + }, + &anyMatcher{ + line: 1185, col: 121, offset: 37829, + }, + }, }, }, - &litMatcher{ - pos: position{line: 1128, col: 87, offset: 37551}, - val: "*", - ignoreCase: false, - want: "\"*\"", - }, }, }, }, @@ -20440,315 +23764,948 @@ var g = &grammar{ }, }, { - name: "ItalicText", - pos: position{line: 1136, col: 1, offset: 37759}, - expr: &choiceExpr{ - pos: position{line: 1136, col: 15, offset: 37773}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1136, col: 15, offset: 37773}, - name: "DoubleQuoteItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1136, col: 39, offset: 37797}, - name: "SingleQuoteItalicText", - }, - }, - }, - }, - { - name: "DoubleQuoteItalicText", - pos: position{line: 1138, col: 1, offset: 37820}, + name: "ImageBlock", + pos: position{line: 1205, col: 1, offset: 38538}, expr: &actionExpr{ - pos: position{line: 1138, col: 26, offset: 37845}, - run: (*parser).callonDoubleQuoteItalicText1, + pos: position{line: 1206, col: 5, offset: 38557}, + run: (*parser).callonImageBlock1, expr: &seqExpr{ - pos: position{line: 1138, col: 26, offset: 37845}, + pos: position{line: 1206, col: 5, offset: 38557}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1138, col: 26, offset: 37845}, - val: "__", - ignoreCase: false, - want: "\"__\"", - }, - &labeledExpr{ - pos: position{line: 1138, col: 31, offset: 37850}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1138, col: 41, offset: 37860}, - name: "DoubleQuoteItalicTextElements", - }, + &andCodeExpr{ + pos: position{line: 1206, col: 5, offset: 38557}, + run: (*parser).callonImageBlock3, }, &litMatcher{ - pos: position{line: 1138, col: 72, offset: 37891}, - val: "__", + pos: position{line: 1210, col: 5, offset: 38709}, + val: "image::", ignoreCase: false, - want: "\"__\"", - }, - }, - }, - }, - }, - { - name: "DoubleQuoteItalicTextElements", - pos: position{line: 1142, col: 1, offset: 38029}, - expr: &zeroOrMoreExpr{ - pos: position{line: 1142, col: 34, offset: 38062}, - expr: &ruleRefExpr{ - pos: position{line: 1142, col: 34, offset: 38062}, - name: "DoubleQuoteItalicTextElement", - }, - }, - }, - { - name: "DoubleQuoteItalicTextElement", - pos: position{line: 1144, col: 1, offset: 38094}, - expr: &actionExpr{ - pos: position{line: 1145, col: 5, offset: 38131}, - run: (*parser).callonDoubleQuoteItalicTextElement1, - expr: &seqExpr{ - pos: position{line: 1145, col: 5, offset: 38131}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1145, col: 5, offset: 38131}, - expr: &litMatcher{ - pos: position{line: 1145, col: 7, offset: 38133}, - val: "__", - ignoreCase: false, - want: "\"__\"", - }, + want: "\"image::\"", }, &labeledExpr{ - pos: position{line: 1145, col: 13, offset: 38139}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 1145, col: 22, offset: 38148}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonDoubleQuoteItalicTextElement7, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + pos: position{line: 1210, col: 15, offset: 38719}, + label: "path", + expr: &actionExpr{ + pos: position{line: 2913, col: 13, offset: 96480}, + run: (*parser).callonImageBlock6, + expr: &seqExpr{ + pos: position{line: 2913, col: 13, offset: 96480}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2913, col: 13, offset: 96480}, + label: "scheme", + expr: &zeroOrOneExpr{ + pos: position{line: 2913, col: 20, offset: 96487}, + expr: &choiceExpr{ + pos: position{line: 2934, col: 11, offset: 97164}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2934, col: 11, offset: 97164}, + val: "http://", + ignoreCase: false, + want: "\"http://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 23, offset: 97176}, + val: "https://", + ignoreCase: false, + want: "\"https://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 36, offset: 97189}, + val: "ftp://", + ignoreCase: false, + want: "\"ftp://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 47, offset: 97200}, + val: "irc://", + ignoreCase: false, + want: "\"irc://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 58, offset: 97211}, + val: "mailto:", + ignoreCase: false, + want: "\"mailto:\"", }, }, }, }, }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonDoubleQuoteItalicTextElement16, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDoubleQuoteItalicTextElement26, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - &seqExpr{ - pos: position{line: 1147, col: 7, offset: 38204}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - ¬Expr{ - pos: position{line: 1147, col: 15, offset: 38212}, + &labeledExpr{ + pos: position{line: 2913, col: 30, offset: 96497}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 2913, col: 35, offset: 96502}, expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2913, col: 36, offset: 96503}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1148, col: 7, offset: 38227}, - name: "QuotedString", - }, - &ruleRefExpr{ - pos: position{line: 1149, col: 7, offset: 38246}, - name: "QuotedTextInDoubleQuoteItalicText", - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonDoubleQuoteItalicTextElement38, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonDoubleQuoteItalicTextElement42, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2921, col: 13, offset: 96772}, + run: (*parser).callonImageBlock19, + expr: &labeledExpr{ + pos: position{line: 2921, col: 13, offset: 96772}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2921, col: 22, offset: 96781}, + expr: &choiceExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + run: (*parser).callonImageBlock23, + expr: &oneOrMoreExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + expr: &charClassMatcher{ + pos: position{line: 2922, col: 6, offset: 96788}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonImageBlock26, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonImageBlock28, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonImageBlock31, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonImageBlock35, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonImageBlock42, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonImageBlock47, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonImageBlock49, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonImageBlock53, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonImageBlock57, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonImageBlock64, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonImageBlock69, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonImageBlock71, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonImageBlock75, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonImageBlock79, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonImageBlock85, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonImageBlock87, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonImageBlock90, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonImageBlock92, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonImageBlock96, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonImageBlock100, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonImageBlock106, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonImageBlock111, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonImageBlock113, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonImageBlock116, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonImageBlock120, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonImageBlock127, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonImageBlock132, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonImageBlock134, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonImageBlock138, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonImageBlock142, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonImageBlock149, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonImageBlock154, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonImageBlock156, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonImageBlock160, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonImageBlock164, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonImageBlock170, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonImageBlock173, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonImageBlock177, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonImageBlock181, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2928, col: 7, offset: 97012}, + run: (*parser).callonImageBlock183, + expr: &litMatcher{ + pos: position{line: 2928, col: 7, offset: 97012}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, }, }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &charClassMatcher{ - pos: position{line: 1167, col: 5, offset: 38740}, - val: "[^\\r\\n_]", - chars: []rune{'\r', '\n', '_'}, - ignoreCase: false, - inverted: true, - }, - &actionExpr{ - pos: position{line: 1168, col: 7, offset: 38839}, - run: (*parser).callonDoubleQuoteItalicTextElement47, - expr: &seqExpr{ - pos: position{line: 1168, col: 7, offset: 38839}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1168, col: 7, offset: 38839}, - val: "__", - ignoreCase: false, - want: "\"__\"", - }, - &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonDoubleQuoteItalicTextElement50, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonImageBlock185, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonImageBlock189, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, }, }, }, @@ -20758,147 +24715,63 @@ var g = &grammar{ }, }, }, - }, - }, - }, - }, - { - name: "QuotedTextInDoubleQuoteItalicText", - pos: position{line: 1155, col: 1, offset: 38388}, - expr: &actionExpr{ - pos: position{line: 1156, col: 5, offset: 38430}, - run: (*parser).callonQuotedTextInDoubleQuoteItalicText1, - expr: &seqExpr{ - pos: position{line: 1156, col: 5, offset: 38430}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1156, col: 5, offset: 38430}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1156, col: 16, offset: 38441}, - expr: &ruleRefExpr{ - pos: position{line: 1156, col: 17, offset: 38442}, - name: "LongHandAttributes", - }, - }, - }, &labeledExpr{ - pos: position{line: 1157, col: 5, offset: 38468}, - label: "text", - expr: &choiceExpr{ - pos: position{line: 1157, col: 11, offset: 38474}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1157, col: 11, offset: 38474}, - name: "SingleQuoteItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1158, col: 11, offset: 38506}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 1159, col: 11, offset: 38525}, - name: "MarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1160, col: 11, offset: 38546}, - name: "MonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1161, col: 11, offset: 38570}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1162, col: 11, offset: 38594}, - name: "SuperscriptText", - }, - }, + pos: position{line: 1210, col: 31, offset: 38735}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 1210, col: 49, offset: 38753}, + name: "InlineAttributes", }, }, - }, - }, - }, - }, - { - name: "SingleQuoteItalicText", - pos: position{line: 1172, col: 1, offset: 39017}, - expr: &choiceExpr{ - pos: position{line: 1173, col: 5, offset: 39047}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1173, col: 5, offset: 39047}, - run: (*parser).callonSingleQuoteItalicText2, - expr: &seqExpr{ - pos: position{line: 1173, col: 5, offset: 39047}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1173, col: 6, offset: 39048}, - val: "_", - ignoreCase: false, - want: "\"_\"", - }, - ¬Expr{ - pos: position{line: 1173, col: 10, offset: 39052}, - expr: &litMatcher{ - pos: position{line: 1173, col: 11, offset: 39053}, - val: "_", - ignoreCase: false, - want: "\"_\"", - }, - }, - &labeledExpr{ - pos: position{line: 1173, col: 16, offset: 39058}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1173, col: 26, offset: 39068}, - name: "SingleQuoteItalicTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1173, col: 57, offset: 39099}, - val: "_", + &zeroOrMoreExpr{ + pos: position{line: 1210, col: 67, offset: 38771}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonImageBlock196, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\"_\"", + inverted: false, }, }, }, - }, - &actionExpr{ - pos: position{line: 1175, col: 9, offset: 39301}, - run: (*parser).callonSingleQuoteItalicText10, - expr: &seqExpr{ - pos: position{line: 1175, col: 9, offset: 39301}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1175, col: 9, offset: 39301}, - val: "_", - ignoreCase: false, - want: "\"_\"", - }, - &labeledExpr{ - pos: position{line: 1175, col: 13, offset: 39305}, - label: "elements", - expr: &seqExpr{ - pos: position{line: 1175, col: 23, offset: 39315}, - exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonImageBlock199, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1175, col: 23, offset: 39315}, - val: "_", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\"_\"", + want: "\"\\n\"", }, - &ruleRefExpr{ - pos: position{line: 1175, col: 27, offset: 39319}, - name: "SingleQuoteItalicTextElements", + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &litMatcher{ - pos: position{line: 1175, col: 58, offset: 39350}, - val: "_", - ignoreCase: false, - want: "\"_\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, @@ -20907,315 +24780,1110 @@ var g = &grammar{ }, }, { - name: "SingleQuoteItalicTextElements", - pos: position{line: 1179, col: 1, offset: 39572}, - expr: &seqExpr{ - pos: position{line: 1179, col: 34, offset: 39605}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1179, col: 34, offset: 39605}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + name: "InlineImage", + pos: position{line: 1216, col: 1, offset: 39065}, + expr: &actionExpr{ + pos: position{line: 1216, col: 16, offset: 39080}, + run: (*parser).callonInlineImage1, + expr: &seqExpr{ + pos: position{line: 1216, col: 16, offset: 39080}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1216, col: 16, offset: 39080}, + val: "image:", + ignoreCase: false, + want: "\"image:\"", + }, + ¬Expr{ + pos: position{line: 1216, col: 25, offset: 39089}, + expr: &litMatcher{ + pos: position{line: 1216, col: 26, offset: 39090}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + &labeledExpr{ + pos: position{line: 1216, col: 30, offset: 39094}, + label: "path", + expr: &actionExpr{ + pos: position{line: 2913, col: 13, offset: 96480}, + run: (*parser).callonInlineImage7, + expr: &seqExpr{ + pos: position{line: 2913, col: 13, offset: 96480}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2913, col: 13, offset: 96480}, + label: "scheme", + expr: &zeroOrOneExpr{ + pos: position{line: 2913, col: 20, offset: 96487}, + expr: &choiceExpr{ + pos: position{line: 2934, col: 11, offset: 97164}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2934, col: 11, offset: 97164}, + val: "http://", + ignoreCase: false, + want: "\"http://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 23, offset: 97176}, + val: "https://", + ignoreCase: false, + want: "\"https://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 36, offset: 97189}, + val: "ftp://", + ignoreCase: false, + want: "\"ftp://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 47, offset: 97200}, + val: "irc://", + ignoreCase: false, + want: "\"irc://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 58, offset: 97211}, + val: "mailto:", + ignoreCase: false, + want: "\"mailto:\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2913, col: 30, offset: 96497}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 2913, col: 35, offset: 96502}, + expr: &choiceExpr{ + pos: position{line: 2913, col: 36, offset: 96503}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2921, col: 13, offset: 96772}, + run: (*parser).callonInlineImage20, + expr: &labeledExpr{ + pos: position{line: 2921, col: 13, offset: 96772}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2921, col: 22, offset: 96781}, + expr: &choiceExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + run: (*parser).callonInlineImage24, + expr: &oneOrMoreExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + expr: &charClassMatcher{ + pos: position{line: 2922, col: 6, offset: 96788}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonInlineImage27, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonInlineImage29, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonInlineImage32, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonInlineImage36, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonInlineImage43, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonInlineImage48, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonInlineImage50, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonInlineImage54, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonInlineImage58, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonInlineImage65, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonInlineImage70, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonInlineImage72, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonInlineImage76, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonInlineImage80, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonInlineImage86, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonInlineImage88, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonInlineImage91, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonInlineImage93, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonInlineImage97, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlineImage101, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonInlineImage107, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonInlineImage112, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonInlineImage114, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonInlineImage117, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonInlineImage121, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonInlineImage128, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonInlineImage133, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonInlineImage135, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonInlineImage139, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonInlineImage143, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonInlineImage150, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonInlineImage155, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonInlineImage157, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonInlineImage161, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonInlineImage165, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonInlineImage171, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonInlineImage174, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonInlineImage178, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonInlineImage182, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2928, col: 7, offset: 97012}, + run: (*parser).callonInlineImage184, + expr: &litMatcher{ + pos: position{line: 2928, col: 7, offset: 97012}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonInlineImage186, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonInlineImage190, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSingleQuoteItalicTextElements5, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + }, + &labeledExpr{ + pos: position{line: 1216, col: 46, offset: 39110}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 1216, col: 64, offset: 39128}, + name: "InlineAttributes", + }, + }, + }, + }, + }, + }, + { + name: "InlineIcon", + pos: position{line: 1223, col: 1, offset: 39558}, + expr: &actionExpr{ + pos: position{line: 1223, col: 15, offset: 39572}, + run: (*parser).callonInlineIcon1, + expr: &seqExpr{ + pos: position{line: 1223, col: 15, offset: 39572}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1223, col: 15, offset: 39572}, + val: "icon:", + ignoreCase: false, + want: "\"icon:\"", + }, + &labeledExpr{ + pos: position{line: 1223, col: 23, offset: 39580}, + label: "icon", + expr: &actionExpr{ + pos: position{line: 1223, col: 29, offset: 39586}, + run: (*parser).callonInlineIcon5, + expr: &oneOrMoreExpr{ + pos: position{line: 1223, col: 29, offset: 39586}, + expr: &charClassMatcher{ + pos: position{line: 1223, col: 29, offset: 39586}, + val: "[_-0-9\\pL]", + chars: []rune{'_', '-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, - }, - &oneOrMoreExpr{ - pos: position{line: 1179, col: 41, offset: 39612}, - expr: &ruleRefExpr{ - pos: position{line: 1179, col: 41, offset: 39612}, - name: "SingleQuoteItalicTextElement", + &labeledExpr{ + pos: position{line: 1223, col: 73, offset: 39630}, + label: "attributes", + expr: &ruleRefExpr{ + pos: position{line: 1223, col: 85, offset: 39642}, + name: "InlineAttributes", + }, }, }, }, }, }, { - name: "SingleQuoteItalicTextElement", - pos: position{line: 1181, col: 1, offset: 39643}, + name: "InlineFootnote", + pos: position{line: 1230, col: 1, offset: 40008}, expr: &choiceExpr{ - pos: position{line: 1182, col: 5, offset: 39680}, + pos: position{line: 1230, col: 19, offset: 40026}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonSingleQuoteItalicTextElement2, + pos: position{line: 1230, col: 19, offset: 40026}, + run: (*parser).callonInlineFootnote2, expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, + pos: position{line: 1230, col: 19, offset: 40026}, exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, + &litMatcher{ + pos: position{line: 1230, col: 19, offset: 40026}, + val: "footnote:[", + ignoreCase: false, + want: "\"footnote:[\"", }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + &labeledExpr{ + pos: position{line: 1230, col: 32, offset: 40039}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 1230, col: 41, offset: 40048}, + name: "FootnoteContent", }, }, + &litMatcher{ + pos: position{line: 1230, col: 58, offset: 40065}, + val: "]", + ignoreCase: false, + want: "\"]\"", + }, }, }, }, &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonSingleQuoteItalicTextElement11, + pos: position{line: 1232, col: 9, offset: 40125}, + run: (*parser).callonInlineFootnote8, expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, + pos: position{line: 1232, col: 9, offset: 40125}, exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, + &litMatcher{ + pos: position{line: 1232, col: 9, offset: 40125}, + val: "footnote:", + ignoreCase: false, + want: "\"footnote:\"", }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, + &labeledExpr{ + pos: position{line: 1232, col: 21, offset: 40137}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonInlineFootnote12, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1183, col: 7, offset: 39691}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - ¬Expr{ - pos: position{line: 1183, col: 15, offset: 39699}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1184, col: 7, offset: 39714}, - name: "QuotedString", - }, - &seqExpr{ - pos: position{line: 1185, col: 7, offset: 39733}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 1185, col: 7, offset: 39733}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSingleQuoteItalicTextElement33, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &zeroOrOneExpr{ - pos: position{line: 1185, col: 14, offset: 39740}, - expr: &seqExpr{ - pos: position{line: 1185, col: 15, offset: 39741}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1185, col: 15, offset: 39741}, - val: "_", - ignoreCase: false, - want: "\"_\"", - }, - ¬Expr{ - pos: position{line: 1185, col: 19, offset: 39745}, - expr: &litMatcher{ - pos: position{line: 1185, col: 20, offset: 39746}, - val: "_", - ignoreCase: false, - want: "\"_\"", - }, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1186, col: 7, offset: 39758}, - name: "QuotedTextInSingleQuoteItalicText", - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonSingleQuoteItalicTextElement41, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonSingleQuoteItalicTextElement45, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &charClassMatcher{ - pos: position{line: 1202, col: 5, offset: 40214}, - val: "[^\\r\\n_]", - chars: []rune{'\r', '\n', '_'}, - ignoreCase: false, - inverted: true, - }, - &actionExpr{ - pos: position{line: 1203, col: 7, offset: 40313}, - run: (*parser).callonSingleQuoteItalicTextElement50, - expr: &seqExpr{ - pos: position{line: 1203, col: 7, offset: 40313}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1203, col: 7, offset: 40313}, - val: "_", - ignoreCase: false, - want: "\"_\"", - }, - &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonSingleQuoteItalicTextElement53, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, }, }, }, + &litMatcher{ + pos: position{line: 1232, col: 39, offset: 40155}, + val: "[", + ignoreCase: false, + want: "\"[\"", + }, + &labeledExpr{ + pos: position{line: 1232, col: 43, offset: 40159}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 1232, col: 51, offset: 40167}, + expr: &ruleRefExpr{ + pos: position{line: 1232, col: 52, offset: 40168}, + name: "FootnoteContent", + }, + }, + }, + &litMatcher{ + pos: position{line: 1232, col: 70, offset: 40186}, + val: "]", + ignoreCase: false, + want: "\"]\"", + }, }, }, }, @@ -21223,56 +25891,32 @@ var g = &grammar{ }, }, { - name: "QuotedTextInSingleQuoteItalicText", - pos: position{line: 1190, col: 1, offset: 39863}, + name: "FootnoteContent", + pos: position{line: 1238, col: 1, offset: 40335}, expr: &actionExpr{ - pos: position{line: 1191, col: 5, offset: 39904}, - run: (*parser).callonQuotedTextInSingleQuoteItalicText1, - expr: &seqExpr{ - pos: position{line: 1191, col: 5, offset: 39904}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1191, col: 5, offset: 39904}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1191, col: 16, offset: 39915}, - expr: &ruleRefExpr{ - pos: position{line: 1191, col: 17, offset: 39916}, - name: "LongHandAttributes", - }, - }, - }, - &labeledExpr{ - pos: position{line: 1192, col: 5, offset: 39942}, - label: "text", - expr: &choiceExpr{ - pos: position{line: 1192, col: 11, offset: 39948}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1192, col: 11, offset: 39948}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 1193, col: 11, offset: 39967}, - name: "DoubleQuoteItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1194, col: 11, offset: 39999}, - name: "MarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1195, col: 11, offset: 40020}, - name: "MonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1196, col: 11, offset: 40044}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1197, col: 11, offset: 40068}, - name: "SuperscriptText", + pos: position{line: 1238, col: 20, offset: 40354}, + run: (*parser).callonFootnoteContent1, + expr: &labeledExpr{ + pos: position{line: 1238, col: 20, offset: 40354}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 1238, col: 29, offset: 40363}, + expr: &seqExpr{ + pos: position{line: 1238, col: 30, offset: 40364}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1238, col: 30, offset: 40364}, + expr: &litMatcher{ + pos: position{line: 1238, col: 31, offset: 40365}, + val: "]", + ignoreCase: false, + want: "\"]\"", }, }, + &ruleRefExpr{ + pos: position{line: 1238, col: 35, offset: 40369}, + name: "InlineElement", + }, }, }, }, @@ -21280,156 +25924,94 @@ var g = &grammar{ }, }, { - name: "EscapedItalicText", - pos: position{line: 1207, col: 1, offset: 40483}, + name: "PassthroughMacro", + pos: position{line: 1270, col: 1, offset: 42058}, expr: &choiceExpr{ - pos: position{line: 1208, col: 5, offset: 40509}, + pos: position{line: 1270, col: 21, offset: 42078}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1208, col: 5, offset: 40509}, - run: (*parser).callonEscapedItalicText2, + pos: position{line: 1270, col: 21, offset: 42078}, + run: (*parser).callonPassthroughMacro2, expr: &seqExpr{ - pos: position{line: 1208, col: 5, offset: 40509}, + pos: position{line: 1270, col: 21, offset: 42078}, exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1208, col: 5, offset: 40509}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1045, col: 25, offset: 34151}, - run: (*parser).callonEscapedItalicText5, - expr: &seqExpr{ - pos: position{line: 1045, col: 25, offset: 34151}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1045, col: 25, offset: 34151}, - val: "\\\\", - ignoreCase: false, - want: "\"\\\\\\\\\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1045, col: 30, offset: 34156}, - expr: &litMatcher{ - pos: position{line: 1045, col: 30, offset: 34156}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1208, col: 40, offset: 40544}, - val: "__", - ignoreCase: false, - want: "\"__\"", - }, - &labeledExpr{ - pos: position{line: 1208, col: 45, offset: 40549}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1208, col: 55, offset: 40559}, - name: "DoubleQuoteItalicTextElements", - }, - }, &litMatcher{ - pos: position{line: 1208, col: 86, offset: 40590}, - val: "__", + pos: position{line: 1270, col: 21, offset: 42078}, + val: "pass:[", ignoreCase: false, - want: "\"__\"", + want: "\"pass:[\"", }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1210, col: 9, offset: 40747}, - run: (*parser).callonEscapedItalicText14, - expr: &seqExpr{ - pos: position{line: 1210, col: 9, offset: 40747}, - exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1210, col: 9, offset: 40747}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - run: (*parser).callonEscapedItalicText17, - expr: &oneOrMoreExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - expr: &litMatcher{ - pos: position{line: 1041, col: 25, offset: 34086}, - val: "\\", + pos: position{line: 1270, col: 30, offset: 42087}, + label: "content", + expr: &zeroOrMoreExpr{ + pos: position{line: 1270, col: 38, offset: 42095}, + expr: &actionExpr{ + pos: position{line: 1276, col: 30, offset: 42421}, + run: (*parser).callonPassthroughMacro7, + expr: &charClassMatcher{ + pos: position{line: 1276, col: 30, offset: 42421}, + val: "[^]]", + chars: []rune{']'}, ignoreCase: false, - want: "\"\\\\\"", + inverted: true, }, }, }, }, &litMatcher{ - pos: position{line: 1210, col: 44, offset: 40782}, - val: "__", - ignoreCase: false, - want: "\"__\"", - }, - &labeledExpr{ - pos: position{line: 1210, col: 49, offset: 40787}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1210, col: 59, offset: 40797}, - name: "SingleQuoteItalicTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1210, col: 90, offset: 40828}, - val: "_", + pos: position{line: 1270, col: 67, offset: 42124}, + val: "]", ignoreCase: false, - want: "\"_\"", + want: "\"]\"", }, }, }, }, &actionExpr{ - pos: position{line: 1213, col: 9, offset: 41028}, - run: (*parser).callonEscapedItalicText24, + pos: position{line: 1272, col: 9, offset: 42228}, + run: (*parser).callonPassthroughMacro10, expr: &seqExpr{ - pos: position{line: 1213, col: 9, offset: 41028}, + pos: position{line: 1272, col: 9, offset: 42228}, exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1213, col: 9, offset: 41028}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - run: (*parser).callonEscapedItalicText27, - expr: &oneOrMoreExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - expr: &litMatcher{ - pos: position{line: 1041, col: 25, offset: 34086}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, - }, - }, - }, &litMatcher{ - pos: position{line: 1213, col: 44, offset: 41063}, - val: "_", + pos: position{line: 1272, col: 9, offset: 42228}, + val: "pass:q[", ignoreCase: false, - want: "\"_\"", + want: "\"pass:q[\"", }, &labeledExpr{ - pos: position{line: 1213, col: 48, offset: 41067}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1213, col: 58, offset: 41077}, - name: "SingleQuoteItalicTextElements", + pos: position{line: 1272, col: 19, offset: 42238}, + label: "content", + expr: &zeroOrMoreExpr{ + pos: position{line: 1272, col: 27, offset: 42246}, + expr: &choiceExpr{ + pos: position{line: 1272, col: 28, offset: 42247}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1272, col: 28, offset: 42247}, + name: "QuotedText", + }, + &actionExpr{ + pos: position{line: 1276, col: 30, offset: 42421}, + run: (*parser).callonPassthroughMacro17, + expr: &charClassMatcher{ + pos: position{line: 1276, col: 30, offset: 42421}, + val: "[^]]", + chars: []rune{']'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, }, }, &litMatcher{ - pos: position{line: 1213, col: 89, offset: 41108}, - val: "_", + pos: position{line: 1272, col: 69, offset: 42288}, + val: "]", ignoreCase: false, - want: "\"_\"", + want: "\"]\"", }, }, }, @@ -21438,321 +26020,961 @@ var g = &grammar{ }, }, { - name: "MonospaceText", - pos: position{line: 1220, col: 1, offset: 41318}, + name: "Link", + pos: position{line: 1283, col: 1, offset: 42677}, expr: &choiceExpr{ - pos: position{line: 1220, col: 18, offset: 41335}, + pos: position{line: 1283, col: 9, offset: 42685}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1220, col: 18, offset: 41335}, - name: "DoubleQuoteMonospaceText", + pos: position{line: 1283, col: 9, offset: 42685}, + name: "RelativeLink", }, &ruleRefExpr{ - pos: position{line: 1220, col: 45, offset: 41362}, - name: "SingleQuoteMonospaceText", + pos: position{line: 1283, col: 24, offset: 42700}, + name: "ExternalLink", }, }, }, }, { - name: "DoubleQuoteMonospaceText", - pos: position{line: 1222, col: 1, offset: 41388}, + name: "RelativeLink", + pos: position{line: 1286, col: 1, offset: 42781}, expr: &actionExpr{ - pos: position{line: 1222, col: 29, offset: 41416}, - run: (*parser).callonDoubleQuoteMonospaceText1, + pos: position{line: 1286, col: 17, offset: 42797}, + run: (*parser).callonRelativeLink1, expr: &seqExpr{ - pos: position{line: 1222, col: 29, offset: 41416}, + pos: position{line: 1286, col: 17, offset: 42797}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1222, col: 29, offset: 41416}, - val: "``", - ignoreCase: false, - want: "\"``\"", - }, - &labeledExpr{ - pos: position{line: 1222, col: 34, offset: 41421}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1222, col: 44, offset: 41431}, - name: "DoubleQuoteMonospaceTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1222, col: 78, offset: 41465}, - val: "``", + pos: position{line: 1286, col: 17, offset: 42797}, + val: "link:", ignoreCase: false, - want: "\"``\"", - }, - }, - }, - }, - }, - { - name: "DoubleQuoteMonospaceTextElements", - pos: position{line: 1226, col: 1, offset: 41606}, - expr: &zeroOrMoreExpr{ - pos: position{line: 1226, col: 37, offset: 41642}, - expr: &ruleRefExpr{ - pos: position{line: 1226, col: 37, offset: 41642}, - name: "DoubleQuoteMonospaceTextElement", - }, - }, - }, - { - name: "DoubleQuoteMonospaceTextElement", - pos: position{line: 1228, col: 1, offset: 41709}, - expr: &actionExpr{ - pos: position{line: 1229, col: 5, offset: 41749}, - run: (*parser).callonDoubleQuoteMonospaceTextElement1, - expr: &seqExpr{ - pos: position{line: 1229, col: 5, offset: 41749}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1229, col: 5, offset: 41749}, - expr: &litMatcher{ - pos: position{line: 1229, col: 7, offset: 41751}, - val: "``", - ignoreCase: false, - want: "\"``\"", - }, + want: "\"link:\"", }, &labeledExpr{ - pos: position{line: 1229, col: 13, offset: 41757}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 1229, col: 22, offset: 41766}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonDoubleQuoteMonospaceTextElement7, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonDoubleQuoteMonospaceTextElement16, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDoubleQuoteMonospaceTextElement26, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - &seqExpr{ - pos: position{line: 1231, col: 7, offset: 41822}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - ¬Expr{ - pos: position{line: 1231, col: 15, offset: 41830}, + pos: position{line: 1286, col: 25, offset: 42805}, + label: "url", + expr: &actionExpr{ + pos: position{line: 2913, col: 13, offset: 96480}, + run: (*parser).callonRelativeLink5, + expr: &seqExpr{ + pos: position{line: 2913, col: 13, offset: 96480}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2913, col: 13, offset: 96480}, + label: "scheme", + expr: &zeroOrOneExpr{ + pos: position{line: 2913, col: 20, offset: 96487}, expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2934, col: 11, offset: 97164}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2934, col: 11, offset: 97164}, + val: "http://", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"http://\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2934, col: 23, offset: 97176}, + val: "https://", ignoreCase: false, - inverted: false, + want: "\"https://\"", }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1232, col: 7, offset: 41845}, - name: "QuotedString", - }, - &litMatcher{ - pos: position{line: 2175, col: 18, offset: 76818}, - val: "`'", - ignoreCase: false, - want: "\"`'\"", - }, - &ruleRefExpr{ - pos: position{line: 1234, col: 7, offset: 41927}, - name: "QuotedTextInDoubleQuoteMonospaceText", - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonDoubleQuoteMonospaceTextElement39, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonDoubleQuoteMonospaceTextElement43, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, + &litMatcher{ + pos: position{line: 2934, col: 36, offset: 97189}, + val: "ftp://", + ignoreCase: false, + want: "\"ftp://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 47, offset: 97200}, + val: "irc://", + ignoreCase: false, + want: "\"irc://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 58, offset: 97211}, + val: "mailto:", + ignoreCase: false, + want: "\"mailto:\"", }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, }, }, - }, - &charClassMatcher{ - pos: position{line: 1252, col: 5, offset: 42433}, - val: "[^\\r\\n`]", - chars: []rune{'\r', '\n', '`'}, - ignoreCase: false, - inverted: true, - }, - &actionExpr{ - pos: position{line: 1253, col: 7, offset: 42535}, - run: (*parser).callonDoubleQuoteMonospaceTextElement48, - expr: &seqExpr{ - pos: position{line: 1253, col: 7, offset: 42535}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1253, col: 7, offset: 42535}, - val: "``", - ignoreCase: false, - want: "\"``\"", - }, - &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonDoubleQuoteMonospaceTextElement51, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 2913, col: 30, offset: 96497}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 2913, col: 35, offset: 96502}, + expr: &choiceExpr{ + pos: position{line: 2913, col: 36, offset: 96503}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2921, col: 13, offset: 96772}, + run: (*parser).callonRelativeLink18, + expr: &labeledExpr{ + pos: position{line: 2921, col: 13, offset: 96772}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2921, col: 22, offset: 96781}, + expr: &choiceExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + run: (*parser).callonRelativeLink22, + expr: &oneOrMoreExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + expr: &charClassMatcher{ + pos: position{line: 2922, col: 6, offset: 96788}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonRelativeLink25, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonRelativeLink27, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonRelativeLink30, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonRelativeLink34, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonRelativeLink41, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonRelativeLink46, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonRelativeLink48, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonRelativeLink52, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonRelativeLink56, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonRelativeLink63, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonRelativeLink68, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonRelativeLink70, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonRelativeLink74, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonRelativeLink78, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonRelativeLink84, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonRelativeLink86, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonRelativeLink89, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonRelativeLink91, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonRelativeLink95, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonRelativeLink99, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonRelativeLink105, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonRelativeLink110, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonRelativeLink112, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonRelativeLink115, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonRelativeLink119, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonRelativeLink126, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonRelativeLink131, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonRelativeLink133, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonRelativeLink137, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonRelativeLink141, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonRelativeLink148, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonRelativeLink153, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonRelativeLink155, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonRelativeLink159, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonRelativeLink163, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonRelativeLink169, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonRelativeLink172, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonRelativeLink176, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonRelativeLink180, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2928, col: 7, offset: 97012}, + run: (*parser).callonRelativeLink182, + expr: &litMatcher{ + pos: position{line: 2928, col: 7, offset: 97012}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonRelativeLink184, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonRelativeLink188, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, }, }, }, @@ -21762,279 +26984,959 @@ var g = &grammar{ }, }, }, + &labeledExpr{ + pos: position{line: 1286, col: 40, offset: 42820}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 1286, col: 58, offset: 42838}, + name: "InlineAttributes", + }, + }, }, }, }, }, { - name: "QuotedTextInDoubleQuoteMonospaceText", - pos: position{line: 1240, col: 1, offset: 42075}, + name: "ExternalLink", + pos: position{line: 1290, col: 1, offset: 42960}, expr: &actionExpr{ - pos: position{line: 1241, col: 5, offset: 42119}, - run: (*parser).callonQuotedTextInDoubleQuoteMonospaceText1, + pos: position{line: 1290, col: 17, offset: 42976}, + run: (*parser).callonExternalLink1, expr: &seqExpr{ - pos: position{line: 1241, col: 5, offset: 42119}, + pos: position{line: 1290, col: 17, offset: 42976}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1241, col: 5, offset: 42119}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1241, col: 16, offset: 42130}, - expr: &ruleRefExpr{ - pos: position{line: 1241, col: 17, offset: 42131}, - name: "LongHandAttributes", - }, - }, - }, - &labeledExpr{ - pos: position{line: 1242, col: 5, offset: 42157}, - label: "text", - expr: &choiceExpr{ - pos: position{line: 1242, col: 11, offset: 42163}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1242, col: 11, offset: 42163}, - name: "SingleQuoteMonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1243, col: 11, offset: 42198}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 1244, col: 11, offset: 42217}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1245, col: 11, offset: 42238}, - name: "MarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1246, col: 11, offset: 42259}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1247, col: 11, offset: 42283}, - name: "SuperscriptText", - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "SingleQuoteMonospaceText", - pos: position{line: 1257, col: 1, offset: 42718}, - expr: &choiceExpr{ - pos: position{line: 1258, col: 5, offset: 42751}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1258, col: 5, offset: 42751}, - run: (*parser).callonSingleQuoteMonospaceText2, - expr: &seqExpr{ - pos: position{line: 1258, col: 5, offset: 42751}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1258, col: 6, offset: 42752}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - ¬Expr{ - pos: position{line: 1258, col: 10, offset: 42756}, - expr: &litMatcher{ - pos: position{line: 1258, col: 11, offset: 42757}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - }, - &labeledExpr{ - pos: position{line: 1258, col: 16, offset: 42762}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1258, col: 26, offset: 42772}, - name: "SingleQuoteMonospaceTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1258, col: 60, offset: 42806}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1260, col: 9, offset: 43011}, - run: (*parser).callonSingleQuoteMonospaceText10, - expr: &seqExpr{ - pos: position{line: 1260, col: 9, offset: 43011}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1260, col: 9, offset: 43011}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - &labeledExpr{ - pos: position{line: 1260, col: 13, offset: 43015}, - label: "elements", - expr: &seqExpr{ - pos: position{line: 1260, col: 23, offset: 43025}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1260, col: 23, offset: 43025}, - val: "`", + pos: position{line: 1290, col: 17, offset: 42976}, + label: "url", + expr: &actionExpr{ + pos: position{line: 2917, col: 23, offset: 96629}, + run: (*parser).callonExternalLink4, + expr: &seqExpr{ + pos: position{line: 2917, col: 23, offset: 96629}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2917, col: 23, offset: 96629}, + expr: &litMatcher{ + pos: position{line: 2917, col: 24, offset: 96630}, + val: "[", ignoreCase: false, - want: "\"`\"", - }, - &ruleRefExpr{ - pos: position{line: 1260, col: 27, offset: 43029}, - name: "SingleQuoteMonospaceTextElements", + want: "\"[\"", }, }, - }, - }, - &litMatcher{ - pos: position{line: 1260, col: 61, offset: 43063}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - }, - }, - }, - }, - }, - }, - { - name: "SingleQuoteMonospaceTextElements", - pos: position{line: 1264, col: 1, offset: 43289}, - expr: &seqExpr{ - pos: position{line: 1264, col: 37, offset: 43325}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1264, col: 37, offset: 43325}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSingleQuoteMonospaceTextElements5, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 1264, col: 44, offset: 43332}, - expr: &ruleRefExpr{ - pos: position{line: 1264, col: 44, offset: 43332}, - name: "SingleQuoteMonospaceTextElement", - }, - }, - }, - }, - }, - { - name: "SingleQuoteMonospaceTextElement", - pos: position{line: 1266, col: 1, offset: 43366}, - expr: &choiceExpr{ - pos: position{line: 1267, col: 5, offset: 43407}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonSingleQuoteMonospaceTextElement2, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 2917, col: 28, offset: 96634}, + label: "scheme", + expr: &choiceExpr{ + pos: position{line: 2934, col: 11, offset: 97164}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2934, col: 11, offset: 97164}, + val: "http://", + ignoreCase: false, + want: "\"http://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 23, offset: 97176}, + val: "https://", + ignoreCase: false, + want: "\"https://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 36, offset: 97189}, + val: "ftp://", + ignoreCase: false, + want: "\"ftp://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 47, offset: 97200}, + val: "irc://", + ignoreCase: false, + want: "\"irc://\"", + }, + &litMatcher{ + pos: position{line: 2934, col: 58, offset: 97211}, + val: "mailto:", + ignoreCase: false, + want: "\"mailto:\"", + }, }, }, }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonSingleQuoteMonospaceTextElement11, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 2917, col: 44, offset: 96650}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 2917, col: 49, offset: 96655}, + expr: &choiceExpr{ + pos: position{line: 2917, col: 50, offset: 96656}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2921, col: 13, offset: 96772}, + run: (*parser).callonExternalLink18, + expr: &labeledExpr{ + pos: position{line: 2921, col: 13, offset: 96772}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2921, col: 22, offset: 96781}, + expr: &choiceExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + run: (*parser).callonExternalLink22, + expr: &oneOrMoreExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + expr: &charClassMatcher{ + pos: position{line: 2922, col: 6, offset: 96788}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonExternalLink25, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonExternalLink27, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonExternalLink30, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonExternalLink34, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonExternalLink41, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonExternalLink46, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonExternalLink48, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonExternalLink52, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonExternalLink56, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonExternalLink63, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonExternalLink68, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonExternalLink70, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonExternalLink74, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonExternalLink78, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonExternalLink84, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonExternalLink86, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonExternalLink89, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonExternalLink91, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonExternalLink95, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExternalLink99, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonExternalLink105, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonExternalLink110, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonExternalLink112, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonExternalLink115, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonExternalLink119, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonExternalLink126, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonExternalLink131, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonExternalLink133, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonExternalLink137, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonExternalLink141, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonExternalLink148, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonExternalLink153, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonExternalLink155, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonExternalLink159, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonExternalLink163, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonExternalLink169, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonExternalLink172, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonExternalLink176, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonExternalLink180, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2928, col: 7, offset: 97012}, + run: (*parser).callonExternalLink182, + expr: &litMatcher{ + pos: position{line: 2928, col: 7, offset: 97012}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonExternalLink184, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonExternalLink188, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + }, }, }, }, @@ -22042,194 +27944,14 @@ var g = &grammar{ }, }, }, - }, - &seqExpr{ - pos: position{line: 1268, col: 7, offset: 43418}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - ¬Expr{ - pos: position{line: 1268, col: 15, offset: 43426}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1269, col: 7, offset: 43441}, - name: "QuotedString", - }, - &seqExpr{ - pos: position{line: 1270, col: 7, offset: 43460}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 1270, col: 7, offset: 43460}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSingleQuoteMonospaceTextElement33, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &zeroOrOneExpr{ - pos: position{line: 1270, col: 14, offset: 43467}, - expr: &seqExpr{ - pos: position{line: 1270, col: 15, offset: 43468}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1270, col: 15, offset: 43468}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - ¬Expr{ - pos: position{line: 1270, col: 19, offset: 43472}, - expr: &litMatcher{ - pos: position{line: 1270, col: 20, offset: 43473}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1271, col: 7, offset: 43597}, - name: "QuotedTextInSingleQuoteMonospaceText", - }, - &litMatcher{ - pos: position{line: 2175, col: 18, offset: 76818}, - val: "`'", - ignoreCase: false, - want: "\"`'\"", - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonSingleQuoteMonospaceTextElement42, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonSingleQuoteMonospaceTextElement46, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1288, col: 5, offset: 44086}, - run: (*parser).callonSingleQuoteMonospaceTextElement50, - expr: &choiceExpr{ - pos: position{line: 1288, col: 6, offset: 44087}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 1288, col: 6, offset: 44087}, - val: "[^\\r\\n`]", - chars: []rune{'\r', '\n', '`'}, - ignoreCase: false, - inverted: true, - }, - &seqExpr{ - pos: position{line: 1289, col: 7, offset: 44191}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1289, col: 7, offset: 44191}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonSingleQuoteMonospaceTextElement55, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, + &labeledExpr{ + pos: position{line: 1290, col: 42, offset: 43001}, + label: "inlineAttributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1290, col: 59, offset: 43018}, + expr: &ruleRefExpr{ + pos: position{line: 1290, col: 60, offset: 43019}, + name: "InlineAttributes", }, }, }, @@ -22238,393 +27960,539 @@ var g = &grammar{ }, }, { - name: "QuotedTextInSingleQuoteMonospaceText", - pos: position{line: 1276, col: 1, offset: 43728}, + name: "ListElements", + pos: position{line: 1298, col: 1, offset: 43379}, expr: &actionExpr{ - pos: position{line: 1277, col: 5, offset: 43772}, - run: (*parser).callonQuotedTextInSingleQuoteMonospaceText1, + pos: position{line: 1299, col: 5, offset: 43400}, + run: (*parser).callonListElements1, expr: &seqExpr{ - pos: position{line: 1277, col: 5, offset: 43772}, + pos: position{line: 1299, col: 5, offset: 43400}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1277, col: 5, offset: 43772}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1277, col: 16, offset: 43783}, - expr: &ruleRefExpr{ - pos: position{line: 1277, col: 17, offset: 43784}, - name: "LongHandAttributes", - }, - }, - }, - &labeledExpr{ - pos: position{line: 1278, col: 5, offset: 43810}, - label: "text", + pos: position{line: 1299, col: 5, offset: 43400}, + label: "firstElement", expr: &choiceExpr{ - pos: position{line: 1278, col: 11, offset: 43816}, + pos: position{line: 1305, col: 5, offset: 43602}, alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1278, col: 11, offset: 43816}, - name: "DoubleQuoteMonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1279, col: 11, offset: 43851}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 1280, col: 11, offset: 43870}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1281, col: 11, offset: 43891}, - name: "MarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1282, col: 11, offset: 43912}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1283, col: 11, offset: 43936}, - name: "SuperscriptText", - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "EscapedMonospaceText", - pos: position{line: 1293, col: 1, offset: 44373}, - expr: &choiceExpr{ - pos: position{line: 1294, col: 5, offset: 44402}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1294, col: 5, offset: 44402}, - run: (*parser).callonEscapedMonospaceText2, - expr: &seqExpr{ - pos: position{line: 1294, col: 5, offset: 44402}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1294, col: 5, offset: 44402}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1045, col: 25, offset: 34151}, - run: (*parser).callonEscapedMonospaceText5, + &actionExpr{ + pos: position{line: 1434, col: 5, offset: 47618}, + run: (*parser).callonListElements5, expr: &seqExpr{ - pos: position{line: 1045, col: 25, offset: 34151}, + pos: position{line: 1434, col: 5, offset: 47618}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1045, col: 25, offset: 34151}, - val: "\\\\", - ignoreCase: false, - want: "\"\\\\\\\\\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1045, col: 30, offset: 34156}, - expr: &litMatcher{ - pos: position{line: 1045, col: 30, offset: 34156}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, + &labeledExpr{ + pos: position{line: 1434, col: 5, offset: 47618}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + run: (*parser).callonListElements8, + expr: &seqExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements11, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1441, col: 12, offset: 47833}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + run: (*parser).callonListElements15, + expr: &seqExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + run: (*parser).callonListElements18, + expr: &oneOrMoreExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + expr: &litMatcher{ + pos: position{line: 1443, col: 17, offset: 47904}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1447, col: 9, offset: 48004}, + run: (*parser).callonListElements21, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + run: (*parser).callonListElements22, + expr: &seqExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + expr: &charClassMatcher{ + pos: position{line: 1466, col: 12, offset: 48722}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1466, col: 20, offset: 48730}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + run: (*parser).callonListElements27, + expr: &seqExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1468, col: 14, offset: 48848}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1468, col: 21, offset: 48855}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + run: (*parser).callonListElements31, + expr: &seqExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1470, col: 14, offset: 48976}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1470, col: 21, offset: 48983}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + run: (*parser).callonListElements35, + expr: &seqExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + expr: &charClassMatcher{ + pos: position{line: 1472, col: 14, offset: 49104}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1472, col: 26, offset: 49116}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + run: (*parser).callonListElements40, + expr: &seqExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + expr: &charClassMatcher{ + pos: position{line: 1474, col: 14, offset: 49237}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1474, col: 26, offset: 49249}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElements45, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1435, col: 5, offset: 47657}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + run: (*parser).callonListElements49, + expr: &seqExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + run: (*parser).callonListElements52, + expr: &oneOrMoreExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + expr: &charClassMatcher{ + pos: position{line: 1374, col: 14, offset: 45833}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements56, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, - }, - &litMatcher{ - pos: position{line: 1294, col: 40, offset: 44437}, - val: "``", - ignoreCase: false, - want: "\"``\"", - }, - &labeledExpr{ - pos: position{line: 1294, col: 45, offset: 44442}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1294, col: 55, offset: 44452}, - name: "DoubleQuoteMonospaceTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1294, col: 89, offset: 44486}, - val: "``", - ignoreCase: false, - want: "\"``\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1296, col: 9, offset: 44643}, - run: (*parser).callonEscapedMonospaceText14, - expr: &seqExpr{ - pos: position{line: 1296, col: 9, offset: 44643}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1296, col: 9, offset: 44643}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - run: (*parser).callonEscapedMonospaceText17, - expr: &oneOrMoreExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - expr: &litMatcher{ - pos: position{line: 1041, col: 25, offset: 34086}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1296, col: 44, offset: 44678}, - val: "``", - ignoreCase: false, - want: "\"``\"", - }, - &labeledExpr{ - pos: position{line: 1296, col: 49, offset: 44683}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1296, col: 59, offset: 44693}, - name: "SingleQuoteMonospaceTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1296, col: 93, offset: 44727}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1299, col: 9, offset: 44927}, - run: (*parser).callonEscapedMonospaceText24, - expr: &seqExpr{ - pos: position{line: 1299, col: 9, offset: 44927}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1299, col: 9, offset: 44927}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - run: (*parser).callonEscapedMonospaceText27, - expr: &oneOrMoreExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - expr: &litMatcher{ - pos: position{line: 1041, col: 25, offset: 34086}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1299, col: 44, offset: 44962}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - &labeledExpr{ - pos: position{line: 1299, col: 48, offset: 44966}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1299, col: 58, offset: 44976}, - name: "SingleQuoteMonospaceTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1299, col: 92, offset: 45010}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - }, - }, - }, - }, - }, - }, - { - name: "QuotedString", - pos: position{line: 1307, col: 1, offset: 45335}, - expr: &choiceExpr{ - pos: position{line: 1307, col: 17, offset: 45351}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1307, col: 17, offset: 45351}, - name: "SingleQuotedString", - }, - &ruleRefExpr{ - pos: position{line: 1307, col: 38, offset: 45372}, - name: "DoubleQuotedString", - }, - }, - }, - }, - { - name: "SingleQuotedString", - pos: position{line: 1309, col: 1, offset: 45392}, - expr: &actionExpr{ - pos: position{line: 1309, col: 23, offset: 45414}, - run: (*parser).callonSingleQuotedString1, - expr: &seqExpr{ - pos: position{line: 1309, col: 23, offset: 45414}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1317, col: 27, offset: 45721}, - val: "'`", - ignoreCase: false, - want: "\"'`\"", - }, - ¬Expr{ - pos: position{line: 1317, col: 32, offset: 45726}, - expr: &charClassMatcher{ - pos: position{line: 1317, col: 33, offset: 45727}, - val: "[ \\t\\r\\n]", - chars: []rune{' ', '\t', '\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - &labeledExpr{ - pos: position{line: 1309, col: 46, offset: 45437}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1309, col: 55, offset: 45446}, - name: "SingleQuotedStringElements", - }, - }, - &litMatcher{ - pos: position{line: 1319, col: 25, offset: 45762}, - val: "`'", - ignoreCase: false, - want: "\"`'\"", - }, - }, - }, - }, - }, - { - name: "SingleQuotedStringElements", - pos: position{line: 1313, col: 1, offset: 45577}, - expr: &actionExpr{ - pos: position{line: 1313, col: 31, offset: 45607}, - run: (*parser).callonSingleQuotedStringElements1, - expr: &labeledExpr{ - pos: position{line: 1313, col: 31, offset: 45607}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 1313, col: 41, offset: 45617}, - expr: &ruleRefExpr{ - pos: position{line: 1313, col: 41, offset: 45617}, - name: "SingleQuotedStringElement", - }, - }, - }, - }, - }, - { - name: "SingleQuotedStringElement", - pos: position{line: 1322, col: 1, offset: 45850}, - expr: &actionExpr{ - pos: position{line: 1323, col: 5, offset: 45884}, - run: (*parser).callonSingleQuotedStringElement1, - expr: &labeledExpr{ - pos: position{line: 1323, col: 5, offset: 45884}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 1324, col: 9, offset: 45902}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1324, col: 9, offset: 45902}, - exprs: []interface{}{ &actionExpr{ - pos: position{line: 995, col: 14, offset: 32701}, - run: (*parser).callonSingleQuotedStringElement5, + pos: position{line: 1484, col: 5, offset: 49515}, + run: (*parser).callonListElements63, expr: &seqExpr{ - pos: position{line: 995, col: 14, offset: 32701}, + pos: position{line: 1484, col: 5, offset: 49515}, exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSingleQuotedStringElement9, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 1484, col: 5, offset: 49515}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + run: (*parser).callonListElements66, + expr: &seqExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements69, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1491, col: 12, offset: 49795}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1491, col: 20, offset: 49803}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + run: (*parser).callonListElements73, + expr: &seqExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + run: (*parser).callonListElements76, + expr: &oneOrMoreExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + expr: &litMatcher{ + pos: position{line: 1493, col: 17, offset: 49868}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1497, col: 9, offset: 49968}, + run: (*parser).callonListElements79, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1514, col: 14, offset: 50675}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1514, col: 21, offset: 50682}, + run: (*parser).callonListElements81, + expr: &litMatcher{ + pos: position{line: 1514, col: 22, offset: 50683}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElements83, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, }, - &litMatcher{ - pos: position{line: 995, col: 20, offset: 32707}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 995, col: 24, offset: 32711}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSingleQuotedStringElement15, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 1485, col: 5, offset: 49556}, + label: "checkstyle", + expr: &zeroOrOneExpr{ + pos: position{line: 1485, col: 16, offset: 49567}, + expr: &actionExpr{ + pos: position{line: 1521, col: 5, offset: 50844}, + run: (*parser).callonListElements88, + expr: &seqExpr{ + pos: position{line: 1521, col: 5, offset: 50844}, + exprs: []interface{}{ + &andExpr{ + pos: position{line: 1521, col: 5, offset: 50844}, + expr: &litMatcher{ + pos: position{line: 1521, col: 6, offset: 50845}, + val: "[", + ignoreCase: false, + want: "\"[\"", + }, + }, + &labeledExpr{ + pos: position{line: 1521, col: 10, offset: 50849}, + label: "style", + expr: &choiceExpr{ + pos: position{line: 1522, col: 7, offset: 50863}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1522, col: 7, offset: 50863}, + run: (*parser).callonListElements94, + expr: &litMatcher{ + pos: position{line: 1522, col: 7, offset: 50863}, + val: "[ ]", + ignoreCase: false, + want: "\"[ ]\"", + }, + }, + &actionExpr{ + pos: position{line: 1523, col: 7, offset: 50908}, + run: (*parser).callonListElements96, + expr: &litMatcher{ + pos: position{line: 1523, col: 7, offset: 50908}, + val: "[*]", + ignoreCase: false, + want: "\"[*]\"", + }, + }, + &actionExpr{ + pos: position{line: 1524, col: 7, offset: 50951}, + run: (*parser).callonListElements98, + expr: &litMatcher{ + pos: position{line: 1524, col: 7, offset: 50951}, + val: "[x]", + ignoreCase: false, + want: "\"[x]\"", + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElements100, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, }, }, - &andExpr{ - pos: position{line: 995, col: 31, offset: 32718}, - expr: &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 1486, col: 5, offset: 49606}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + run: (*parser).callonListElements104, + expr: &seqExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + run: (*parser).callonListElements107, + expr: &oneOrMoreExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + expr: &charClassMatcher{ + pos: position{line: 1374, col: 14, offset: 45833}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements111, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, }, }, }, @@ -22633,2651 +28501,1702 @@ var g = &grammar{ }, }, }, - ¬Expr{ - pos: position{line: 1324, col: 19, offset: 45912}, - expr: &litMatcher{ - pos: position{line: 1319, col: 25, offset: 45762}, - val: "`'", - ignoreCase: false, - want: "\"`'\"", - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1325, col: 11, offset: 45969}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 1325, col: 11, offset: 45969}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSingleQuotedStringElement29, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 1325, col: 18, offset: 45976}, - expr: &litMatcher{ - pos: position{line: 1319, col: 25, offset: 45762}, - val: "`'", - ignoreCase: false, - want: "\"`'\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1326, col: 12, offset: 46009}, - run: (*parser).callonSingleQuotedStringElement33, - expr: &seqExpr{ - pos: position{line: 1326, col: 12, offset: 46009}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1326, col: 12, offset: 46009}, - expr: &litMatcher{ - pos: position{line: 1326, col: 13, offset: 46010}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - }, - &labeledExpr{ - pos: position{line: 1326, col: 17, offset: 46014}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 2169, col: 11, offset: 76653}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2171, col: 15, offset: 76747}, - run: (*parser).callonSingleQuotedStringElement39, - expr: &litMatcher{ - pos: position{line: 2171, col: 15, offset: 76747}, - val: "`'", - ignoreCase: false, - want: "\"`'\"", - }, - }, - &actionExpr{ - pos: position{line: 2177, col: 14, offset: 76854}, - run: (*parser).callonSingleQuotedStringElement41, - expr: &litMatcher{ - pos: position{line: 2177, col: 14, offset: 76854}, - val: "(C)", - ignoreCase: false, - want: "\"(C)\"", - }, - }, - &actionExpr{ - pos: position{line: 2180, col: 14, offset: 76921}, - run: (*parser).callonSingleQuotedStringElement43, - expr: &litMatcher{ - pos: position{line: 2180, col: 14, offset: 76921}, - val: "(TM)", - ignoreCase: false, - want: "\"(TM)\"", - }, - }, - &actionExpr{ - pos: position{line: 2183, col: 15, offset: 76990}, - run: (*parser).callonSingleQuotedStringElement45, - expr: &litMatcher{ - pos: position{line: 2183, col: 15, offset: 76990}, - val: "(R)", - ignoreCase: false, - want: "\"(R)\"", - }, - }, - &actionExpr{ - pos: position{line: 2186, col: 13, offset: 77056}, - run: (*parser).callonSingleQuotedStringElement47, - expr: &litMatcher{ - pos: position{line: 2186, col: 13, offset: 77056}, - val: "...", - ignoreCase: false, - want: "\"...\"", - }, - }, - &actionExpr{ - pos: position{line: 2194, col: 22, offset: 77354}, - run: (*parser).callonSingleQuotedStringElement49, + &actionExpr{ + pos: position{line: 1591, col: 5, offset: 52800}, + run: (*parser).callonListElements118, + expr: &seqExpr{ + pos: position{line: 1591, col: 5, offset: 52800}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1591, col: 5, offset: 52800}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + run: (*parser).callonListElements121, expr: &seqExpr{ - pos: position{line: 2194, col: 22, offset: 77354}, + pos: position{line: 1597, col: 5, offset: 53001}, exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &litMatcher{ + pos: position{line: 1597, col: 5, offset: 53001}, + val: "<", ignoreCase: false, - inverted: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1597, col: 9, offset: 53005}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + run: (*parser).callonListElements125, + expr: &oneOrMoreExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + expr: &charClassMatcher{ + pos: position{line: 1597, col: 14, offset: 53010}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, &litMatcher{ - pos: position{line: 2194, col: 31, offset: 77363}, - val: "'", + pos: position{line: 1597, col: 62, offset: 53058}, + val: ">", ignoreCase: false, - want: "\"'\"", + want: "\">\"", }, - &andExpr{ - pos: position{line: 2194, col: 35, offset: 77367}, - expr: &charClassMatcher{ - pos: position{line: 2194, col: 36, offset: 77368}, - val: "[\\pL]", - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElements129, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, }, }, }, }, }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1327, col: 11, offset: 46095}, - name: "QuotedTextInSingleQuotedString", - }, - &ruleRefExpr{ - pos: position{line: 1328, col: 11, offset: 46136}, - name: "DoubleQuotedString", - }, - &charClassMatcher{ - pos: position{line: 1345, col: 41, offset: 46617}, - val: "[^\\r\\n\\t `]", - chars: []rune{'\r', '\n', '\t', ' ', '`'}, - ignoreCase: false, - inverted: true, - }, - &actionExpr{ - pos: position{line: 1345, col: 55, offset: 46631}, - run: (*parser).callonSingleQuotedStringElement58, - expr: &seqExpr{ - pos: position{line: 1345, col: 55, offset: 46631}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1345, col: 55, offset: 46631}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - ¬Expr{ - pos: position{line: 1345, col: 59, offset: 46635}, - expr: &litMatcher{ - pos: position{line: 1345, col: 60, offset: 46636}, - val: "'", - ignoreCase: false, - want: "\"'\"", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "QuotedTextInSingleQuotedString", - pos: position{line: 1334, col: 1, offset: 46244}, - expr: &actionExpr{ - pos: position{line: 1335, col: 5, offset: 46282}, - run: (*parser).callonQuotedTextInSingleQuotedString1, - expr: &seqExpr{ - pos: position{line: 1335, col: 5, offset: 46282}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1335, col: 5, offset: 46282}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1335, col: 16, offset: 46293}, - expr: &ruleRefExpr{ - pos: position{line: 1335, col: 17, offset: 46294}, - name: "LongHandAttributes", - }, - }, - }, - &labeledExpr{ - pos: position{line: 1336, col: 5, offset: 46320}, - label: "text", - expr: &choiceExpr{ - pos: position{line: 1336, col: 11, offset: 46326}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1336, col: 11, offset: 46326}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 1337, col: 11, offset: 46345}, - name: "ItalicText", - }, - &actionExpr{ - pos: position{line: 1338, col: 12, offset: 46367}, - run: (*parser).callonQuotedTextInSingleQuotedString10, - expr: &seqExpr{ - pos: position{line: 1338, col: 12, offset: 46367}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1338, col: 12, offset: 46367}, - expr: &litMatcher{ - pos: position{line: 1338, col: 13, offset: 46368}, - val: "`'", - ignoreCase: false, - want: "\"`'\"", - }, - }, &labeledExpr{ - pos: position{line: 1338, col: 18, offset: 46373}, - label: "element", - expr: &ruleRefExpr{ - pos: position{line: 1338, col: 27, offset: 46382}, - name: "MonospaceText", + pos: position{line: 1592, col: 5, offset: 52836}, + label: "description", + expr: &actionExpr{ + pos: position{line: 1602, col: 5, offset: 53136}, + run: (*parser).callonListElements133, + expr: &seqExpr{ + pos: position{line: 1602, col: 5, offset: 53136}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1602, col: 5, offset: 53136}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1602, col: 14, offset: 53145}, + run: (*parser).callonListElements136, + expr: &oneOrMoreExpr{ + pos: position{line: 1602, col: 14, offset: 53145}, + expr: &charClassMatcher{ + pos: position{line: 1602, col: 14, offset: 53145}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements140, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, }, }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1339, col: 11, offset: 46431}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1340, col: 11, offset: 46455}, - name: "SuperscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1341, col: 11, offset: 46481}, - name: "MarkedText", - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "DoubleQuotedString", - pos: position{line: 1349, col: 1, offset: 46700}, - expr: &actionExpr{ - pos: position{line: 1349, col: 23, offset: 46722}, - run: (*parser).callonDoubleQuotedString1, - expr: &seqExpr{ - pos: position{line: 1349, col: 23, offset: 46722}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1378, col: 27, offset: 47742}, - val: "\"`", - ignoreCase: false, - want: "\"\\\"`\"", - }, - ¬Expr{ - pos: position{line: 1378, col: 33, offset: 47748}, - expr: &charClassMatcher{ - pos: position{line: 1378, col: 34, offset: 47749}, - val: "[ \\t\\r\\n]", - chars: []rune{' ', '\t', '\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - &labeledExpr{ - pos: position{line: 1349, col: 46, offset: 46745}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1349, col: 55, offset: 46754}, - name: "DoubleQuotedStringElements", - }, - }, - &litMatcher{ - pos: position{line: 1380, col: 25, offset: 47784}, - val: "`\"", - ignoreCase: false, - want: "\"`\\\"\"", - }, - }, - }, - }, - }, - { - name: "DoubleQuotedStringElements", - pos: position{line: 1353, col: 1, offset: 46885}, - expr: &actionExpr{ - pos: position{line: 1353, col: 31, offset: 46915}, - run: (*parser).callonDoubleQuotedStringElements1, - expr: &labeledExpr{ - pos: position{line: 1353, col: 31, offset: 46915}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 1353, col: 41, offset: 46925}, - expr: &ruleRefExpr{ - pos: position{line: 1353, col: 41, offset: 46925}, - name: "DoubleQuotedStringElement", - }, - }, - }, - }, - }, - { - name: "DoubleQuotedStringElement", - pos: position{line: 1358, col: 1, offset: 47085}, - expr: &actionExpr{ - pos: position{line: 1358, col: 30, offset: 47114}, - run: (*parser).callonDoubleQuotedStringElement1, - expr: &labeledExpr{ - pos: position{line: 1358, col: 30, offset: 47114}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 1359, col: 9, offset: 47132}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1359, col: 9, offset: 47132}, - exprs: []interface{}{ &actionExpr{ - pos: position{line: 995, col: 14, offset: 32701}, - run: (*parser).callonDoubleQuotedStringElement5, + pos: position{line: 1533, col: 5, offset: 51144}, + run: (*parser).callonListElements147, expr: &seqExpr{ - pos: position{line: 995, col: 14, offset: 32701}, + pos: position{line: 1533, col: 5, offset: 51144}, exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDoubleQuotedStringElement9, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 995, col: 20, offset: 32707}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 995, col: 24, offset: 32711}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDoubleQuotedStringElement15, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 1533, col: 5, offset: 51144}, + label: "term", + expr: &actionExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + run: (*parser).callonListElements150, + expr: &oneOrMoreExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + expr: &seqExpr{ + pos: position{line: 1541, col: 6, offset: 51404}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1541, col: 6, offset: 51404}, + expr: &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonListElements154, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonListElements157, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonListElements160, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1541, col: 35, offset: 51433}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements163, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1541, col: 40, offset: 51438, + }, }, }, }, }, }, - &andExpr{ - pos: position{line: 995, col: 31, offset: 32718}, - expr: &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 1534, col: 5, offset: 51179}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonListElements172, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonListElements175, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonListElements178, }, }, }, }, }, - }, - }, - }, - ¬Expr{ - pos: position{line: 1359, col: 19, offset: 47142}, - expr: &litMatcher{ - pos: position{line: 1380, col: 25, offset: 47784}, - val: "`\"", - ignoreCase: false, - want: "\"`\\\"\"", - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1360, col: 11, offset: 47199}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 1360, col: 11, offset: 47199}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDoubleQuotedStringElement29, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 1360, col: 18, offset: 47206}, - expr: &litMatcher{ - pos: position{line: 1380, col: 25, offset: 47784}, - val: "`\"", - ignoreCase: false, - want: "\"`\\\"\"", - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1361, col: 11, offset: 47238}, - name: "QuotedTextInDoubleQuotedString", - }, - &ruleRefExpr{ - pos: position{line: 1362, col: 11, offset: 47279}, - name: "SingleQuotedString", - }, - &actionExpr{ - pos: position{line: 1382, col: 41, offset: 47831}, - run: (*parser).callonDoubleQuotedStringElement35, - expr: &choiceExpr{ - pos: position{line: 1382, col: 42, offset: 47832}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 1382, col: 42, offset: 47832}, - val: "[^\\r\\n\\t `]", - chars: []rune{'\r', '\n', '\t', ' ', '`'}, - ignoreCase: false, - inverted: true, - }, - &seqExpr{ - pos: position{line: 1382, col: 56, offset: 47846}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1382, col: 56, offset: 47846}, - val: "`", - ignoreCase: false, - want: "\"`\"", - }, - ¬Expr{ - pos: position{line: 1382, col: 60, offset: 47850}, - expr: &litMatcher{ - pos: position{line: 1382, col: 61, offset: 47851}, - val: "\"", - ignoreCase: false, - want: "\"\\\"\"", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "QuotedTextInDoubleQuotedString", - pos: position{line: 1367, col: 1, offset: 47382}, - expr: &actionExpr{ - pos: position{line: 1368, col: 5, offset: 47420}, - run: (*parser).callonQuotedTextInDoubleQuotedString1, - expr: &seqExpr{ - pos: position{line: 1368, col: 5, offset: 47420}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1368, col: 5, offset: 47420}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1368, col: 16, offset: 47431}, - expr: &ruleRefExpr{ - pos: position{line: 1368, col: 17, offset: 47432}, - name: "LongHandAttributes", - }, - }, - }, - &labeledExpr{ - pos: position{line: 1369, col: 5, offset: 47458}, - label: "text", - expr: &choiceExpr{ - pos: position{line: 1369, col: 11, offset: 47464}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1369, col: 11, offset: 47464}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 1370, col: 11, offset: 47483}, - name: "ItalicText", - }, - &actionExpr{ - pos: position{line: 1371, col: 12, offset: 47505}, - run: (*parser).callonQuotedTextInDoubleQuotedString10, - expr: &seqExpr{ - pos: position{line: 1371, col: 12, offset: 47505}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1371, col: 12, offset: 47505}, - expr: &litMatcher{ - pos: position{line: 1371, col: 13, offset: 47506}, - val: "`\"", - ignoreCase: false, - want: "\"`\\\"\"", - }, - }, &labeledExpr{ - pos: position{line: 1371, col: 19, offset: 47512}, - label: "element", - expr: &ruleRefExpr{ - pos: position{line: 1371, col: 28, offset: 47521}, - name: "MonospaceText", - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1372, col: 11, offset: 47570}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1373, col: 11, offset: 47594}, - name: "SuperscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1374, col: 11, offset: 47620}, - name: "MarkedText", - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "MarkedText", - pos: position{line: 1391, col: 1, offset: 47971}, - expr: &choiceExpr{ - pos: position{line: 1391, col: 15, offset: 47985}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1391, col: 15, offset: 47985}, - name: "DoubleQuoteMarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1391, col: 39, offset: 48009}, - name: "SingleQuoteMarkedText", - }, - }, - }, - }, - { - name: "DoubleQuoteMarkedText", - pos: position{line: 1393, col: 1, offset: 48032}, - expr: &actionExpr{ - pos: position{line: 1393, col: 26, offset: 48057}, - run: (*parser).callonDoubleQuoteMarkedText1, - expr: &seqExpr{ - pos: position{line: 1393, col: 26, offset: 48057}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1393, col: 26, offset: 48057}, - val: "##", - ignoreCase: false, - want: "\"##\"", - }, - &labeledExpr{ - pos: position{line: 1393, col: 31, offset: 48062}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1393, col: 41, offset: 48072}, - name: "DoubleQuoteMarkedTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1393, col: 72, offset: 48103}, - val: "##", - ignoreCase: false, - want: "\"##\"", - }, - }, - }, - }, - }, - { - name: "DoubleQuoteMarkedTextElements", - pos: position{line: 1397, col: 1, offset: 48241}, - expr: &seqExpr{ - pos: position{line: 1397, col: 34, offset: 48274}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1397, col: 34, offset: 48274}, - name: "DoubleQuoteMarkedTextElement", - }, - &zeroOrMoreExpr{ - pos: position{line: 1397, col: 63, offset: 48303}, - expr: &seqExpr{ - pos: position{line: 1397, col: 64, offset: 48304}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1397, col: 64, offset: 48304}, - expr: &litMatcher{ - pos: position{line: 1397, col: 66, offset: 48306}, - val: "##", - ignoreCase: false, - want: "\"##\"", - }, - }, - &choiceExpr{ - pos: position{line: 1397, col: 73, offset: 48313}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDoubleQuoteMarkedTextElements9, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - &ruleRefExpr{ - pos: position{line: 1397, col: 81, offset: 48321}, - name: "DoubleQuoteMarkedTextElement", - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "DoubleQuoteMarkedTextElement", - pos: position{line: 1399, col: 1, offset: 48388}, - expr: &choiceExpr{ - pos: position{line: 1399, col: 33, offset: 48420}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonDoubleQuoteMarkedTextElement2, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonDoubleQuoteMarkedTextElement11, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1400, col: 11, offset: 48435}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - ¬Expr{ - pos: position{line: 1400, col: 19, offset: 48443}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1401, col: 11, offset: 48462}, - name: "QuotedString", - }, - &ruleRefExpr{ - pos: position{line: 1402, col: 11, offset: 48485}, - name: "NonDoubleQuoteMarkedText", - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonDoubleQuoteMarkedTextElement30, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonDoubleQuoteMarkedTextElement34, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &charClassMatcher{ - pos: position{line: 1418, col: 5, offset: 48932}, - val: "[^\\r\\n#]", - chars: []rune{'\r', '\n', '#'}, - ignoreCase: false, - inverted: true, - }, - &actionExpr{ - pos: position{line: 1419, col: 7, offset: 49031}, - run: (*parser).callonDoubleQuoteMarkedTextElement39, - expr: &seqExpr{ - pos: position{line: 1419, col: 7, offset: 49031}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1419, col: 7, offset: 49031}, - val: "##", - ignoreCase: false, - want: "\"##\"", - }, - &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonDoubleQuoteMarkedTextElement42, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "NonDoubleQuoteMarkedText", - pos: position{line: 1406, col: 1, offset: 48589}, - expr: &actionExpr{ - pos: position{line: 1407, col: 5, offset: 48621}, - run: (*parser).callonNonDoubleQuoteMarkedText1, - expr: &seqExpr{ - pos: position{line: 1407, col: 5, offset: 48621}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1407, col: 5, offset: 48621}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1407, col: 16, offset: 48632}, - expr: &ruleRefExpr{ - pos: position{line: 1407, col: 17, offset: 48633}, - name: "LongHandAttributes", - }, - }, - }, - &labeledExpr{ - pos: position{line: 1408, col: 5, offset: 48659}, - label: "text", - expr: &choiceExpr{ - pos: position{line: 1408, col: 11, offset: 48665}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1408, col: 11, offset: 48665}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 1409, col: 11, offset: 48684}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1410, col: 11, offset: 48705}, - name: "MonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1411, col: 11, offset: 48729}, - name: "SingleQuoteMarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1412, col: 11, offset: 48761}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1413, col: 11, offset: 48785}, - name: "SuperscriptText", - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "SingleQuoteMarkedText", - pos: position{line: 1423, col: 1, offset: 49201}, - expr: &choiceExpr{ - pos: position{line: 1423, col: 26, offset: 49226}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1423, col: 26, offset: 49226}, - run: (*parser).callonSingleQuoteMarkedText2, - expr: &seqExpr{ - pos: position{line: 1423, col: 26, offset: 49226}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1423, col: 27, offset: 49227}, - val: "#", - ignoreCase: false, - want: "\"#\"", - }, - ¬Expr{ - pos: position{line: 1423, col: 31, offset: 49231}, - expr: &litMatcher{ - pos: position{line: 1423, col: 32, offset: 49232}, - val: "#", - ignoreCase: false, - want: "\"#\"", - }, - }, - &labeledExpr{ - pos: position{line: 1423, col: 37, offset: 49237}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1423, col: 47, offset: 49247}, - name: "SingleQuoteMarkedTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1423, col: 78, offset: 49278}, - val: "#", - ignoreCase: false, - want: "\"#\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1425, col: 5, offset: 49472}, - run: (*parser).callonSingleQuoteMarkedText10, - expr: &seqExpr{ - pos: position{line: 1425, col: 5, offset: 49472}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1425, col: 5, offset: 49472}, - val: "#", - ignoreCase: false, - want: "\"#\"", - }, - &labeledExpr{ - pos: position{line: 1425, col: 9, offset: 49476}, - label: "elements", - expr: &seqExpr{ - pos: position{line: 1425, col: 19, offset: 49486}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1425, col: 19, offset: 49486}, - val: "#", - ignoreCase: false, - want: "\"#\"", - }, - &ruleRefExpr{ - pos: position{line: 1425, col: 23, offset: 49490}, - name: "SingleQuoteMarkedTextElements", - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1425, col: 54, offset: 49521}, - val: "#", - ignoreCase: false, - want: "\"#\"", - }, - }, - }, - }, - }, - }, - }, - { - name: "SingleQuoteMarkedTextElements", - pos: position{line: 1429, col: 1, offset: 49734}, - expr: &seqExpr{ - pos: position{line: 1429, col: 34, offset: 49767}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1429, col: 34, offset: 49767}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSingleQuoteMarkedTextElements5, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 1429, col: 41, offset: 49774}, - expr: &ruleRefExpr{ - pos: position{line: 1429, col: 41, offset: 49774}, - name: "SingleQuoteMarkedTextElement", - }, - }, - }, - }, - }, - { - name: "SingleQuoteMarkedTextElement", - pos: position{line: 1431, col: 1, offset: 49805}, - expr: &choiceExpr{ - pos: position{line: 1431, col: 33, offset: 49837}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonSingleQuoteMarkedTextElement2, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonSingleQuoteMarkedTextElement11, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1432, col: 11, offset: 49852}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - ¬Expr{ - pos: position{line: 1432, col: 19, offset: 49860}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1433, col: 11, offset: 49879}, - name: "QuotedString", - }, - &seqExpr{ - pos: position{line: 1434, col: 11, offset: 49902}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 1434, col: 11, offset: 49902}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSingleQuoteMarkedTextElement33, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &zeroOrOneExpr{ - pos: position{line: 1434, col: 18, offset: 49909}, - expr: &seqExpr{ - pos: position{line: 1434, col: 19, offset: 49910}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1434, col: 19, offset: 49910}, - val: "#", - ignoreCase: false, - want: "\"#\"", - }, - ¬Expr{ - pos: position{line: 1434, col: 23, offset: 49914}, - expr: &litMatcher{ - pos: position{line: 1434, col: 24, offset: 49915}, - val: "#", - ignoreCase: false, - want: "\"#\"", - }, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1435, col: 11, offset: 49931}, - name: "NonSingleQuoteMarkedText", - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonSingleQuoteMarkedTextElement41, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonSingleQuoteMarkedTextElement45, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &charClassMatcher{ - pos: position{line: 1450, col: 5, offset: 50377}, - val: "[^\\r\\n#]", - chars: []rune{'\r', '\n', '#'}, - ignoreCase: false, - inverted: true, - }, - &actionExpr{ - pos: position{line: 1451, col: 7, offset: 50474}, - run: (*parser).callonSingleQuoteMarkedTextElement50, - expr: &seqExpr{ - pos: position{line: 1451, col: 7, offset: 50474}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1451, col: 7, offset: 50474}, - val: "#", - ignoreCase: false, - want: "\"#\"", - }, - &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonSingleQuoteMarkedTextElement53, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "NonSingleQuoteMarkedText", - pos: position{line: 1439, col: 1, offset: 50035}, - expr: &actionExpr{ - pos: position{line: 1440, col: 5, offset: 50067}, - run: (*parser).callonNonSingleQuoteMarkedText1, - expr: &seqExpr{ - pos: position{line: 1440, col: 5, offset: 50067}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1440, col: 5, offset: 50067}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1440, col: 16, offset: 50078}, - expr: &ruleRefExpr{ - pos: position{line: 1440, col: 17, offset: 50079}, - name: "LongHandAttributes", - }, - }, - }, - &labeledExpr{ - pos: position{line: 1441, col: 5, offset: 50105}, - label: "text", - expr: &choiceExpr{ - pos: position{line: 1441, col: 11, offset: 50111}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1441, col: 11, offset: 50111}, - name: "DoubleQuoteMarkedText", - }, - &ruleRefExpr{ - pos: position{line: 1442, col: 11, offset: 50143}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 1443, col: 11, offset: 50162}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1444, col: 11, offset: 50183}, - name: "MonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1445, col: 11, offset: 50207}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1446, col: 11, offset: 50231}, - name: "SuperscriptText", - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "EscapedMarkedText", - pos: position{line: 1455, col: 1, offset: 50641}, - expr: &choiceExpr{ - pos: position{line: 1456, col: 5, offset: 50666}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1456, col: 5, offset: 50666}, - run: (*parser).callonEscapedMarkedText2, - expr: &seqExpr{ - pos: position{line: 1456, col: 5, offset: 50666}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1456, col: 5, offset: 50666}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1045, col: 25, offset: 34151}, - run: (*parser).callonEscapedMarkedText5, - expr: &seqExpr{ - pos: position{line: 1045, col: 25, offset: 34151}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1045, col: 25, offset: 34151}, - val: "\\\\", - ignoreCase: false, - want: "\"\\\\\\\\\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1045, col: 30, offset: 34156}, - expr: &litMatcher{ - pos: position{line: 1045, col: 30, offset: 34156}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1456, col: 40, offset: 50701}, - val: "##", - ignoreCase: false, - want: "\"##\"", - }, - &labeledExpr{ - pos: position{line: 1456, col: 45, offset: 50706}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1456, col: 55, offset: 50716}, - name: "DoubleQuoteMarkedTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1456, col: 86, offset: 50747}, - val: "##", - ignoreCase: false, - want: "\"##\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1458, col: 9, offset: 50904}, - run: (*parser).callonEscapedMarkedText14, - expr: &seqExpr{ - pos: position{line: 1458, col: 9, offset: 50904}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1458, col: 9, offset: 50904}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - run: (*parser).callonEscapedMarkedText17, - expr: &oneOrMoreExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - expr: &litMatcher{ - pos: position{line: 1041, col: 25, offset: 34086}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1458, col: 44, offset: 50939}, - val: "##", - ignoreCase: false, - want: "\"##\"", - }, - &labeledExpr{ - pos: position{line: 1458, col: 49, offset: 50944}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1458, col: 59, offset: 50954}, - name: "SingleQuoteMarkedTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1458, col: 90, offset: 50985}, - val: "#", - ignoreCase: false, - want: "\"#\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1461, col: 9, offset: 51185}, - run: (*parser).callonEscapedMarkedText24, - expr: &seqExpr{ - pos: position{line: 1461, col: 9, offset: 51185}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1461, col: 9, offset: 51185}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - run: (*parser).callonEscapedMarkedText27, - expr: &oneOrMoreExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - expr: &litMatcher{ - pos: position{line: 1041, col: 25, offset: 34086}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1461, col: 44, offset: 51220}, - val: "#", - ignoreCase: false, - want: "\"#\"", - }, - &labeledExpr{ - pos: position{line: 1461, col: 48, offset: 51224}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1461, col: 58, offset: 51234}, - name: "SingleQuoteMarkedTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1461, col: 89, offset: 51265}, - val: "#", - ignoreCase: false, - want: "\"#\"", - }, - }, - }, - }, - }, - }, - }, - { - name: "SubscriptText", - pos: position{line: 1466, col: 1, offset: 51415}, - expr: &actionExpr{ - pos: position{line: 1466, col: 18, offset: 51432}, - run: (*parser).callonSubscriptText1, - expr: &seqExpr{ - pos: position{line: 1466, col: 18, offset: 51432}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1466, col: 18, offset: 51432}, - val: "~", - ignoreCase: false, - want: "\"~\"", - }, - &labeledExpr{ - pos: position{line: 1466, col: 22, offset: 51436}, - label: "element", - expr: &ruleRefExpr{ - pos: position{line: 1466, col: 31, offset: 51445}, - name: "SubscriptTextElement", - }, - }, - &litMatcher{ - pos: position{line: 1466, col: 53, offset: 51467}, - val: "~", - ignoreCase: false, - want: "\"~\"", - }, - }, - }, - }, - }, - { - name: "SubscriptTextElement", - pos: position{line: 1470, col: 1, offset: 51567}, - expr: &choiceExpr{ - pos: position{line: 1470, col: 25, offset: 51591}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1470, col: 25, offset: 51591}, - name: "QuotedText", - }, - &actionExpr{ - pos: position{line: 1472, col: 21, offset: 51643}, - run: (*parser).callonSubscriptTextElement3, - expr: &oneOrMoreExpr{ - pos: position{line: 1472, col: 21, offset: 51643}, - expr: &charClassMatcher{ - pos: position{line: 1472, col: 21, offset: 51643}, - val: "[^\\r\\n ~]", - chars: []rune{'\r', '\n', ' ', '~'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - }, - }, - { - name: "EscapedSubscriptText", - pos: position{line: 1476, col: 1, offset: 51720}, - expr: &actionExpr{ - pos: position{line: 1476, col: 25, offset: 51744}, - run: (*parser).callonEscapedSubscriptText1, - expr: &seqExpr{ - pos: position{line: 1476, col: 25, offset: 51744}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1476, col: 25, offset: 51744}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - run: (*parser).callonEscapedSubscriptText4, - expr: &oneOrMoreExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - expr: &litMatcher{ - pos: position{line: 1041, col: 25, offset: 34086}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1476, col: 60, offset: 51779}, - val: "~", - ignoreCase: false, - want: "\"~\"", - }, - &labeledExpr{ - pos: position{line: 1476, col: 64, offset: 51783}, - label: "element", - expr: &ruleRefExpr{ - pos: position{line: 1476, col: 73, offset: 51792}, - name: "SubscriptTextElement", - }, - }, - &litMatcher{ - pos: position{line: 1476, col: 95, offset: 51814}, - val: "~", - ignoreCase: false, - want: "\"~\"", - }, - }, - }, - }, - }, - { - name: "SuperscriptText", - pos: position{line: 1480, col: 1, offset: 51943}, - expr: &actionExpr{ - pos: position{line: 1480, col: 20, offset: 51962}, - run: (*parser).callonSuperscriptText1, - expr: &seqExpr{ - pos: position{line: 1480, col: 20, offset: 51962}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1480, col: 20, offset: 51962}, - val: "^", - ignoreCase: false, - want: "\"^\"", - }, - &labeledExpr{ - pos: position{line: 1480, col: 24, offset: 51966}, - label: "element", - expr: &ruleRefExpr{ - pos: position{line: 1480, col: 33, offset: 51975}, - name: "SuperscriptTextElement", - }, - }, - &litMatcher{ - pos: position{line: 1480, col: 57, offset: 51999}, - val: "^", - ignoreCase: false, - want: "\"^\"", - }, - }, - }, - }, - }, - { - name: "SuperscriptTextElement", - pos: position{line: 1484, col: 1, offset: 52101}, - expr: &choiceExpr{ - pos: position{line: 1484, col: 27, offset: 52127}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1484, col: 27, offset: 52127}, - name: "QuotedText", - }, - &actionExpr{ - pos: position{line: 1486, col: 23, offset: 52183}, - run: (*parser).callonSuperscriptTextElement3, - expr: &oneOrMoreExpr{ - pos: position{line: 1486, col: 23, offset: 52183}, - expr: &charClassMatcher{ - pos: position{line: 1486, col: 23, offset: 52183}, - val: "[^\\r\\n ^]", - chars: []rune{'\r', '\n', ' ', '^'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - }, - }, - { - name: "EscapedSuperscriptText", - pos: position{line: 1490, col: 1, offset: 52260}, - expr: &actionExpr{ - pos: position{line: 1490, col: 27, offset: 52286}, - run: (*parser).callonEscapedSuperscriptText1, - expr: &seqExpr{ - pos: position{line: 1490, col: 27, offset: 52286}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1490, col: 27, offset: 52286}, - label: "backslashes", - expr: &actionExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - run: (*parser).callonEscapedSuperscriptText4, - expr: &oneOrMoreExpr{ - pos: position{line: 1041, col: 25, offset: 34086}, - expr: &litMatcher{ - pos: position{line: 1041, col: 25, offset: 34086}, - val: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1490, col: 62, offset: 52321}, - val: "^", - ignoreCase: false, - want: "\"^\"", - }, - &labeledExpr{ - pos: position{line: 1490, col: 66, offset: 52325}, - label: "element", - expr: &ruleRefExpr{ - pos: position{line: 1490, col: 75, offset: 52334}, - name: "SuperscriptTextElement", - }, - }, - &litMatcher{ - pos: position{line: 1490, col: 99, offset: 52358}, - val: "^", - ignoreCase: false, - want: "\"^\"", - }, - }, - }, - }, - }, - { - name: "InlinePassthrough", - pos: position{line: 1497, col: 1, offset: 52600}, - expr: &choiceExpr{ - pos: position{line: 1497, col: 22, offset: 52621}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1513, col: 26, offset: 53441}, - run: (*parser).callonInlinePassthrough2, - expr: &seqExpr{ - pos: position{line: 1513, col: 26, offset: 53441}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1511, col: 32, offset: 53409}, - val: "+++", - ignoreCase: false, - want: "\"+++\"", - }, - &labeledExpr{ - pos: position{line: 1513, col: 54, offset: 53469}, - label: "content", - expr: &choiceExpr{ - pos: position{line: 1517, col: 33, offset: 53674}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1517, col: 34, offset: 53675}, - run: (*parser).callonInlinePassthrough7, - expr: &zeroOrMoreExpr{ - pos: position{line: 1517, col: 34, offset: 53675}, - expr: &seqExpr{ - pos: position{line: 1517, col: 35, offset: 53676}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1517, col: 35, offset: 53676}, - expr: &litMatcher{ - pos: position{line: 1511, col: 32, offset: 53409}, - val: "+++", - ignoreCase: false, - want: "\"+++\"", - }, - }, - &anyMatcher{ - line: 1517, col: 64, offset: 53705, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1519, col: 7, offset: 53870}, - run: (*parser).callonInlinePassthrough13, - expr: &zeroOrOneExpr{ - pos: position{line: 1519, col: 7, offset: 53870}, - expr: &seqExpr{ - pos: position{line: 1519, col: 8, offset: 53871}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1519, col: 8, offset: 53871}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlinePassthrough19, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 1519, col: 15, offset: 53878}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 1519, col: 24, offset: 53887}, - expr: &litMatcher{ - pos: position{line: 1511, col: 32, offset: 53409}, - val: "+++", - ignoreCase: false, - want: "\"+++\"", - }, - }, - &anyMatcher{ - line: 1519, col: 53, offset: 53916, - }, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1511, col: 32, offset: 53409}, - val: "+++", - ignoreCase: false, - want: "\"+++\"", - }, - ¬Expr{ - pos: position{line: 1513, col: 121, offset: 53536}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1501, col: 26, offset: 52748}, - run: (*parser).callonInlinePassthrough31, - expr: &seqExpr{ - pos: position{line: 1501, col: 26, offset: 52748}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1499, col: 32, offset: 52718}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - &labeledExpr{ - pos: position{line: 1501, col: 54, offset: 52776}, - label: "content", - expr: &choiceExpr{ - pos: position{line: 1505, col: 33, offset: 52981}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1505, col: 34, offset: 52982}, - run: (*parser).callonInlinePassthrough36, - expr: &seqExpr{ - pos: position{line: 1505, col: 34, offset: 52982}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1505, col: 35, offset: 52983}, - expr: &litMatcher{ - pos: position{line: 1499, col: 32, offset: 52718}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - }, - ¬Expr{ - pos: position{line: 1505, col: 64, offset: 53012}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlinePassthrough43, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 1505, col: 71, offset: 53019}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &anyMatcher{ - line: 1505, col: 80, offset: 53028, - }, - &zeroOrMoreExpr{ - pos: position{line: 1505, col: 83, offset: 53031}, - expr: &seqExpr{ - pos: position{line: 1505, col: 84, offset: 53032}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1505, col: 84, offset: 53032}, - expr: &seqExpr{ - pos: position{line: 1505, col: 86, offset: 53034}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 1505, col: 86, offset: 53034}, + pos: position{line: 1535, col: 5, offset: 51224}, + label: "description", + expr: &choiceExpr{ + pos: position{line: 1557, col: 5, offset: 51854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1559, col: 9, offset: 51919}, + run: (*parser).callonListElements181, + expr: &seqExpr{ + pos: position{line: 1559, col: 9, offset: 51919}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1559, col: 9, offset: 51919}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements184, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements187, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlinePassthrough57, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &litMatcher{ - pos: position{line: 1499, col: 32, offset: 52718}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 1505, col: 122, offset: 53070}, - expr: &litMatcher{ - pos: position{line: 1499, col: 32, offset: 52718}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - }, - ¬Expr{ - pos: position{line: 1505, col: 151, offset: 53099}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, - }, - &anyMatcher{ - line: 1505, col: 160, offset: 53108, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1507, col: 7, offset: 53250}, - run: (*parser).callonInlinePassthrough67, - expr: &seqExpr{ - pos: position{line: 1507, col: 8, offset: 53251}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1507, col: 8, offset: 53251}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlinePassthrough72, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 1507, col: 15, offset: 53258}, - expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 1507, col: 24, offset: 53267}, - expr: &litMatcher{ - pos: position{line: 1499, col: 32, offset: 52718}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - }, - &anyMatcher{ - line: 1507, col: 53, offset: 53296, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1499, col: 32, offset: 52718}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - ¬Expr{ - pos: position{line: 1501, col: 121, offset: 52843}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1497, col: 70, offset: 52669}, - name: "PassthroughMacro", - }, - }, - }, - }, - { - name: "PassthroughMacro", - pos: position{line: 1523, col: 1, offset: 53999}, - expr: &choiceExpr{ - pos: position{line: 1523, col: 21, offset: 54019}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1523, col: 21, offset: 54019}, - run: (*parser).callonPassthroughMacro2, - expr: &seqExpr{ - pos: position{line: 1523, col: 21, offset: 54019}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1523, col: 21, offset: 54019}, - val: "pass:[", - ignoreCase: false, - want: "\"pass:[\"", - }, - &labeledExpr{ - pos: position{line: 1523, col: 30, offset: 54028}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1523, col: 38, offset: 54036}, - expr: &actionExpr{ - pos: position{line: 1529, col: 30, offset: 54346}, - run: (*parser).callonPassthroughMacro7, - expr: &charClassMatcher{ - pos: position{line: 1529, col: 30, offset: 54346}, - val: "[^]]", - chars: []rune{']'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1523, col: 67, offset: 54065}, - val: "]", - ignoreCase: false, - want: "\"]\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1525, col: 5, offset: 54161}, - run: (*parser).callonPassthroughMacro10, - expr: &seqExpr{ - pos: position{line: 1525, col: 5, offset: 54161}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1525, col: 5, offset: 54161}, - val: "pass:q[", - ignoreCase: false, - want: "\"pass:q[\"", - }, - &labeledExpr{ - pos: position{line: 1525, col: 15, offset: 54171}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1525, col: 23, offset: 54179}, - expr: &choiceExpr{ - pos: position{line: 1525, col: 24, offset: 54180}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1525, col: 24, offset: 54180}, - name: "QuotedText", - }, - &actionExpr{ - pos: position{line: 1529, col: 30, offset: 54346}, - run: (*parser).callonPassthroughMacro17, - expr: &charClassMatcher{ - pos: position{line: 1529, col: 30, offset: 54346}, - val: "[^]]", - chars: []rune{']'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1525, col: 65, offset: 54221}, - val: "]", - ignoreCase: false, - want: "\"]\"", - }, - }, - }, - }, - }, - }, - }, - { - name: "CrossReference", - pos: position{line: 1536, col: 1, offset: 54519}, - expr: &choiceExpr{ - pos: position{line: 1536, col: 19, offset: 54537}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, - run: (*parser).callonCrossReference2, - expr: &seqExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1538, col: 27, offset: 54613}, - val: "<<", - ignoreCase: false, - want: "\"<<\"", - }, - &labeledExpr{ - pos: position{line: 1538, col: 32, offset: 54618}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonCrossReference6, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 1538, col: 40, offset: 54626}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonCrossReference12, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1538, col: 47, offset: 54633}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - &labeledExpr{ - pos: position{line: 1538, col: 51, offset: 54637}, - label: "label", - expr: &oneOrMoreExpr{ - pos: position{line: 1548, col: 24, offset: 55025}, - expr: &choiceExpr{ - pos: position{line: 1549, col: 5, offset: 55031}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, - run: (*parser).callonCrossReference18, - expr: &seqExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 1549, col: 6, offset: 55032}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 1549, col: 14, offset: 55040}, - expr: &charClassMatcher{ - pos: position{line: 1549, col: 14, offset: 55040}, - val: "[^\\r\\n{<>]", - chars: []rune{'\r', '\n', '{', '<', '>'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonCrossReference23, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonCrossReference27, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &zeroOrMoreExpr{ + pos: position{line: 1560, col: 9, offset: 51939}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonListElements195, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements201, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements204, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, }, }, }, - }, - }, - }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1553, col: 6, offset: 55250}, - run: (*parser).callonCrossReference33, - expr: &litMatcher{ - pos: position{line: 1553, col: 6, offset: 55250}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1538, col: 79, offset: 54665}, - val: ">>", - ignoreCase: false, - want: "\">>\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1540, col: 5, offset: 54730}, - run: (*parser).callonCrossReference36, - expr: &seqExpr{ - pos: position{line: 1540, col: 5, offset: 54730}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1540, col: 5, offset: 54730}, - val: "<<", - ignoreCase: false, - want: "\"<<\"", - }, - &labeledExpr{ - pos: position{line: 1540, col: 10, offset: 54735}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonCrossReference40, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1540, col: 18, offset: 54743}, - val: ">>", - ignoreCase: false, - want: "\">>\"", - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1536, col: 44, offset: 54562}, - name: "ExternalCrossReference", - }, - }, - }, - }, - { - name: "ExternalCrossReference", - pos: position{line: 1544, col: 1, offset: 54806}, - expr: &actionExpr{ - pos: position{line: 1544, col: 27, offset: 54832}, - run: (*parser).callonExternalCrossReference1, - expr: &seqExpr{ - pos: position{line: 1544, col: 27, offset: 54832}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1544, col: 27, offset: 54832}, - val: "xref:", - ignoreCase: false, - want: "\"xref:\"", - }, - &labeledExpr{ - pos: position{line: 1544, col: 35, offset: 54840}, - label: "url", - expr: &actionExpr{ - pos: position{line: 2241, col: 17, offset: 79131}, - run: (*parser).callonExternalCrossReference5, - expr: &labeledExpr{ - pos: position{line: 2241, col: 17, offset: 79131}, - label: "path", - expr: &oneOrMoreExpr{ - pos: position{line: 2241, col: 22, offset: 79136}, - expr: &choiceExpr{ - pos: position{line: 2241, col: 23, offset: 79137}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - run: (*parser).callonExternalCrossReference9, - expr: &oneOrMoreExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - expr: &charClassMatcher{ - pos: position{line: 2253, col: 14, offset: 79513}, - val: "[^\\r\\n[]� ]", - chars: []rune{'\r', '\n', '[', ']', '�', ' '}, - ignoreCase: false, - inverted: true, - }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonExternalCrossReference12, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonExternalCrossReference16, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 1561, col: 9, offset: 51959}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 1561, col: 17, offset: 51967}, + expr: &actionExpr{ + pos: position{line: 1359, col: 5, offset: 45398}, + run: (*parser).callonListElements213, + expr: &seqExpr{ + pos: position{line: 1359, col: 5, offset: 45398}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1359, col: 5, offset: 45398}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonListElements216, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements222, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements225, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1360, col: 5, offset: 45413}, + expr: &seqExpr{ + pos: position{line: 1392, col: 34, offset: 46323}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1392, col: 34, offset: 46323}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 38, offset: 46327}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements236, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements238, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1361, col: 5, offset: 45448}, + expr: &actionExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + run: (*parser).callonListElements244, + expr: &seqExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements247, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1441, col: 12, offset: 47833}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + run: (*parser).callonListElements251, + expr: &seqExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + run: (*parser).callonListElements254, + expr: &oneOrMoreExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + expr: &litMatcher{ + pos: position{line: 1443, col: 17, offset: 47904}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1447, col: 9, offset: 48004}, + run: (*parser).callonListElements257, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + run: (*parser).callonListElements258, + expr: &seqExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + expr: &charClassMatcher{ + pos: position{line: 1466, col: 12, offset: 48722}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1466, col: 20, offset: 48730}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + run: (*parser).callonListElements263, + expr: &seqExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1468, col: 14, offset: 48848}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1468, col: 21, offset: 48855}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + run: (*parser).callonListElements267, + expr: &seqExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1470, col: 14, offset: 48976}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1470, col: 21, offset: 48983}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + run: (*parser).callonListElements271, + expr: &seqExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + expr: &charClassMatcher{ + pos: position{line: 1472, col: 14, offset: 49104}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1472, col: 26, offset: 49116}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + run: (*parser).callonListElements276, + expr: &seqExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + expr: &charClassMatcher{ + pos: position{line: 1474, col: 14, offset: 49237}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1474, col: 26, offset: 49249}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElements281, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1362, col: 5, offset: 45478}, + expr: &actionExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + run: (*parser).callonListElements285, + expr: &seqExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements288, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1491, col: 12, offset: 49795}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1491, col: 20, offset: 49803}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + run: (*parser).callonListElements292, + expr: &seqExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + run: (*parser).callonListElements295, + expr: &oneOrMoreExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + expr: &litMatcher{ + pos: position{line: 1493, col: 17, offset: 49868}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1497, col: 9, offset: 49968}, + run: (*parser).callonListElements298, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1514, col: 14, offset: 50675}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1514, col: 21, offset: 50682}, + run: (*parser).callonListElements300, + expr: &litMatcher{ + pos: position{line: 1514, col: 22, offset: 50683}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElements302, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1363, col: 5, offset: 45510}, + expr: &actionExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + run: (*parser).callonListElements306, + expr: &seqExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1597, col: 5, offset: 53001}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1597, col: 9, offset: 53005}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + run: (*parser).callonListElements310, + expr: &oneOrMoreExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + expr: &charClassMatcher{ + pos: position{line: 1597, col: 14, offset: 53010}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1597, col: 62, offset: 53058}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElements314, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1364, col: 5, offset: 45540}, + expr: &seqExpr{ + pos: position{line: 1364, col: 7, offset: 45542}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + run: (*parser).callonListElements319, + expr: &oneOrMoreExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + expr: &seqExpr{ + pos: position{line: 1541, col: 6, offset: 51404}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1541, col: 6, offset: 51404}, + expr: &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonListElements323, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonListElements326, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonListElements329, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1541, col: 35, offset: 51433}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements332, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1541, col: 40, offset: 51438, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonListElements340, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonListElements343, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonListElements346, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1365, col: 5, offset: 45598}, + expr: &actionExpr{ + pos: position{line: 571, col: 5, offset: 18579}, + run: (*parser).callonListElements348, + expr: &seqExpr{ + pos: position{line: 571, col: 5, offset: 18579}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 571, col: 5, offset: 18579}, + expr: &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 572, col: 5, offset: 18609}, + label: "delimiter", + expr: &choiceExpr{ + pos: position{line: 573, col: 9, offset: 18629}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 585, col: 26, offset: 18950}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements357, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements360, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 587, col: 26, offset: 18994}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 587, col: 26, offset: 18994}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 587, col: 33, offset: 19001}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements370, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements373, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 589, col: 25, offset: 19037}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 589, col: 25, offset: 19037}, + val: "```", + ignoreCase: false, + want: "\"```\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 589, col: 31, offset: 19043}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements383, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements386, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 591, col: 26, offset: 19080}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 591, col: 26, offset: 19080}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 591, col: 33, offset: 19087}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements396, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements399, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 593, col: 26, offset: 19124}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 593, col: 26, offset: 19124}, + val: "....", + ignoreCase: false, + want: "\"....\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 593, col: 33, offset: 19131}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements409, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements412, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 595, col: 30, offset: 19172}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 595, col: 30, offset: 19172}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 595, col: 37, offset: 19179}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements422, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements425, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 597, col: 24, offset: 19214}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 597, col: 24, offset: 19214}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 597, col: 31, offset: 19221}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements435, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements438, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 599, col: 26, offset: 19258}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 599, col: 26, offset: 19258}, + val: "****", + ignoreCase: false, + want: "\"****\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 599, col: 33, offset: 19265}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElements448, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements451, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1366, col: 5, offset: 45618}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1366, col: 14, offset: 45627}, + run: (*parser).callonListElements459, + expr: &oneOrMoreExpr{ + pos: position{line: 1366, col: 14, offset: 45627}, + expr: &charClassMatcher{ + pos: position{line: 1366, col: 14, offset: 45627}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements463, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", + &actionExpr{ + pos: position{line: 1569, col: 9, offset: 52202}, + run: (*parser).callonListElements470, + expr: &seqExpr{ + pos: position{line: 1569, col: 9, offset: 52202}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElements472, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1570, col: 9, offset: 52254}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1570, col: 18, offset: 52263}, + run: (*parser).callonListElements476, + expr: &oneOrMoreExpr{ + pos: position{line: 1570, col: 18, offset: 52263}, + expr: &charClassMatcher{ + pos: position{line: 1570, col: 18, offset: 52263}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElements480, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, }, }, }, @@ -25289,11 +30208,11 @@ var g = &grammar{ }, }, &labeledExpr{ - pos: position{line: 1544, col: 54, offset: 54859}, - label: "inlineAttributes", + pos: position{line: 1300, col: 5, offset: 43431}, + label: "extraElements", expr: &ruleRefExpr{ - pos: position{line: 1544, col: 72, offset: 54877}, - name: "InlineAttributes", + pos: position{line: 1300, col: 20, offset: 43446}, + name: "ExtraListElements", }, }, }, @@ -25301,145 +30220,703 @@ var g = &grammar{ }, }, { - name: "Link", - pos: position{line: 1561, col: 1, offset: 55427}, - expr: &choiceExpr{ - pos: position{line: 1561, col: 9, offset: 55435}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1561, col: 9, offset: 55435}, - name: "RelativeLink", - }, - &ruleRefExpr{ - pos: position{line: 1561, col: 24, offset: 55450}, - name: "ExternalLink", + name: "ExtraListElements", + pos: position{line: 1310, col: 1, offset: 43701}, + expr: &actionExpr{ + pos: position{line: 1310, col: 22, offset: 43722}, + run: (*parser).callonExtraListElements1, + expr: &labeledExpr{ + pos: position{line: 1310, col: 22, offset: 43722}, + label: "elements", + expr: &zeroOrMoreExpr{ + pos: position{line: 1310, col: 31, offset: 43731}, + expr: &ruleRefExpr{ + pos: position{line: 1310, col: 32, offset: 43732}, + name: "ExtraListElement", + }, }, }, }, }, { - name: "RelativeLink", - pos: position{line: 1564, col: 1, offset: 55531}, + name: "ExtraListElement", + pos: position{line: 1314, col: 1, offset: 43812}, expr: &actionExpr{ - pos: position{line: 1564, col: 17, offset: 55547}, - run: (*parser).callonRelativeLink1, + pos: position{line: 1315, col: 5, offset: 43951}, + run: (*parser).callonExtraListElement1, expr: &seqExpr{ - pos: position{line: 1564, col: 17, offset: 55547}, + pos: position{line: 1315, col: 5, offset: 43951}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1564, col: 17, offset: 55547}, - val: "link:", - ignoreCase: false, - want: "\"link:\"", + ¬Expr{ + pos: position{line: 1315, col: 5, offset: 43951}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, &labeledExpr{ - pos: position{line: 1564, col: 25, offset: 55555}, - label: "url", - expr: &actionExpr{ - pos: position{line: 2245, col: 13, offset: 79241}, - run: (*parser).callonRelativeLink5, - expr: &seqExpr{ - pos: position{line: 2245, col: 13, offset: 79241}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2245, col: 13, offset: 79241}, - label: "scheme", - expr: &zeroOrOneExpr{ - pos: position{line: 2245, col: 20, offset: 79248}, - expr: &choiceExpr{ - pos: position{line: 2257, col: 11, offset: 79645}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2257, col: 11, offset: 79645}, - val: "http://", - ignoreCase: false, - want: "\"http://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 23, offset: 79657}, - val: "https://", - ignoreCase: false, - want: "\"https://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 36, offset: 79670}, - val: "ftp://", - ignoreCase: false, - want: "\"ftp://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 47, offset: 79681}, - val: "irc://", - ignoreCase: false, - want: "\"irc://\"", + pos: position{line: 1316, col: 5, offset: 43961}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1317, col: 9, offset: 43979}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1317, col: 13, offset: 43983}, + run: (*parser).callonExtraListElement8, + expr: &seqExpr{ + pos: position{line: 1317, col: 13, offset: 43983}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1317, col: 13, offset: 43983}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonExtraListElement11, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement17, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement20, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, }, - &litMatcher{ - pos: position{line: 2257, col: 58, offset: 79692}, - val: "mailto:", - ignoreCase: false, - want: "\"mailto:\"", + }, + }, + &labeledExpr{ + pos: position{line: 1318, col: 13, offset: 44007}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1434, col: 5, offset: 47618}, + run: (*parser).callonExtraListElement28, + expr: &seqExpr{ + pos: position{line: 1434, col: 5, offset: 47618}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1434, col: 5, offset: 47618}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + run: (*parser).callonExtraListElement31, + expr: &seqExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement34, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1441, col: 12, offset: 47833}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + run: (*parser).callonExtraListElement38, + expr: &seqExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + run: (*parser).callonExtraListElement41, + expr: &oneOrMoreExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + expr: &litMatcher{ + pos: position{line: 1443, col: 17, offset: 47904}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1447, col: 9, offset: 48004}, + run: (*parser).callonExtraListElement44, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + run: (*parser).callonExtraListElement45, + expr: &seqExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + expr: &charClassMatcher{ + pos: position{line: 1466, col: 12, offset: 48722}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1466, col: 20, offset: 48730}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + run: (*parser).callonExtraListElement50, + expr: &seqExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1468, col: 14, offset: 48848}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1468, col: 21, offset: 48855}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + run: (*parser).callonExtraListElement54, + expr: &seqExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1470, col: 14, offset: 48976}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1470, col: 21, offset: 48983}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + run: (*parser).callonExtraListElement58, + expr: &seqExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + expr: &charClassMatcher{ + pos: position{line: 1472, col: 14, offset: 49104}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1472, col: 26, offset: 49116}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + run: (*parser).callonExtraListElement63, + expr: &seqExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + expr: &charClassMatcher{ + pos: position{line: 1474, col: 14, offset: 49237}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1474, col: 26, offset: 49249}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement68, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1435, col: 5, offset: 47657}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + run: (*parser).callonExtraListElement72, + expr: &seqExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + run: (*parser).callonExtraListElement75, + expr: &oneOrMoreExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + expr: &charClassMatcher{ + pos: position{line: 1374, col: 14, offset: 45833}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement79, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, }, - &labeledExpr{ - pos: position{line: 2245, col: 30, offset: 79258}, - label: "path", - expr: &oneOrMoreExpr{ - pos: position{line: 2245, col: 35, offset: 79263}, - expr: &choiceExpr{ - pos: position{line: 2245, col: 36, offset: 79264}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - run: (*parser).callonRelativeLink18, - expr: &oneOrMoreExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - expr: &charClassMatcher{ - pos: position{line: 2253, col: 14, offset: 79513}, - val: "[^\\r\\n[]� ]", - chars: []rune{'\r', '\n', '[', ']', '�', ' '}, - ignoreCase: false, - inverted: true, - }, - }, + }, + &actionExpr{ + pos: position{line: 1321, col: 13, offset: 44099}, + run: (*parser).callonExtraListElement86, + expr: &seqExpr{ + pos: position{line: 1321, col: 13, offset: 44099}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1321, col: 13, offset: 44099}, + label: "attributes", + expr: &oneOrMoreExpr{ + pos: position{line: 1321, col: 24, offset: 44110}, + expr: &ruleRefExpr{ + pos: position{line: 1321, col: 25, offset: 44111}, + name: "BlockAttributes", }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonRelativeLink21, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonRelativeLink25, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 1322, col: 13, offset: 44142}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1434, col: 5, offset: 47618}, + run: (*parser).callonExtraListElement92, + expr: &seqExpr{ + pos: position{line: 1434, col: 5, offset: 47618}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1434, col: 5, offset: 47618}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + run: (*parser).callonExtraListElement95, + expr: &seqExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement98, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1441, col: 12, offset: 47833}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + run: (*parser).callonExtraListElement102, + expr: &seqExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + run: (*parser).callonExtraListElement105, + expr: &oneOrMoreExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + expr: &litMatcher{ + pos: position{line: 1443, col: 17, offset: 47904}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1447, col: 9, offset: 48004}, + run: (*parser).callonExtraListElement108, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + run: (*parser).callonExtraListElement109, + expr: &seqExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + expr: &charClassMatcher{ + pos: position{line: 1466, col: 12, offset: 48722}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1466, col: 20, offset: 48730}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + run: (*parser).callonExtraListElement114, + expr: &seqExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1468, col: 14, offset: 48848}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1468, col: 21, offset: 48855}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + run: (*parser).callonExtraListElement118, + expr: &seqExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1470, col: 14, offset: 48976}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1470, col: 21, offset: 48983}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + run: (*parser).callonExtraListElement122, + expr: &seqExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + expr: &charClassMatcher{ + pos: position{line: 1472, col: 14, offset: 49104}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1472, col: 26, offset: 49116}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + run: (*parser).callonExtraListElement127, + expr: &seqExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + expr: &charClassMatcher{ + pos: position{line: 1474, col: 14, offset: 49237}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1474, col: 26, offset: 49249}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement132, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 1435, col: 5, offset: 47657}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + run: (*parser).callonExtraListElement136, + expr: &seqExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + run: (*parser).callonExtraListElement139, + expr: &oneOrMoreExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + expr: &charClassMatcher{ + pos: position{line: 1374, col: 14, offset: 45833}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement143, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, }, }, }, @@ -25449,493 +30926,607 @@ var g = &grammar{ }, }, }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1564, col: 40, offset: 55570}, - label: "inlineAttributes", - expr: &ruleRefExpr{ - pos: position{line: 1564, col: 58, offset: 55588}, - name: "InlineAttributes", - }, - }, - }, - }, - }, - }, - { - name: "ExternalLink", - pos: position{line: 1568, col: 1, offset: 55701}, - expr: &actionExpr{ - pos: position{line: 1568, col: 17, offset: 55717}, - run: (*parser).callonExternalLink1, - expr: &seqExpr{ - pos: position{line: 1568, col: 17, offset: 55717}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1568, col: 17, offset: 55717}, - label: "url", - expr: &actionExpr{ - pos: position{line: 2249, col: 23, offset: 79382}, - run: (*parser).callonExternalLink4, - expr: &seqExpr{ - pos: position{line: 2249, col: 23, offset: 79382}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2249, col: 23, offset: 79382}, - label: "scheme", - expr: &choiceExpr{ - pos: position{line: 2257, col: 11, offset: 79645}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2257, col: 11, offset: 79645}, - val: "http://", - ignoreCase: false, - want: "\"http://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 23, offset: 79657}, - val: "https://", - ignoreCase: false, - want: "\"https://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 36, offset: 79670}, - val: "ftp://", - ignoreCase: false, - want: "\"ftp://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 47, offset: 79681}, - val: "irc://", - ignoreCase: false, - want: "\"irc://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 58, offset: 79692}, - val: "mailto:", - ignoreCase: false, - want: "\"mailto:\"", - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2249, col: 39, offset: 79398}, - label: "path", - expr: &oneOrMoreExpr{ - pos: position{line: 2249, col: 44, offset: 79403}, - expr: &choiceExpr{ - pos: position{line: 2249, col: 45, offset: 79404}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - run: (*parser).callonExternalLink16, - expr: &oneOrMoreExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - expr: &charClassMatcher{ - pos: position{line: 2253, col: 14, offset: 79513}, - val: "[^\\r\\n[]� ]", - chars: []rune{'\r', '\n', '[', ']', '�', ' '}, - ignoreCase: false, - inverted: true, + &actionExpr{ + pos: position{line: 1325, col: 13, offset: 44270}, + run: (*parser).callonExtraListElement150, + expr: &seqExpr{ + pos: position{line: 1325, col: 13, offset: 44270}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1325, col: 13, offset: 44270}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonExtraListElement153, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonExternalLink19, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement159, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonExternalLink23, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement162, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, }, }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1568, col: 42, offset: 55742}, - label: "inlineAttributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1568, col: 59, offset: 55759}, - expr: &ruleRefExpr{ - pos: position{line: 1568, col: 60, offset: 55760}, - name: "InlineAttributes", - }, - }, - }, - }, - }, - }, - }, - { - name: "ImageBlock", - pos: position{line: 1575, col: 1, offset: 55957}, - expr: &actionExpr{ - pos: position{line: 1576, col: 5, offset: 55976}, - run: (*parser).callonImageBlock1, - expr: &seqExpr{ - pos: position{line: 1576, col: 5, offset: 55976}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 1576, col: 5, offset: 55976}, - run: (*parser).callonImageBlock3, - }, - &litMatcher{ - pos: position{line: 1580, col: 5, offset: 56128}, - val: "image::", - ignoreCase: false, - want: "\"image::\"", - }, - &labeledExpr{ - pos: position{line: 1580, col: 15, offset: 56138}, - label: "path", - expr: &actionExpr{ - pos: position{line: 2245, col: 13, offset: 79241}, - run: (*parser).callonImageBlock6, - expr: &seqExpr{ - pos: position{line: 2245, col: 13, offset: 79241}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2245, col: 13, offset: 79241}, - label: "scheme", - expr: &zeroOrOneExpr{ - pos: position{line: 2245, col: 20, offset: 79248}, - expr: &choiceExpr{ - pos: position{line: 2257, col: 11, offset: 79645}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2257, col: 11, offset: 79645}, - val: "http://", - ignoreCase: false, - want: "\"http://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 23, offset: 79657}, - val: "https://", - ignoreCase: false, - want: "\"https://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 36, offset: 79670}, - val: "ftp://", - ignoreCase: false, - want: "\"ftp://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 47, offset: 79681}, - val: "irc://", - ignoreCase: false, - want: "\"irc://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 58, offset: 79692}, - val: "mailto:", - ignoreCase: false, - want: "\"mailto:\"", - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2245, col: 30, offset: 79258}, - label: "path", - expr: &oneOrMoreExpr{ - pos: position{line: 2245, col: 35, offset: 79263}, - expr: &choiceExpr{ - pos: position{line: 2245, col: 36, offset: 79264}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - run: (*parser).callonImageBlock19, - expr: &oneOrMoreExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - expr: &charClassMatcher{ - pos: position{line: 2253, col: 14, offset: 79513}, - val: "[^\\r\\n[]� ]", - chars: []rune{'\r', '\n', '[', ']', '�', ' '}, - ignoreCase: false, - inverted: true, - }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonImageBlock22, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", + &labeledExpr{ + pos: position{line: 1326, col: 13, offset: 44294}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1484, col: 5, offset: 49515}, + run: (*parser).callonExtraListElement170, + expr: &seqExpr{ + pos: position{line: 1484, col: 5, offset: 49515}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1484, col: 5, offset: 49515}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + run: (*parser).callonExtraListElement173, + expr: &seqExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement176, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1491, col: 12, offset: 49795}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1491, col: 20, offset: 49803}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + run: (*parser).callonExtraListElement180, + expr: &seqExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + run: (*parser).callonExtraListElement183, + expr: &oneOrMoreExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + expr: &litMatcher{ + pos: position{line: 1493, col: 17, offset: 49868}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1497, col: 9, offset: 49968}, + run: (*parser).callonExtraListElement186, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1514, col: 14, offset: 50675}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1514, col: 21, offset: 50682}, + run: (*parser).callonExtraListElement188, + expr: &litMatcher{ + pos: position{line: 1514, col: 22, offset: 50683}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement190, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", + }, + &labeledExpr{ + pos: position{line: 1485, col: 5, offset: 49556}, + label: "checkstyle", + expr: &zeroOrOneExpr{ + pos: position{line: 1485, col: 16, offset: 49567}, expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonImageBlock26, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + pos: position{line: 1521, col: 5, offset: 50844}, + run: (*parser).callonExtraListElement195, + expr: &seqExpr{ + pos: position{line: 1521, col: 5, offset: 50844}, + exprs: []interface{}{ + &andExpr{ + pos: position{line: 1521, col: 5, offset: 50844}, + expr: &litMatcher{ + pos: position{line: 1521, col: 6, offset: 50845}, + val: "[", + ignoreCase: false, + want: "\"[\"", + }, + }, + &labeledExpr{ + pos: position{line: 1521, col: 10, offset: 50849}, + label: "style", + expr: &choiceExpr{ + pos: position{line: 1522, col: 7, offset: 50863}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1522, col: 7, offset: 50863}, + run: (*parser).callonExtraListElement201, + expr: &litMatcher{ + pos: position{line: 1522, col: 7, offset: 50863}, + val: "[ ]", + ignoreCase: false, + want: "\"[ ]\"", + }, + }, + &actionExpr{ + pos: position{line: 1523, col: 7, offset: 50908}, + run: (*parser).callonExtraListElement203, + expr: &litMatcher{ + pos: position{line: 1523, col: 7, offset: 50908}, + val: "[*]", + ignoreCase: false, + want: "\"[*]\"", + }, + }, + &actionExpr{ + pos: position{line: 1524, col: 7, offset: 50951}, + run: (*parser).callonExtraListElement205, + expr: &litMatcher{ + pos: position{line: 1524, col: 7, offset: 50951}, + val: "[x]", + ignoreCase: false, + want: "\"[x]\"", + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement207, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1580, col: 31, offset: 56154}, - label: "inlineAttributes", - expr: &ruleRefExpr{ - pos: position{line: 1580, col: 49, offset: 56172}, - name: "InlineAttributes", - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 1580, col: 67, offset: 56190}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonImageBlock35, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "InlineImage", - pos: position{line: 1585, col: 1, offset: 56431}, - expr: &actionExpr{ - pos: position{line: 1585, col: 16, offset: 56446}, - run: (*parser).callonInlineImage1, - expr: &seqExpr{ - pos: position{line: 1585, col: 16, offset: 56446}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1585, col: 16, offset: 56446}, - val: "image:", - ignoreCase: false, - want: "\"image:\"", - }, - ¬Expr{ - pos: position{line: 1585, col: 25, offset: 56455}, - expr: &litMatcher{ - pos: position{line: 1585, col: 26, offset: 56456}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - }, - &labeledExpr{ - pos: position{line: 1585, col: 30, offset: 56460}, - label: "path", - expr: &actionExpr{ - pos: position{line: 2245, col: 13, offset: 79241}, - run: (*parser).callonInlineImage7, - expr: &seqExpr{ - pos: position{line: 2245, col: 13, offset: 79241}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2245, col: 13, offset: 79241}, - label: "scheme", - expr: &zeroOrOneExpr{ - pos: position{line: 2245, col: 20, offset: 79248}, - expr: &choiceExpr{ - pos: position{line: 2257, col: 11, offset: 79645}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2257, col: 11, offset: 79645}, - val: "http://", - ignoreCase: false, - want: "\"http://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 23, offset: 79657}, - val: "https://", - ignoreCase: false, - want: "\"https://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 36, offset: 79670}, - val: "ftp://", - ignoreCase: false, - want: "\"ftp://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 47, offset: 79681}, - val: "irc://", - ignoreCase: false, - want: "\"irc://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 58, offset: 79692}, - val: "mailto:", - ignoreCase: false, - want: "\"mailto:\"", + &labeledExpr{ + pos: position{line: 1486, col: 5, offset: 49606}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + run: (*parser).callonExtraListElement211, + expr: &seqExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + run: (*parser).callonExtraListElement214, + expr: &oneOrMoreExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + expr: &charClassMatcher{ + pos: position{line: 1374, col: 14, offset: 45833}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement218, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, }, - &labeledExpr{ - pos: position{line: 2245, col: 30, offset: 79258}, - label: "path", - expr: &oneOrMoreExpr{ - pos: position{line: 2245, col: 35, offset: 79263}, - expr: &choiceExpr{ - pos: position{line: 2245, col: 36, offset: 79264}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - run: (*parser).callonInlineImage20, - expr: &oneOrMoreExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - expr: &charClassMatcher{ - pos: position{line: 2253, col: 14, offset: 79513}, - val: "[^\\r\\n[]� ]", - chars: []rune{'\r', '\n', '[', ']', '�', ' '}, - ignoreCase: false, - inverted: true, - }, - }, + }, + &actionExpr{ + pos: position{line: 1329, col: 13, offset: 44388}, + run: (*parser).callonExtraListElement225, + expr: &seqExpr{ + pos: position{line: 1329, col: 13, offset: 44388}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1329, col: 13, offset: 44388}, + label: "attributes", + expr: &oneOrMoreExpr{ + pos: position{line: 1329, col: 24, offset: 44399}, + expr: &ruleRefExpr{ + pos: position{line: 1329, col: 25, offset: 44400}, + name: "BlockAttributes", }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonInlineImage23, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", + }, + }, + &labeledExpr{ + pos: position{line: 1330, col: 13, offset: 44431}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1484, col: 5, offset: 49515}, + run: (*parser).callonExtraListElement231, + expr: &seqExpr{ + pos: position{line: 1484, col: 5, offset: 49515}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1484, col: 5, offset: 49515}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + run: (*parser).callonExtraListElement234, + expr: &seqExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement237, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1491, col: 12, offset: 49795}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1491, col: 20, offset: 49803}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + run: (*parser).callonExtraListElement241, + expr: &seqExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + run: (*parser).callonExtraListElement244, + expr: &oneOrMoreExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + expr: &litMatcher{ + pos: position{line: 1493, col: 17, offset: 49868}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1497, col: 9, offset: 49968}, + run: (*parser).callonExtraListElement247, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1514, col: 14, offset: 50675}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1514, col: 21, offset: 50682}, + run: (*parser).callonExtraListElement249, + expr: &litMatcher{ + pos: position{line: 1514, col: 22, offset: 50683}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement251, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", + }, + &labeledExpr{ + pos: position{line: 1485, col: 5, offset: 49556}, + label: "checkstyle", + expr: &zeroOrOneExpr{ + pos: position{line: 1485, col: 16, offset: 49567}, expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonInlineImage27, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + pos: position{line: 1521, col: 5, offset: 50844}, + run: (*parser).callonExtraListElement256, + expr: &seqExpr{ + pos: position{line: 1521, col: 5, offset: 50844}, + exprs: []interface{}{ + &andExpr{ + pos: position{line: 1521, col: 5, offset: 50844}, + expr: &litMatcher{ + pos: position{line: 1521, col: 6, offset: 50845}, + val: "[", + ignoreCase: false, + want: "\"[\"", + }, + }, + &labeledExpr{ + pos: position{line: 1521, col: 10, offset: 50849}, + label: "style", + expr: &choiceExpr{ + pos: position{line: 1522, col: 7, offset: 50863}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1522, col: 7, offset: 50863}, + run: (*parser).callonExtraListElement262, + expr: &litMatcher{ + pos: position{line: 1522, col: 7, offset: 50863}, + val: "[ ]", + ignoreCase: false, + want: "\"[ ]\"", + }, + }, + &actionExpr{ + pos: position{line: 1523, col: 7, offset: 50908}, + run: (*parser).callonExtraListElement264, + expr: &litMatcher{ + pos: position{line: 1523, col: 7, offset: 50908}, + val: "[*]", + ignoreCase: false, + want: "\"[*]\"", + }, + }, + &actionExpr{ + pos: position{line: 1524, col: 7, offset: 50951}, + run: (*parser).callonExtraListElement266, + expr: &litMatcher{ + pos: position{line: 1524, col: 7, offset: 50951}, + val: "[x]", + ignoreCase: false, + want: "\"[x]\"", + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement268, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 1486, col: 5, offset: 49606}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + run: (*parser).callonExtraListElement272, + expr: &seqExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + run: (*parser).callonExtraListElement275, + expr: &oneOrMoreExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + expr: &charClassMatcher{ + pos: position{line: 1374, col: 14, offset: 45833}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement279, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, }, }, }, @@ -25945,611 +31536,2028 @@ var g = &grammar{ }, }, }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1585, col: 46, offset: 56476}, - label: "inlineAttributes", - expr: &ruleRefExpr{ - pos: position{line: 1585, col: 64, offset: 56494}, - name: "InlineAttributes", - }, - }, - }, - }, - }, - }, - { - name: "InlineIcon", - pos: position{line: 1592, col: 1, offset: 56829}, - expr: &actionExpr{ - pos: position{line: 1592, col: 15, offset: 56843}, - run: (*parser).callonInlineIcon1, - expr: &seqExpr{ - pos: position{line: 1592, col: 15, offset: 56843}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1592, col: 15, offset: 56843}, - val: "icon:", - ignoreCase: false, - want: "\"icon:\"", - }, - &labeledExpr{ - pos: position{line: 1592, col: 23, offset: 56851}, - label: "icon", - expr: &actionExpr{ - pos: position{line: 1592, col: 29, offset: 56857}, - run: (*parser).callonInlineIcon5, - expr: &oneOrMoreExpr{ - pos: position{line: 1592, col: 29, offset: 56857}, - expr: &charClassMatcher{ - pos: position{line: 1592, col: 29, offset: 56857}, - val: "[_-0-9\\pL]", - chars: []rune{'_', '-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1592, col: 73, offset: 56901}, - label: "attributes", - expr: &ruleRefExpr{ - pos: position{line: 1592, col: 85, offset: 56913}, - name: "InlineAttributes", - }, - }, - }, - }, - }, - }, - { - name: "InlineFootnote", - pos: position{line: 1599, col: 1, offset: 57185}, - expr: &choiceExpr{ - pos: position{line: 1599, col: 19, offset: 57203}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1599, col: 19, offset: 57203}, - run: (*parser).callonInlineFootnote2, - expr: &seqExpr{ - pos: position{line: 1599, col: 19, offset: 57203}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1599, col: 19, offset: 57203}, - val: "footnote:[", - ignoreCase: false, - want: "\"footnote:[\"", - }, - &labeledExpr{ - pos: position{line: 1599, col: 32, offset: 57216}, - label: "content", - expr: &ruleRefExpr{ - pos: position{line: 1599, col: 41, offset: 57225}, - name: "FootnoteContent", - }, - }, - &litMatcher{ - pos: position{line: 1599, col: 58, offset: 57242}, - val: "]", - ignoreCase: false, - want: "\"]\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1601, col: 5, offset: 57310}, - run: (*parser).callonInlineFootnote8, - expr: &seqExpr{ - pos: position{line: 1601, col: 5, offset: 57310}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1601, col: 5, offset: 57310}, - val: "footnote:", - ignoreCase: false, - want: "\"footnote:\"", - }, - &labeledExpr{ - pos: position{line: 1601, col: 17, offset: 57322}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonInlineFootnote12, - expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1601, col: 35, offset: 57340}, - val: "[", - ignoreCase: false, - want: "\"[\"", - }, - &labeledExpr{ - pos: position{line: 1601, col: 39, offset: 57344}, - label: "content", - expr: &zeroOrOneExpr{ - pos: position{line: 1601, col: 47, offset: 57352}, - expr: &ruleRefExpr{ - pos: position{line: 1601, col: 48, offset: 57353}, - name: "FootnoteContent", - }, - }, - }, - &litMatcher{ - pos: position{line: 1601, col: 66, offset: 57371}, - val: "]", - ignoreCase: false, - want: "\"]\"", - }, - }, - }, - }, - }, - }, - }, - { - name: "FootnoteContent", - pos: position{line: 1607, col: 1, offset: 57458}, - expr: &actionExpr{ - pos: position{line: 1607, col: 20, offset: 57477}, - run: (*parser).callonFootnoteContent1, - expr: &labeledExpr{ - pos: position{line: 1607, col: 20, offset: 57477}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 1607, col: 29, offset: 57486}, - expr: &seqExpr{ - pos: position{line: 1607, col: 30, offset: 57487}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1607, col: 30, offset: 57487}, - expr: &litMatcher{ - pos: position{line: 1607, col: 31, offset: 57488}, - val: "]", - ignoreCase: false, - want: "\"]\"", - }, - }, - &ruleRefExpr{ - pos: position{line: 1607, col: 35, offset: 57492}, - name: "InlineElement", - }, - }, - }, - }, - }, - }, - }, - { - name: "Callout", - pos: position{line: 1615, col: 1, offset: 57808}, - expr: &actionExpr{ - pos: position{line: 1615, col: 12, offset: 57819}, - run: (*parser).callonCallout1, - expr: &seqExpr{ - pos: position{line: 1615, col: 12, offset: 57819}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1615, col: 12, offset: 57819}, - val: "<", - ignoreCase: false, - want: "\"<\"", - }, - &labeledExpr{ - pos: position{line: 1615, col: 16, offset: 57823}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1615, col: 21, offset: 57828}, - run: (*parser).callonCallout5, - expr: &oneOrMoreExpr{ - pos: position{line: 1615, col: 21, offset: 57828}, - expr: &charClassMatcher{ - pos: position{line: 1615, col: 21, offset: 57828}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1615, col: 69, offset: 57876}, - val: ">", - ignoreCase: false, - want: "\">\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1615, col: 73, offset: 57880}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonCallout12, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &andExpr{ - pos: position{line: 1615, col: 80, offset: 57887}, - expr: &choiceExpr{ - pos: position{line: 1615, col: 82, offset: 57889}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - &ruleRefExpr{ - pos: position{line: 1615, col: 88, offset: 57895}, - name: "Callout", - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "CalloutListItem", - pos: position{line: 1619, col: 1, offset: 57948}, - expr: &actionExpr{ - pos: position{line: 1619, col: 20, offset: 57967}, - run: (*parser).callonCalloutListItem1, - expr: &seqExpr{ - pos: position{line: 1619, col: 20, offset: 57967}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1619, col: 20, offset: 57967}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1623, col: 26, offset: 58130}, - run: (*parser).callonCalloutListItem4, - expr: &seqExpr{ - pos: position{line: 1623, col: 26, offset: 58130}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1623, col: 26, offset: 58130}, - val: "<", - ignoreCase: false, - want: "\"<\"", - }, - &labeledExpr{ - pos: position{line: 1623, col: 30, offset: 58134}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1623, col: 35, offset: 58139}, - run: (*parser).callonCalloutListItem8, - expr: &oneOrMoreExpr{ - pos: position{line: 1623, col: 35, offset: 58139}, - expr: &charClassMatcher{ - pos: position{line: 1623, col: 35, offset: 58139}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1623, col: 83, offset: 58187}, - val: ">", - ignoreCase: false, - want: "\">\"", - }, - &oneOrMoreExpr{ - pos: position{line: 1623, col: 87, offset: 58191}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + pos: position{line: 1333, col: 13, offset: 44561}, + run: (*parser).callonExtraListElement286, + expr: &seqExpr{ + pos: position{line: 1333, col: 13, offset: 44561}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1333, col: 13, offset: 44561}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonExtraListElement289, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement295, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement298, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonCalloutListItem15, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + }, + &labeledExpr{ + pos: position{line: 1334, col: 13, offset: 44585}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1591, col: 5, offset: 52800}, + run: (*parser).callonExtraListElement306, + expr: &seqExpr{ + pos: position{line: 1591, col: 5, offset: 52800}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1591, col: 5, offset: 52800}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + run: (*parser).callonExtraListElement309, + expr: &seqExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1597, col: 5, offset: 53001}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1597, col: 9, offset: 53005}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + run: (*parser).callonExtraListElement313, + expr: &oneOrMoreExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + expr: &charClassMatcher{ + pos: position{line: 1597, col: 14, offset: 53010}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1597, col: 62, offset: 53058}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement317, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1592, col: 5, offset: 52836}, + label: "description", + expr: &actionExpr{ + pos: position{line: 1602, col: 5, offset: 53136}, + run: (*parser).callonExtraListElement321, + expr: &seqExpr{ + pos: position{line: 1602, col: 5, offset: 53136}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1602, col: 5, offset: 53136}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1602, col: 14, offset: 53145}, + run: (*parser).callonExtraListElement324, + expr: &oneOrMoreExpr{ + pos: position{line: 1602, col: 14, offset: 53145}, + expr: &charClassMatcher{ + pos: position{line: 1602, col: 14, offset: 53145}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement328, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, }, }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1619, col: 48, offset: 57995}, - label: "description", - expr: &oneOrMoreExpr{ - pos: position{line: 1619, col: 61, offset: 58008}, - expr: &ruleRefExpr{ - pos: position{line: 1619, col: 61, offset: 58008}, - name: "ListParagraph", - }, - }, - }, - }, - }, - }, - }, - { - name: "DelimitedBlock", - pos: position{line: 1642, col: 1, offset: 58759}, - expr: &actionExpr{ - pos: position{line: 1642, col: 19, offset: 58777}, - run: (*parser).callonDelimitedBlock1, - expr: &seqExpr{ - pos: position{line: 1642, col: 19, offset: 58777}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1642, col: 19, offset: 58777}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &labeledExpr{ - pos: position{line: 1643, col: 5, offset: 58866}, - label: "block", - expr: &choiceExpr{ - pos: position{line: 1643, col: 12, offset: 58873}, - alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1835, col: 16, offset: 65237}, - run: (*parser).callonDelimitedBlock7, + pos: position{line: 1337, col: 13, offset: 44677}, + run: (*parser).callonExtraListElement335, expr: &seqExpr{ - pos: position{line: 1835, col: 16, offset: 65237}, + pos: position{line: 1337, col: 13, offset: 44677}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1841, col: 30, offset: 65538}, - val: "```", - ignoreCase: false, - want: "\"```\"", + &labeledExpr{ + pos: position{line: 1337, col: 13, offset: 44677}, + label: "attributes", + expr: &oneOrMoreExpr{ + pos: position{line: 1337, col: 24, offset: 44688}, + expr: &ruleRefExpr{ + pos: position{line: 1337, col: 25, offset: 44689}, + name: "BlockAttributes", + }, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 1841, col: 36, offset: 65544}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock13, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 1338, col: 13, offset: 44720}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1591, col: 5, offset: 52800}, + run: (*parser).callonExtraListElement341, + expr: &seqExpr{ + pos: position{line: 1591, col: 5, offset: 52800}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1591, col: 5, offset: 52800}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + run: (*parser).callonExtraListElement344, + expr: &seqExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1597, col: 5, offset: 53001}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1597, col: 9, offset: 53005}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + run: (*parser).callonExtraListElement348, + expr: &oneOrMoreExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + expr: &charClassMatcher{ + pos: position{line: 1597, col: 14, offset: 53010}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1597, col: 62, offset: 53058}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement352, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1592, col: 5, offset: 52836}, + label: "description", + expr: &actionExpr{ + pos: position{line: 1602, col: 5, offset: 53136}, + run: (*parser).callonExtraListElement356, + expr: &seqExpr{ + pos: position{line: 1602, col: 5, offset: 53136}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1602, col: 5, offset: 53136}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1602, col: 14, offset: 53145}, + run: (*parser).callonExtraListElement359, + expr: &oneOrMoreExpr{ + pos: position{line: 1602, col: 14, offset: 53145}, + expr: &charClassMatcher{ + pos: position{line: 1602, col: 14, offset: 53145}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement363, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1341, col: 11, offset: 44846}, + name: "ListElementContinuation", + }, + &actionExpr{ + pos: position{line: 1342, col: 13, offset: 44882}, + run: (*parser).callonExtraListElement371, + expr: &seqExpr{ + pos: position{line: 1342, col: 13, offset: 44882}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1342, col: 13, offset: 44882}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonExtraListElement374, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement380, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement383, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, }, }, }, }, &labeledExpr{ - pos: position{line: 1835, col: 42, offset: 65263}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1845, col: 26, offset: 65634}, - expr: &actionExpr{ - pos: position{line: 1845, col: 27, offset: 65635}, - run: (*parser).callonDelimitedBlock22, - expr: &seqExpr{ - pos: position{line: 1845, col: 27, offset: 65635}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1845, col: 27, offset: 65635}, - expr: &choiceExpr{ - pos: position{line: 1843, col: 28, offset: 65583}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1843, col: 29, offset: 65584}, + pos: position{line: 1343, col: 13, offset: 44906}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1533, col: 5, offset: 51144}, + run: (*parser).callonExtraListElement391, + expr: &seqExpr{ + pos: position{line: 1533, col: 5, offset: 51144}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1533, col: 5, offset: 51144}, + label: "term", + expr: &actionExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + run: (*parser).callonExtraListElement394, + expr: &oneOrMoreExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + expr: &seqExpr{ + pos: position{line: 1541, col: 6, offset: 51404}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1541, col: 6, offset: 51404}, + expr: &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonExtraListElement398, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonExtraListElement401, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonExtraListElement404, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1541, col: 35, offset: 51433}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement407, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1541, col: 40, offset: 51438, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1534, col: 5, offset: 51179}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonExtraListElement416, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonExtraListElement419, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonExtraListElement422, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1535, col: 5, offset: 51224}, + label: "description", + expr: &choiceExpr{ + pos: position{line: 1557, col: 5, offset: 51854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1559, col: 9, offset: 51919}, + run: (*parser).callonExtraListElement425, + expr: &seqExpr{ + pos: position{line: 1559, col: 9, offset: 51919}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1843, col: 29, offset: 65584}, - val: "```", - ignoreCase: false, - want: "\"```\"", + &zeroOrMoreExpr{ + pos: position{line: 1559, col: 9, offset: 51919}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement428, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement431, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, }, &zeroOrMoreExpr{ - pos: position{line: 1843, col: 35, offset: 65590}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + pos: position{line: 1560, col: 9, offset: 51939}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonExtraListElement439, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement445, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement448, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock31, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1561, col: 9, offset: 51959}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 1561, col: 17, offset: 51967}, + expr: &actionExpr{ + pos: position{line: 1359, col: 5, offset: 45398}, + run: (*parser).callonExtraListElement457, + expr: &seqExpr{ + pos: position{line: 1359, col: 5, offset: 45398}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1359, col: 5, offset: 45398}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonExtraListElement460, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement466, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement469, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1360, col: 5, offset: 45413}, + expr: &seqExpr{ + pos: position{line: 1392, col: 34, offset: 46323}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1392, col: 34, offset: 46323}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 38, offset: 46327}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement480, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement482, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1361, col: 5, offset: 45448}, + expr: &actionExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + run: (*parser).callonExtraListElement488, + expr: &seqExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement491, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1441, col: 12, offset: 47833}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + run: (*parser).callonExtraListElement495, + expr: &seqExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + run: (*parser).callonExtraListElement498, + expr: &oneOrMoreExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + expr: &litMatcher{ + pos: position{line: 1443, col: 17, offset: 47904}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1447, col: 9, offset: 48004}, + run: (*parser).callonExtraListElement501, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + run: (*parser).callonExtraListElement502, + expr: &seqExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + expr: &charClassMatcher{ + pos: position{line: 1466, col: 12, offset: 48722}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1466, col: 20, offset: 48730}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + run: (*parser).callonExtraListElement507, + expr: &seqExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1468, col: 14, offset: 48848}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1468, col: 21, offset: 48855}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + run: (*parser).callonExtraListElement511, + expr: &seqExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1470, col: 14, offset: 48976}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1470, col: 21, offset: 48983}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + run: (*parser).callonExtraListElement515, + expr: &seqExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + expr: &charClassMatcher{ + pos: position{line: 1472, col: 14, offset: 49104}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1472, col: 26, offset: 49116}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + run: (*parser).callonExtraListElement520, + expr: &seqExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + expr: &charClassMatcher{ + pos: position{line: 1474, col: 14, offset: 49237}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1474, col: 26, offset: 49249}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement525, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1362, col: 5, offset: 45478}, + expr: &actionExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + run: (*parser).callonExtraListElement529, + expr: &seqExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement532, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1491, col: 12, offset: 49795}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1491, col: 20, offset: 49803}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + run: (*parser).callonExtraListElement536, + expr: &seqExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + run: (*parser).callonExtraListElement539, + expr: &oneOrMoreExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + expr: &litMatcher{ + pos: position{line: 1493, col: 17, offset: 49868}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1497, col: 9, offset: 49968}, + run: (*parser).callonExtraListElement542, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1514, col: 14, offset: 50675}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1514, col: 21, offset: 50682}, + run: (*parser).callonExtraListElement544, + expr: &litMatcher{ + pos: position{line: 1514, col: 22, offset: 50683}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement546, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1363, col: 5, offset: 45510}, + expr: &actionExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + run: (*parser).callonExtraListElement550, + expr: &seqExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1597, col: 5, offset: 53001}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1597, col: 9, offset: 53005}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + run: (*parser).callonExtraListElement554, + expr: &oneOrMoreExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + expr: &charClassMatcher{ + pos: position{line: 1597, col: 14, offset: 53010}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1597, col: 62, offset: 53058}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement558, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1364, col: 5, offset: 45540}, + expr: &seqExpr{ + pos: position{line: 1364, col: 7, offset: 45542}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + run: (*parser).callonExtraListElement563, + expr: &oneOrMoreExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + expr: &seqExpr{ + pos: position{line: 1541, col: 6, offset: 51404}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1541, col: 6, offset: 51404}, + expr: &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonExtraListElement567, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonExtraListElement570, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonExtraListElement573, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1541, col: 35, offset: 51433}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement576, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1541, col: 40, offset: 51438, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonExtraListElement584, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonExtraListElement587, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonExtraListElement590, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1365, col: 5, offset: 45598}, + expr: &actionExpr{ + pos: position{line: 571, col: 5, offset: 18579}, + run: (*parser).callonExtraListElement592, + expr: &seqExpr{ + pos: position{line: 571, col: 5, offset: 18579}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 571, col: 5, offset: 18579}, + expr: &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 572, col: 5, offset: 18609}, + label: "delimiter", + expr: &choiceExpr{ + pos: position{line: 573, col: 9, offset: 18629}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 585, col: 26, offset: 18950}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement601, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement604, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 587, col: 26, offset: 18994}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 587, col: 26, offset: 18994}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 587, col: 33, offset: 19001}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement614, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement617, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 589, col: 25, offset: 19037}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 589, col: 25, offset: 19037}, + val: "```", + ignoreCase: false, + want: "\"```\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 589, col: 31, offset: 19043}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement627, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement630, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 591, col: 26, offset: 19080}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 591, col: 26, offset: 19080}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 591, col: 33, offset: 19087}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement640, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement643, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 593, col: 26, offset: 19124}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 593, col: 26, offset: 19124}, + val: "....", + ignoreCase: false, + want: "\"....\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 593, col: 33, offset: 19131}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement653, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement656, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 595, col: 30, offset: 19172}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 595, col: 30, offset: 19172}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 595, col: 37, offset: 19179}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement666, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement669, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 597, col: 24, offset: 19214}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 597, col: 24, offset: 19214}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 597, col: 31, offset: 19221}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement679, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement682, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 599, col: 26, offset: 19258}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 599, col: 26, offset: 19258}, + val: "****", + ignoreCase: false, + want: "\"****\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 599, col: 33, offset: 19265}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement692, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement695, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1366, col: 5, offset: 45618}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1366, col: 14, offset: 45627}, + run: (*parser).callonExtraListElement703, + expr: &oneOrMoreExpr{ + pos: position{line: 1366, col: 14, offset: 45627}, + expr: &charClassMatcher{ + pos: position{line: 1366, col: 14, offset: 45627}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement707, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, }, }, }, - }, - }, - &labeledExpr{ - pos: position{line: 1845, col: 52, offset: 65660}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonDelimitedBlock41, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonDelimitedBlock47, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, + &actionExpr{ + pos: position{line: 1569, col: 9, offset: 52202}, + run: (*parser).callonExtraListElement714, + expr: &seqExpr{ + pos: position{line: 1569, col: 9, offset: 52202}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement716, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 1570, col: 9, offset: 52254}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1570, col: 18, offset: 52263}, + run: (*parser).callonExtraListElement720, + expr: &oneOrMoreExpr{ + pos: position{line: 1570, col: 18, offset: 52263}, + expr: &charClassMatcher{ + pos: position{line: 1570, col: 18, offset: 52263}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement724, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, @@ -26563,573 +33571,1585 @@ var g = &grammar{ }, }, }, - &choiceExpr{ - pos: position{line: 1843, col: 28, offset: 65583}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1843, col: 29, offset: 65584}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1843, col: 29, offset: 65584}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1843, col: 35, offset: 65590}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock61, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, }, }, }, &actionExpr{ - pos: position{line: 1852, col: 17, offset: 65916}, - run: (*parser).callonDelimitedBlock70, + pos: position{line: 1346, col: 13, offset: 44998}, + run: (*parser).callonExtraListElement731, expr: &seqExpr{ - pos: position{line: 1852, col: 17, offset: 65916}, + pos: position{line: 1346, col: 13, offset: 44998}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1858, col: 31, offset: 66169}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1858, col: 38, offset: 66176}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock76, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + &labeledExpr{ + pos: position{line: 1346, col: 13, offset: 44998}, + label: "attributes", + expr: &oneOrMoreExpr{ + pos: position{line: 1346, col: 24, offset: 45009}, + expr: &ruleRefExpr{ + pos: position{line: 1346, col: 25, offset: 45010}, + name: "BlockAttributes", }, }, }, &labeledExpr{ - pos: position{line: 1852, col: 44, offset: 65943}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1862, col: 27, offset: 66269}, - expr: &actionExpr{ - pos: position{line: 1862, col: 28, offset: 66270}, - run: (*parser).callonDelimitedBlock85, - expr: &seqExpr{ - pos: position{line: 1862, col: 28, offset: 66270}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1862, col: 28, offset: 66270}, - expr: &choiceExpr{ - pos: position{line: 1860, col: 29, offset: 66216}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1860, col: 30, offset: 66217}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1860, col: 30, offset: 66217}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1860, col: 37, offset: 66224}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + pos: position{line: 1347, col: 13, offset: 45041}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1533, col: 5, offset: 51144}, + run: (*parser).callonExtraListElement737, + expr: &seqExpr{ + pos: position{line: 1533, col: 5, offset: 51144}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1533, col: 5, offset: 51144}, + label: "term", + expr: &actionExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + run: (*parser).callonExtraListElement740, + expr: &oneOrMoreExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + expr: &seqExpr{ + pos: position{line: 1541, col: 6, offset: 51404}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1541, col: 6, offset: 51404}, + expr: &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonExtraListElement744, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonExtraListElement747, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock94, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonExtraListElement750, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1541, col: 35, offset: 51433}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement753, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &anyMatcher{ + line: 1541, col: 40, offset: 51438, }, }, }, }, }, - &labeledExpr{ - pos: position{line: 1862, col: 54, offset: 66296}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonDelimitedBlock104, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonDelimitedBlock110, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + }, + &labeledExpr{ + pos: position{line: 1534, col: 5, offset: 51179}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonExtraListElement762, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonExtraListElement765, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\":\"", }, }, }, }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonExtraListElement768, + }, }, }, }, }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 1860, col: 29, offset: 66216}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1860, col: 30, offset: 66217}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1860, col: 30, offset: 66217}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1860, col: 37, offset: 66224}, + &labeledExpr{ + pos: position{line: 1535, col: 5, offset: 51224}, + label: "description", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 1557, col: 5, offset: 51854}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock124, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1645, col: 11, offset: 58920}, - name: "ExampleBlock", - }, - &actionExpr{ - pos: position{line: 1870, col: 5, offset: 66553}, - run: (*parser).callonDelimitedBlock134, - expr: &seqExpr{ - pos: position{line: 1870, col: 5, offset: 66553}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 1870, col: 5, offset: 66553}, - run: (*parser).callonDelimitedBlock136, - }, - &litMatcher{ - pos: position{line: 1738, col: 29, offset: 62027}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1738, col: 36, offset: 62034}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock141, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1874, col: 30, offset: 66758}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1878, col: 25, offset: 66936}, - expr: &actionExpr{ - pos: position{line: 1878, col: 26, offset: 66937}, - run: (*parser).callonDelimitedBlock150, - expr: &seqExpr{ - pos: position{line: 1878, col: 26, offset: 66937}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1878, col: 26, offset: 66937}, - expr: &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1740, col: 28, offset: 62098}, + pos: position{line: 1559, col: 9, offset: 51919}, + run: (*parser).callonExtraListElement771, + expr: &seqExpr{ + pos: position{line: 1559, col: 9, offset: 51919}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1740, col: 28, offset: 62098}, - val: "____", - ignoreCase: false, - want: "\"____\"", + &zeroOrMoreExpr{ + pos: position{line: 1559, col: 9, offset: 51919}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement774, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement777, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, }, &zeroOrMoreExpr{ - pos: position{line: 1740, col: 35, offset: 62105}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + pos: position{line: 1560, col: 9, offset: 51939}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonExtraListElement785, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement791, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement794, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock159, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1561, col: 9, offset: 51959}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 1561, col: 17, offset: 51967}, + expr: &actionExpr{ + pos: position{line: 1359, col: 5, offset: 45398}, + run: (*parser).callonExtraListElement803, + expr: &seqExpr{ + pos: position{line: 1359, col: 5, offset: 45398}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1359, col: 5, offset: 45398}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonExtraListElement806, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement812, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement815, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1360, col: 5, offset: 45413}, + expr: &seqExpr{ + pos: position{line: 1392, col: 34, offset: 46323}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1392, col: 34, offset: 46323}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 38, offset: 46327}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement826, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement828, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1361, col: 5, offset: 45448}, + expr: &actionExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + run: (*parser).callonExtraListElement834, + expr: &seqExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement837, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1441, col: 12, offset: 47833}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + run: (*parser).callonExtraListElement841, + expr: &seqExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + run: (*parser).callonExtraListElement844, + expr: &oneOrMoreExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + expr: &litMatcher{ + pos: position{line: 1443, col: 17, offset: 47904}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1447, col: 9, offset: 48004}, + run: (*parser).callonExtraListElement847, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + run: (*parser).callonExtraListElement848, + expr: &seqExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + expr: &charClassMatcher{ + pos: position{line: 1466, col: 12, offset: 48722}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1466, col: 20, offset: 48730}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + run: (*parser).callonExtraListElement853, + expr: &seqExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1468, col: 14, offset: 48848}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1468, col: 21, offset: 48855}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + run: (*parser).callonExtraListElement857, + expr: &seqExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1470, col: 14, offset: 48976}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1470, col: 21, offset: 48983}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + run: (*parser).callonExtraListElement861, + expr: &seqExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + expr: &charClassMatcher{ + pos: position{line: 1472, col: 14, offset: 49104}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1472, col: 26, offset: 49116}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + run: (*parser).callonExtraListElement866, + expr: &seqExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + expr: &charClassMatcher{ + pos: position{line: 1474, col: 14, offset: 49237}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1474, col: 26, offset: 49249}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement871, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1362, col: 5, offset: 45478}, + expr: &actionExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + run: (*parser).callonExtraListElement875, + expr: &seqExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement878, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1491, col: 12, offset: 49795}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1491, col: 20, offset: 49803}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + run: (*parser).callonExtraListElement882, + expr: &seqExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + run: (*parser).callonExtraListElement885, + expr: &oneOrMoreExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + expr: &litMatcher{ + pos: position{line: 1493, col: 17, offset: 49868}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1497, col: 9, offset: 49968}, + run: (*parser).callonExtraListElement888, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1514, col: 14, offset: 50675}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1514, col: 21, offset: 50682}, + run: (*parser).callonExtraListElement890, + expr: &litMatcher{ + pos: position{line: 1514, col: 22, offset: 50683}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement892, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1363, col: 5, offset: 45510}, + expr: &actionExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + run: (*parser).callonExtraListElement896, + expr: &seqExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1597, col: 5, offset: 53001}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1597, col: 9, offset: 53005}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + run: (*parser).callonExtraListElement900, + expr: &oneOrMoreExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + expr: &charClassMatcher{ + pos: position{line: 1597, col: 14, offset: 53010}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1597, col: 62, offset: 53058}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement904, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1364, col: 5, offset: 45540}, + expr: &seqExpr{ + pos: position{line: 1364, col: 7, offset: 45542}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + run: (*parser).callonExtraListElement909, + expr: &oneOrMoreExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + expr: &seqExpr{ + pos: position{line: 1541, col: 6, offset: 51404}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1541, col: 6, offset: 51404}, + expr: &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonExtraListElement913, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonExtraListElement916, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonExtraListElement919, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1541, col: 35, offset: 51433}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement922, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1541, col: 40, offset: 51438, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonExtraListElement930, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonExtraListElement933, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonExtraListElement936, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1365, col: 5, offset: 45598}, + expr: &actionExpr{ + pos: position{line: 571, col: 5, offset: 18579}, + run: (*parser).callonExtraListElement938, + expr: &seqExpr{ + pos: position{line: 571, col: 5, offset: 18579}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 571, col: 5, offset: 18579}, + expr: &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 572, col: 5, offset: 18609}, + label: "delimiter", + expr: &choiceExpr{ + pos: position{line: 573, col: 9, offset: 18629}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 585, col: 26, offset: 18950}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement947, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement950, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 587, col: 26, offset: 18994}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 587, col: 26, offset: 18994}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 587, col: 33, offset: 19001}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement960, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement963, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 589, col: 25, offset: 19037}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 589, col: 25, offset: 19037}, + val: "```", + ignoreCase: false, + want: "\"```\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 589, col: 31, offset: 19043}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement973, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement976, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 591, col: 26, offset: 19080}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 591, col: 26, offset: 19080}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 591, col: 33, offset: 19087}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement986, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement989, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 593, col: 26, offset: 19124}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 593, col: 26, offset: 19124}, + val: "....", + ignoreCase: false, + want: "\"....\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 593, col: 33, offset: 19131}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement999, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1002, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 595, col: 30, offset: 19172}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 595, col: 30, offset: 19172}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 595, col: 37, offset: 19179}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1012, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1015, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 597, col: 24, offset: 19214}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 597, col: 24, offset: 19214}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 597, col: 31, offset: 19221}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1025, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1028, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 599, col: 26, offset: 19258}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 599, col: 26, offset: 19258}, + val: "****", + ignoreCase: false, + want: "\"****\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 599, col: 33, offset: 19265}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1038, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1041, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1366, col: 5, offset: 45618}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1366, col: 14, offset: 45627}, + run: (*parser).callonExtraListElement1049, + expr: &oneOrMoreExpr{ + pos: position{line: 1366, col: 14, offset: 45627}, + expr: &charClassMatcher{ + pos: position{line: 1366, col: 14, offset: 45627}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1053, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, }, }, }, - }, - }, - &labeledExpr{ - pos: position{line: 1878, col: 50, offset: 66961}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonDelimitedBlock169, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonDelimitedBlock175, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, + &actionExpr{ + pos: position{line: 1569, col: 9, offset: 52202}, + run: (*parser).callonExtraListElement1060, + expr: &seqExpr{ + pos: position{line: 1569, col: 9, offset: 52202}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement1062, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 1570, col: 9, offset: 52254}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1570, col: 18, offset: 52263}, + run: (*parser).callonExtraListElement1066, + expr: &oneOrMoreExpr{ + pos: position{line: 1570, col: 18, offset: 52263}, + expr: &charClassMatcher{ + pos: position{line: 1570, col: 18, offset: 52263}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1070, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, @@ -27143,356 +35163,223 @@ var g = &grammar{ }, }, }, - &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1740, col: 28, offset: 62098}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1740, col: 28, offset: 62098}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1740, col: 35, offset: 62105}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock189, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1647, col: 11, offset: 58965}, - name: "QuoteBlock", - }, - &ruleRefExpr{ - pos: position{line: 1648, col: 11, offset: 58986}, - name: "SidebarBlock", - }, &actionExpr{ - pos: position{line: 1885, col: 21, offset: 67225}, - run: (*parser).callonDelimitedBlock200, + pos: position{line: 2667, col: 22, offset: 88893}, + run: (*parser).callonExtraListElement1077, expr: &seqExpr{ - pos: position{line: 1885, col: 21, offset: 67225}, + pos: position{line: 2667, col: 22, offset: 88893}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1891, col: 35, offset: 67502}, - val: "++++", + pos: position{line: 2672, col: 31, offset: 89114}, + val: "//", ignoreCase: false, - want: "\"++++\"", + want: "\"//\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1891, col: 42, offset: 67509}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + ¬Expr{ + pos: position{line: 2672, col: 36, offset: 89119}, + expr: &litMatcher{ + pos: position{line: 2672, col: 37, offset: 89120}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + }, + &labeledExpr{ + pos: position{line: 2667, col: 49, offset: 88920}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + run: (*parser).callonExtraListElement1083, + expr: &zeroOrMoreExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + expr: &charClassMatcher{ + pos: position{line: 2674, col: 29, offset: 89155}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock206, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + inverted: true, }, }, }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1087, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, }, - &labeledExpr{ - pos: position{line: 1885, col: 52, offset: 67256}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1895, col: 31, offset: 67610}, - expr: &actionExpr{ - pos: position{line: 1895, col: 32, offset: 67611}, - run: (*parser).callonDelimitedBlock215, - expr: &seqExpr{ - pos: position{line: 1895, col: 32, offset: 67611}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1895, col: 32, offset: 67611}, - expr: &choiceExpr{ - pos: position{line: 1893, col: 33, offset: 67553}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1893, col: 34, offset: 67554}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1893, col: 34, offset: 67554}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1893, col: 41, offset: 67561}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock224, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1351, col: 13, offset: 45197}, + run: (*parser).callonExtraListElement1094, + expr: &labeledExpr{ + pos: position{line: 1351, col: 13, offset: 45197}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1359, col: 5, offset: 45398}, + run: (*parser).callonExtraListElement1096, + expr: &seqExpr{ + pos: position{line: 1359, col: 5, offset: 45398}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1359, col: 5, offset: 45398}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonExtraListElement1099, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1105, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, - }, - &labeledExpr{ - pos: position{line: 1895, col: 62, offset: 67641}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonDelimitedBlock234, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonDelimitedBlock240, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1108, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 1893, col: 33, offset: 67553}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1893, col: 34, offset: 67554}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1893, col: 34, offset: 67554}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1893, col: 41, offset: 67561}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + ¬Expr{ + pos: position{line: 1360, col: 5, offset: 45413}, + expr: &seqExpr{ + pos: position{line: 1392, col: 34, offset: 46323}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1392, col: 34, offset: 46323}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 38, offset: 46327}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1119, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock254, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + inverted: false, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1121, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, @@ -27500,216 +35387,178 @@ var g = &grammar{ }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, - run: (*parser).callonDelimitedBlock263, - expr: &seqExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1904, col: 31, offset: 67955}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1904, col: 38, offset: 67962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock269, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1908, col: 44, offset: 68072}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1912, col: 27, offset: 68225}, - expr: &actionExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - run: (*parser).callonDelimitedBlock278, - expr: &seqExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1912, col: 28, offset: 68226}, - expr: &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock287, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 1361, col: 5, offset: 45448}, + expr: &actionExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + run: (*parser).callonExtraListElement1127, + expr: &seqExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1130, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1441, col: 12, offset: 47833}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + run: (*parser).callonExtraListElement1134, + expr: &seqExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + run: (*parser).callonExtraListElement1137, + expr: &oneOrMoreExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + expr: &litMatcher{ + pos: position{line: 1443, col: 17, offset: 47904}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, }, }, }, + &andCodeExpr{ + pos: position{line: 1447, col: 9, offset: 48004}, + run: (*parser).callonExtraListElement1140, + }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + }, + &actionExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + run: (*parser).callonExtraListElement1141, + expr: &seqExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + expr: &charClassMatcher{ + pos: position{line: 1466, col: 12, offset: 48722}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 1466, col: 20, offset: 48730}, + val: ".", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\".\"", }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + run: (*parser).callonExtraListElement1146, + expr: &seqExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 1468, col: 14, offset: 48848}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + &litMatcher{ + pos: position{line: 1468, col: 21, offset: 48855}, + val: ".", + ignoreCase: false, + want: "\".\"", }, }, }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1912, col: 54, offset: 68252}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonDelimitedBlock297, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + run: (*parser).callonExtraListElement1150, + expr: &seqExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1470, col: 14, offset: 48976}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1470, col: 21, offset: 48983}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, }, }, }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonDelimitedBlock303, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + &actionExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + run: (*parser).callonExtraListElement1154, + expr: &seqExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + expr: &charClassMatcher{ + pos: position{line: 1472, col: 14, offset: 49104}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1472, col: 26, offset: 49116}, + val: ")", ignoreCase: false, - inverted: true, + want: "\")\"", }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + run: (*parser).callonExtraListElement1159, + expr: &seqExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + expr: &charClassMatcher{ + pos: position{line: 1474, col: 14, offset: 49237}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1474, col: 26, offset: 49249}, + val: ")", + ignoreCase: false, + want: "\")\"", }, }, }, @@ -27717,68 +35566,167 @@ var g = &grammar{ }, }, }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement1164, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + ¬Expr{ + pos: position{line: 1362, col: 5, offset: 45478}, + expr: &actionExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + run: (*parser).callonExtraListElement1168, + expr: &seqExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1171, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock317, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &labeledExpr{ + pos: position{line: 1491, col: 12, offset: 49795}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1491, col: 20, offset: 49803}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + run: (*parser).callonExtraListElement1175, + expr: &seqExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + run: (*parser).callonExtraListElement1178, + expr: &oneOrMoreExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + expr: &litMatcher{ + pos: position{line: 1493, col: 17, offset: 49868}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1497, col: 9, offset: 49968}, + run: (*parser).callonExtraListElement1181, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1514, col: 14, offset: 50675}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1514, col: 21, offset: 50682}, + run: (*parser).callonExtraListElement1183, + expr: &litMatcher{ + pos: position{line: 1514, col: 22, offset: 50683}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement1185, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + }, + }, + ¬Expr{ + pos: position{line: 1363, col: 5, offset: 45510}, + expr: &actionExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + run: (*parser).callonExtraListElement1189, + expr: &seqExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 1597, col: 5, offset: 53001}, + val: "<", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"<\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &labeledExpr{ + pos: position{line: 1597, col: 9, offset: 53005}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + run: (*parser).callonExtraListElement1193, + expr: &oneOrMoreExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + expr: &charClassMatcher{ + pos: position{line: 1597, col: 14, offset: 53010}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1597, col: 62, offset: 53058}, + val: ">", ignoreCase: false, - inverted: false, + want: "\">\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonExtraListElement1197, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -27786,1071 +35734,660 @@ var g = &grammar{ }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "ExampleBlock", - pos: position{line: 1666, col: 1, offset: 59642}, - expr: &actionExpr{ - pos: position{line: 1667, col: 5, offset: 59663}, - run: (*parser).callonExampleBlock1, - expr: &seqExpr{ - pos: position{line: 1667, col: 5, offset: 59663}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1676, col: 31, offset: 59937}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1676, col: 38, offset: 59944}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlock7, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1668, col: 5, offset: 59695}, - label: "blocks", - expr: &ruleRefExpr{ - pos: position{line: 1668, col: 13, offset: 59703}, - name: "ExampleBlockRawContent", - }, - }, - &choiceExpr{ - pos: position{line: 1678, col: 29, offset: 59984}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1678, col: 30, offset: 59985}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1678, col: 30, offset: 59985}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1678, col: 37, offset: 59992}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlock22, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "ExampleBlockRawContent", - pos: position{line: 1680, col: 1, offset: 60011}, - expr: &actionExpr{ - pos: position{line: 1681, col: 5, offset: 60042}, - run: (*parser).callonExampleBlockRawContent1, - expr: &labeledExpr{ - pos: position{line: 1681, col: 5, offset: 60042}, - label: "elements", - expr: &zeroOrMoreExpr{ - pos: position{line: 1681, col: 14, offset: 60051}, - expr: &actionExpr{ - pos: position{line: 1682, col: 9, offset: 60061}, - run: (*parser).callonExampleBlockRawContent4, - expr: &seqExpr{ - pos: position{line: 1682, col: 9, offset: 60061}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1682, col: 9, offset: 60061}, - expr: &choiceExpr{ - pos: position{line: 1678, col: 29, offset: 59984}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1678, col: 30, offset: 59985}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1678, col: 30, offset: 59985}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1678, col: 37, offset: 59992}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, + pos: position{line: 1364, col: 5, offset: 45540}, + expr: &seqExpr{ + pos: position{line: 1364, col: 7, offset: 45542}, + exprs: []interface{}{ &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent13, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1683, col: 9, offset: 60096}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1683, col: 20, offset: 60107}, - expr: &ruleRefExpr{ - pos: position{line: 1683, col: 21, offset: 60108}, - name: "BlockAttributes", - }, - }, - }, - &stateCodeExpr{ - pos: position{line: 1684, col: 9, offset: 60134}, - run: (*parser).callonExampleBlockRawContent25, - }, - &labeledExpr{ - pos: position{line: 1688, col: 9, offset: 60232}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 1689, col: 13, offset: 60254}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1689, col: 13, offset: 60254}, - name: "LabeledListItem", - }, - &actionExpr{ - pos: position{line: 920, col: 5, offset: 29951}, - run: (*parser).callonExampleBlockRawContent29, - expr: &seqExpr{ - pos: position{line: 920, col: 5, offset: 29951}, - exprs: []interface{}{ - ¬CodeExpr{ - pos: position{line: 920, col: 5, offset: 29951}, - run: (*parser).callonExampleBlockRawContent31, - }, - &labeledExpr{ - pos: position{line: 923, col: 5, offset: 30081}, - label: "firstLine", - expr: &actionExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - run: (*parser).callonExampleBlockRawContent33, - expr: &seqExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - label: "content", - expr: &actionExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - run: (*parser).callonExampleBlockRawContent36, - expr: &seqExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - label: "elements", - expr: &choiceExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonExampleBlockRawContent40, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + pos: position{line: 1541, col: 5, offset: 51403}, + run: (*parser).callonExtraListElement1202, + expr: &oneOrMoreExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + expr: &seqExpr{ + pos: position{line: 1541, col: 6, offset: 51404}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1541, col: 6, offset: 51404}, + expr: &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonExtraListElement1206, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonExtraListElement1209, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", }, }, }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonExampleBlockRawContent49, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, + }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonExtraListElement1212, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1541, col: 35, offset: 51433}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1215, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - }, - &zeroOrMoreExpr{ - pos: position{line: 929, col: 28, offset: 30362}, - expr: &charClassMatcher{ - pos: position{line: 929, col: 28, offset: 30362}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, + &anyMatcher{ + line: 1541, col: 40, offset: 51438, + }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + }, + &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonExtraListElement1223, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonExtraListElement1226, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, }, }, }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonExtraListElement1229, + }, }, }, }, }, }, - &labeledExpr{ - pos: position{line: 924, col: 5, offset: 30118}, - label: "otherLines", - expr: &zeroOrMoreExpr{ - pos: position{line: 924, col: 16, offset: 30129}, - expr: &choiceExpr{ - pos: position{line: 924, col: 17, offset: 30130}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonExampleBlockRawContent68, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + }, + ¬Expr{ + pos: position{line: 1365, col: 5, offset: 45598}, + expr: &actionExpr{ + pos: position{line: 571, col: 5, offset: 18579}, + run: (*parser).callonExtraListElement1231, + expr: &seqExpr{ + pos: position{line: 571, col: 5, offset: 18579}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 571, col: 5, offset: 18579}, + expr: &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 572, col: 5, offset: 18609}, + label: "delimiter", + expr: &choiceExpr{ + pos: position{line: 573, col: 9, offset: 18629}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 585, col: 26, offset: 18950}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1240, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\"////\"", + inverted: false, }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1243, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent76, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonExampleBlockRawContent85, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, + }, + &seqExpr{ + pos: position{line: 587, col: 26, offset: 18994}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 587, col: 26, offset: 18994}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 587, col: 33, offset: 19001}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1253, expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1256, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, }, - }, - }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonExampleBlockRawContent93, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, + &seqExpr{ + pos: position{line: 589, col: 25, offset: 19037}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 589, col: 25, offset: 19037}, + val: "```", + ignoreCase: false, + want: "\"```\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 589, col: 31, offset: 19043}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1266, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1269, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - inverted: false, + want: "\"\\n\"", }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent106, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent118, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent130, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 591, col: 26, offset: 19080}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 591, col: 26, offset: 19080}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 591, col: 33, offset: 19087}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1279, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1282, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent142, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent154, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 593, col: 26, offset: 19124}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 593, col: 26, offset: 19124}, + val: "....", + ignoreCase: false, + want: "\"....\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 593, col: 33, offset: 19131}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1292, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1295, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent166, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 595, col: 30, offset: 19172}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 595, col: 30, offset: 19172}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 595, col: 37, offset: 19179}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1305, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1308, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent178, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 597, col: 24, offset: 19214}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 597, col: 24, offset: 19214}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 597, col: 31, offset: 19221}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1318, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1321, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonExampleBlockRawContent186, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, + }, + &seqExpr{ + pos: position{line: 599, col: 26, offset: 19258}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 599, col: 26, offset: 19258}, + val: "****", + ignoreCase: false, + want: "\"****\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 599, col: 33, offset: 19265}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonExtraListElement1331, expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1334, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonExampleBlockRawContent194, - }, }, }, }, @@ -28859,443 +36396,488 @@ var g = &grammar{ }, }, }, - }, - }, - &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonExampleBlockRawContent195, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 1366, col: 5, offset: 45618}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1366, col: 14, offset: 45627}, + run: (*parser).callonExtraListElement1342, + expr: &oneOrMoreExpr{ + pos: position{line: 1366, col: 14, offset: 45627}, + expr: &charClassMatcher{ + pos: position{line: 1366, col: 14, offset: 45627}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent203, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonExtraListElement1346, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\r\"", }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1692, col: 15, offset: 60380}, - name: "ImageBlock", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "ListElementContinuation", + pos: position{line: 1384, col: 1, offset: 46051}, + expr: &actionExpr{ + pos: position{line: 1385, col: 5, offset: 46083}, + run: (*parser).callonListElementContinuation1, + expr: &seqExpr{ + pos: position{line: 1385, col: 5, offset: 46083}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1385, col: 5, offset: 46083}, + label: "offset", + expr: &zeroOrMoreExpr{ + pos: position{line: 1385, col: 12, offset: 46090}, + expr: &seqExpr{ + pos: position{line: 1385, col: 13, offset: 46091}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1385, col: 13, offset: 46091}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuation7, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, - &actionExpr{ - pos: position{line: 1632, col: 18, offset: 58455}, - run: (*parser).callonExampleBlockRawContent211, - expr: &seqExpr{ - pos: position{line: 1632, col: 18, offset: 58455}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 1632, col: 19, offset: 58456}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 1632, col: 19, offset: 58456}, - val: "***", - ignoreCase: false, - want: "\"***\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 27, offset: 58464}, - val: "* * *", - ignoreCase: false, - want: "\"* * *\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 37, offset: 58474}, - val: "---", - ignoreCase: false, - want: "\"---\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 45, offset: 58482}, - val: "- - -", - ignoreCase: false, - want: "\"- - -\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 55, offset: 58492}, - val: "___", - ignoreCase: false, - want: "\"___\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 63, offset: 58500}, - val: "_ _ _", - ignoreCase: false, - want: "\"_ _ _\"", - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + }, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuation9, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, - &ruleRefExpr{ - pos: position{line: 1694, col: 15, offset: 60433}, - name: "OrderedListItem", - }, - &ruleRefExpr{ - pos: position{line: 1695, col: 15, offset: 60464}, - name: "UnorderedListItem", - }, - &ruleRefExpr{ - pos: position{line: 1696, col: 15, offset: 60497}, - name: "ContinuedListItemElement", - }, - &actionExpr{ - pos: position{line: 1835, col: 16, offset: 65237}, - run: (*parser).callonExampleBlockRawContent228, - expr: &seqExpr{ - pos: position{line: 1835, col: 16, offset: 65237}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1841, col: 30, offset: 65538}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1841, col: 36, offset: 65544}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1392, col: 34, offset: 46323}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 38, offset: 46327}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuation16, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuation18, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1387, col: 5, offset: 46147}, + label: "element", + expr: &zeroOrOneExpr{ + pos: position{line: 1387, col: 13, offset: 46155}, + expr: &ruleRefExpr{ + pos: position{line: 1387, col: 13, offset: 46155}, + name: "ListElementContinuationElement", + }, + }, + }, + }, + }, + }, + }, + { + name: "ListElementContinuationElement", + pos: position{line: 1394, col: 1, offset: 46343}, + expr: &actionExpr{ + pos: position{line: 1395, col: 5, offset: 46421}, + run: (*parser).callonListElementContinuationElement1, + expr: &seqExpr{ + pos: position{line: 1395, col: 5, offset: 46421}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1395, col: 5, offset: 46421}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + ¬Expr{ + pos: position{line: 1396, col: 5, offset: 46447}, + expr: &choiceExpr{ + pos: position{line: 1305, col: 5, offset: 43602}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1434, col: 5, offset: 47618}, + run: (*parser).callonListElementContinuationElement8, + expr: &seqExpr{ + pos: position{line: 1434, col: 5, offset: 47618}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1434, col: 5, offset: 47618}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + run: (*parser).callonListElementContinuationElement11, + expr: &seqExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement14, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent234, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + inverted: false, }, }, }, - }, - &labeledExpr{ - pos: position{line: 1835, col: 42, offset: 65263}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1845, col: 26, offset: 65634}, - expr: &actionExpr{ - pos: position{line: 1845, col: 27, offset: 65635}, - run: (*parser).callonExampleBlockRawContent243, - expr: &seqExpr{ - pos: position{line: 1845, col: 27, offset: 65635}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1845, col: 27, offset: 65635}, - expr: &choiceExpr{ - pos: position{line: 1843, col: 28, offset: 65583}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1843, col: 29, offset: 65584}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1843, col: 29, offset: 65584}, - val: "```", + &labeledExpr{ + pos: position{line: 1441, col: 12, offset: 47833}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + run: (*parser).callonListElementContinuationElement18, + expr: &seqExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + run: (*parser).callonListElementContinuationElement21, + expr: &oneOrMoreExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + expr: &litMatcher{ + pos: position{line: 1443, col: 17, offset: 47904}, + val: ".", ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1843, col: 35, offset: 65590}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent252, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + want: "\".\"", }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + }, + &andCodeExpr{ + pos: position{line: 1447, col: 9, offset: 48004}, + run: (*parser).callonListElementContinuationElement24, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + run: (*parser).callonListElementContinuationElement25, + expr: &seqExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + expr: &charClassMatcher{ + pos: position{line: 1466, col: 12, offset: 48722}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, + &litMatcher{ + pos: position{line: 1466, col: 20, offset: 48730}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, }, }, - &labeledExpr{ - pos: position{line: 1845, col: 52, offset: 65660}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonExampleBlockRawContent262, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonExampleBlockRawContent268, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, + }, + &actionExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + run: (*parser).callonListElementContinuationElement30, + expr: &seqExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1468, col: 14, offset: 48848}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1468, col: 21, offset: 48855}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + run: (*parser).callonListElementContinuationElement34, + expr: &seqExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1470, col: 14, offset: 48976}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1470, col: 21, offset: 48983}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + run: (*parser).callonListElementContinuationElement38, + expr: &seqExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + expr: &charClassMatcher{ + pos: position{line: 1472, col: 14, offset: 49104}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1472, col: 26, offset: 49116}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + run: (*parser).callonListElementContinuationElement43, + expr: &seqExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + expr: &charClassMatcher{ + pos: position{line: 1474, col: 14, offset: 49237}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, }, }, + &litMatcher{ + pos: position{line: 1474, col: 26, offset: 49249}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, }, }, }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 1843, col: 28, offset: 65583}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1843, col: 29, offset: 65584}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1843, col: 29, offset: 65584}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1843, col: 35, offset: 65590}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent282, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElementContinuationElement48, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1435, col: 5, offset: 47657}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + run: (*parser).callonListElementContinuationElement52, + expr: &seqExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + run: (*parser).callonListElementContinuationElement55, + expr: &oneOrMoreExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + expr: &charClassMatcher{ + pos: position{line: 1374, col: 14, offset: 45833}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement59, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, @@ -29303,285 +36885,249 @@ var g = &grammar{ }, }, }, - &actionExpr{ - pos: position{line: 1852, col: 17, offset: 65916}, - run: (*parser).callonExampleBlockRawContent291, - expr: &seqExpr{ - pos: position{line: 1852, col: 17, offset: 65916}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1858, col: 31, offset: 66169}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1858, col: 38, offset: 66176}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + }, + }, + }, + &actionExpr{ + pos: position{line: 1484, col: 5, offset: 49515}, + run: (*parser).callonListElementContinuationElement66, + expr: &seqExpr{ + pos: position{line: 1484, col: 5, offset: 49515}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1484, col: 5, offset: 49515}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + run: (*parser).callonListElementContinuationElement69, + expr: &seqExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement72, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent297, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + inverted: false, }, }, }, - }, - &labeledExpr{ - pos: position{line: 1852, col: 44, offset: 65943}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1862, col: 27, offset: 66269}, - expr: &actionExpr{ - pos: position{line: 1862, col: 28, offset: 66270}, - run: (*parser).callonExampleBlockRawContent306, - expr: &seqExpr{ - pos: position{line: 1862, col: 28, offset: 66270}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1862, col: 28, offset: 66270}, - expr: &choiceExpr{ - pos: position{line: 1860, col: 29, offset: 66216}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1860, col: 30, offset: 66217}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1860, col: 30, offset: 66217}, - val: "----", + &labeledExpr{ + pos: position{line: 1491, col: 12, offset: 49795}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1491, col: 20, offset: 49803}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + run: (*parser).callonListElementContinuationElement76, + expr: &seqExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + run: (*parser).callonListElementContinuationElement79, + expr: &oneOrMoreExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + expr: &litMatcher{ + pos: position{line: 1493, col: 17, offset: 49868}, + val: "*", ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1860, col: 37, offset: 66224}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent315, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + want: "\"*\"", }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + }, + &andCodeExpr{ + pos: position{line: 1497, col: 9, offset: 49968}, + run: (*parser).callonListElementContinuationElement82, }, }, }, - &labeledExpr{ - pos: position{line: 1862, col: 54, offset: 66296}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonExampleBlockRawContent325, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonExampleBlockRawContent331, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, + }, + &labeledExpr{ + pos: position{line: 1514, col: 14, offset: 50675}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1514, col: 21, offset: 50682}, + run: (*parser).callonListElementContinuationElement84, + expr: &litMatcher{ + pos: position{line: 1514, col: 22, offset: 50683}, + val: "-", + ignoreCase: false, + want: "\"-\"", }, }, }, }, }, }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElementContinuationElement86, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, - &choiceExpr{ - pos: position{line: 1860, col: 29, offset: 66216}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1860, col: 30, offset: 66217}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1860, col: 30, offset: 66217}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1860, col: 37, offset: 66224}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent345, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1485, col: 5, offset: 49556}, + label: "checkstyle", + expr: &zeroOrOneExpr{ + pos: position{line: 1485, col: 16, offset: 49567}, + expr: &actionExpr{ + pos: position{line: 1521, col: 5, offset: 50844}, + run: (*parser).callonListElementContinuationElement91, + expr: &seqExpr{ + pos: position{line: 1521, col: 5, offset: 50844}, + exprs: []interface{}{ + &andExpr{ + pos: position{line: 1521, col: 5, offset: 50844}, + expr: &litMatcher{ + pos: position{line: 1521, col: 6, offset: 50845}, + val: "[", + ignoreCase: false, + want: "\"[\"", + }, + }, + &labeledExpr{ + pos: position{line: 1521, col: 10, offset: 50849}, + label: "style", + expr: &choiceExpr{ + pos: position{line: 1522, col: 7, offset: 50863}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1522, col: 7, offset: 50863}, + run: (*parser).callonListElementContinuationElement97, + expr: &litMatcher{ + pos: position{line: 1522, col: 7, offset: 50863}, + val: "[ ]", + ignoreCase: false, + want: "\"[ ]\"", + }, + }, + &actionExpr{ + pos: position{line: 1523, col: 7, offset: 50908}, + run: (*parser).callonListElementContinuationElement99, + expr: &litMatcher{ + pos: position{line: 1523, col: 7, offset: 50908}, + val: "[*]", + ignoreCase: false, + want: "\"[*]\"", + }, + }, + &actionExpr{ + pos: position{line: 1524, col: 7, offset: 50951}, + run: (*parser).callonListElementContinuationElement101, + expr: &litMatcher{ + pos: position{line: 1524, col: 7, offset: 50951}, + val: "[x]", + ignoreCase: false, + want: "\"[x]\"", }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElementContinuationElement103, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1486, col: 5, offset: 49606}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + run: (*parser).callonListElementContinuationElement107, + expr: &seqExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1374, col: 5, offset: 45824}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + run: (*parser).callonListElementContinuationElement110, + expr: &oneOrMoreExpr{ + pos: position{line: 1374, col: 14, offset: 45833}, + expr: &charClassMatcher{ + pos: position{line: 1374, col: 14, offset: 45833}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement114, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, @@ -29589,289 +37135,134 @@ var g = &grammar{ }, }, }, - &actionExpr{ - pos: position{line: 1870, col: 5, offset: 66553}, - run: (*parser).callonExampleBlockRawContent354, - expr: &seqExpr{ - pos: position{line: 1870, col: 5, offset: 66553}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 1870, col: 5, offset: 66553}, - run: (*parser).callonExampleBlockRawContent356, - }, - &litMatcher{ - pos: position{line: 1738, col: 29, offset: 62027}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1738, col: 36, offset: 62034}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent361, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + }, + }, + &actionExpr{ + pos: position{line: 1591, col: 5, offset: 52800}, + run: (*parser).callonListElementContinuationElement121, + expr: &seqExpr{ + pos: position{line: 1591, col: 5, offset: 52800}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1591, col: 5, offset: 52800}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + run: (*parser).callonListElementContinuationElement124, + expr: &seqExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1597, col: 5, offset: 53001}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1597, col: 9, offset: 53005}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + run: (*parser).callonListElementContinuationElement128, + expr: &oneOrMoreExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + expr: &charClassMatcher{ + pos: position{line: 1597, col: 14, offset: 53010}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &litMatcher{ + pos: position{line: 1597, col: 62, offset: 53058}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElementContinuationElement132, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, }, - &labeledExpr{ - pos: position{line: 1874, col: 30, offset: 66758}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1878, col: 25, offset: 66936}, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1592, col: 5, offset: 52836}, + label: "description", + expr: &actionExpr{ + pos: position{line: 1602, col: 5, offset: 53136}, + run: (*parser).callonListElementContinuationElement136, + expr: &seqExpr{ + pos: position{line: 1602, col: 5, offset: 53136}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1602, col: 5, offset: 53136}, + label: "rawline", expr: &actionExpr{ - pos: position{line: 1878, col: 26, offset: 66937}, - run: (*parser).callonExampleBlockRawContent370, - expr: &seqExpr{ - pos: position{line: 1878, col: 26, offset: 66937}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1878, col: 26, offset: 66937}, - expr: &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1740, col: 28, offset: 62098}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1740, col: 28, offset: 62098}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1740, col: 35, offset: 62105}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent379, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1878, col: 50, offset: 66961}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonExampleBlockRawContent389, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonExampleBlockRawContent395, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, + pos: position{line: 1602, col: 14, offset: 53145}, + run: (*parser).callonListElementContinuationElement139, + expr: &oneOrMoreExpr{ + pos: position{line: 1602, col: 14, offset: 53145}, + expr: &charClassMatcher{ + pos: position{line: 1602, col: 14, offset: 53145}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1740, col: 28, offset: 62098}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1740, col: 28, offset: 62098}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1740, col: 35, offset: 62105}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent409, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement143, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, @@ -29879,552 +37270,703 @@ var g = &grammar{ }, }, }, - &ruleRefExpr{ - pos: position{line: 1700, col: 15, offset: 60616}, - name: "QuoteBlock", - }, - &ruleRefExpr{ - pos: position{line: 1701, col: 15, offset: 60641}, - name: "SidebarBlock", - }, - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonExampleBlockRawContent420, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent428, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + }, + }, + }, + &actionExpr{ + pos: position{line: 1533, col: 5, offset: 51144}, + run: (*parser).callonListElementContinuationElement150, + expr: &seqExpr{ + pos: position{line: 1533, col: 5, offset: 51144}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1533, col: 5, offset: 51144}, + label: "term", + expr: &actionExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + run: (*parser).callonListElementContinuationElement153, + expr: &oneOrMoreExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + expr: &seqExpr{ + pos: position{line: 1541, col: 6, offset: 51404}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1541, col: 6, offset: 51404}, + expr: &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonListElementContinuationElement157, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonListElementContinuationElement160, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, }, }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonListElementContinuationElement163, + }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + ¬Expr{ + pos: position{line: 1541, col: 35, offset: 51433}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement166, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - }, - }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonExampleBlockRawContent437, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + &anyMatcher{ + line: 1541, col: 40, offset: 51438, }, }, }, }, }, }, - &actionExpr{ - pos: position{line: 1885, col: 21, offset: 67225}, - run: (*parser).callonExampleBlockRawContent445, - expr: &seqExpr{ - pos: position{line: 1885, col: 21, offset: 67225}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1891, col: 35, offset: 67502}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1891, col: 42, offset: 67509}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent451, + &labeledExpr{ + pos: position{line: 1534, col: 5, offset: 51179}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonListElementContinuationElement175, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonListElementContinuationElement178, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", ignoreCase: false, - want: "\"\\t\"", + want: "\":\"", }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonListElementContinuationElement181, }, }, - &labeledExpr{ - pos: position{line: 1885, col: 52, offset: 67256}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1895, col: 31, offset: 67610}, - expr: &actionExpr{ - pos: position{line: 1895, col: 32, offset: 67611}, - run: (*parser).callonExampleBlockRawContent460, - expr: &seqExpr{ - pos: position{line: 1895, col: 32, offset: 67611}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1895, col: 32, offset: 67611}, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1535, col: 5, offset: 51224}, + label: "description", + expr: &choiceExpr{ + pos: position{line: 1557, col: 5, offset: 51854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1559, col: 9, offset: 51919}, + run: (*parser).callonListElementContinuationElement184, + expr: &seqExpr{ + pos: position{line: 1559, col: 9, offset: 51919}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1559, col: 9, offset: 51919}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement187, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement190, expr: &choiceExpr{ - pos: position{line: 1893, col: 33, offset: 67553}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1893, col: 34, offset: 67554}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1893, col: 34, offset: 67554}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1893, col: 41, offset: 67561}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent469, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 1560, col: 9, offset: 51939}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonListElementContinuationElement198, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement204, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement207, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, }, - &labeledExpr{ - pos: position{line: 1895, col: 62, offset: 67641}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonExampleBlockRawContent479, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonExampleBlockRawContent485, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, + }, + }, + &labeledExpr{ + pos: position{line: 1561, col: 9, offset: 51959}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 1561, col: 17, offset: 51967}, + expr: &actionExpr{ + pos: position{line: 1359, col: 5, offset: 45398}, + run: (*parser).callonListElementContinuationElement216, + expr: &seqExpr{ + pos: position{line: 1359, col: 5, offset: 45398}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1359, col: 5, offset: 45398}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonListElementContinuationElement219, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement225, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement228, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + }, + ¬Expr{ + pos: position{line: 1360, col: 5, offset: 45413}, + expr: &seqExpr{ + pos: position{line: 1392, col: 34, offset: 46323}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 1392, col: 34, offset: 46323}, + val: "+", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"+\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 38, offset: 46327}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement239, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement241, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 1893, col: 33, offset: 67553}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1893, col: 34, offset: 67554}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1893, col: 34, offset: 67554}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1893, col: 41, offset: 67561}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent499, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1704, col: 15, offset: 60731}, - name: "Table", - }, - &actionExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, - run: (*parser).callonExampleBlockRawContent509, - expr: &seqExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1904, col: 31, offset: 67955}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1904, col: 38, offset: 67962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent515, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1908, col: 44, offset: 68072}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1912, col: 27, offset: 68225}, - expr: &actionExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - run: (*parser).callonExampleBlockRawContent524, - expr: &seqExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1912, col: 28, offset: 68226}, - expr: &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + ¬Expr{ + pos: position{line: 1361, col: 5, offset: 45448}, + expr: &actionExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + run: (*parser).callonListElementContinuationElement247, + expr: &seqExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1441, col: 5, offset: 47826}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement250, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1441, col: 12, offset: 47833}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + run: (*parser).callonListElementContinuationElement254, + expr: &seqExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1443, col: 9, offset: 47896}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + run: (*parser).callonListElementContinuationElement257, + expr: &oneOrMoreExpr{ + pos: position{line: 1443, col: 16, offset: 47903}, + expr: &litMatcher{ + pos: position{line: 1443, col: 17, offset: 47904}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1447, col: 9, offset: 48004}, + run: (*parser).callonListElementContinuationElement260, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + run: (*parser).callonListElementContinuationElement261, + expr: &seqExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1466, col: 11, offset: 48721}, + expr: &charClassMatcher{ + pos: position{line: 1466, col: 12, offset: 48722}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1466, col: 20, offset: 48730}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + run: (*parser).callonListElementContinuationElement266, + expr: &seqExpr{ + pos: position{line: 1468, col: 13, offset: 48847}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1468, col: 14, offset: 48848}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1468, col: 21, offset: 48855}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + run: (*parser).callonListElementContinuationElement270, + expr: &seqExpr{ + pos: position{line: 1470, col: 13, offset: 48975}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1470, col: 14, offset: 48976}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1470, col: 21, offset: 48983}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + run: (*parser).callonListElementContinuationElement274, + expr: &seqExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1472, col: 13, offset: 49103}, + expr: &charClassMatcher{ + pos: position{line: 1472, col: 14, offset: 49104}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1472, col: 26, offset: 49116}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + run: (*parser).callonListElementContinuationElement279, + expr: &seqExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1474, col: 13, offset: 49236}, + expr: &charClassMatcher{ + pos: position{line: 1474, col: 14, offset: 49237}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1474, col: 26, offset: 49249}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent533, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElementContinuationElement284, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", + }, + }, + ¬Expr{ + pos: position{line: 1362, col: 5, offset: 45478}, + expr: &actionExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + run: (*parser).callonListElementContinuationElement288, + expr: &seqExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1491, col: 5, offset: 49788}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement291, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 1491, col: 12, offset: 49795}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1491, col: 20, offset: 49803}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + run: (*parser).callonListElementContinuationElement295, + expr: &seqExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1493, col: 9, offset: 49860}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + run: (*parser).callonListElementContinuationElement298, + expr: &oneOrMoreExpr{ + pos: position{line: 1493, col: 16, offset: 49867}, + expr: &litMatcher{ + pos: position{line: 1493, col: 17, offset: 49868}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1497, col: 9, offset: 49968}, + run: (*parser).callonListElementContinuationElement301, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1514, col: 14, offset: 50675}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1514, col: 21, offset: 50682}, + run: (*parser).callonListElementContinuationElement303, + expr: &litMatcher{ + pos: position{line: 1514, col: 22, offset: 50683}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElementContinuationElement305, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -30432,510 +37974,1420 @@ var g = &grammar{ }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1912, col: 54, offset: 68252}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonExampleBlockRawContent543, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonExampleBlockRawContent549, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 1363, col: 5, offset: 45510}, + expr: &actionExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + run: (*parser).callonListElementContinuationElement309, + expr: &seqExpr{ + pos: position{line: 1597, col: 5, offset: 53001}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1597, col: 5, offset: 53001}, + val: "<", ignoreCase: false, - inverted: true, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1597, col: 9, offset: 53005}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + run: (*parser).callonListElementContinuationElement313, + expr: &oneOrMoreExpr{ + pos: position{line: 1597, col: 14, offset: 53010}, + expr: &charClassMatcher{ + pos: position{line: 1597, col: 14, offset: 53010}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1597, col: 62, offset: 53058}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElementContinuationElement317, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + }, + ¬Expr{ + pos: position{line: 1364, col: 5, offset: 45540}, + expr: &seqExpr{ + pos: position{line: 1364, col: 7, offset: 45542}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + run: (*parser).callonListElementContinuationElement322, + expr: &oneOrMoreExpr{ + pos: position{line: 1541, col: 5, offset: 51403}, + expr: &seqExpr{ + pos: position{line: 1541, col: 6, offset: 51404}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1541, col: 6, offset: 51404}, + expr: &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonListElementContinuationElement326, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonListElementContinuationElement329, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonListElementContinuationElement332, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1541, col: 35, offset: 51433}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement335, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1541, col: 40, offset: 51438, + }, + }, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + run: (*parser).callonListElementContinuationElement343, + expr: &seqExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1546, col: 5, offset: 51535}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + run: (*parser).callonListElementContinuationElement346, + expr: &oneOrMoreExpr{ + pos: position{line: 1546, col: 16, offset: 51546}, + expr: &litMatcher{ + pos: position{line: 1546, col: 17, offset: 51547}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1549, col: 5, offset: 51604}, + run: (*parser).callonListElementContinuationElement349, + }, + }, }, }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent563, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - run: (*parser).callonExampleBlockRawContent572, - expr: &seqExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - run: (*parser).callonExampleBlockRawContent574, - }, - &labeledExpr{ - pos: position{line: 2120, col: 5, offset: 75117}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 2120, col: 11, offset: 75123}, - expr: &actionExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - run: (*parser).callonExampleBlockRawContent577, - expr: &seqExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2128, col: 25, offset: 75365}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonExampleBlockRawContent580, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent588, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + ¬Expr{ + pos: position{line: 1365, col: 5, offset: 45598}, + expr: &actionExpr{ + pos: position{line: 571, col: 5, offset: 18579}, + run: (*parser).callonListElementContinuationElement351, + expr: &seqExpr{ + pos: position{line: 571, col: 5, offset: 18579}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 571, col: 5, offset: 18579}, + expr: &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 572, col: 5, offset: 18609}, + label: "delimiter", + expr: &choiceExpr{ + pos: position{line: 573, col: 9, offset: 18629}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 585, col: 26, offset: 18950}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 585, col: 26, offset: 18950}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 585, col: 33, offset: 18957}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement360, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement363, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 587, col: 26, offset: 18994}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 587, col: 26, offset: 18994}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 587, col: 33, offset: 19001}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement373, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement376, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 589, col: 25, offset: 19037}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 589, col: 25, offset: 19037}, + val: "```", + ignoreCase: false, + want: "\"```\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 589, col: 31, offset: 19043}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement386, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement389, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 591, col: 26, offset: 19080}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 591, col: 26, offset: 19080}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 591, col: 33, offset: 19087}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement399, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement402, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 593, col: 26, offset: 19124}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 593, col: 26, offset: 19124}, + val: "....", + ignoreCase: false, + want: "\"....\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 593, col: 33, offset: 19131}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement412, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement415, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 595, col: 30, offset: 19172}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 595, col: 30, offset: 19172}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 595, col: 37, offset: 19179}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement425, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement428, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 597, col: 24, offset: 19214}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 597, col: 24, offset: 19214}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 597, col: 31, offset: 19221}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement438, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement441, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 599, col: 26, offset: 19258}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 599, col: 26, offset: 19258}, + val: "****", + ignoreCase: false, + want: "\"****\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 599, col: 33, offset: 19265}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement451, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement454, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", + }, + &labeledExpr{ + pos: position{line: 1366, col: 5, offset: 45618}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1366, col: 14, offset: 45627}, + run: (*parser).callonListElementContinuationElement462, + expr: &oneOrMoreExpr{ + pos: position{line: 1366, col: 14, offset: 45627}, + expr: &charClassMatcher{ + pos: position{line: 1366, col: 14, offset: 45627}, + val: "[^\\r\\n]", chars: []rune{'\r', '\n'}, ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + inverted: true, }, }, }, }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2128, col: 36, offset: 75376}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - run: (*parser).callonExampleBlockRawContent596, - expr: &oneOrMoreExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - expr: &charClassMatcher{ - pos: position{line: 2128, col: 45, offset: 75385}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2080, col: 31, offset: 73460}, - run: (*parser).callonExampleBlockRawContent604, - expr: &labeledExpr{ - pos: position{line: 2080, col: 31, offset: 73460}, - label: "lines", - expr: &actionExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - run: (*parser).callonExampleBlockRawContent606, - expr: &seqExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - label: "firstLine", - expr: &actionExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - run: (*parser).callonExampleBlockRawContent609, - expr: &seqExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - label: "line", - expr: &actionExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - run: (*parser).callonExampleBlockRawContent612, - expr: &seqExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement466, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent617, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &oneOrMoreExpr{ - pos: position{line: 2091, col: 48, offset: 73971}, - expr: &charClassMatcher{ - pos: position{line: 2091, col: 48, offset: 73971}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1569, col: 9, offset: 52202}, + run: (*parser).callonListElementContinuationElement473, + expr: &seqExpr{ + pos: position{line: 1569, col: 9, offset: 52202}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElementContinuationElement475, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1570, col: 9, offset: 52254}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1570, col: 18, offset: 52263}, + run: (*parser).callonListElementContinuationElement479, + expr: &oneOrMoreExpr{ + pos: position{line: 1570, col: 18, offset: 52263}, + expr: &charClassMatcher{ + pos: position{line: 1570, col: 18, offset: 52263}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement483, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1397, col: 5, offset: 46464}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1397, col: 16, offset: 46475}, + expr: &ruleRefExpr{ + pos: position{line: 1397, col: 17, offset: 46476}, + name: "BlockAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1398, col: 5, offset: 46498}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1399, col: 9, offset: 46516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonListElementContinuationElement495, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement501, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement504, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 152, col: 5, offset: 4423}, + run: (*parser).callonListElementContinuationElement511, + expr: &seqExpr{ + pos: position{line: 152, col: 5, offset: 4423}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 152, col: 5, offset: 4423}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 152, col: 9, offset: 4427}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonListElementContinuationElement515, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 152, col: 30, offset: 4448}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 153, col: 5, offset: 4457}, + label: "value", + expr: &zeroOrOneExpr{ + pos: position{line: 153, col: 11, offset: 4463}, + expr: &actionExpr{ + pos: position{line: 167, col: 5, offset: 4915}, + run: (*parser).callonListElementContinuationElement523, + expr: &seqExpr{ + pos: position{line: 167, col: 5, offset: 4915}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElementContinuationElement525, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, &labeledExpr{ - pos: position{line: 2087, col: 5, offset: 73803}, - label: "otherLines", + pos: position{line: 167, col: 12, offset: 4922}, + label: "elements", expr: &zeroOrMoreExpr{ - pos: position{line: 2087, col: 16, offset: 73814}, + pos: position{line: 167, col: 21, offset: 4931}, expr: &actionExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - run: (*parser).callonExampleBlockRawContent628, + pos: position{line: 171, col: 37, offset: 5090}, + run: (*parser).callonListElementContinuationElement530, expr: &seqExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, + pos: position{line: 171, col: 37, offset: 5090}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 2128, col: 25, offset: 75365}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonExampleBlockRawContent631, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent639, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 171, col: 37, offset: 5090}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement534, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, &labeledExpr{ - pos: position{line: 2128, col: 36, offset: 75376}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - run: (*parser).callonExampleBlockRawContent647, - expr: &oneOrMoreExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - expr: &charClassMatcher{ - pos: position{line: 2128, col: 45, offset: 75385}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, + pos: position{line: 172, col: 5, offset: 5100}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 173, col: 9, offset: 5118}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 173, col: 10, offset: 5119}, + run: (*parser).callonListElementContinuationElement543, + expr: &oneOrMoreExpr{ + pos: position{line: 173, col: 10, offset: 5119}, + expr: &charClassMatcher{ + pos: position{line: 173, col: 10, offset: 5119}, + val: "[^\\r\\n{]", + chars: []rune{'\r', '\n', '{'}, + ignoreCase: false, + inverted: true, + }, + }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonListElementContinuationElement546, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonListElementContinuationElement548, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonListElementContinuationElement551, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonListElementContinuationElement555, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonListElementContinuationElement562, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonListElementContinuationElement567, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonListElementContinuationElement569, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonListElementContinuationElement573, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonListElementContinuationElement577, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonListElementContinuationElement584, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonListElementContinuationElement589, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonListElementContinuationElement591, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonListElementContinuationElement595, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonListElementContinuationElement599, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 177, col: 12, offset: 5247}, + run: (*parser).callonListElementContinuationElement605, + expr: &litMatcher{ + pos: position{line: 177, col: 12, offset: 5247}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, }, }, }, @@ -30950,129 +39402,460 @@ var g = &grammar{ }, }, }, - &actionExpr{ - pos: position{line: 2098, col: 39, offset: 74215}, - run: (*parser).callonExampleBlockRawContent655, - expr: &seqExpr{ - pos: position{line: 2098, col: 39, offset: 74215}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement608, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 184, col: 19, offset: 5402}, + run: (*parser).callonListElementContinuationElement615, + expr: &seqExpr{ + pos: position{line: 184, col: 19, offset: 5402}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 184, col: 19, offset: 5402}, + val: ":!", + ignoreCase: false, + want: "\":!\"", + }, + &labeledExpr{ + pos: position{line: 184, col: 24, offset: 5407}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonListElementContinuationElement619, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 184, col: 45, offset: 5428}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 184, col: 49, offset: 5432}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement626, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement629, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 186, col: 5, offset: 5499}, + run: (*parser).callonListElementContinuationElement636, + expr: &seqExpr{ + pos: position{line: 186, col: 5, offset: 5499}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 186, col: 5, offset: 5499}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 186, col: 9, offset: 5503}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonListElementContinuationElement640, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 2098, col: 61, offset: 74237}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent661, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + }, + }, + }, + &litMatcher{ + pos: position{line: 186, col: 30, offset: 5524}, + val: "!:", + ignoreCase: false, + want: "\"!:\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 186, col: 35, offset: 5529}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement647, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement650, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1402, col: 11, offset: 46592}, + name: "DelimitedBlock", + }, + &actionExpr{ + pos: position{line: 2818, col: 18, offset: 93317}, + run: (*parser).callonListElementContinuationElement658, + expr: &seqExpr{ + pos: position{line: 2818, col: 18, offset: 93317}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2818, col: 19, offset: 93318}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2818, col: 19, offset: 93318}, + val: "***", + ignoreCase: false, + want: "\"***\"", + }, + &litMatcher{ + pos: position{line: 2818, col: 27, offset: 93326}, + val: "* * *", + ignoreCase: false, + want: "\"* * *\"", + }, + &litMatcher{ + pos: position{line: 2818, col: 37, offset: 93336}, + val: "---", + ignoreCase: false, + want: "\"---\"", + }, + &litMatcher{ + pos: position{line: 2818, col: 45, offset: 93344}, + val: "- - -", + ignoreCase: false, + want: "\"- - -\"", + }, + &litMatcher{ + pos: position{line: 2818, col: 55, offset: 93354}, + val: "___", + ignoreCase: false, + want: "\"___\"", + }, + &litMatcher{ + pos: position{line: 2818, col: 63, offset: 93362}, + val: "_ _ _", + ignoreCase: false, + want: "\"_ _ _\"", + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1404, col: 11, offset: 46678}, + name: "ImageBlock", + }, + &ruleRefExpr{ + pos: position{line: 1405, col: 11, offset: 46699}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 2717, col: 5, offset: 90449}, + run: (*parser).callonListElementContinuationElement671, + expr: &seqExpr{ + pos: position{line: 2717, col: 5, offset: 90449}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement675, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement678, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, + want: "\"\\r\"", }, }, }, - &labeledExpr{ - pos: position{line: 2098, col: 76, offset: 74252}, - label: "lines", - expr: &actionExpr{ - pos: position{line: 2103, col: 44, offset: 74559}, - run: (*parser).callonExampleBlockRawContent667, - expr: &labeledExpr{ - pos: position{line: 2103, col: 44, offset: 74559}, - label: "lines", - expr: &zeroOrMoreExpr{ - pos: position{line: 2103, col: 50, offset: 74565}, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2718, col: 5, offset: 90473}, + label: "header", + expr: &zeroOrOneExpr{ + pos: position{line: 2718, col: 12, offset: 90480}, + expr: &actionExpr{ + pos: position{line: 2732, col: 5, offset: 90792}, + run: (*parser).callonListElementContinuationElement687, + expr: &seqExpr{ + pos: position{line: 2732, col: 5, offset: 90792}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2732, col: 5, offset: 90792}, + label: "cells", + expr: &oneOrMoreExpr{ + pos: position{line: 2732, col: 11, offset: 90798}, expr: &actionExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - run: (*parser).callonExampleBlockRawContent670, + pos: position{line: 2738, col: 5, offset: 90915}, + run: (*parser).callonListElementContinuationElement691, expr: &seqExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, + pos: position{line: 2738, col: 5, offset: 90915}, exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - label: "line", - expr: &actionExpr{ - pos: position{line: 2108, col: 11, offset: 74711}, - run: (*parser).callonExampleBlockRawContent673, - expr: &seqExpr{ - pos: position{line: 2108, col: 11, offset: 74711}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2108, col: 11, offset: 74711}, - expr: &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2108, col: 34, offset: 74734}, - expr: &charClassMatcher{ - pos: position{line: 2108, col: 34, offset: 74734}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2738, col: 5, offset: 90915}, + val: "|", + ignoreCase: false, + want: "\"|\"", }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &zeroOrMoreExpr{ + pos: position{line: 2738, col: 9, offset: 90919}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement695, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + }, + &labeledExpr{ + pos: position{line: 2739, col: 5, offset: 90931}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 2739, col: 14, offset: 90940}, + expr: &actionExpr{ + pos: position{line: 2771, col: 5, offset: 91728}, + run: (*parser).callonListElementContinuationElement699, + expr: &labeledExpr{ + pos: position{line: 2771, col: 5, offset: 91728}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2771, col: 14, offset: 91737}, + run: (*parser).callonListElementContinuationElement701, + expr: &oneOrMoreExpr{ + pos: position{line: 2771, col: 14, offset: 91737}, + expr: &charClassMatcher{ + pos: position{line: 2771, col: 14, offset: 91737}, + val: "[^\\r\\n|]", + chars: []rune{'\r', '\n', '|'}, + ignoreCase: false, + inverted: true, + }, + }, + }, }, }, }, @@ -31082,719 +39865,923 @@ var g = &grammar{ }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2098, col: 125, offset: 74301}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 2098, col: 126, offset: 74302}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2098, col: 148, offset: 74324}, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement705, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent690, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 879, col: 6, offset: 28334}, - run: (*parser).callonExampleBlockRawContent699, - expr: &seqExpr{ - pos: position{line: 879, col: 6, offset: 28334}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 879, col: 6, offset: 28334}, - label: "t", - expr: &choiceExpr{ - pos: position{line: 856, col: 19, offset: 27732}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 856, col: 19, offset: 27732}, - run: (*parser).callonExampleBlockRawContent703, - expr: &litMatcher{ - pos: position{line: 856, col: 19, offset: 27732}, - val: "TIP", - ignoreCase: false, - want: "\"TIP\"", - }, - }, - &actionExpr{ - pos: position{line: 858, col: 5, offset: 27770}, - run: (*parser).callonExampleBlockRawContent705, - expr: &litMatcher{ - pos: position{line: 858, col: 5, offset: 27770}, - val: "NOTE", - ignoreCase: false, - want: "\"NOTE\"", - }, - }, - &actionExpr{ - pos: position{line: 860, col: 5, offset: 27810}, - run: (*parser).callonExampleBlockRawContent707, - expr: &litMatcher{ - pos: position{line: 860, col: 5, offset: 27810}, - val: "IMPORTANT", - ignoreCase: false, - want: "\"IMPORTANT\"", - }, - }, - &actionExpr{ - pos: position{line: 862, col: 5, offset: 27860}, - run: (*parser).callonExampleBlockRawContent709, - expr: &litMatcher{ - pos: position{line: 862, col: 5, offset: 27860}, - val: "WARNING", - ignoreCase: false, - want: "\"WARNING\"", - }, - }, - &actionExpr{ - pos: position{line: 864, col: 5, offset: 27906}, - run: (*parser).callonExampleBlockRawContent711, - expr: &litMatcher{ - pos: position{line: 864, col: 5, offset: 27906}, - val: "CAUTION", - ignoreCase: false, - want: "\"CAUTION\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, - }, - }, - &litMatcher{ - pos: position{line: 879, col: 25, offset: 28353}, - val: ": ", - ignoreCase: false, - want: "\": \"", - }, - &labeledExpr{ - pos: position{line: 879, col: 30, offset: 28358}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 879, col: 36, offset: 28364}, - expr: &choiceExpr{ - pos: position{line: 879, col: 37, offset: 28365}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonExampleBlockRawContent717, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent725, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + &oneOrMoreExpr{ + pos: position{line: 2733, col: 5, offset: 90820}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonListElementContinuationElement713, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement719, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonExampleBlockRawContent734, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement722, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonExampleBlockRawContent742, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent755, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2719, col: 5, offset: 90499}, + label: "rows", + expr: &zeroOrMoreExpr{ + pos: position{line: 2719, col: 10, offset: 90504}, + expr: &choiceExpr{ + pos: position{line: 2743, col: 13, offset: 91037}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2753, col: 5, offset: 91256}, + run: (*parser).callonListElementContinuationElement732, + expr: &seqExpr{ + pos: position{line: 2753, col: 5, offset: 91256}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2753, col: 5, offset: 91256}, + expr: &choiceExpr{ + pos: position{line: 2728, col: 22, offset: 90705}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2724, col: 19, offset: 90625}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement739, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement742, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent767, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2754, col: 5, offset: 91279}, + label: "cells", + expr: &oneOrMoreExpr{ + pos: position{line: 2754, col: 11, offset: 91285}, + expr: &actionExpr{ + pos: position{line: 2754, col: 12, offset: 91286}, + run: (*parser).callonListElementContinuationElement753, + expr: &seqExpr{ + pos: position{line: 2754, col: 12, offset: 91286}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2754, col: 12, offset: 91286}, + label: "cell", + expr: &actionExpr{ + pos: position{line: 2763, col: 5, offset: 91527}, + run: (*parser).callonListElementContinuationElement756, + expr: &seqExpr{ + pos: position{line: 2763, col: 5, offset: 91527}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2763, col: 5, offset: 91527}, + expr: &choiceExpr{ + pos: position{line: 2728, col: 22, offset: 90705}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2724, col: 19, offset: 90625}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement763, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement766, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + ¬Expr{ + pos: position{line: 2764, col: 5, offset: 91550}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonListElementContinuationElement776, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement782, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement785, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, }, }, }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &litMatcher{ + pos: position{line: 2765, col: 5, offset: 91565}, + val: "|", + ignoreCase: false, + want: "\"|\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2765, col: 9, offset: 91569}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement794, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent779, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + }, + }, + &labeledExpr{ + pos: position{line: 2765, col: 16, offset: 91576}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 2765, col: 25, offset: 91585}, + expr: &actionExpr{ + pos: position{line: 2771, col: 5, offset: 91728}, + run: (*parser).callonListElementContinuationElement798, + expr: &labeledExpr{ + pos: position{line: 2771, col: 5, offset: 91728}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2771, col: 14, offset: 91737}, + run: (*parser).callonListElementContinuationElement800, + expr: &oneOrMoreExpr{ + pos: position{line: 2771, col: 14, offset: 91737}, + expr: &charClassMatcher{ + pos: position{line: 2771, col: 14, offset: 91737}, + val: "[^\\r\\n|]", + chars: []rune{'\r', '\n', '|'}, + ignoreCase: false, + inverted: true, + }, + }, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement804, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + }, + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2757, col: 6, offset: 91348}, + alternatives: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2757, col: 6, offset: 91348}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonListElementContinuationElement813, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement819, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\"////\"", + inverted: false, }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement822, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent791, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", + }, + }, + }, + }, + &andExpr{ + pos: position{line: 2757, col: 19, offset: 91361}, + expr: &choiceExpr{ + pos: position{line: 2728, col: 22, offset: 90705}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2724, col: 19, offset: 90625}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement834, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent803, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement837, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2746, col: 5, offset: 91104}, + run: (*parser).callonListElementContinuationElement846, + expr: &seqExpr{ + pos: position{line: 2746, col: 5, offset: 91104}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2746, col: 5, offset: 91104}, + expr: &choiceExpr{ + pos: position{line: 2728, col: 22, offset: 90705}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2724, col: 19, offset: 90625}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement853, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement856, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, - }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent815, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2747, col: 5, offset: 91127}, + label: "cells", + expr: &oneOrMoreExpr{ + pos: position{line: 2747, col: 11, offset: 91133}, + expr: &actionExpr{ + pos: position{line: 2763, col: 5, offset: 91527}, + run: (*parser).callonListElementContinuationElement867, + expr: &seqExpr{ + pos: position{line: 2763, col: 5, offset: 91527}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2763, col: 5, offset: 91527}, + expr: &choiceExpr{ + pos: position{line: 2728, col: 22, offset: 90705}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2724, col: 19, offset: 90625}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"|===\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement874, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement877, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + }, + ¬Expr{ + pos: position{line: 2764, col: 5, offset: 91550}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonListElementContinuationElement887, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement893, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\" \"", + inverted: false, }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent827, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement896, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + }, + }, + &litMatcher{ + pos: position{line: 2765, col: 5, offset: 91565}, + val: "|", + ignoreCase: false, + want: "\"|\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2765, col: 9, offset: 91569}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement905, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2765, col: 16, offset: 91576}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 2765, col: 25, offset: 91585}, + expr: &actionExpr{ + pos: position{line: 2771, col: 5, offset: 91728}, + run: (*parser).callonListElementContinuationElement909, + expr: &labeledExpr{ + pos: position{line: 2771, col: 5, offset: 91728}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2771, col: 14, offset: 91737}, + run: (*parser).callonListElementContinuationElement911, + expr: &oneOrMoreExpr{ + pos: position{line: 2771, col: 14, offset: 91737}, + expr: &charClassMatcher{ + pos: position{line: 2771, col: 14, offset: 91737}, + val: "[^\\r\\n|]", + chars: []rune{'\r', '\n', '|'}, + ignoreCase: false, + inverted: true, }, }, }, @@ -31804,147 +40791,112 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonExampleBlockRawContent835, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement915, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonExampleBlockRawContent843, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 884, col: 5, offset: 28625}, - run: (*parser).callonExampleBlockRawContent844, - expr: &seqExpr{ - pos: position{line: 884, col: 5, offset: 28625}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 884, col: 5, offset: 28625}, - val: "> ", - ignoreCase: false, - want: "\"> \"", - }, - &labeledExpr{ - pos: position{line: 884, col: 10, offset: 28630}, - label: "content", - expr: &oneOrMoreExpr{ - pos: position{line: 899, col: 33, offset: 29398}, - expr: &actionExpr{ - pos: position{line: 899, col: 34, offset: 29399}, - run: (*parser).callonExampleBlockRawContent849, - expr: &seqExpr{ - pos: position{line: 899, col: 34, offset: 29399}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 899, col: 34, offset: 29399}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonExampleBlockRawContent852, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + &zeroOrMoreExpr{ + pos: position{line: 2748, col: 5, offset: 91154}, + expr: &actionExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + run: (*parser).callonListElementContinuationElement923, + expr: &seqExpr{ + pos: position{line: 526, col: 14, offset: 17058}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 526, col: 14, offset: 17058}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent860, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &zeroOrMoreExpr{ + pos: position{line: 526, col: 19, offset: 17063}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement929, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement932, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\r\"", }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -31952,544 +40904,529 @@ var g = &grammar{ }, }, }, - &zeroOrOneExpr{ - pos: position{line: 899, col: 45, offset: 29410}, - expr: &litMatcher{ - pos: position{line: 899, col: 45, offset: 29410}, - val: "> ", + }, + }, + }, + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2728, col: 22, offset: 90705}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2724, col: 19, offset: 90625}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2724, col: 19, offset: 90625}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2724, col: 26, offset: 90632}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement943, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement946, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\"> \"", + want: "\"\\n\"", }, - }, - &labeledExpr{ - pos: position{line: 899, col: 51, offset: 29416}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonExampleBlockRawContent870, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonExampleBlockRawContent876, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, - &actionExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - run: (*parser).callonExampleBlockRawContent884, - expr: &seqExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - run: (*parser).callonExampleBlockRawContent886, + }, + }, + }, + &actionExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + run: (*parser).callonListElementContinuationElement955, + expr: &seqExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2672, col: 31, offset: 89114}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2672, col: 36, offset: 89119}, + expr: &litMatcher{ + pos: position{line: 2672, col: 37, offset: 89120}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + }, + &labeledExpr{ + pos: position{line: 2667, col: 49, offset: 88920}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + run: (*parser).callonListElementContinuationElement961, + expr: &zeroOrMoreExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + expr: &charClassMatcher{ + pos: position{line: 2674, col: 29, offset: 89155}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, - &labeledExpr{ - pos: position{line: 891, col: 7, offset: 29028}, - label: "content", - expr: &oneOrMoreExpr{ - pos: position{line: 891, col: 15, offset: 29036}, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement965, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1650, col: 5, offset: 54833}, + run: (*parser).callonListElementContinuationElement972, + expr: &seqExpr{ + pos: position{line: 1650, col: 5, offset: 54833}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1650, col: 5, offset: 54833}, + label: "kind", + expr: &choiceExpr{ + pos: position{line: 136, col: 19, offset: 3960}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 136, col: 19, offset: 3960}, + run: (*parser).callonListElementContinuationElement976, + expr: &litMatcher{ + pos: position{line: 136, col: 19, offset: 3960}, + val: "TIP", + ignoreCase: false, + want: "\"TIP\"", + }, + }, + &actionExpr{ + pos: position{line: 138, col: 5, offset: 3998}, + run: (*parser).callonListElementContinuationElement978, + expr: &litMatcher{ + pos: position{line: 138, col: 5, offset: 3998}, + val: "NOTE", + ignoreCase: false, + want: "\"NOTE\"", + }, + }, + &actionExpr{ + pos: position{line: 140, col: 5, offset: 4038}, + run: (*parser).callonListElementContinuationElement980, + expr: &litMatcher{ + pos: position{line: 140, col: 5, offset: 4038}, + val: "IMPORTANT", + ignoreCase: false, + want: "\"IMPORTANT\"", + }, + }, + &actionExpr{ + pos: position{line: 142, col: 5, offset: 4088}, + run: (*parser).callonListElementContinuationElement982, + expr: &litMatcher{ + pos: position{line: 142, col: 5, offset: 4088}, + val: "WARNING", + ignoreCase: false, + want: "\"WARNING\"", + }, + }, + &actionExpr{ + pos: position{line: 144, col: 5, offset: 4134}, + run: (*parser).callonListElementContinuationElement984, + expr: &litMatcher{ + pos: position{line: 144, col: 5, offset: 4134}, + val: "CAUTION", + ignoreCase: false, + want: "\"CAUTION\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1650, col: 27, offset: 54855}, + val: ": ", + ignoreCase: false, + want: "\": \"", + }, + &labeledExpr{ + pos: position{line: 1651, col: 5, offset: 54865}, + label: "firstLine", + expr: &actionExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + run: (*parser).callonListElementContinuationElement988, + expr: &seqExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + label: "content", expr: &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonExampleBlockRawContent889, + pos: position{line: 1662, col: 14, offset: 55218}, + run: (*parser).callonListElementContinuationElement991, + expr: &oneOrMoreExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + expr: &charClassMatcher{ + pos: position{line: 1662, col: 14, offset: 55218}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1665, col: 5, offset: 55275}, + run: (*parser).callonListElementContinuationElement994, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement996, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1652, col: 5, offset: 54899}, + label: "otherLines", + expr: &zeroOrMoreExpr{ + pos: position{line: 1652, col: 16, offset: 54910}, + expr: &actionExpr{ + pos: position{line: 1653, col: 9, offset: 54920}, + run: (*parser).callonListElementContinuationElement1005, + expr: &seqExpr{ + pos: position{line: 1653, col: 9, offset: 54920}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1653, col: 9, offset: 54920}, expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, + pos: position{line: 1392, col: 34, offset: 46323}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, + &litMatcher{ + pos: position{line: 1392, col: 34, offset: 46323}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 38, offset: 46327}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonListElementContinuationElement1011, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement1013, expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent902, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent914, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1654, col: 9, offset: 54959}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 1654, col: 15, offset: 54965}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + run: (*parser).callonListElementContinuationElement1020, + expr: &seqExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2672, col: 31, offset: 89114}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2672, col: 36, offset: 89119}, + expr: &litMatcher{ + pos: position{line: 2672, col: 37, offset: 89120}, + val: "//", + ignoreCase: false, + want: "\"//\"", }, }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent926, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &labeledExpr{ + pos: position{line: 2667, col: 49, offset: 88920}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + run: (*parser).callonListElementContinuationElement1026, + expr: &zeroOrMoreExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + expr: &charClassMatcher{ + pos: position{line: 2674, col: 29, offset: 89155}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement1030, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent938, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + want: "\"\\n\"", }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", ignoreCase: false, - want: "\" \"", + want: "\"\\r\\n\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent950, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent962, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + run: (*parser).callonListElementContinuationElement1037, + expr: &seqExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + run: (*parser).callonListElementContinuationElement1040, + expr: &oneOrMoreExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + expr: &charClassMatcher{ + pos: position{line: 1662, col: 14, offset: 55218}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, + &andCodeExpr{ + pos: position{line: 1665, col: 5, offset: 55275}, + run: (*parser).callonListElementContinuationElement1043, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement1045, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent974, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -32497,756 +41434,1782 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonExampleBlockRawContent982, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1673, col: 5, offset: 55439}, + run: (*parser).callonListElementContinuationElement1052, + expr: &seqExpr{ + pos: position{line: 1673, col: 5, offset: 55439}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1673, col: 5, offset: 55439}, + label: "firstLine", + expr: &actionExpr{ + pos: position{line: 1680, col: 5, offset: 55724}, + run: (*parser).callonListElementContinuationElement1055, + expr: &seqExpr{ + pos: position{line: 1680, col: 5, offset: 55724}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1680, col: 5, offset: 55724}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1680, col: 14, offset: 55733}, + run: (*parser).callonListElementContinuationElement1058, + expr: &seqExpr{ + pos: position{line: 1680, col: 14, offset: 55733}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonListElementContinuationElement1060, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 1680, col: 21, offset: 55740}, + expr: &charClassMatcher{ + pos: position{line: 1680, col: 21, offset: 55740}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1683, col: 5, offset: 55797}, + run: (*parser).callonListElementContinuationElement1065, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement1067, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1674, col: 5, offset: 55480}, + label: "otherLines", + expr: &zeroOrMoreExpr{ + pos: position{line: 1674, col: 16, offset: 55491}, + expr: &choiceExpr{ + pos: position{line: 1674, col: 17, offset: 55492}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + run: (*parser).callonListElementContinuationElement1077, + expr: &seqExpr{ + pos: position{line: 2667, col: 22, offset: 88893}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2672, col: 31, offset: 89114}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2672, col: 36, offset: 89119}, + expr: &litMatcher{ + pos: position{line: 2672, col: 37, offset: 89120}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + }, + &labeledExpr{ + pos: position{line: 2667, col: 49, offset: 88920}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + run: (*parser).callonListElementContinuationElement1083, + expr: &zeroOrMoreExpr{ + pos: position{line: 2674, col: 29, offset: 89155}, + expr: &charClassMatcher{ + pos: position{line: 2674, col: 29, offset: 89155}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement1087, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + run: (*parser).callonListElementContinuationElement1094, + expr: &seqExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1662, col: 5, offset: 55209}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + run: (*parser).callonListElementContinuationElement1097, + expr: &oneOrMoreExpr{ + pos: position{line: 1662, col: 14, offset: 55218}, + expr: &charClassMatcher{ + pos: position{line: 1662, col: 14, offset: 55218}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, ignoreCase: false, - want: "\"\\r\\n\"", + inverted: true, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1665, col: 5, offset: 55275}, + run: (*parser).callonListElementContinuationElement1100, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement1102, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1423, col: 5, offset: 47333}, + run: (*parser).callonListElementContinuationElement1109, + expr: &seqExpr{ + pos: position{line: 1423, col: 5, offset: 47333}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1423, col: 5, offset: 47333}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1423, col: 14, offset: 47342}, + run: (*parser).callonListElementContinuationElement1112, + expr: &oneOrMoreExpr{ + pos: position{line: 1423, col: 14, offset: 47342}, + expr: &charClassMatcher{ + pos: position{line: 1423, col: 14, offset: 47342}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonListElementContinuationElement1116, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "Callout", + pos: position{line: 1581, col: 1, offset: 52496}, + expr: &actionExpr{ + pos: position{line: 1583, col: 5, offset: 52574}, + run: (*parser).callonCallout1, + expr: &seqExpr{ + pos: position{line: 1583, col: 5, offset: 52574}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 1583, col: 5, offset: 52574}, + run: (*parser).callonCallout3, + }, + &litMatcher{ + pos: position{line: 1586, col: 5, offset: 52636}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1586, col: 9, offset: 52640}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1586, col: 14, offset: 52645}, + run: (*parser).callonCallout6, + expr: &oneOrMoreExpr{ + pos: position{line: 1586, col: 14, offset: 52645}, + expr: &charClassMatcher{ + pos: position{line: 1586, col: 14, offset: 52645}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1586, col: 62, offset: 52693}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1586, col: 66, offset: 52697}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonCallout11, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &andExpr{ + pos: position{line: 1586, col: 73, offset: 52704}, + expr: &choiceExpr{ + pos: position{line: 1586, col: 75, offset: 52706}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonCallout15, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + &ruleRefExpr{ + pos: position{line: 1586, col: 81, offset: 52712}, + name: "Callout", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedText", + pos: position{line: 1693, col: 1, offset: 56259}, + expr: &choiceExpr{ + pos: position{line: 1694, col: 5, offset: 56278}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1695, col: 9, offset: 56288}, + run: (*parser).callonQuotedText2, + expr: &seqExpr{ + pos: position{line: 1695, col: 9, offset: 56288}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1695, col: 9, offset: 56288}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1695, col: 20, offset: 56299}, + expr: &ruleRefExpr{ + pos: position{line: 1695, col: 21, offset: 56300}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1696, col: 9, offset: 56426}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 1696, col: 15, offset: 56432}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1696, col: 15, offset: 56432}, + name: "UnconstrainedQuotedText", + }, + &ruleRefExpr{ + pos: position{line: 1696, col: 41, offset: 56458}, + name: "ConstrainedQuotedText", + }, + }, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1700, col: 7, offset: 56577}, + name: "EscapedQuotedText", + }, + }, + }, + }, + { + name: "ConstrainedQuotedText", + pos: position{line: 1706, col: 1, offset: 56768}, + expr: &choiceExpr{ + pos: position{line: 1707, col: 5, offset: 56798}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1707, col: 5, offset: 56798}, + name: "SingleQuoteBoldText", + }, + &ruleRefExpr{ + pos: position{line: 1708, col: 7, offset: 56825}, + name: "SingleQuoteItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1709, col: 7, offset: 56853}, + name: "SingleQuoteMarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1710, col: 7, offset: 56881}, + name: "SingleQuoteMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1711, col: 7, offset: 56913}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1712, col: 7, offset: 56934}, + name: "SuperscriptText", + }, + }, + }, + }, + { + name: "UnconstrainedQuotedText", + pos: position{line: 1714, col: 1, offset: 56952}, + expr: &choiceExpr{ + pos: position{line: 1715, col: 5, offset: 56984}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1715, col: 5, offset: 56984}, + name: "DoubleQuoteBoldText", + }, + &ruleRefExpr{ + pos: position{line: 1716, col: 7, offset: 57010}, + name: "DoubleQuoteItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1717, col: 7, offset: 57038}, + name: "DoubleQuoteMarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1718, col: 7, offset: 57066}, + name: "DoubleQuoteMonospaceText", + }, + }, + }, + }, + { + name: "EscapedQuotedText", + pos: position{line: 1720, col: 1, offset: 57092}, + expr: &actionExpr{ + pos: position{line: 1721, col: 5, offset: 57173}, + run: (*parser).callonEscapedQuotedText1, + expr: &seqExpr{ + pos: position{line: 1721, col: 5, offset: 57173}, + exprs: []interface{}{ + &andExpr{ + pos: position{line: 1721, col: 5, offset: 57173}, + expr: &litMatcher{ + pos: position{line: 1721, col: 7, offset: 57175}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &labeledExpr{ + pos: position{line: 1722, col: 5, offset: 57184}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1723, col: 9, offset: 57202}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1723, col: 9, offset: 57202}, + name: "EscapedBoldText", + }, + &ruleRefExpr{ + pos: position{line: 1724, col: 11, offset: 57229}, + name: "EscapedItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1725, col: 11, offset: 57257}, + name: "EscapedMarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1726, col: 11, offset: 57285}, + name: "EscapedMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1727, col: 11, offset: 57317}, + name: "EscapedSubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1728, col: 11, offset: 57349}, + name: "EscapedSuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "BoldText", + pos: position{line: 1748, col: 1, offset: 57876}, + expr: &choiceExpr{ + pos: position{line: 1748, col: 13, offset: 57888}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1748, col: 13, offset: 57888}, + name: "DoubleQuoteBoldText", + }, + &ruleRefExpr{ + pos: position{line: 1748, col: 35, offset: 57910}, + name: "SingleQuoteBoldText", + }, + }, + }, + }, + { + name: "DoubleQuoteBoldText", + pos: position{line: 1762, col: 1, offset: 58272}, + expr: &actionExpr{ + pos: position{line: 1763, col: 5, offset: 58300}, + run: (*parser).callonDoubleQuoteBoldText1, + expr: &seqExpr{ + pos: position{line: 1763, col: 5, offset: 58300}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1760, col: 33, offset: 58266}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + &labeledExpr{ + pos: position{line: 1764, col: 5, offset: 58334}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1764, col: 15, offset: 58344}, + name: "DoubleQuoteBoldTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1760, col: 33, offset: 58266}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + }, + }, + }, + }, + { + name: "DoubleQuoteBoldTextElements", + pos: position{line: 1769, col: 1, offset: 58501}, + expr: &oneOrMoreExpr{ + pos: position{line: 1769, col: 32, offset: 58532}, + expr: &ruleRefExpr{ + pos: position{line: 1769, col: 32, offset: 58532}, + name: "DoubleQuoteBoldTextElement", + }, + }, + }, + { + name: "DoubleQuoteBoldTextElement", + pos: position{line: 1771, col: 1, offset: 58563}, + expr: &actionExpr{ + pos: position{line: 1772, col: 5, offset: 58598}, + run: (*parser).callonDoubleQuoteBoldTextElement1, + expr: &seqExpr{ + pos: position{line: 1772, col: 5, offset: 58598}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1772, col: 5, offset: 58598}, + expr: &litMatcher{ + pos: position{line: 1760, col: 33, offset: 58266}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + }, + &labeledExpr{ + pos: position{line: 1773, col: 5, offset: 58632}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1774, col: 9, offset: 58650}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1753, col: 5, offset: 58024}, + run: (*parser).callonDoubleQuoteBoldTextElement7, + expr: &seqExpr{ + pos: position{line: 1753, col: 5, offset: 58024}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1753, col: 5, offset: 58024}, + expr: &charClassMatcher{ + pos: position{line: 1753, col: 5, offset: 58024}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 1753, col: 19, offset: 58038}, + expr: &choiceExpr{ + pos: position{line: 1753, col: 21, offset: 58040}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDoubleQuoteBoldTextElement13, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1750, col: 22, offset: 57998}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonDoubleQuoteBoldTextElement16, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 1776, col: 11, offset: 58723}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDoubleQuoteBoldTextElement20, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1776, col: 19, offset: 58731}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDoubleQuoteBoldTextElement26, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteBoldTextElement31, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteBoldTextElement33, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonDoubleQuoteBoldTextElement36, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteBoldTextElement40, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonExampleBlockRawContent990, - }, }, }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 895, col: 5, offset: 29222}, - run: (*parser).callonExampleBlockRawContent991, - expr: &labeledExpr{ - pos: position{line: 895, col: 5, offset: 29222}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 895, col: 11, offset: 29228}, - expr: &choiceExpr{ - pos: position{line: 895, col: 12, offset: 29229}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonExampleBlockRawContent995, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteBoldTextElement47, expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 515, col: 17, offset: 16692}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", ignoreCase: false, - want: "\"////\"", + want: "\":\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 515, col: 28, offset: 16703}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent1003, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonExampleBlockRawContent1012, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonExampleBlockRawContent1020, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent1033, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent1045, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent1057, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteBoldTextElement52, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent1069, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteBoldTextElement54, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent1081, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonDoubleQuoteBoldTextElement58, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteBoldTextElement62, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteBoldTextElement69, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteBoldTextElement74, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteBoldTextElement76, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonDoubleQuoteBoldTextElement80, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteBoldTextElement84, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonDoubleQuoteBoldTextElement90, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonDoubleQuoteBoldTextElement92, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonDoubleQuoteBoldTextElement95, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonDoubleQuoteBoldTextElement97, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonDoubleQuoteBoldTextElement101, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDoubleQuoteBoldTextElement105, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonDoubleQuoteBoldTextElement111, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent1093, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, ignoreCase: false, - want: "\"\\t\"", + inverted: true, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteBoldTextElement116, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteBoldTextElement118, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent1105, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonDoubleQuoteBoldTextElement121, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteBoldTextElement125, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteBoldTextElement132, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteBoldTextElement137, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteBoldTextElement139, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonDoubleQuoteBoldTextElement143, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteBoldTextElement147, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteBoldTextElement154, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteBoldTextElement159, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteBoldTextElement161, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonDoubleQuoteBoldTextElement165, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteBoldTextElement169, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonDoubleQuoteBoldTextElement175, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", }, }, }, }, }, }, - }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonExampleBlockRawContent1113, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonDoubleQuoteBoldTextElement178, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonDoubleQuoteBoldTextElement182, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, }, }, }, - }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonExampleBlockRawContent1121, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, }, }, }, }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonDoubleQuoteBoldTextElement186, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, - &actionExpr{ - pos: position{line: 1708, col: 15, offset: 60833}, - run: (*parser).callonExampleBlockRawContent1122, - expr: &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", + }, + }, + }, + &actionExpr{ + pos: position{line: 2683, col: 15, offset: 89501}, + run: (*parser).callonDoubleQuoteBoldTextElement188, + expr: &litMatcher{ + pos: position{line: 2683, col: 15, offset: 89501}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2689, col: 14, offset: 89616}, + run: (*parser).callonDoubleQuoteBoldTextElement190, + expr: &litMatcher{ + pos: position{line: 2689, col: 14, offset: 89616}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2693, col: 14, offset: 89692}, + run: (*parser).callonDoubleQuoteBoldTextElement192, + expr: &litMatcher{ + pos: position{line: 2693, col: 14, offset: 89692}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2697, col: 15, offset: 89770}, + run: (*parser).callonDoubleQuoteBoldTextElement194, + expr: &litMatcher{ + pos: position{line: 2697, col: 15, offset: 89770}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2701, col: 13, offset: 89845}, + run: (*parser).callonDoubleQuoteBoldTextElement196, + expr: &litMatcher{ + pos: position{line: 2701, col: 13, offset: 89845}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + run: (*parser).callonDoubleQuoteBoldTextElement198, + expr: &seqExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2709, col: 31, offset: 90160}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2709, col: 35, offset: 90164}, + expr: &charClassMatcher{ + pos: position{line: 2709, col: 36, offset: 90165}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1780, col: 11, offset: 58860}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 1781, col: 11, offset: 58882}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 1782, col: 11, offset: 58905}, + name: "QuotedTextInDoubleQuoteBoldText", + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonDoubleQuoteBoldTextElement207, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonDoubleQuoteBoldTextElement211, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent1128, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + inverted: false, }, }, }, }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 1801, col: 5, offset: 59417}, + val: "[^\\r\\n*]", + chars: []rune{'\r', '\n', '*'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 1802, col: 7, offset: 59514}, + run: (*parser).callonDoubleQuoteBoldTextElement216, + expr: &seqExpr{ + pos: position{line: 1802, col: 7, offset: 59514}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1760, col: 33, offset: 58266}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonDoubleQuoteBoldTextElement219, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, @@ -33258,1002 +43221,969 @@ var g = &grammar{ }, }, { - name: "QuoteBlock", - pos: position{line: 1722, col: 1, offset: 61387}, + name: "QuotedTextInDoubleQuoteBoldText", + pos: position{line: 1788, col: 1, offset: 59059}, expr: &actionExpr{ - pos: position{line: 1723, col: 5, offset: 61406}, - run: (*parser).callonQuoteBlock1, + pos: position{line: 1789, col: 5, offset: 59099}, + run: (*parser).callonQuotedTextInDoubleQuoteBoldText1, expr: &seqExpr{ - pos: position{line: 1723, col: 5, offset: 61406}, + pos: position{line: 1789, col: 5, offset: 59099}, exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 1723, col: 5, offset: 61406}, - run: (*parser).callonQuoteBlock3, - }, - &litMatcher{ - pos: position{line: 1738, col: 29, offset: 62027}, - val: "____", - ignoreCase: false, - want: "\"____\"", + &labeledExpr{ + pos: position{line: 1789, col: 5, offset: 59099}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1789, col: 16, offset: 59110}, + expr: &ruleRefExpr{ + pos: position{line: 1789, col: 17, offset: 59111}, + name: "LongHandAttributes", + }, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 1738, col: 36, offset: 62034}, + &labeledExpr{ + pos: position{line: 1790, col: 5, offset: 59137}, + label: "text", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 1791, col: 9, offset: 59152}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &ruleRefExpr{ + pos: position{line: 1791, col: 9, offset: 59152}, + name: "SingleQuoteBoldText", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlock8, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &ruleRefExpr{ + pos: position{line: 1792, col: 11, offset: 59182}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1793, col: 11, offset: 59203}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1794, col: 11, offset: 59224}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1795, col: 11, offset: 59248}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1796, col: 11, offset: 59272}, + name: "SuperscriptText", }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", + }, + }, + }, + }, + { + name: "SingleQuoteBoldText", + pos: position{line: 1813, col: 1, offset: 59901}, + expr: &actionExpr{ + pos: position{line: 1814, col: 5, offset: 59929}, + run: (*parser).callonSingleQuoteBoldText1, + expr: &seqExpr{ + pos: position{line: 1814, col: 5, offset: 59929}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1809, col: 38, offset: 59855}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + &labeledExpr{ + pos: position{line: 1815, col: 5, offset: 59967}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1815, col: 15, offset: 59977}, + name: "SingleQuoteBoldTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1811, col: 36, offset: 59895}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + }, + { + name: "SingleQuoteBoldTextElements", + pos: position{line: 1820, col: 1, offset: 60137}, + expr: &actionExpr{ + pos: position{line: 1821, col: 5, offset: 60174}, + run: (*parser).callonSingleQuoteBoldTextElements1, + expr: &seqExpr{ + pos: position{line: 1821, col: 5, offset: 60174}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1821, col: 5, offset: 60174}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + }, + }, + ¬Expr{ + pos: position{line: 1821, col: 10, offset: 60179}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuoteBoldTextElements7, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + }, + &labeledExpr{ + pos: position{line: 1822, col: 5, offset: 60218}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 1822, col: 14, offset: 60227}, + expr: &ruleRefExpr{ + pos: position{line: 1822, col: 15, offset: 60228}, + name: "SingleQuoteBoldTextElement", + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1823, col: 5, offset: 60262}, + run: (*parser).callonSingleQuoteBoldTextElements12, + }, + }, + }, + }, + }, + { + name: "SingleQuoteBoldTextElement", + pos: position{line: 1829, col: 1, offset: 60403}, + expr: &choiceExpr{ + pos: position{line: 1830, col: 5, offset: 60438}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1753, col: 5, offset: 58024}, + run: (*parser).callonSingleQuoteBoldTextElement2, + expr: &seqExpr{ + pos: position{line: 1753, col: 5, offset: 58024}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1753, col: 5, offset: 58024}, + expr: &charClassMatcher{ + pos: position{line: 1753, col: 5, offset: 58024}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 1753, col: 19, offset: 58038}, + expr: &choiceExpr{ + pos: position{line: 1753, col: 21, offset: 58040}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuoteBoldTextElement8, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1750, col: 22, offset: 57998}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, }, }, }, }, - &labeledExpr{ - pos: position{line: 1732, col: 30, offset: 61778}, - label: "content", - expr: &ruleRefExpr{ - pos: position{line: 1732, col: 39, offset: 61787}, - name: "QuoteBlockRawContent", + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonSingleQuoteBoldTextElement11, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, - &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1740, col: 28, offset: 62098}, - exprs: []interface{}{ + }, + &seqExpr{ + pos: position{line: 1832, col: 7, offset: 60470}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSingleQuoteBoldTextElement15, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1740, col: 28, offset: 62098}, - val: "____", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\"____\"", + want: "\"\\n\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1740, col: 35, offset: 62105}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlock23, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + ¬Expr{ + pos: position{line: 1832, col: 15, offset: 60478}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSingleQuoteBoldTextElement21, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, }, }, - }, - }, - }, - { - name: "QuoteBlockRawContent", - pos: position{line: 1742, col: 1, offset: 62149}, - expr: &actionExpr{ - pos: position{line: 1743, col: 5, offset: 62177}, - run: (*parser).callonQuoteBlockRawContent1, - expr: &labeledExpr{ - pos: position{line: 1743, col: 5, offset: 62177}, - label: "elements", - expr: &zeroOrMoreExpr{ - pos: position{line: 1743, col: 14, offset: 62186}, - expr: &actionExpr{ - pos: position{line: 1744, col: 9, offset: 62196}, - run: (*parser).callonQuoteBlockRawContent4, - expr: &seqExpr{ - pos: position{line: 1744, col: 9, offset: 62196}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1744, col: 9, offset: 62196}, - expr: &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1740, col: 28, offset: 62098}, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteBoldTextElement26, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteBoldTextElement28, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonSingleQuoteBoldTextElement31, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1740, col: 28, offset: 62098}, - val: "____", + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", ignoreCase: false, - want: "\"____\"", + want: "\"{counter:\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1740, col: 35, offset: 62105}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent13, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteBoldTextElement35, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1745, col: 9, offset: 62229}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1745, col: 20, offset: 62240}, - expr: &ruleRefExpr{ - pos: position{line: 1745, col: 21, offset: 62241}, - name: "BlockAttributes", - }, - }, - }, - &stateCodeExpr{ - pos: position{line: 1746, col: 9, offset: 62267}, - run: (*parser).callonQuoteBlockRawContent25, - }, - &labeledExpr{ - pos: position{line: 1750, col: 9, offset: 62365}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 1750, col: 18, offset: 62374}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1750, col: 18, offset: 62374}, - name: "LabeledListItem", - }, - &actionExpr{ - pos: position{line: 920, col: 5, offset: 29951}, - run: (*parser).callonQuoteBlockRawContent29, - expr: &seqExpr{ - pos: position{line: 920, col: 5, offset: 29951}, - exprs: []interface{}{ - ¬CodeExpr{ - pos: position{line: 920, col: 5, offset: 29951}, - run: (*parser).callonQuoteBlockRawContent31, - }, - &labeledExpr{ - pos: position{line: 923, col: 5, offset: 30081}, - label: "firstLine", + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, expr: &actionExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - run: (*parser).callonQuoteBlockRawContent33, + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteBoldTextElement42, expr: &seqExpr{ - pos: position{line: 929, col: 5, offset: 30339}, + pos: position{line: 515, col: 17, offset: 16692}, exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, &labeledExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - label: "content", - expr: &actionExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - run: (*parser).callonQuoteBlockRawContent36, - expr: &seqExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - label: "elements", - expr: &choiceExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonQuoteBlockRawContent40, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonQuoteBlockRawContent49, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteBoldTextElement47, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, }, - &zeroOrMoreExpr{ - pos: position{line: 929, col: 28, offset: 30362}, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteBoldTextElement49, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, expr: &charClassMatcher{ - pos: position{line: 929, col: 28, offset: 30362}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonSingleQuoteBoldTextElement53, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteBoldTextElement57, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, - &labeledExpr{ - pos: position{line: 924, col: 5, offset: 30118}, - label: "otherLines", - expr: &zeroOrMoreExpr{ - pos: position{line: 924, col: 16, offset: 30129}, - expr: &choiceExpr{ - pos: position{line: 924, col: 17, offset: 30130}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonQuoteBlockRawContent68, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent76, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteBoldTextElement64, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteBoldTextElement69, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, }, }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonQuoteBlockRawContent85, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteBoldTextElement71, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonSingleQuoteBoldTextElement75, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteBoldTextElement79, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonSingleQuoteBoldTextElement85, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonSingleQuoteBoldTextElement87, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonSingleQuoteBoldTextElement90, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonSingleQuoteBoldTextElement92, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonSingleQuoteBoldTextElement96, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuoteBoldTextElement100, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonSingleQuoteBoldTextElement106, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, }, }, }, }, }, - }, - }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonQuoteBlockRawContent93, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteBoldTextElement111, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteBoldTextElement113, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonSingleQuoteBoldTextElement116, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", ignoreCase: false, - want: "\" \"", + want: "\"{counter:\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent106, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteBoldTextElement120, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent118, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteBoldTextElement127, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteBoldTextElement132, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteBoldTextElement134, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent130, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + want: "\"}\"", }, }, }, }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonSingleQuoteBoldTextElement138, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", ignoreCase: false, - want: "\" \"", + want: "\"{counter2:\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent142, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteBoldTextElement142, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteBoldTextElement149, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteBoldTextElement154, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteBoldTextElement156, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent154, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + want: "\"}\"", }, }, }, }, - }, - }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonSingleQuoteBoldTextElement160, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", ignoreCase: false, - want: "\" \"", + want: "\"{\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent166, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteBoldTextElement164, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent178, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + want: "\"}\"", }, }, }, @@ -34263,418 +44193,903 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonQuoteBlockRawContent186, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonQuoteBlockRawContent194, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonSingleQuoteBoldTextElement170, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, }, - }, - }, - &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonQuoteBlockRawContent195, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonSingleQuoteBoldTextElement173, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent203, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonSingleQuoteBoldTextElement177, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\">>\"", }, }, }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1753, col: 15, offset: 62500}, - name: "ImageBlock", + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonSingleQuoteBoldTextElement181, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, }, - &actionExpr{ - pos: position{line: 1632, col: 18, offset: 58455}, - run: (*parser).callonQuoteBlockRawContent211, - expr: &seqExpr{ - pos: position{line: 1632, col: 18, offset: 58455}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 1632, col: 19, offset: 58456}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 1632, col: 19, offset: 58456}, - val: "***", - ignoreCase: false, - want: "\"***\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 27, offset: 58464}, - val: "* * *", - ignoreCase: false, - want: "\"* * *\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 37, offset: 58474}, - val: "---", - ignoreCase: false, - want: "\"---\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 45, offset: 58482}, - val: "- - -", - ignoreCase: false, - want: "\"- - -\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 55, offset: 58492}, - val: "___", - ignoreCase: false, - want: "\"___\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 63, offset: 58500}, - val: "_ _ _", - ignoreCase: false, - want: "\"_ _ _\"", - }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2683, col: 15, offset: 89501}, + run: (*parser).callonSingleQuoteBoldTextElement183, + expr: &litMatcher{ + pos: position{line: 2683, col: 15, offset: 89501}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2689, col: 14, offset: 89616}, + run: (*parser).callonSingleQuoteBoldTextElement185, + expr: &litMatcher{ + pos: position{line: 2689, col: 14, offset: 89616}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2693, col: 14, offset: 89692}, + run: (*parser).callonSingleQuoteBoldTextElement187, + expr: &litMatcher{ + pos: position{line: 2693, col: 14, offset: 89692}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2697, col: 15, offset: 89770}, + run: (*parser).callonSingleQuoteBoldTextElement189, + expr: &litMatcher{ + pos: position{line: 2697, col: 15, offset: 89770}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2701, col: 13, offset: 89845}, + run: (*parser).callonSingleQuoteBoldTextElement191, + expr: &litMatcher{ + pos: position{line: 2701, col: 13, offset: 89845}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + run: (*parser).callonSingleQuoteBoldTextElement193, + expr: &seqExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2709, col: 31, offset: 90160}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2709, col: 35, offset: 90164}, + expr: &charClassMatcher{ + pos: position{line: 2709, col: 36, offset: 90165}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1836, col: 7, offset: 60591}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 1837, col: 7, offset: 60609}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 1838, col: 7, offset: 60628}, + name: "QuotedTextInSingleQuoteBoldText", + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonSingleQuoteBoldTextElement202, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonSingleQuoteBoldTextElement206, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 1854, col: 5, offset: 61086}, + val: "[^\\r\\n *]", + chars: []rune{'\r', '\n', ' ', '*'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 1855, col: 7, offset: 61191}, + run: (*parser).callonSingleQuoteBoldTextElement211, + expr: &seqExpr{ + pos: position{line: 1855, col: 7, offset: 61191}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1855, col: 7, offset: 61191}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonSingleQuoteBoldTextElement214, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInSingleQuoteBoldText", + pos: position{line: 1842, col: 1, offset: 60729}, + expr: &actionExpr{ + pos: position{line: 1843, col: 5, offset: 60769}, + run: (*parser).callonQuotedTextInSingleQuoteBoldText1, + expr: &seqExpr{ + pos: position{line: 1843, col: 5, offset: 60769}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1843, col: 5, offset: 60769}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1843, col: 16, offset: 60780}, + expr: &ruleRefExpr{ + pos: position{line: 1843, col: 17, offset: 60781}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1844, col: 5, offset: 60807}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 1845, col: 9, offset: 60822}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1845, col: 9, offset: 60822}, + name: "DoubleQuoteBoldText", + }, + &ruleRefExpr{ + pos: position{line: 1846, col: 11, offset: 60852}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1847, col: 11, offset: 60873}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1848, col: 11, offset: 60897}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1849, col: 11, offset: 60918}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1850, col: 11, offset: 60942}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "EscapedBoldText", + pos: position{line: 1859, col: 1, offset: 61366}, + expr: &choiceExpr{ + pos: position{line: 1860, col: 5, offset: 61390}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1860, col: 5, offset: 61390}, + run: (*parser).callonEscapedBoldText2, + expr: &seqExpr{ + pos: position{line: 1860, col: 5, offset: 61390}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1860, col: 5, offset: 61390}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1741, col: 25, offset: 57692}, + run: (*parser).callonEscapedBoldText5, + expr: &seqExpr{ + pos: position{line: 1741, col: 25, offset: 57692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1741, col: 25, offset: 57692}, + val: "\\\\", + ignoreCase: false, + want: "\"\\\\\\\\\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1741, col: 30, offset: 57697}, + expr: &litMatcher{ + pos: position{line: 1741, col: 30, offset: 57697}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1860, col: 40, offset: 61425}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + &labeledExpr{ + pos: position{line: 1860, col: 45, offset: 61430}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1860, col: 55, offset: 61440}, + name: "DoubleQuoteBoldTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1860, col: 84, offset: 61469}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1862, col: 9, offset: 61626}, + run: (*parser).callonEscapedBoldText14, + expr: &seqExpr{ + pos: position{line: 1862, col: 9, offset: 61626}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1862, col: 9, offset: 61626}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + run: (*parser).callonEscapedBoldText17, + expr: &oneOrMoreExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + expr: &litMatcher{ + pos: position{line: 1737, col: 25, offset: 57619}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1862, col: 44, offset: 61661}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + &labeledExpr{ + pos: position{line: 1862, col: 49, offset: 61666}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1862, col: 59, offset: 61676}, + name: "SingleQuoteBoldTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1862, col: 88, offset: 61705}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1865, col: 9, offset: 61905}, + run: (*parser).callonEscapedBoldText24, + expr: &seqExpr{ + pos: position{line: 1865, col: 9, offset: 61905}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1865, col: 9, offset: 61905}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + run: (*parser).callonEscapedBoldText27, + expr: &oneOrMoreExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + expr: &litMatcher{ + pos: position{line: 1737, col: 25, offset: 57619}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1865, col: 44, offset: 61940}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + &labeledExpr{ + pos: position{line: 1865, col: 48, offset: 61944}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1865, col: 58, offset: 61954}, + name: "SingleQuoteBoldTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1865, col: 87, offset: 61983}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + }, + }, + }, + { + name: "ItalicText", + pos: position{line: 1873, col: 1, offset: 62281}, + expr: &choiceExpr{ + pos: position{line: 1873, col: 15, offset: 62295}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1873, col: 15, offset: 62295}, + name: "DoubleQuoteItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1873, col: 39, offset: 62319}, + name: "SingleQuoteItalicText", + }, + }, + }, + }, + { + name: "DoubleQuoteItalicText", + pos: position{line: 1887, col: 1, offset: 62647}, + expr: &actionExpr{ + pos: position{line: 1888, col: 5, offset: 62677}, + run: (*parser).callonDoubleQuoteItalicText1, + expr: &seqExpr{ + pos: position{line: 1888, col: 5, offset: 62677}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1885, col: 35, offset: 62641}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + &labeledExpr{ + pos: position{line: 1889, col: 5, offset: 62713}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1889, col: 15, offset: 62723}, + name: "DoubleQuoteItalicTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1885, col: 35, offset: 62641}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + }, + }, + }, + }, + { + name: "DoubleQuoteItalicTextElements", + pos: position{line: 1894, col: 1, offset: 62931}, + expr: &oneOrMoreExpr{ + pos: position{line: 1894, col: 34, offset: 62964}, + expr: &ruleRefExpr{ + pos: position{line: 1894, col: 34, offset: 62964}, + name: "DoubleQuoteItalicTextElement", + }, + }, + }, + { + name: "DoubleQuoteItalicTextElement", + pos: position{line: 1896, col: 1, offset: 62996}, + expr: &actionExpr{ + pos: position{line: 1897, col: 5, offset: 63033}, + run: (*parser).callonDoubleQuoteItalicTextElement1, + expr: &seqExpr{ + pos: position{line: 1897, col: 5, offset: 63033}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1897, col: 5, offset: 63033}, + expr: &litMatcher{ + pos: position{line: 1885, col: 35, offset: 62641}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + }, + &labeledExpr{ + pos: position{line: 1898, col: 5, offset: 63069}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1899, col: 9, offset: 63087}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1878, col: 5, offset: 62393}, + run: (*parser).callonDoubleQuoteItalicTextElement7, + expr: &seqExpr{ + pos: position{line: 1878, col: 5, offset: 62393}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1878, col: 5, offset: 62393}, + expr: &charClassMatcher{ + pos: position{line: 1878, col: 5, offset: 62393}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 1878, col: 15, offset: 62403}, + expr: &choiceExpr{ + pos: position{line: 1878, col: 17, offset: 62405}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDoubleQuoteItalicTextElement13, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + &litMatcher{ + pos: position{line: 1875, col: 24, offset: 62365}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonDoubleQuoteItalicTextElement16, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 1901, col: 11, offset: 63162}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDoubleQuoteItalicTextElement20, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1901, col: 19, offset: 63170}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDoubleQuoteItalicTextElement26, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1755, col: 15, offset: 62553}, - name: "OrderedListItem", - }, - &ruleRefExpr{ - pos: position{line: 1756, col: 15, offset: 62584}, - name: "UnorderedListItem", - }, - &ruleRefExpr{ - pos: position{line: 1757, col: 15, offset: 62617}, - name: "ContinuedListItemElement", + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteItalicTextElement31, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteItalicTextElement33, }, - &actionExpr{ - pos: position{line: 1835, col: 16, offset: 65237}, - run: (*parser).callonQuoteBlockRawContent228, - expr: &seqExpr{ - pos: position{line: 1835, col: 16, offset: 65237}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1841, col: 30, offset: 65538}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1841, col: 36, offset: 65544}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonDoubleQuoteItalicTextElement36, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", ignoreCase: false, - want: "\" \"", + want: "\"{counter:\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent234, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteItalicTextElement40, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1835, col: 42, offset: 65263}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1845, col: 26, offset: 65634}, - expr: &actionExpr{ - pos: position{line: 1845, col: 27, offset: 65635}, - run: (*parser).callonQuoteBlockRawContent243, - expr: &seqExpr{ - pos: position{line: 1845, col: 27, offset: 65635}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1845, col: 27, offset: 65635}, - expr: &choiceExpr{ - pos: position{line: 1843, col: 28, offset: 65583}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1843, col: 29, offset: 65584}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1843, col: 29, offset: 65584}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1843, col: 35, offset: 65590}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent252, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteItalicTextElement47, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteItalicTextElement52, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteItalicTextElement54, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonDoubleQuoteItalicTextElement58, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteItalicTextElement62, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, - &labeledExpr{ - pos: position{line: 1845, col: 52, offset: 65660}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonQuoteBlockRawContent262, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonQuoteBlockRawContent268, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteItalicTextElement69, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteItalicTextElement74, expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteItalicTextElement76, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -34685,75 +45100,66 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, - &choiceExpr{ - pos: position{line: 1843, col: 28, offset: 65583}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1843, col: 29, offset: 65584}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1843, col: 29, offset: 65584}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1843, col: 35, offset: 65590}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonDoubleQuoteItalicTextElement80, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteItalicTextElement84, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent282, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", }, }, }, @@ -34761,909 +45167,1641 @@ var g = &grammar{ }, }, }, - &actionExpr{ - pos: position{line: 1852, col: 17, offset: 65916}, - run: (*parser).callonQuoteBlockRawContent291, - expr: &seqExpr{ - pos: position{line: 1852, col: 17, offset: 65916}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1858, col: 31, offset: 66169}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1858, col: 38, offset: 66176}, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonDoubleQuoteItalicTextElement90, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonDoubleQuoteItalicTextElement92, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonDoubleQuoteItalicTextElement95, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 535, col: 27, offset: 17411}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent297, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1852, col: 44, offset: 65943}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1862, col: 27, offset: 66269}, - expr: &actionExpr{ - pos: position{line: 1862, col: 28, offset: 66270}, - run: (*parser).callonQuoteBlockRawContent306, - expr: &seqExpr{ - pos: position{line: 1862, col: 28, offset: 66270}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1862, col: 28, offset: 66270}, - expr: &choiceExpr{ - pos: position{line: 1860, col: 29, offset: 66216}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1860, col: 30, offset: 66217}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1860, col: 30, offset: 66217}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1860, col: 37, offset: 66224}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonDoubleQuoteItalicTextElement97, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonDoubleQuoteItalicTextElement101, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDoubleQuoteItalicTextElement105, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonDoubleQuoteItalicTextElement111, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent315, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, ignoreCase: false, - want: "\"\\t\"", + inverted: true, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteItalicTextElement116, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteItalicTextElement118, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonDoubleQuoteItalicTextElement121, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteItalicTextElement125, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteItalicTextElement132, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteItalicTextElement137, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteItalicTextElement139, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonDoubleQuoteItalicTextElement143, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteItalicTextElement147, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteItalicTextElement154, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteItalicTextElement159, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteItalicTextElement161, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonDoubleQuoteItalicTextElement165, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteItalicTextElement169, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, }, }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1862, col: 54, offset: 66296}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonQuoteBlockRawContent325, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonQuoteBlockRawContent331, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonDoubleQuoteItalicTextElement175, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 1860, col: 29, offset: 66216}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1860, col: 30, offset: 66217}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1860, col: 30, offset: 66217}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1860, col: 37, offset: 66224}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent345, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonDoubleQuoteItalicTextElement178, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonDoubleQuoteItalicTextElement182, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\">>\"", }, }, }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonDoubleQuoteItalicTextElement186, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, }, }, }, }, }, - &actionExpr{ - pos: position{line: 1870, col: 5, offset: 66553}, - run: (*parser).callonQuoteBlockRawContent354, - expr: &seqExpr{ - pos: position{line: 1870, col: 5, offset: 66553}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 1870, col: 5, offset: 66553}, - run: (*parser).callonQuoteBlockRawContent356, - }, - &litMatcher{ - pos: position{line: 1738, col: 29, offset: 62027}, - val: "____", + }, + }, + }, + &actionExpr{ + pos: position{line: 2683, col: 15, offset: 89501}, + run: (*parser).callonDoubleQuoteItalicTextElement188, + expr: &litMatcher{ + pos: position{line: 2683, col: 15, offset: 89501}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2689, col: 14, offset: 89616}, + run: (*parser).callonDoubleQuoteItalicTextElement190, + expr: &litMatcher{ + pos: position{line: 2689, col: 14, offset: 89616}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2693, col: 14, offset: 89692}, + run: (*parser).callonDoubleQuoteItalicTextElement192, + expr: &litMatcher{ + pos: position{line: 2693, col: 14, offset: 89692}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2697, col: 15, offset: 89770}, + run: (*parser).callonDoubleQuoteItalicTextElement194, + expr: &litMatcher{ + pos: position{line: 2697, col: 15, offset: 89770}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2701, col: 13, offset: 89845}, + run: (*parser).callonDoubleQuoteItalicTextElement196, + expr: &litMatcher{ + pos: position{line: 2701, col: 13, offset: 89845}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + run: (*parser).callonDoubleQuoteItalicTextElement198, + expr: &seqExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2709, col: 31, offset: 90160}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2709, col: 35, offset: 90164}, + expr: &charClassMatcher{ + pos: position{line: 2709, col: 36, offset: 90165}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1905, col: 11, offset: 63299}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 1906, col: 11, offset: 63321}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 1907, col: 11, offset: 63344}, + name: "QuotedTextInDoubleQuoteItalicText", + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonDoubleQuoteItalicTextElement207, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonDoubleQuoteItalicTextElement211, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1738, col: 36, offset: 62034}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent361, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + inverted: false, }, - &labeledExpr{ - pos: position{line: 1874, col: 30, offset: 66758}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1878, col: 25, offset: 66936}, - expr: &actionExpr{ - pos: position{line: 1878, col: 26, offset: 66937}, - run: (*parser).callonQuoteBlockRawContent370, - expr: &seqExpr{ - pos: position{line: 1878, col: 26, offset: 66937}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1878, col: 26, offset: 66937}, - expr: &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1740, col: 28, offset: 62098}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1740, col: 28, offset: 62098}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1740, col: 35, offset: 62105}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent379, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1878, col: 50, offset: 66961}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonQuoteBlockRawContent389, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonQuoteBlockRawContent395, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 1925, col: 5, offset: 63855}, + val: "[^\\r\\n_]", + chars: []rune{'\r', '\n', '_'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 1926, col: 7, offset: 63954}, + run: (*parser).callonDoubleQuoteItalicTextElement216, + expr: &seqExpr{ + pos: position{line: 1926, col: 7, offset: 63954}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1926, col: 7, offset: 63954}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonDoubleQuoteItalicTextElement219, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInDoubleQuoteItalicText", + pos: position{line: 1913, col: 1, offset: 63502}, + expr: &actionExpr{ + pos: position{line: 1914, col: 5, offset: 63544}, + run: (*parser).callonQuotedTextInDoubleQuoteItalicText1, + expr: &seqExpr{ + pos: position{line: 1914, col: 5, offset: 63544}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1914, col: 5, offset: 63544}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1914, col: 16, offset: 63555}, + expr: &ruleRefExpr{ + pos: position{line: 1914, col: 17, offset: 63556}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1915, col: 5, offset: 63582}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 1915, col: 11, offset: 63588}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1915, col: 11, offset: 63588}, + name: "SingleQuoteItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1916, col: 11, offset: 63620}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 1917, col: 11, offset: 63639}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1918, col: 11, offset: 63660}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1919, col: 11, offset: 63684}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1920, col: 11, offset: 63708}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "SingleQuoteItalicText", + pos: position{line: 1937, col: 1, offset: 64330}, + expr: &actionExpr{ + pos: position{line: 1938, col: 5, offset: 64360}, + run: (*parser).callonSingleQuoteItalicText1, + expr: &seqExpr{ + pos: position{line: 1938, col: 5, offset: 64360}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1933, col: 40, offset: 64281}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + &labeledExpr{ + pos: position{line: 1939, col: 5, offset: 64400}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1939, col: 15, offset: 64410}, + name: "SingleQuoteItalicTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1935, col: 38, offset: 64324}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + }, + }, + }, + }, + { + name: "SingleQuoteItalicTextElements", + pos: position{line: 1944, col: 1, offset: 64577}, + expr: &actionExpr{ + pos: position{line: 1945, col: 5, offset: 64615}, + run: (*parser).callonSingleQuoteItalicTextElements1, + expr: &seqExpr{ + pos: position{line: 1945, col: 5, offset: 64615}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1945, col: 5, offset: 64615}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + ¬Expr{ + pos: position{line: 1945, col: 10, offset: 64620}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuoteItalicTextElements7, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1946, col: 5, offset: 64659}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 1946, col: 14, offset: 64668}, + expr: &ruleRefExpr{ + pos: position{line: 1946, col: 15, offset: 64669}, + name: "SingleQuoteItalicTextElement", + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1947, col: 5, offset: 64704}, + run: (*parser).callonSingleQuoteItalicTextElements12, + }, + }, + }, + }, + }, + { + name: "SingleQuoteItalicTextElement", + pos: position{line: 1953, col: 1, offset: 64845}, + expr: &choiceExpr{ + pos: position{line: 1954, col: 5, offset: 64882}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1878, col: 5, offset: 62393}, + run: (*parser).callonSingleQuoteItalicTextElement2, + expr: &seqExpr{ + pos: position{line: 1878, col: 5, offset: 62393}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1878, col: 5, offset: 62393}, + expr: &charClassMatcher{ + pos: position{line: 1878, col: 5, offset: 62393}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 1878, col: 15, offset: 62403}, + expr: &choiceExpr{ + pos: position{line: 1878, col: 17, offset: 62405}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuoteItalicTextElement8, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1875, col: 24, offset: 62365}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonSingleQuoteItalicTextElement11, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 1956, col: 7, offset: 64916}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSingleQuoteItalicTextElement15, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1956, col: 15, offset: 64924}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSingleQuoteItalicTextElement21, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteItalicTextElement26, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteItalicTextElement28, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonSingleQuoteItalicTextElement31, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteItalicTextElement35, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1740, col: 28, offset: 62098}, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteItalicTextElement42, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1740, col: 28, offset: 62098}, - val: "____", + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", ignoreCase: false, - want: "\"____\"", + want: "\":\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1740, col: 35, offset: 62105}, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 515, col: 28, offset: 16703}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent409, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteItalicTextElement47, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteItalicTextElement49, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, - &ruleRefExpr{ - pos: position{line: 1761, col: 15, offset: 62736}, - name: "ExampleBlock", - }, - &ruleRefExpr{ - pos: position{line: 1762, col: 15, offset: 62763}, - name: "SidebarBlock", - }, - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonQuoteBlockRawContent420, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonSingleQuoteItalicTextElement53, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteItalicTextElement57, expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 162, col: 18, offset: 4814}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"////\"", + inverted: false, }, &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent428, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonQuoteBlockRawContent437, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteItalicTextElement64, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteItalicTextElement69, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteItalicTextElement71, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, - &actionExpr{ - pos: position{line: 1885, col: 21, offset: 67225}, - run: (*parser).callonQuoteBlockRawContent445, - expr: &seqExpr{ - pos: position{line: 1885, col: 21, offset: 67225}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1891, col: 35, offset: 67502}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1891, col: 42, offset: 67509}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonSingleQuoteItalicTextElement75, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteItalicTextElement79, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent451, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonSingleQuoteItalicTextElement85, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonSingleQuoteItalicTextElement87, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonSingleQuoteItalicTextElement90, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonSingleQuoteItalicTextElement92, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"<<\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonSingleQuoteItalicTextElement96, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuoteItalicTextElement100, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, }, - }, - }, - &labeledExpr{ - pos: position{line: 1885, col: 52, offset: 67256}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1895, col: 31, offset: 67610}, - expr: &actionExpr{ - pos: position{line: 1895, col: 32, offset: 67611}, - run: (*parser).callonQuoteBlockRawContent460, - expr: &seqExpr{ - pos: position{line: 1895, col: 32, offset: 67611}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1895, col: 32, offset: 67611}, - expr: &choiceExpr{ - pos: position{line: 1893, col: 33, offset: 67553}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1893, col: 34, offset: 67554}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1893, col: 34, offset: 67554}, - val: "++++", + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonSingleQuoteItalicTextElement106, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1893, col: 41, offset: 67561}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent469, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + inverted: true, }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, - }, - &labeledExpr{ - pos: position{line: 1895, col: 62, offset: 67641}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonQuoteBlockRawContent479, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteItalicTextElement111, expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, + pos: position{line: 493, col: 5, offset: 15857}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteItalicTextElement113, }, &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonQuoteBlockRawContent485, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonSingleQuoteItalicTextElement116, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteItalicTextElement120, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteItalicTextElement127, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteItalicTextElement132, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteItalicTextElement134, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonSingleQuoteItalicTextElement138, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteItalicTextElement142, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteItalicTextElement149, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteItalicTextElement154, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteItalicTextElement156, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonSingleQuoteItalicTextElement160, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteItalicTextElement164, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, }, }, }, @@ -35671,289 +46809,791 @@ var g = &grammar{ }, }, }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonSingleQuoteItalicTextElement170, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, }, }, }, }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, - &choiceExpr{ - pos: position{line: 1893, col: 33, offset: 67553}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1893, col: 34, offset: 67554}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1893, col: 34, offset: 67554}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1893, col: 41, offset: 67561}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent499, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonSingleQuoteItalicTextElement173, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonSingleQuoteItalicTextElement177, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, }, }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", }, }, }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1765, col: 15, offset: 62853}, - name: "Table", + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonSingleQuoteItalicTextElement181, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2683, col: 15, offset: 89501}, + run: (*parser).callonSingleQuoteItalicTextElement183, + expr: &litMatcher{ + pos: position{line: 2683, col: 15, offset: 89501}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2689, col: 14, offset: 89616}, + run: (*parser).callonSingleQuoteItalicTextElement185, + expr: &litMatcher{ + pos: position{line: 2689, col: 14, offset: 89616}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2693, col: 14, offset: 89692}, + run: (*parser).callonSingleQuoteItalicTextElement187, + expr: &litMatcher{ + pos: position{line: 2693, col: 14, offset: 89692}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2697, col: 15, offset: 89770}, + run: (*parser).callonSingleQuoteItalicTextElement189, + expr: &litMatcher{ + pos: position{line: 2697, col: 15, offset: 89770}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2701, col: 13, offset: 89845}, + run: (*parser).callonSingleQuoteItalicTextElement191, + expr: &litMatcher{ + pos: position{line: 2701, col: 13, offset: 89845}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + run: (*parser).callonSingleQuoteItalicTextElement193, + expr: &seqExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2709, col: 31, offset: 90160}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2709, col: 35, offset: 90164}, + expr: &charClassMatcher{ + pos: position{line: 2709, col: 36, offset: 90165}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1960, col: 7, offset: 65037}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 1961, col: 7, offset: 65055}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 1962, col: 7, offset: 65074}, + name: "QuotedTextInSingleQuoteItalicText", + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonSingleQuoteItalicTextElement202, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonSingleQuoteItalicTextElement206, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 1978, col: 5, offset: 65531}, + val: "[^\\r\\n _]", + chars: []rune{'\r', '\n', ' ', '_'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 1979, col: 7, offset: 65638}, + run: (*parser).callonSingleQuoteItalicTextElement211, + expr: &seqExpr{ + pos: position{line: 1979, col: 7, offset: 65638}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1979, col: 7, offset: 65638}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonSingleQuoteItalicTextElement214, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInSingleQuoteItalicText", + pos: position{line: 1966, col: 1, offset: 65179}, + expr: &actionExpr{ + pos: position{line: 1967, col: 5, offset: 65220}, + run: (*parser).callonQuotedTextInSingleQuoteItalicText1, + expr: &seqExpr{ + pos: position{line: 1967, col: 5, offset: 65220}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1967, col: 5, offset: 65220}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1967, col: 16, offset: 65231}, + expr: &ruleRefExpr{ + pos: position{line: 1967, col: 17, offset: 65232}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1968, col: 5, offset: 65258}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 1968, col: 11, offset: 65264}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1968, col: 11, offset: 65264}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 1969, col: 11, offset: 65283}, + name: "DoubleQuoteItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1970, col: 11, offset: 65315}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1971, col: 11, offset: 65336}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1972, col: 11, offset: 65360}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1973, col: 11, offset: 65384}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "EscapedItalicText", + pos: position{line: 1983, col: 1, offset: 65816}, + expr: &choiceExpr{ + pos: position{line: 1984, col: 5, offset: 65842}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1984, col: 5, offset: 65842}, + run: (*parser).callonEscapedItalicText2, + expr: &seqExpr{ + pos: position{line: 1984, col: 5, offset: 65842}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1984, col: 5, offset: 65842}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1741, col: 25, offset: 57692}, + run: (*parser).callonEscapedItalicText5, + expr: &seqExpr{ + pos: position{line: 1741, col: 25, offset: 57692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1741, col: 25, offset: 57692}, + val: "\\\\", + ignoreCase: false, + want: "\"\\\\\\\\\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1741, col: 30, offset: 57697}, + expr: &litMatcher{ + pos: position{line: 1741, col: 30, offset: 57697}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1984, col: 40, offset: 65877}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + &labeledExpr{ + pos: position{line: 1984, col: 45, offset: 65882}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1984, col: 55, offset: 65892}, + name: "DoubleQuoteItalicTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1984, col: 86, offset: 65923}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1986, col: 9, offset: 66080}, + run: (*parser).callonEscapedItalicText14, + expr: &seqExpr{ + pos: position{line: 1986, col: 9, offset: 66080}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1986, col: 9, offset: 66080}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + run: (*parser).callonEscapedItalicText17, + expr: &oneOrMoreExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + expr: &litMatcher{ + pos: position{line: 1737, col: 25, offset: 57619}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1986, col: 44, offset: 66115}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + &labeledExpr{ + pos: position{line: 1986, col: 49, offset: 66120}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1986, col: 59, offset: 66130}, + name: "SingleQuoteItalicTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1986, col: 90, offset: 66161}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1989, col: 9, offset: 66361}, + run: (*parser).callonEscapedItalicText24, + expr: &seqExpr{ + pos: position{line: 1989, col: 9, offset: 66361}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1989, col: 9, offset: 66361}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + run: (*parser).callonEscapedItalicText27, + expr: &oneOrMoreExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + expr: &litMatcher{ + pos: position{line: 1737, col: 25, offset: 57619}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1989, col: 44, offset: 66396}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + &labeledExpr{ + pos: position{line: 1989, col: 48, offset: 66400}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1989, col: 58, offset: 66410}, + name: "SingleQuoteItalicTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1989, col: 89, offset: 66441}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + }, + }, + }, + }, + }, + }, + { + name: "MonospaceText", + pos: position{line: 1996, col: 1, offset: 66760}, + expr: &choiceExpr{ + pos: position{line: 1996, col: 18, offset: 66777}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1996, col: 18, offset: 66777}, + name: "DoubleQuoteMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1996, col: 45, offset: 66804}, + name: "SingleQuoteMonospaceText", + }, + }, + }, + }, + { + name: "DoubleQuoteMonospaceText", + pos: position{line: 2010, col: 1, offset: 67156}, + expr: &actionExpr{ + pos: position{line: 2011, col: 5, offset: 67189}, + run: (*parser).callonDoubleQuoteMonospaceText1, + expr: &seqExpr{ + pos: position{line: 2011, col: 5, offset: 67189}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2008, col: 38, offset: 67150}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + &labeledExpr{ + pos: position{line: 2012, col: 5, offset: 67228}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2012, col: 15, offset: 67238}, + name: "DoubleQuoteMonospaceTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2008, col: 38, offset: 67150}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + }, + }, + }, + }, + { + name: "DoubleQuoteMonospaceTextElements", + pos: position{line: 2017, col: 1, offset: 67410}, + expr: &oneOrMoreExpr{ + pos: position{line: 2017, col: 37, offset: 67446}, + expr: &ruleRefExpr{ + pos: position{line: 2017, col: 37, offset: 67446}, + name: "DoubleQuoteMonospaceTextElement", + }, + }, + }, + { + name: "DoubleQuoteMonospaceTextElement", + pos: position{line: 2019, col: 1, offset: 67513}, + expr: &actionExpr{ + pos: position{line: 2020, col: 5, offset: 67553}, + run: (*parser).callonDoubleQuoteMonospaceTextElement1, + expr: &seqExpr{ + pos: position{line: 2020, col: 5, offset: 67553}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2020, col: 5, offset: 67553}, + expr: &litMatcher{ + pos: position{line: 2008, col: 38, offset: 67150}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + }, + &labeledExpr{ + pos: position{line: 2021, col: 5, offset: 67592}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2022, col: 9, offset: 67610}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2001, col: 5, offset: 66887}, + run: (*parser).callonDoubleQuoteMonospaceTextElement7, + expr: &seqExpr{ + pos: position{line: 2001, col: 5, offset: 66887}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2001, col: 5, offset: 66887}, + expr: &charClassMatcher{ + pos: position{line: 2001, col: 5, offset: 66887}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2001, col: 15, offset: 66897}, + expr: &choiceExpr{ + pos: position{line: 2001, col: 17, offset: 66899}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDoubleQuoteMonospaceTextElement13, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1998, col: 27, offset: 66856}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonDoubleQuoteMonospaceTextElement16, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 2024, col: 11, offset: 67688}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDoubleQuoteMonospaceTextElement20, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2024, col: 19, offset: 67696}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDoubleQuoteMonospaceTextElement26, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteMonospaceTextElement31, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteMonospaceTextElement33, }, - &actionExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, - run: (*parser).callonQuoteBlockRawContent509, - expr: &seqExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1904, col: 31, offset: 67955}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1904, col: 38, offset: 67962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonDoubleQuoteMonospaceTextElement36, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent515, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + want: "\"{counter:\"", }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1908, col: 44, offset: 68072}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1912, col: 27, offset: 68225}, - expr: &actionExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - run: (*parser).callonQuoteBlockRawContent524, - expr: &seqExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1912, col: 28, offset: 68226}, - expr: &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent533, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteMonospaceTextElement40, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, - &labeledExpr{ - pos: position{line: 1912, col: 54, offset: 68252}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonQuoteBlockRawContent543, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonQuoteBlockRawContent549, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteMonospaceTextElement47, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteMonospaceTextElement52, expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteMonospaceTextElement54, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -35964,575 +47604,1277 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, - &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonDoubleQuoteMonospaceTextElement58, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteMonospaceTextElement62, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent563, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - run: (*parser).callonQuoteBlockRawContent572, - expr: &seqExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - run: (*parser).callonQuoteBlockRawContent574, - }, - &labeledExpr{ - pos: position{line: 2120, col: 5, offset: 75117}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 2120, col: 11, offset: 75123}, - expr: &actionExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - run: (*parser).callonQuoteBlockRawContent577, - expr: &seqExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2128, col: 25, offset: 75365}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonQuoteBlockRawContent580, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteMonospaceTextElement69, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteMonospaceTextElement74, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent588, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteMonospaceTextElement76, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2128, col: 36, offset: 75376}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - run: (*parser).callonQuoteBlockRawContent596, - expr: &oneOrMoreExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - expr: &charClassMatcher{ - pos: position{line: 2128, col: 45, offset: 75385}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonDoubleQuoteMonospaceTextElement80, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteMonospaceTextElement84, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, }, }, }, - &actionExpr{ - pos: position{line: 2080, col: 31, offset: 73460}, - run: (*parser).callonQuoteBlockRawContent604, - expr: &labeledExpr{ - pos: position{line: 2080, col: 31, offset: 73460}, - label: "lines", - expr: &actionExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - run: (*parser).callonQuoteBlockRawContent606, - expr: &seqExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - label: "firstLine", - expr: &actionExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - run: (*parser).callonQuoteBlockRawContent609, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonDoubleQuoteMonospaceTextElement90, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonDoubleQuoteMonospaceTextElement92, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonDoubleQuoteMonospaceTextElement95, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonDoubleQuoteMonospaceTextElement97, expr: &seqExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, + pos: position{line: 535, col: 27, offset: 17411}, exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, &labeledExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - label: "line", + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", expr: &actionExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - run: (*parser).callonQuoteBlockRawContent612, - expr: &seqExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent617, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2091, col: 48, offset: 73971}, - expr: &charClassMatcher{ - pos: position{line: 2091, col: 48, offset: 73971}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonDoubleQuoteMonospaceTextElement101, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDoubleQuoteMonospaceTextElement105, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2087, col: 5, offset: 73803}, - label: "otherLines", - expr: &zeroOrMoreExpr{ - pos: position{line: 2087, col: 16, offset: 73814}, - expr: &actionExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - run: (*parser).callonQuoteBlockRawContent628, - expr: &seqExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2128, col: 25, offset: 75365}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonQuoteBlockRawContent631, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonDoubleQuoteMonospaceTextElement111, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent639, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + inverted: true, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteMonospaceTextElement116, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteMonospaceTextElement118, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonDoubleQuoteMonospaceTextElement121, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteMonospaceTextElement125, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteMonospaceTextElement132, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteMonospaceTextElement137, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteMonospaceTextElement139, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonDoubleQuoteMonospaceTextElement143, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteMonospaceTextElement147, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteMonospaceTextElement154, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteMonospaceTextElement159, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteMonospaceTextElement161, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonDoubleQuoteMonospaceTextElement165, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteMonospaceTextElement169, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, }, }, }, }, }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2128, col: 36, offset: 75376}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - run: (*parser).callonQuoteBlockRawContent647, - expr: &oneOrMoreExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - expr: &charClassMatcher{ - pos: position{line: 2128, col: 45, offset: 75385}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonDoubleQuoteMonospaceTextElement175, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonDoubleQuoteMonospaceTextElement178, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonDoubleQuoteMonospaceTextElement182, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + inverted: true, }, }, }, }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, }, }, }, }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonDoubleQuoteMonospaceTextElement186, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, - &actionExpr{ - pos: position{line: 2098, col: 39, offset: 74215}, - run: (*parser).callonQuoteBlockRawContent655, - expr: &seqExpr{ - pos: position{line: 2098, col: 39, offset: 74215}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", + }, + }, + }, + &actionExpr{ + pos: position{line: 2683, col: 15, offset: 89501}, + run: (*parser).callonDoubleQuoteMonospaceTextElement188, + expr: &litMatcher{ + pos: position{line: 2683, col: 15, offset: 89501}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2689, col: 14, offset: 89616}, + run: (*parser).callonDoubleQuoteMonospaceTextElement190, + expr: &litMatcher{ + pos: position{line: 2689, col: 14, offset: 89616}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2693, col: 14, offset: 89692}, + run: (*parser).callonDoubleQuoteMonospaceTextElement192, + expr: &litMatcher{ + pos: position{line: 2693, col: 14, offset: 89692}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2697, col: 15, offset: 89770}, + run: (*parser).callonDoubleQuoteMonospaceTextElement194, + expr: &litMatcher{ + pos: position{line: 2697, col: 15, offset: 89770}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2701, col: 13, offset: 89845}, + run: (*parser).callonDoubleQuoteMonospaceTextElement196, + expr: &litMatcher{ + pos: position{line: 2701, col: 13, offset: 89845}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + run: (*parser).callonDoubleQuoteMonospaceTextElement198, + expr: &seqExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2709, col: 31, offset: 90160}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2709, col: 35, offset: 90164}, + expr: &charClassMatcher{ + pos: position{line: 2709, col: 36, offset: 90165}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2028, col: 11, offset: 67825}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 2029, col: 11, offset: 67847}, + name: "QuotedString", + }, + &litMatcher{ + pos: position{line: 2687, col: 18, offset: 89580}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &ruleRefExpr{ + pos: position{line: 2031, col: 11, offset: 67937}, + name: "QuotedTextInDoubleQuoteMonospaceText", + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonDoubleQuoteMonospaceTextElement208, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonDoubleQuoteMonospaceTextElement212, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, - want: "\"....\"", + inverted: false, }, - &zeroOrMoreExpr{ - pos: position{line: 2098, col: 61, offset: 74237}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 2050, col: 5, offset: 68469}, + val: "[^\\r\\n`]", + chars: []rune{'\r', '\n', '`'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 2051, col: 7, offset: 68571}, + run: (*parser).callonDoubleQuoteMonospaceTextElement217, + expr: &seqExpr{ + pos: position{line: 2051, col: 7, offset: 68571}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2051, col: 7, offset: 68571}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonDoubleQuoteMonospaceTextElement220, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInDoubleQuoteMonospaceText", + pos: position{line: 2037, col: 1, offset: 68101}, + expr: &actionExpr{ + pos: position{line: 2038, col: 5, offset: 68145}, + run: (*parser).callonQuotedTextInDoubleQuoteMonospaceText1, + expr: &seqExpr{ + pos: position{line: 2038, col: 5, offset: 68145}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2038, col: 5, offset: 68145}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 2038, col: 16, offset: 68156}, + expr: &ruleRefExpr{ + pos: position{line: 2038, col: 17, offset: 68157}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 2039, col: 5, offset: 68183}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 2040, col: 9, offset: 68198}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2040, col: 9, offset: 68198}, + name: "SingleQuoteMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 2041, col: 11, offset: 68233}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 2042, col: 11, offset: 68252}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 2043, col: 11, offset: 68273}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 2044, col: 11, offset: 68294}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2045, col: 11, offset: 68318}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "SingleQuoteMonospaceText", + pos: position{line: 2064, col: 1, offset: 69057}, + expr: &actionExpr{ + pos: position{line: 2065, col: 5, offset: 69090}, + run: (*parser).callonSingleQuoteMonospaceText1, + expr: &seqExpr{ + pos: position{line: 2065, col: 5, offset: 69090}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2060, col: 43, offset: 69005}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + &labeledExpr{ + pos: position{line: 2066, col: 5, offset: 69134}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2066, col: 15, offset: 69144}, + name: "SingleQuoteMonospaceTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2062, col: 41, offset: 69051}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + }, + }, + }, + { + name: "SingleQuoteMonospaceTextElements", + pos: position{line: 2071, col: 1, offset: 69320}, + expr: &actionExpr{ + pos: position{line: 2072, col: 5, offset: 69361}, + run: (*parser).callonSingleQuoteMonospaceTextElements1, + expr: &seqExpr{ + pos: position{line: 2072, col: 5, offset: 69361}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2072, col: 5, offset: 69361}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + ¬Expr{ + pos: position{line: 2072, col: 10, offset: 69366}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuoteMonospaceTextElements7, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2073, col: 5, offset: 69405}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2073, col: 14, offset: 69414}, + expr: &ruleRefExpr{ + pos: position{line: 2073, col: 15, offset: 69415}, + name: "SingleQuoteMonospaceTextElement", + }, + }, + }, + &andCodeExpr{ + pos: position{line: 2074, col: 5, offset: 69453}, + run: (*parser).callonSingleQuoteMonospaceTextElements12, + }, + }, + }, + }, + }, + { + name: "SingleQuoteMonospaceTextElement", + pos: position{line: 2080, col: 1, offset: 69594}, + expr: &choiceExpr{ + pos: position{line: 2081, col: 5, offset: 69635}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2872, col: 5, offset: 95246}, + run: (*parser).callonSingleQuoteMonospaceTextElement2, + expr: &seqExpr{ + pos: position{line: 2872, col: 5, offset: 95246}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2872, col: 5, offset: 95246}, + expr: &charClassMatcher{ + pos: position{line: 2872, col: 5, offset: 95246}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2872, col: 15, offset: 95256}, + expr: &choiceExpr{ + pos: position{line: 2872, col: 17, offset: 95258}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2872, col: 17, offset: 95258}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2874, col: 9, offset: 95340}, + run: (*parser).callonSingleQuoteMonospaceTextElement11, + expr: &seqExpr{ + pos: position{line: 2874, col: 9, offset: 95340}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2874, col: 9, offset: 95340}, + expr: &charClassMatcher{ + pos: position{line: 2874, col: 9, offset: 95340}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 19, offset: 95350}, + expr: &seqExpr{ + pos: position{line: 2874, col: 20, offset: 95351}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2874, col: 20, offset: 95351}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 27, offset: 95358}, + expr: &charClassMatcher{ + pos: position{line: 2874, col: 27, offset: 95358}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonSingleQuoteMonospaceTextElement20, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 2083, col: 7, offset: 69660}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSingleQuoteMonospaceTextElement24, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2083, col: 15, offset: 69668}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSingleQuoteMonospaceTextElement30, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteMonospaceTextElement35, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteMonospaceTextElement37, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonSingleQuoteMonospaceTextElement40, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteMonospaceTextElement44, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent661, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2098, col: 76, offset: 74252}, - label: "lines", + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, expr: &actionExpr{ - pos: position{line: 2103, col: 44, offset: 74559}, - run: (*parser).callonQuoteBlockRawContent667, - expr: &labeledExpr{ - pos: position{line: 2103, col: 44, offset: 74559}, - label: "lines", - expr: &zeroOrMoreExpr{ - pos: position{line: 2103, col: 50, offset: 74565}, - expr: &actionExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - run: (*parser).callonQuoteBlockRawContent670, - expr: &seqExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - label: "line", - expr: &actionExpr{ - pos: position{line: 2108, col: 11, offset: 74711}, - run: (*parser).callonQuoteBlockRawContent673, - expr: &seqExpr{ - pos: position{line: 2108, col: 11, offset: 74711}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2108, col: 11, offset: 74711}, - expr: &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2108, col: 34, offset: 74734}, - expr: &charClassMatcher{ - pos: position{line: 2108, col: 34, offset: 74734}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteMonospaceTextElement51, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteMonospaceTextElement56, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteMonospaceTextElement58, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, }, @@ -36542,717 +48884,584 @@ var g = &grammar{ }, }, }, - &choiceExpr{ - pos: position{line: 2098, col: 125, offset: 74301}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 2098, col: 126, offset: 74302}, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonSingleQuoteMonospaceTextElement62, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteMonospaceTextElement66, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteMonospaceTextElement73, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", ignoreCase: false, - want: "\"....\"", + want: "\":\"", }, - &zeroOrMoreExpr{ - pos: position{line: 2098, col: 148, offset: 74324}, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 515, col: 28, offset: 16703}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent690, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteMonospaceTextElement78, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteMonospaceTextElement80, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, - &actionExpr{ - pos: position{line: 879, col: 6, offset: 28334}, - run: (*parser).callonQuoteBlockRawContent699, - expr: &seqExpr{ - pos: position{line: 879, col: 6, offset: 28334}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 879, col: 6, offset: 28334}, - label: "t", - expr: &choiceExpr{ - pos: position{line: 856, col: 19, offset: 27732}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 856, col: 19, offset: 27732}, - run: (*parser).callonQuoteBlockRawContent703, - expr: &litMatcher{ - pos: position{line: 856, col: 19, offset: 27732}, - val: "TIP", - ignoreCase: false, - want: "\"TIP\"", - }, - }, - &actionExpr{ - pos: position{line: 858, col: 5, offset: 27770}, - run: (*parser).callonQuoteBlockRawContent705, - expr: &litMatcher{ - pos: position{line: 858, col: 5, offset: 27770}, - val: "NOTE", - ignoreCase: false, - want: "\"NOTE\"", - }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonSingleQuoteMonospaceTextElement84, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteMonospaceTextElement88, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, - &actionExpr{ - pos: position{line: 860, col: 5, offset: 27810}, - run: (*parser).callonQuoteBlockRawContent707, - expr: &litMatcher{ - pos: position{line: 860, col: 5, offset: 27810}, - val: "IMPORTANT", + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"IMPORTANT\"", + inverted: false, }, }, - &actionExpr{ - pos: position{line: 862, col: 5, offset: 27860}, - run: (*parser).callonQuoteBlockRawContent709, - expr: &litMatcher{ - pos: position{line: 862, col: 5, offset: 27860}, - val: "WARNING", - ignoreCase: false, - want: "\"WARNING\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonSingleQuoteMonospaceTextElement94, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonSingleQuoteMonospaceTextElement96, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonSingleQuoteMonospaceTextElement99, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonSingleQuoteMonospaceTextElement101, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonSingleQuoteMonospaceTextElement105, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, }, }, - &actionExpr{ - pos: position{line: 864, col: 5, offset: 27906}, - run: (*parser).callonQuoteBlockRawContent711, - expr: &litMatcher{ - pos: position{line: 864, col: 5, offset: 27906}, - val: "CAUTION", + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuoteMonospaceTextElement109, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\"CAUTION\"", + inverted: false, }, }, }, - }, - }, - &litMatcher{ - pos: position{line: 879, col: 25, offset: 28353}, - val: ": ", - ignoreCase: false, - want: "\": \"", - }, - &labeledExpr{ - pos: position{line: 879, col: 30, offset: 28358}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 879, col: 36, offset: 28364}, - expr: &choiceExpr{ - pos: position{line: 879, col: 37, offset: 28365}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonQuoteBlockRawContent717, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent725, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonQuoteBlockRawContent734, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonSingleQuoteMonospaceTextElement115, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, }, }, }, }, }, - }, - }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonQuoteBlockRawContent742, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent755, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent767, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent779, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteMonospaceTextElement120, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteMonospaceTextElement122, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonSingleQuoteMonospaceTextElement125, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent791, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + want: "\"{counter:\"", }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteMonospaceTextElement129, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent803, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteMonospaceTextElement136, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteMonospaceTextElement141, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteMonospaceTextElement143, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", }, }, }, }, - }, - }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonSingleQuoteMonospaceTextElement147, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", ignoreCase: false, - want: "\" \"", + want: "\"{counter2:\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent815, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteMonospaceTextElement151, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteMonospaceTextElement158, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteMonospaceTextElement163, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteMonospaceTextElement165, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", }, }, }, }, - }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonSingleQuoteMonospaceTextElement169, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", ignoreCase: false, - want: "\" \"", + want: "\"{\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent827, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteMonospaceTextElement173, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", }, }, }, @@ -37262,690 +49471,803 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonQuoteBlockRawContent835, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonQuoteBlockRawContent843, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonSingleQuoteMonospaceTextElement179, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonSingleQuoteMonospaceTextElement182, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonSingleQuoteMonospaceTextElement186, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonSingleQuoteMonospaceTextElement190, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2683, col: 15, offset: 89501}, + run: (*parser).callonSingleQuoteMonospaceTextElement192, + expr: &litMatcher{ + pos: position{line: 2683, col: 15, offset: 89501}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2689, col: 14, offset: 89616}, + run: (*parser).callonSingleQuoteMonospaceTextElement194, + expr: &litMatcher{ + pos: position{line: 2689, col: 14, offset: 89616}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2693, col: 14, offset: 89692}, + run: (*parser).callonSingleQuoteMonospaceTextElement196, + expr: &litMatcher{ + pos: position{line: 2693, col: 14, offset: 89692}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2697, col: 15, offset: 89770}, + run: (*parser).callonSingleQuoteMonospaceTextElement198, + expr: &litMatcher{ + pos: position{line: 2697, col: 15, offset: 89770}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2701, col: 13, offset: 89845}, + run: (*parser).callonSingleQuoteMonospaceTextElement200, + expr: &litMatcher{ + pos: position{line: 2701, col: 13, offset: 89845}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + run: (*parser).callonSingleQuoteMonospaceTextElement202, + expr: &seqExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2709, col: 31, offset: 90160}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2709, col: 35, offset: 90164}, + expr: &charClassMatcher{ + pos: position{line: 2709, col: 36, offset: 90165}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2087, col: 7, offset: 69781}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 2088, col: 7, offset: 69799}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 2089, col: 7, offset: 69818}, + name: "QuotedTextInSingleQuoteMonospaceText", + }, + &litMatcher{ + pos: position{line: 2687, col: 18, offset: 89580}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonSingleQuoteMonospaceTextElement212, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonSingleQuoteMonospaceTextElement216, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2107, col: 5, offset: 70317}, + run: (*parser).callonSingleQuoteMonospaceTextElement220, + expr: &choiceExpr{ + pos: position{line: 2107, col: 6, offset: 70318}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2107, col: 6, offset: 70318}, + val: "[^\\r\\n` ]", + chars: []rune{'\r', '\n', '`', ' '}, + ignoreCase: false, + inverted: true, + }, + &seqExpr{ + pos: position{line: 2108, col: 7, offset: 70430}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1998, col: 27, offset: 66856}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonSingleQuoteMonospaceTextElement225, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInSingleQuoteMonospaceText", + pos: position{line: 2094, col: 1, offset: 69949}, + expr: &actionExpr{ + pos: position{line: 2095, col: 5, offset: 69993}, + run: (*parser).callonQuotedTextInSingleQuoteMonospaceText1, + expr: &seqExpr{ + pos: position{line: 2095, col: 5, offset: 69993}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2095, col: 5, offset: 69993}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 2095, col: 16, offset: 70004}, + expr: &ruleRefExpr{ + pos: position{line: 2095, col: 17, offset: 70005}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 2096, col: 5, offset: 70031}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 2097, col: 9, offset: 70046}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2097, col: 9, offset: 70046}, + name: "DoubleQuoteMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 2098, col: 11, offset: 70081}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 2099, col: 11, offset: 70100}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 2100, col: 11, offset: 70121}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 2101, col: 11, offset: 70142}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2102, col: 11, offset: 70166}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "EscapedMonospaceText", + pos: position{line: 2112, col: 1, offset: 70631}, + expr: &choiceExpr{ + pos: position{line: 2113, col: 5, offset: 70660}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2113, col: 5, offset: 70660}, + run: (*parser).callonEscapedMonospaceText2, + expr: &seqExpr{ + pos: position{line: 2113, col: 5, offset: 70660}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2113, col: 5, offset: 70660}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1741, col: 25, offset: 57692}, + run: (*parser).callonEscapedMonospaceText5, + expr: &seqExpr{ + pos: position{line: 1741, col: 25, offset: 57692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1741, col: 25, offset: 57692}, + val: "\\\\", + ignoreCase: false, + want: "\"\\\\\\\\\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1741, col: 30, offset: 57697}, + expr: &litMatcher{ + pos: position{line: 1741, col: 30, offset: 57697}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2113, col: 40, offset: 70695}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + &labeledExpr{ + pos: position{line: 2113, col: 45, offset: 70700}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2113, col: 55, offset: 70710}, + name: "DoubleQuoteMonospaceTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2113, col: 89, offset: 70744}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2115, col: 9, offset: 70901}, + run: (*parser).callonEscapedMonospaceText14, + expr: &seqExpr{ + pos: position{line: 2115, col: 9, offset: 70901}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2115, col: 9, offset: 70901}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + run: (*parser).callonEscapedMonospaceText17, + expr: &oneOrMoreExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + expr: &litMatcher{ + pos: position{line: 1737, col: 25, offset: 57619}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2115, col: 44, offset: 70936}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + &labeledExpr{ + pos: position{line: 2115, col: 49, offset: 70941}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2115, col: 59, offset: 70951}, + name: "SingleQuoteMonospaceTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2115, col: 93, offset: 70985}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2118, col: 9, offset: 71185}, + run: (*parser).callonEscapedMonospaceText24, + expr: &seqExpr{ + pos: position{line: 2118, col: 9, offset: 71185}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2118, col: 9, offset: 71185}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + run: (*parser).callonEscapedMonospaceText27, + expr: &oneOrMoreExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + expr: &litMatcher{ + pos: position{line: 1737, col: 25, offset: 57619}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2118, col: 44, offset: 71220}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + &labeledExpr{ + pos: position{line: 2118, col: 48, offset: 71224}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2118, col: 58, offset: 71234}, + name: "SingleQuoteMonospaceTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2118, col: 92, offset: 71268}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + }, + }, + }, + }, + }, + { + name: "MarkedText", + pos: position{line: 2125, col: 1, offset: 71565}, + expr: &choiceExpr{ + pos: position{line: 2125, col: 15, offset: 71579}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2125, col: 15, offset: 71579}, + name: "DoubleQuoteMarkedText", + }, + &ruleRefExpr{ + pos: position{line: 2125, col: 39, offset: 71603}, + name: "SingleQuoteMarkedText", + }, + }, + }, + }, + { + name: "DoubleQuoteMarkedText", + pos: position{line: 2139, col: 1, offset: 71941}, + expr: &actionExpr{ + pos: position{line: 2140, col: 5, offset: 71971}, + run: (*parser).callonDoubleQuoteMarkedText1, + expr: &seqExpr{ + pos: position{line: 2140, col: 5, offset: 71971}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2137, col: 35, offset: 71935}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + &labeledExpr{ + pos: position{line: 2141, col: 5, offset: 72007}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2141, col: 15, offset: 72017}, + name: "DoubleQuoteMarkedTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2137, col: 35, offset: 71935}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + }, + }, + }, + }, + { + name: "DoubleQuoteMarkedTextElements", + pos: position{line: 2146, col: 1, offset: 72180}, + expr: &zeroOrMoreExpr{ + pos: position{line: 2146, col: 34, offset: 72213}, + expr: &ruleRefExpr{ + pos: position{line: 2146, col: 34, offset: 72213}, + name: "DoubleQuoteMarkedTextElement", + }, + }, + }, + { + name: "DoubleQuoteMarkedTextElement", + pos: position{line: 2148, col: 1, offset: 72244}, + expr: &actionExpr{ + pos: position{line: 2149, col: 5, offset: 72313}, + run: (*parser).callonDoubleQuoteMarkedTextElement1, + expr: &seqExpr{ + pos: position{line: 2149, col: 5, offset: 72313}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2149, col: 5, offset: 72313}, + expr: &litMatcher{ + pos: position{line: 2137, col: 35, offset: 71935}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + }, + &labeledExpr{ + pos: position{line: 2150, col: 5, offset: 72349}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2151, col: 9, offset: 72367}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2130, col: 5, offset: 71677}, + run: (*parser).callonDoubleQuoteMarkedTextElement7, + expr: &seqExpr{ + pos: position{line: 2130, col: 5, offset: 71677}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2130, col: 5, offset: 71677}, + expr: &charClassMatcher{ + pos: position{line: 2130, col: 5, offset: 71677}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2130, col: 19, offset: 71691}, + expr: &choiceExpr{ + pos: position{line: 2130, col: 21, offset: 71693}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDoubleQuoteMarkedTextElement13, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, + &litMatcher{ + pos: position{line: 2127, col: 24, offset: 71649}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, }, }, }, - &actionExpr{ - pos: position{line: 884, col: 5, offset: 28625}, - run: (*parser).callonQuoteBlockRawContent844, - expr: &seqExpr{ - pos: position{line: 884, col: 5, offset: 28625}, - exprs: []interface{}{ + }, + }, + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonDoubleQuoteMarkedTextElement16, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 2153, col: 11, offset: 72442}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDoubleQuoteMarkedTextElement20, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2153, col: 19, offset: 72450}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDoubleQuoteMarkedTextElement26, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 884, col: 5, offset: 28625}, - val: "> ", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\"> \"", + want: "\"\\n\"", }, - &labeledExpr{ - pos: position{line: 884, col: 10, offset: 28630}, - label: "content", - expr: &oneOrMoreExpr{ - pos: position{line: 899, col: 33, offset: 29398}, - expr: &actionExpr{ - pos: position{line: 899, col: 34, offset: 29399}, - run: (*parser).callonQuoteBlockRawContent849, - expr: &seqExpr{ - pos: position{line: 899, col: 34, offset: 29399}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 899, col: 34, offset: 29399}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonQuoteBlockRawContent852, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent860, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteMarkedTextElement31, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteMarkedTextElement33, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonDoubleQuoteMarkedTextElement36, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteMarkedTextElement40, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, - }, - }, - &zeroOrOneExpr{ - pos: position{line: 899, col: 45, offset: 29410}, - expr: &litMatcher{ - pos: position{line: 899, col: 45, offset: 29410}, - val: "> ", - ignoreCase: false, - want: "\"> \"", - }, - }, - &labeledExpr{ - pos: position{line: 899, col: 51, offset: 29416}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonQuoteBlockRawContent870, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonQuoteBlockRawContent876, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - run: (*parser).callonQuoteBlockRawContent884, - expr: &seqExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - run: (*parser).callonQuoteBlockRawContent886, - }, - &labeledExpr{ - pos: position{line: 891, col: 7, offset: 29028}, - label: "content", - expr: &oneOrMoreExpr{ - pos: position{line: 891, col: 15, offset: 29036}, - expr: &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonQuoteBlockRawContent889, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent902, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent914, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent926, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent938, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent950, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteMarkedTextElement47, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent962, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteMarkedTextElement52, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteMarkedTextElement54, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent974, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + inverted: false, }, }, }, @@ -37955,132 +50277,110 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonQuoteBlockRawContent982, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonDoubleQuoteMarkedTextElement58, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteMarkedTextElement62, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonQuoteBlockRawContent990, - }, }, }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 895, col: 5, offset: 29222}, - run: (*parser).callonQuoteBlockRawContent991, - expr: &labeledExpr{ - pos: position{line: 895, col: 5, offset: 29222}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 895, col: 11, offset: 29228}, - expr: &choiceExpr{ - pos: position{line: 895, col: 12, offset: 29229}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonQuoteBlockRawContent995, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteMarkedTextElement69, expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 515, col: 17, offset: 16692}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", ignoreCase: false, - want: "\"////\"", + want: "\":\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 515, col: 28, offset: 16703}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent1003, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteMarkedTextElement74, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteMarkedTextElement76, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, @@ -38088,629 +50388,558 @@ var g = &grammar{ }, }, }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonQuoteBlockRawContent1012, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonDoubleQuoteMarkedTextElement80, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteMarkedTextElement84, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonQuoteBlockRawContent1020, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent1033, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent1045, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent1057, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent1069, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent1081, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonDoubleQuoteMarkedTextElement90, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonDoubleQuoteMarkedTextElement92, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonDoubleQuoteMarkedTextElement95, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonDoubleQuoteMarkedTextElement97, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonDoubleQuoteMarkedTextElement101, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, }, }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent1093, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDoubleQuoteMarkedTextElement105, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonDoubleQuoteMarkedTextElement111, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent1105, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, ignoreCase: false, - want: "\"\\t\"", + inverted: true, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteMarkedTextElement116, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuoteMarkedTextElement118, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonDoubleQuoteMarkedTextElement121, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteMarkedTextElement125, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteMarkedTextElement132, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteMarkedTextElement137, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteMarkedTextElement139, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonDoubleQuoteMarkedTextElement143, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteMarkedTextElement147, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuoteMarkedTextElement154, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuoteMarkedTextElement159, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuoteMarkedTextElement161, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonDoubleQuoteMarkedTextElement165, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuoteMarkedTextElement169, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, }, }, }, }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonDoubleQuoteMarkedTextElement175, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, }, }, }, }, - }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonQuoteBlockRawContent1113, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonDoubleQuoteMarkedTextElement178, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonDoubleQuoteMarkedTextElement182, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, }, }, }, - }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonQuoteBlockRawContent1121, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1769, col: 15, offset: 62955}, - run: (*parser).callonQuoteBlockRawContent1122, - expr: &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1740, col: 28, offset: 62098}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1740, col: 28, offset: 62098}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1740, col: 35, offset: 62105}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent1129, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", ignoreCase: false, - want: "\"\\t\"", + want: "\">>\"", }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonDoubleQuoteMarkedTextElement186, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, }, }, }, @@ -38719,6 +50948,177 @@ var g = &grammar{ }, }, }, + &actionExpr{ + pos: position{line: 2683, col: 15, offset: 89501}, + run: (*parser).callonDoubleQuoteMarkedTextElement188, + expr: &litMatcher{ + pos: position{line: 2683, col: 15, offset: 89501}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2689, col: 14, offset: 89616}, + run: (*parser).callonDoubleQuoteMarkedTextElement190, + expr: &litMatcher{ + pos: position{line: 2689, col: 14, offset: 89616}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2693, col: 14, offset: 89692}, + run: (*parser).callonDoubleQuoteMarkedTextElement192, + expr: &litMatcher{ + pos: position{line: 2693, col: 14, offset: 89692}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2697, col: 15, offset: 89770}, + run: (*parser).callonDoubleQuoteMarkedTextElement194, + expr: &litMatcher{ + pos: position{line: 2697, col: 15, offset: 89770}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2701, col: 13, offset: 89845}, + run: (*parser).callonDoubleQuoteMarkedTextElement196, + expr: &litMatcher{ + pos: position{line: 2701, col: 13, offset: 89845}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + run: (*parser).callonDoubleQuoteMarkedTextElement198, + expr: &seqExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2709, col: 31, offset: 90160}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2709, col: 35, offset: 90164}, + expr: &charClassMatcher{ + pos: position{line: 2709, col: 36, offset: 90165}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2157, col: 11, offset: 72579}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 2158, col: 11, offset: 72601}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 2159, col: 11, offset: 72624}, + name: "QuotedTextInDoubleMarkedBoldText", + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonDoubleQuoteMarkedTextElement207, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonDoubleQuoteMarkedTextElement211, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 2179, col: 5, offset: 73139}, + val: "[^\\r\\n#]", + chars: []rune{'\r', '\n', '#'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 2180, col: 7, offset: 73238}, + run: (*parser).callonDoubleQuoteMarkedTextElement216, + expr: &seqExpr{ + pos: position{line: 2180, col: 7, offset: 73238}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2137, col: 35, offset: 71935}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonDoubleQuoteMarkedTextElement219, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, }, }, }, @@ -38727,998 +51127,969 @@ var g = &grammar{ }, }, { - name: "SidebarBlock", - pos: position{line: 1784, col: 1, offset: 63513}, + name: "QuotedTextInDoubleMarkedBoldText", + pos: position{line: 2166, col: 1, offset: 72778}, expr: &actionExpr{ - pos: position{line: 1784, col: 17, offset: 63529}, - run: (*parser).callonSidebarBlock1, + pos: position{line: 2167, col: 5, offset: 72818}, + run: (*parser).callonQuotedTextInDoubleMarkedBoldText1, expr: &seqExpr{ - pos: position{line: 1784, col: 17, offset: 63529}, + pos: position{line: 2167, col: 5, offset: 72818}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1790, col: 31, offset: 63782}, - val: "****", - ignoreCase: false, - want: "\"****\"", + &labeledExpr{ + pos: position{line: 2167, col: 5, offset: 72818}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 2167, col: 16, offset: 72829}, + expr: &ruleRefExpr{ + pos: position{line: 2167, col: 17, offset: 72830}, + name: "LongHandAttributes", + }, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 1790, col: 38, offset: 63789}, + &labeledExpr{ + pos: position{line: 2168, col: 5, offset: 72856}, + label: "text", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2169, col: 9, offset: 72871}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &ruleRefExpr{ + pos: position{line: 2169, col: 9, offset: 72871}, + name: "SingleQuoteMarkedText", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlock7, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &ruleRefExpr{ + pos: position{line: 2170, col: 11, offset: 72903}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 2171, col: 11, offset: 72922}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 2172, col: 11, offset: 72943}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 2173, col: 11, offset: 72967}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2174, col: 11, offset: 72991}, + name: "SuperscriptText", }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", + }, + }, + }, + }, + { + name: "SingleQuoteMarkedText", + pos: position{line: 2191, col: 1, offset: 73645}, + expr: &actionExpr{ + pos: position{line: 2192, col: 5, offset: 73675}, + run: (*parser).callonSingleQuoteMarkedText1, + expr: &seqExpr{ + pos: position{line: 2192, col: 5, offset: 73675}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2187, col: 40, offset: 73597}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, + &labeledExpr{ + pos: position{line: 2193, col: 5, offset: 73715}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2193, col: 15, offset: 73725}, + name: "SingleQuoteMarkedTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2189, col: 38, offset: 73639}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, + }, + }, + }, + }, + { + name: "SingleQuoteMarkedTextElements", + pos: position{line: 2198, col: 1, offset: 73892}, + expr: &actionExpr{ + pos: position{line: 2199, col: 5, offset: 73930}, + run: (*parser).callonSingleQuoteMarkedTextElements1, + expr: &seqExpr{ + pos: position{line: 2199, col: 5, offset: 73930}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2199, col: 5, offset: 73930}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + }, + }, + ¬Expr{ + pos: position{line: 2199, col: 10, offset: 73935}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuoteMarkedTextElements7, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + }, + &labeledExpr{ + pos: position{line: 2200, col: 5, offset: 73974}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2200, col: 14, offset: 73983}, + expr: &ruleRefExpr{ + pos: position{line: 2200, col: 15, offset: 73984}, + name: "SingleQuoteMarkedTextElement", + }, + }, + }, + &andCodeExpr{ + pos: position{line: 2201, col: 5, offset: 74020}, + run: (*parser).callonSingleQuoteMarkedTextElements12, + }, + }, + }, + }, + }, + { + name: "SingleQuoteMarkedTextElement", + pos: position{line: 2207, col: 1, offset: 74161}, + expr: &choiceExpr{ + pos: position{line: 2208, col: 5, offset: 74198}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2130, col: 5, offset: 71677}, + run: (*parser).callonSingleQuoteMarkedTextElement2, + expr: &seqExpr{ + pos: position{line: 2130, col: 5, offset: 71677}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2130, col: 5, offset: 71677}, + expr: &charClassMatcher{ + pos: position{line: 2130, col: 5, offset: 71677}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2130, col: 19, offset: 71691}, + expr: &choiceExpr{ + pos: position{line: 2130, col: 21, offset: 71693}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuoteMarkedTextElement8, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 2127, col: 24, offset: 71649}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, + }, }, }, }, }, - &labeledExpr{ - pos: position{line: 1784, col: 44, offset: 63556}, - label: "content", - expr: &ruleRefExpr{ - pos: position{line: 1784, col: 53, offset: 63565}, - name: "SidebarBlockRawContent", + }, + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonSingleQuoteMarkedTextElement11, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, - &choiceExpr{ - pos: position{line: 1792, col: 29, offset: 63829}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1792, col: 30, offset: 63830}, - exprs: []interface{}{ + }, + &seqExpr{ + pos: position{line: 2210, col: 7, offset: 74232}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSingleQuoteMarkedTextElement15, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1792, col: 30, offset: 63830}, - val: "****", + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", ignoreCase: false, - want: "\"****\"", + want: "\"\\n\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1792, col: 37, offset: 63837}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlock22, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + ¬Expr{ + pos: position{line: 2210, col: 15, offset: 74240}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSingleQuoteMarkedTextElement21, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, - }, - }, - }, - }, - }, - { - name: "SidebarBlockRawContent", - pos: position{line: 1794, col: 1, offset: 63856}, - expr: &actionExpr{ - pos: position{line: 1795, col: 5, offset: 63886}, - run: (*parser).callonSidebarBlockRawContent1, - expr: &labeledExpr{ - pos: position{line: 1795, col: 5, offset: 63886}, - label: "elements", - expr: &zeroOrMoreExpr{ - pos: position{line: 1795, col: 14, offset: 63895}, - expr: &actionExpr{ - pos: position{line: 1796, col: 9, offset: 63905}, - run: (*parser).callonSidebarBlockRawContent4, - expr: &seqExpr{ - pos: position{line: 1796, col: 9, offset: 63905}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1796, col: 9, offset: 63905}, - expr: &choiceExpr{ - pos: position{line: 1792, col: 29, offset: 63829}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1792, col: 30, offset: 63830}, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteMarkedTextElement26, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteMarkedTextElement28, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonSingleQuoteMarkedTextElement31, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1792, col: 30, offset: 63830}, - val: "****", + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", ignoreCase: false, - want: "\"****\"", + want: "\"{counter:\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1792, col: 37, offset: 63837}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent13, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteMarkedTextElement35, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteMarkedTextElement42, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteMarkedTextElement47, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteMarkedTextElement49, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1797, col: 9, offset: 63940}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 1797, col: 20, offset: 63951}, - expr: &ruleRefExpr{ - pos: position{line: 1797, col: 21, offset: 63952}, - name: "BlockAttributes", }, - }, - }, - &stateCodeExpr{ - pos: position{line: 1798, col: 9, offset: 63978}, - run: (*parser).callonSidebarBlockRawContent25, - }, - &labeledExpr{ - pos: position{line: 1802, col: 9, offset: 64076}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 1802, col: 18, offset: 64085}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1802, col: 18, offset: 64085}, - name: "LabeledListItem", - }, - &actionExpr{ - pos: position{line: 920, col: 5, offset: 29951}, - run: (*parser).callonSidebarBlockRawContent29, - expr: &seqExpr{ - pos: position{line: 920, col: 5, offset: 29951}, - exprs: []interface{}{ - ¬CodeExpr{ - pos: position{line: 920, col: 5, offset: 29951}, - run: (*parser).callonSidebarBlockRawContent31, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonSingleQuoteMarkedTextElement53, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteMarkedTextElement57, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, - &labeledExpr{ - pos: position{line: 923, col: 5, offset: 30081}, - label: "firstLine", + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, expr: &actionExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - run: (*parser).callonSidebarBlockRawContent33, + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteMarkedTextElement64, expr: &seqExpr{ - pos: position{line: 929, col: 5, offset: 30339}, + pos: position{line: 515, col: 17, offset: 16692}, exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, &labeledExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - label: "content", - expr: &actionExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - run: (*parser).callonSidebarBlockRawContent36, - expr: &seqExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - label: "elements", - expr: &choiceExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonSidebarBlockRawContent40, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonSidebarBlockRawContent49, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteMarkedTextElement69, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, }, - &zeroOrMoreExpr{ - pos: position{line: 929, col: 28, offset: 30362}, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteMarkedTextElement71, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, expr: &charClassMatcher{ - pos: position{line: 929, col: 28, offset: 30362}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonSingleQuoteMarkedTextElement75, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteMarkedTextElement79, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, - &labeledExpr{ - pos: position{line: 924, col: 5, offset: 30118}, - label: "otherLines", - expr: &zeroOrMoreExpr{ - pos: position{line: 924, col: 16, offset: 30129}, - expr: &choiceExpr{ - pos: position{line: 924, col: 17, offset: 30130}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonSidebarBlockRawContent68, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent76, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonSidebarBlockRawContent85, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonSingleQuoteMarkedTextElement85, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonSingleQuoteMarkedTextElement87, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonSingleQuoteMarkedTextElement90, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonSingleQuoteMarkedTextElement92, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonSingleQuoteMarkedTextElement96, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuoteMarkedTextElement100, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonSingleQuoteMarkedTextElement106, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonSidebarBlockRawContent93, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent106, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteMarkedTextElement111, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuoteMarkedTextElement113, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonSingleQuoteMarkedTextElement116, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", ignoreCase: false, - want: "\" \"", + want: "\"{counter:\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent118, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteMarkedTextElement120, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteMarkedTextElement127, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteMarkedTextElement132, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteMarkedTextElement134, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent130, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + want: "\"}\"", }, }, }, }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonSingleQuoteMarkedTextElement138, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", ignoreCase: false, - want: "\" \"", + want: "\"{counter2:\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent142, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteMarkedTextElement142, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuoteMarkedTextElement149, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuoteMarkedTextElement154, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuoteMarkedTextElement156, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent154, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + want: "\"}\"", }, }, }, }, - }, - }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonSingleQuoteMarkedTextElement160, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", ignoreCase: false, - want: "\" \"", + want: "\"{\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent166, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuoteMarkedTextElement164, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent178, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + want: "\"}\"", }, }, }, @@ -39728,418 +52099,1152 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonSidebarBlockRawContent186, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonSidebarBlockRawContent194, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonSingleQuoteMarkedTextElement170, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonSingleQuoteMarkedTextElement173, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonSingleQuoteMarkedTextElement177, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, }, }, }, - &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonSidebarBlockRawContent195, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent203, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonSingleQuoteMarkedTextElement181, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2683, col: 15, offset: 89501}, + run: (*parser).callonSingleQuoteMarkedTextElement183, + expr: &litMatcher{ + pos: position{line: 2683, col: 15, offset: 89501}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2689, col: 14, offset: 89616}, + run: (*parser).callonSingleQuoteMarkedTextElement185, + expr: &litMatcher{ + pos: position{line: 2689, col: 14, offset: 89616}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2693, col: 14, offset: 89692}, + run: (*parser).callonSingleQuoteMarkedTextElement187, + expr: &litMatcher{ + pos: position{line: 2693, col: 14, offset: 89692}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2697, col: 15, offset: 89770}, + run: (*parser).callonSingleQuoteMarkedTextElement189, + expr: &litMatcher{ + pos: position{line: 2697, col: 15, offset: 89770}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2701, col: 13, offset: 89845}, + run: (*parser).callonSingleQuoteMarkedTextElement191, + expr: &litMatcher{ + pos: position{line: 2701, col: 13, offset: 89845}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + run: (*parser).callonSingleQuoteMarkedTextElement193, + expr: &seqExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2709, col: 31, offset: 90160}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2709, col: 35, offset: 90164}, + expr: &charClassMatcher{ + pos: position{line: 2709, col: 36, offset: 90165}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2214, col: 7, offset: 74353}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 2215, col: 7, offset: 74371}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 2216, col: 7, offset: 74390}, + name: "QuotedTextInSingleQuoteMarkedText", + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonSingleQuoteMarkedTextElement202, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonSingleQuoteMarkedTextElement206, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 2233, col: 5, offset: 74857}, + val: "[^\\r\\n #]", + chars: []rune{'\r', '\n', ' ', '#'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 2234, col: 7, offset: 74962}, + run: (*parser).callonSingleQuoteMarkedTextElement211, + expr: &seqExpr{ + pos: position{line: 2234, col: 7, offset: 74962}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2234, col: 7, offset: 74962}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonSingleQuoteMarkedTextElement214, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInSingleQuoteMarkedText", + pos: position{line: 2220, col: 1, offset: 74495}, + expr: &actionExpr{ + pos: position{line: 2221, col: 5, offset: 74536}, + run: (*parser).callonQuotedTextInSingleQuoteMarkedText1, + expr: &seqExpr{ + pos: position{line: 2221, col: 5, offset: 74536}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2221, col: 5, offset: 74536}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 2221, col: 16, offset: 74547}, + expr: &ruleRefExpr{ + pos: position{line: 2221, col: 17, offset: 74548}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 2222, col: 5, offset: 74574}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 2223, col: 9, offset: 74589}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2223, col: 9, offset: 74589}, + name: "DoubleQuoteMarkedText", + }, + &ruleRefExpr{ + pos: position{line: 2224, col: 11, offset: 74621}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 2225, col: 11, offset: 74640}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 2226, col: 11, offset: 74661}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 2227, col: 11, offset: 74685}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2228, col: 11, offset: 74709}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "EscapedMarkedText", + pos: position{line: 2238, col: 1, offset: 75137}, + expr: &choiceExpr{ + pos: position{line: 2239, col: 5, offset: 75162}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2239, col: 5, offset: 75162}, + run: (*parser).callonEscapedMarkedText2, + expr: &seqExpr{ + pos: position{line: 2239, col: 5, offset: 75162}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2239, col: 5, offset: 75162}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1741, col: 25, offset: 57692}, + run: (*parser).callonEscapedMarkedText5, + expr: &seqExpr{ + pos: position{line: 1741, col: 25, offset: 57692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1741, col: 25, offset: 57692}, + val: "\\\\", + ignoreCase: false, + want: "\"\\\\\\\\\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1741, col: 30, offset: 57697}, + expr: &litMatcher{ + pos: position{line: 1741, col: 30, offset: 57697}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2239, col: 40, offset: 75197}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + &labeledExpr{ + pos: position{line: 2239, col: 45, offset: 75202}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2239, col: 55, offset: 75212}, + name: "DoubleQuoteMarkedTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2239, col: 86, offset: 75243}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2241, col: 9, offset: 75400}, + run: (*parser).callonEscapedMarkedText14, + expr: &seqExpr{ + pos: position{line: 2241, col: 9, offset: 75400}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2241, col: 9, offset: 75400}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + run: (*parser).callonEscapedMarkedText17, + expr: &oneOrMoreExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + expr: &litMatcher{ + pos: position{line: 1737, col: 25, offset: 57619}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2241, col: 44, offset: 75435}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + &labeledExpr{ + pos: position{line: 2241, col: 49, offset: 75440}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2241, col: 59, offset: 75450}, + name: "SingleQuoteMarkedTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2241, col: 90, offset: 75481}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2244, col: 9, offset: 75681}, + run: (*parser).callonEscapedMarkedText24, + expr: &seqExpr{ + pos: position{line: 2244, col: 9, offset: 75681}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2244, col: 9, offset: 75681}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + run: (*parser).callonEscapedMarkedText27, + expr: &oneOrMoreExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + expr: &litMatcher{ + pos: position{line: 1737, col: 25, offset: 57619}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2244, col: 44, offset: 75716}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, + &labeledExpr{ + pos: position{line: 2244, col: 48, offset: 75720}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2244, col: 58, offset: 75730}, + name: "SingleQuoteMarkedTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2244, col: 89, offset: 75761}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, + }, + }, + }, + }, + }, + }, + { + name: "SubscriptText", + pos: position{line: 2251, col: 1, offset: 76073}, + expr: &actionExpr{ + pos: position{line: 2252, col: 5, offset: 76095}, + run: (*parser).callonSubscriptText1, + expr: &seqExpr{ + pos: position{line: 2252, col: 5, offset: 76095}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2258, col: 27, offset: 76310}, + val: "~", + ignoreCase: false, + want: "\"~\"", + }, + &labeledExpr{ + pos: position{line: 2253, col: 5, offset: 76122}, + label: "element", + expr: &ruleRefExpr{ + pos: position{line: 2253, col: 14, offset: 76131}, + name: "SubscriptTextElement", + }, + }, + &litMatcher{ + pos: position{line: 2258, col: 27, offset: 76310}, + val: "~", + ignoreCase: false, + want: "\"~\"", + }, + }, + }, + }, + }, + { + name: "SubscriptTextElement", + pos: position{line: 2260, col: 1, offset: 76315}, + expr: &choiceExpr{ + pos: position{line: 2260, col: 25, offset: 76339}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2260, col: 25, offset: 76339}, + name: "QuotedText", + }, + &actionExpr{ + pos: position{line: 2262, col: 21, offset: 76391}, + run: (*parser).callonSubscriptTextElement3, + expr: &oneOrMoreExpr{ + pos: position{line: 2262, col: 21, offset: 76391}, + expr: &charClassMatcher{ + pos: position{line: 2262, col: 21, offset: 76391}, + val: "[^\\r\\n ~]", + chars: []rune{'\r', '\n', ' ', '~'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + { + name: "EscapedSubscriptText", + pos: position{line: 2266, col: 1, offset: 76476}, + expr: &actionExpr{ + pos: position{line: 2267, col: 5, offset: 76505}, + run: (*parser).callonEscapedSubscriptText1, + expr: &seqExpr{ + pos: position{line: 2267, col: 5, offset: 76505}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2267, col: 5, offset: 76505}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + run: (*parser).callonEscapedSubscriptText4, + expr: &oneOrMoreExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + expr: &litMatcher{ + pos: position{line: 1737, col: 25, offset: 57619}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2258, col: 27, offset: 76310}, + val: "~", + ignoreCase: false, + want: "\"~\"", + }, + &labeledExpr{ + pos: position{line: 2269, col: 5, offset: 76573}, + label: "element", + expr: &ruleRefExpr{ + pos: position{line: 2269, col: 14, offset: 76582}, + name: "SubscriptTextElement", + }, + }, + &litMatcher{ + pos: position{line: 2258, col: 27, offset: 76310}, + val: "~", + ignoreCase: false, + want: "\"~\"", + }, + }, + }, + }, + }, + { + name: "SuperscriptText", + pos: position{line: 2277, col: 1, offset: 76845}, + expr: &actionExpr{ + pos: position{line: 2278, col: 5, offset: 76869}, + run: (*parser).callonSuperscriptText1, + expr: &seqExpr{ + pos: position{line: 2278, col: 5, offset: 76869}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2284, col: 29, offset: 77096}, + val: "^", + ignoreCase: false, + want: "\"^\"", + }, + &labeledExpr{ + pos: position{line: 2279, col: 5, offset: 76899}, + label: "element", + expr: &ruleRefExpr{ + pos: position{line: 2279, col: 14, offset: 76908}, + name: "SuperscriptTextElement", + }, + }, + &litMatcher{ + pos: position{line: 2284, col: 29, offset: 77096}, + val: "^", + ignoreCase: false, + want: "\"^\"", + }, + }, + }, + }, + }, + { + name: "SuperscriptTextElement", + pos: position{line: 2286, col: 1, offset: 77101}, + expr: &choiceExpr{ + pos: position{line: 2286, col: 27, offset: 77127}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2286, col: 27, offset: 77127}, + name: "QuotedText", + }, + &actionExpr{ + pos: position{line: 2288, col: 23, offset: 77183}, + run: (*parser).callonSuperscriptTextElement3, + expr: &oneOrMoreExpr{ + pos: position{line: 2288, col: 23, offset: 77183}, + expr: &charClassMatcher{ + pos: position{line: 2288, col: 23, offset: 77183}, + val: "[^\\r\\n ^]", + chars: []rune{'\r', '\n', ' ', '^'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + { + name: "EscapedSuperscriptText", + pos: position{line: 2292, col: 1, offset: 77268}, + expr: &actionExpr{ + pos: position{line: 2293, col: 5, offset: 77299}, + run: (*parser).callonEscapedSuperscriptText1, + expr: &seqExpr{ + pos: position{line: 2293, col: 5, offset: 77299}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2293, col: 5, offset: 77299}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + run: (*parser).callonEscapedSuperscriptText4, + expr: &oneOrMoreExpr{ + pos: position{line: 1737, col: 25, offset: 57619}, + expr: &litMatcher{ + pos: position{line: 1737, col: 25, offset: 57619}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2284, col: 29, offset: 77096}, + val: "^", + ignoreCase: false, + want: "\"^\"", + }, + &labeledExpr{ + pos: position{line: 2295, col: 5, offset: 77369}, + label: "element", + expr: &ruleRefExpr{ + pos: position{line: 2295, col: 14, offset: 77378}, + name: "SuperscriptTextElement", + }, + }, + &litMatcher{ + pos: position{line: 2284, col: 29, offset: 77096}, + val: "^", + ignoreCase: false, + want: "\"^\"", + }, + }, + }, + }, + }, + { + name: "QuotedString", + pos: position{line: 2304, col: 1, offset: 77826}, + expr: &choiceExpr{ + pos: position{line: 2304, col: 17, offset: 77842}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2304, col: 17, offset: 77842}, + name: "SingleQuotedString", + }, + &ruleRefExpr{ + pos: position{line: 2304, col: 38, offset: 77863}, + name: "DoubleQuotedString", + }, + }, + }, + }, + { + name: "SingleQuotedString", + pos: position{line: 2306, col: 1, offset: 77883}, + expr: &actionExpr{ + pos: position{line: 2307, col: 5, offset: 77910}, + run: (*parser).callonSingleQuotedString1, + expr: &seqExpr{ + pos: position{line: 2307, col: 5, offset: 77910}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2319, col: 27, offset: 78285}, + val: "'`", + ignoreCase: false, + want: "\"'`\"", + }, + ¬Expr{ + pos: position{line: 2319, col: 32, offset: 78290}, + expr: &charClassMatcher{ + pos: position{line: 2319, col: 33, offset: 78291}, + val: "[ \\t\\r\\n]", + chars: []rune{' ', '\t', '\r', '\n'}, + ignoreCase: false, + inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 2308, col: 5, offset: 77938}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2308, col: 14, offset: 77947}, + name: "SingleQuotedStringElements", + }, + }, + &litMatcher{ + pos: position{line: 2321, col: 25, offset: 78326}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + }, + }, + }, + { + name: "SingleQuotedStringElements", + pos: position{line: 2313, col: 1, offset: 78091}, + expr: &actionExpr{ + pos: position{line: 2314, col: 5, offset: 78126}, + run: (*parser).callonSingleQuotedStringElements1, + expr: &labeledExpr{ + pos: position{line: 2314, col: 5, offset: 78126}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2314, col: 14, offset: 78135}, + expr: &ruleRefExpr{ + pos: position{line: 2314, col: 15, offset: 78136}, + name: "SingleQuotedStringElement", + }, + }, + }, + }, + }, + { + name: "SingleQuotedStringElement", + pos: position{line: 2328, col: 1, offset: 78539}, + expr: &actionExpr{ + pos: position{line: 2329, col: 5, offset: 78573}, + run: (*parser).callonSingleQuotedStringElement1, + expr: &seqExpr{ + pos: position{line: 2329, col: 5, offset: 78573}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2329, col: 5, offset: 78573}, + expr: &litMatcher{ + pos: position{line: 2321, col: 25, offset: 78326}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &labeledExpr{ + pos: position{line: 2330, col: 5, offset: 78599}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2331, col: 9, offset: 78617}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2323, col: 21, offset: 78352}, + run: (*parser).callonSingleQuotedStringElement7, + expr: &seqExpr{ + pos: position{line: 2323, col: 21, offset: 78352}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2323, col: 21, offset: 78352}, + expr: &charClassMatcher{ + pos: position{line: 2323, col: 21, offset: 78352}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2323, col: 31, offset: 78362}, + expr: &choiceExpr{ + pos: position{line: 2323, col: 33, offset: 78364}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuotedStringElement13, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + &litMatcher{ + pos: position{line: 2321, col: 25, offset: 78326}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1805, col: 15, offset: 64211}, - name: "ImageBlock", + }, + }, + }, + &seqExpr{ + pos: position{line: 2332, col: 11, offset: 78644}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuotedStringElement17, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, - &actionExpr{ - pos: position{line: 1632, col: 18, offset: 58455}, - run: (*parser).callonSidebarBlockRawContent211, - expr: &seqExpr{ - pos: position{line: 1632, col: 18, offset: 58455}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 1632, col: 19, offset: 58456}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 1632, col: 19, offset: 58456}, - val: "***", - ignoreCase: false, - want: "\"***\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 27, offset: 58464}, - val: "* * *", - ignoreCase: false, - want: "\"* * *\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 37, offset: 58474}, - val: "---", - ignoreCase: false, - want: "\"---\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 45, offset: 58482}, - val: "- - -", - ignoreCase: false, - want: "\"- - -\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 55, offset: 58492}, - val: "___", - ignoreCase: false, - want: "\"___\"", - }, - &litMatcher{ - pos: position{line: 1632, col: 63, offset: 58500}, - val: "_ _ _", - ignoreCase: false, - want: "\"_ _ _\"", - }, - }, + }, + ¬Expr{ + pos: position{line: 2332, col: 17, offset: 78650}, + expr: &litMatcher{ + pos: position{line: 2321, col: 25, offset: 78326}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 2333, col: 11, offset: 78682}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSingleQuotedStringElement22, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2333, col: 19, offset: 78690}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSingleQuotedStringElement28, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1807, col: 15, offset: 64264}, - name: "OrderedListItem", - }, - &ruleRefExpr{ - pos: position{line: 1808, col: 15, offset: 64295}, - name: "UnorderedListItem", - }, - &ruleRefExpr{ - pos: position{line: 1809, col: 15, offset: 64328}, - name: "ContinuedListItemElement", + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuotedStringElement33, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuotedStringElement35, }, - &actionExpr{ - pos: position{line: 1835, col: 16, offset: 65237}, - run: (*parser).callonSidebarBlockRawContent228, - expr: &seqExpr{ - pos: position{line: 1835, col: 16, offset: 65237}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1841, col: 30, offset: 65538}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1841, col: 36, offset: 65544}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonSingleQuotedStringElement38, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", ignoreCase: false, - want: "\" \"", + want: "\"{counter:\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent234, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuotedStringElement42, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1835, col: 42, offset: 65263}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1845, col: 26, offset: 65634}, - expr: &actionExpr{ - pos: position{line: 1845, col: 27, offset: 65635}, - run: (*parser).callonSidebarBlockRawContent243, - expr: &seqExpr{ - pos: position{line: 1845, col: 27, offset: 65635}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1845, col: 27, offset: 65635}, - expr: &choiceExpr{ - pos: position{line: 1843, col: 28, offset: 65583}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1843, col: 29, offset: 65584}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1843, col: 29, offset: 65584}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1843, col: 35, offset: 65590}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent252, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuotedStringElement49, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuotedStringElement54, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuotedStringElement56, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonSingleQuotedStringElement60, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuotedStringElement64, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, - &labeledExpr{ - pos: position{line: 1845, col: 52, offset: 65660}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonSidebarBlockRawContent262, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonSidebarBlockRawContent268, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuotedStringElement71, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuotedStringElement76, expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuotedStringElement78, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -40150,75 +53255,66 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, - &choiceExpr{ - pos: position{line: 1843, col: 28, offset: 65583}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1843, col: 29, offset: 65584}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1843, col: 29, offset: 65584}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1843, col: 35, offset: 65590}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonSingleQuotedStringElement82, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuotedStringElement86, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent282, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", }, }, }, @@ -40226,702 +53322,1084 @@ var g = &grammar{ }, }, }, - &actionExpr{ - pos: position{line: 1852, col: 17, offset: 65916}, - run: (*parser).callonSidebarBlockRawContent291, - expr: &seqExpr{ - pos: position{line: 1852, col: 17, offset: 65916}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1858, col: 31, offset: 66169}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1858, col: 38, offset: 66176}, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonSingleQuotedStringElement92, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonSingleQuotedStringElement94, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonSingleQuotedStringElement97, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 535, col: 27, offset: 17411}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent297, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1852, col: 44, offset: 65943}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1862, col: 27, offset: 66269}, - expr: &actionExpr{ - pos: position{line: 1862, col: 28, offset: 66270}, - run: (*parser).callonSidebarBlockRawContent306, - expr: &seqExpr{ - pos: position{line: 1862, col: 28, offset: 66270}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1862, col: 28, offset: 66270}, - expr: &choiceExpr{ - pos: position{line: 1860, col: 29, offset: 66216}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1860, col: 30, offset: 66217}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1860, col: 30, offset: 66217}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1860, col: 37, offset: 66224}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonSingleQuotedStringElement99, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonSingleQuotedStringElement103, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuotedStringElement107, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonSingleQuotedStringElement113, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent315, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, ignoreCase: false, - want: "\"\\t\"", + inverted: true, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuotedStringElement118, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSingleQuotedStringElement120, }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1862, col: 54, offset: 66296}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonSidebarBlockRawContent325, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonSidebarBlockRawContent331, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 1860, col: 29, offset: 66216}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1860, col: 30, offset: 66217}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1860, col: 30, offset: 66217}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1860, col: 37, offset: 66224}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent345, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonSingleQuotedStringElement123, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuotedStringElement127, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuotedStringElement134, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuotedStringElement139, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuotedStringElement141, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonSingleQuotedStringElement145, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuotedStringElement149, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSingleQuotedStringElement156, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSingleQuotedStringElement161, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSingleQuotedStringElement163, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonSingleQuotedStringElement167, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSingleQuotedStringElement171, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonSingleQuotedStringElement177, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\">>\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonSingleQuotedStringElement180, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", ignoreCase: false, - inverted: false, + want: "\"<<\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonSingleQuotedStringElement184, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, }, }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonSingleQuotedStringElement188, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, }, }, }, }, }, - &actionExpr{ - pos: position{line: 1870, col: 5, offset: 66553}, - run: (*parser).callonSidebarBlockRawContent354, - expr: &seqExpr{ - pos: position{line: 1870, col: 5, offset: 66553}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 1870, col: 5, offset: 66553}, - run: (*parser).callonSidebarBlockRawContent356, - }, - &litMatcher{ - pos: position{line: 1738, col: 29, offset: 62027}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1738, col: 36, offset: 62034}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent361, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2336, col: 11, offset: 78802}, + name: "InlineMacro", + }, + &seqExpr{ + pos: position{line: 2337, col: 11, offset: 78824}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + run: (*parser).callonSingleQuotedStringElement192, + expr: &seqExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + run: (*parser).callonSingleQuotedStringElement194, + }, + &litMatcher{ + pos: position{line: 1002, col: 5, offset: 31813}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1002, col: 9, offset: 31817}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSingleQuotedStringElement197, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + &andExpr{ + pos: position{line: 1002, col: 16, offset: 31824}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSingleQuotedStringElement201, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, }, - &labeledExpr{ - pos: position{line: 1874, col: 30, offset: 66758}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1878, col: 25, offset: 66936}, - expr: &actionExpr{ - pos: position{line: 1878, col: 26, offset: 66937}, - run: (*parser).callonSidebarBlockRawContent370, - expr: &seqExpr{ - pos: position{line: 1878, col: 26, offset: 66937}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1878, col: 26, offset: 66937}, - expr: &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1740, col: 28, offset: 62098}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1740, col: 28, offset: 62098}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1740, col: 35, offset: 62105}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent379, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1878, col: 50, offset: 66961}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonSidebarBlockRawContent389, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonSidebarBlockRawContent395, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2337, col: 21, offset: 78834}, + expr: &litMatcher{ + pos: position{line: 2321, col: 25, offset: 78326}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2683, col: 15, offset: 89501}, + run: (*parser).callonSingleQuotedStringElement210, + expr: &litMatcher{ + pos: position{line: 2683, col: 15, offset: 89501}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2689, col: 14, offset: 89616}, + run: (*parser).callonSingleQuotedStringElement212, + expr: &litMatcher{ + pos: position{line: 2689, col: 14, offset: 89616}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2693, col: 14, offset: 89692}, + run: (*parser).callonSingleQuotedStringElement214, + expr: &litMatcher{ + pos: position{line: 2693, col: 14, offset: 89692}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2697, col: 15, offset: 89770}, + run: (*parser).callonSingleQuotedStringElement216, + expr: &litMatcher{ + pos: position{line: 2697, col: 15, offset: 89770}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2701, col: 13, offset: 89845}, + run: (*parser).callonSingleQuotedStringElement218, + expr: &litMatcher{ + pos: position{line: 2701, col: 13, offset: 89845}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + run: (*parser).callonSingleQuotedStringElement220, + expr: &seqExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2709, col: 31, offset: 90160}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2709, col: 35, offset: 90164}, + expr: &charClassMatcher{ + pos: position{line: 2709, col: 36, offset: 90165}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2339, col: 11, offset: 78883}, + name: "QuotedTextInSingleQuotedString", + }, + &ruleRefExpr{ + pos: position{line: 2340, col: 11, offset: 78924}, + name: "DoubleQuotedString", + }, + &charClassMatcher{ + pos: position{line: 2358, col: 41, offset: 79442}, + val: "[^\\r\\n\\t `]", + chars: []rune{'\r', '\n', '\t', ' ', '`'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 2358, col: 55, offset: 79456}, + run: (*parser).callonSingleQuotedStringElement229, + expr: &seqExpr{ + pos: position{line: 2358, col: 55, offset: 79456}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2358, col: 55, offset: 79456}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + ¬Expr{ + pos: position{line: 2358, col: 59, offset: 79460}, + expr: &litMatcher{ + pos: position{line: 2358, col: 60, offset: 79461}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInSingleQuotedString", + pos: position{line: 2347, col: 1, offset: 79068}, + expr: &actionExpr{ + pos: position{line: 2348, col: 5, offset: 79106}, + run: (*parser).callonQuotedTextInSingleQuotedString1, + expr: &seqExpr{ + pos: position{line: 2348, col: 5, offset: 79106}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2348, col: 5, offset: 79106}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 2348, col: 16, offset: 79117}, + expr: &ruleRefExpr{ + pos: position{line: 2348, col: 17, offset: 79118}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 2349, col: 5, offset: 79144}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 2349, col: 11, offset: 79150}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2349, col: 11, offset: 79150}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 2350, col: 11, offset: 79169}, + name: "ItalicText", + }, + &actionExpr{ + pos: position{line: 2351, col: 12, offset: 79191}, + run: (*parser).callonQuotedTextInSingleQuotedString10, + expr: &seqExpr{ + pos: position{line: 2351, col: 12, offset: 79191}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2351, col: 12, offset: 79191}, + expr: &litMatcher{ + pos: position{line: 2351, col: 13, offset: 79192}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &labeledExpr{ + pos: position{line: 2351, col: 18, offset: 79197}, + label: "element", + expr: &ruleRefExpr{ + pos: position{line: 2351, col: 27, offset: 79206}, + name: "MonospaceText", + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2352, col: 11, offset: 79255}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2353, col: 11, offset: 79279}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2354, col: 11, offset: 79305}, + name: "MarkedText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "DoubleQuotedString", + pos: position{line: 2362, col: 1, offset: 79533}, + expr: &actionExpr{ + pos: position{line: 2362, col: 23, offset: 79555}, + run: (*parser).callonDoubleQuotedString1, + expr: &seqExpr{ + pos: position{line: 2362, col: 23, offset: 79555}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2401, col: 27, offset: 80861}, + val: "\"`", + ignoreCase: false, + want: "\"\\\"`\"", + }, + ¬Expr{ + pos: position{line: 2401, col: 33, offset: 80867}, + expr: &charClassMatcher{ + pos: position{line: 2401, col: 34, offset: 80868}, + val: "[ \\t\\r\\n]", + chars: []rune{' ', '\t', '\r', '\n'}, + ignoreCase: false, + inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 2362, col: 46, offset: 79578}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2362, col: 55, offset: 79587}, + name: "DoubleQuotedStringElements", + }, + }, + &litMatcher{ + pos: position{line: 2403, col: 25, offset: 80903}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + }, + }, + }, + }, + { + name: "DoubleQuotedStringElements", + pos: position{line: 2366, col: 1, offset: 79726}, + expr: &actionExpr{ + pos: position{line: 2366, col: 31, offset: 79756}, + run: (*parser).callonDoubleQuotedStringElements1, + expr: &labeledExpr{ + pos: position{line: 2366, col: 31, offset: 79756}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2366, col: 41, offset: 79766}, + expr: &ruleRefExpr{ + pos: position{line: 2366, col: 41, offset: 79766}, + name: "DoubleQuotedStringElement", + }, + }, + }, + }, + }, + { + name: "DoubleQuotedStringElement", + pos: position{line: 2372, col: 1, offset: 79971}, + expr: &actionExpr{ + pos: position{line: 2373, col: 5, offset: 80005}, + run: (*parser).callonDoubleQuotedStringElement1, + expr: &seqExpr{ + pos: position{line: 2373, col: 5, offset: 80005}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2373, col: 5, offset: 80005}, + expr: &litMatcher{ + pos: position{line: 2403, col: 25, offset: 80903}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + }, + &labeledExpr{ + pos: position{line: 2374, col: 5, offset: 80031}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2375, col: 9, offset: 80049}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2323, col: 21, offset: 78352}, + run: (*parser).callonDoubleQuotedStringElement7, + expr: &seqExpr{ + pos: position{line: 2323, col: 21, offset: 78352}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2323, col: 21, offset: 78352}, + expr: &charClassMatcher{ + pos: position{line: 2323, col: 21, offset: 78352}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2323, col: 31, offset: 78362}, + expr: &choiceExpr{ + pos: position{line: 2323, col: 33, offset: 78364}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDoubleQuotedStringElement13, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, - &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1740, col: 28, offset: 62098}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1740, col: 28, offset: 62098}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1740, col: 35, offset: 62105}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent409, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + &litMatcher{ + pos: position{line: 2321, col: 25, offset: 78326}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 2376, col: 11, offset: 80076}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDoubleQuotedStringElement17, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + ¬Expr{ + pos: position{line: 2376, col: 17, offset: 80082}, + expr: &litMatcher{ + pos: position{line: 2403, col: 25, offset: 80903}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 2377, col: 11, offset: 80114}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDoubleQuotedStringElement22, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2377, col: 19, offset: 80122}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDoubleQuotedStringElement28, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1813, col: 15, offset: 64447}, - name: "ExampleBlock", - }, - &ruleRefExpr{ - pos: position{line: 1814, col: 15, offset: 64474}, - name: "QuoteBlock", - }, - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonSidebarBlockRawContent420, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent428, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + }, + &seqExpr{ + pos: position{line: 2378, col: 11, offset: 80175}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + run: (*parser).callonDoubleQuotedStringElement34, + expr: &seqExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + run: (*parser).callonDoubleQuotedStringElement36, + }, + &litMatcher{ + pos: position{line: 1002, col: 5, offset: 31813}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1002, col: 9, offset: 31817}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDoubleQuotedStringElement39, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &andExpr{ + pos: position{line: 1002, col: 16, offset: 31824}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonDoubleQuotedStringElement43, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\r\"", }, }, }, }, - }, - }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", - ignoreCase: false, - want: "\"//\"", - }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonSidebarBlockRawContent437, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, @@ -40929,206 +54407,126 @@ var g = &grammar{ }, }, }, - &actionExpr{ - pos: position{line: 1885, col: 21, offset: 67225}, - run: (*parser).callonSidebarBlockRawContent445, - expr: &seqExpr{ - pos: position{line: 1885, col: 21, offset: 67225}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1891, col: 35, offset: 67502}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1891, col: 42, offset: 67509}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + }, + ¬Expr{ + pos: position{line: 2378, col: 21, offset: 80185}, + expr: &litMatcher{ + pos: position{line: 2321, col: 25, offset: 78326}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuotedStringElement52, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuotedStringElement54, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonDoubleQuotedStringElement57, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent451, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + want: "\"{counter:\"", }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1885, col: 52, offset: 67256}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1895, col: 31, offset: 67610}, - expr: &actionExpr{ - pos: position{line: 1895, col: 32, offset: 67611}, - run: (*parser).callonSidebarBlockRawContent460, - expr: &seqExpr{ - pos: position{line: 1895, col: 32, offset: 67611}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1895, col: 32, offset: 67611}, - expr: &choiceExpr{ - pos: position{line: 1893, col: 33, offset: 67553}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1893, col: 34, offset: 67554}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1893, col: 34, offset: 67554}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1893, col: 41, offset: 67561}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent469, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuotedStringElement61, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, - &labeledExpr{ - pos: position{line: 1895, col: 62, offset: 67641}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonSidebarBlockRawContent479, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonSidebarBlockRawContent485, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuotedStringElement68, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuotedStringElement73, expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuotedStringElement75, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -41139,286 +54537,107 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, - &choiceExpr{ - pos: position{line: 1893, col: 33, offset: 67553}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1893, col: 34, offset: 67554}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1893, col: 34, offset: 67554}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1893, col: 41, offset: 67561}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonDoubleQuotedStringElement79, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuotedStringElement83, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent499, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1817, col: 15, offset: 64562}, - name: "Table", - }, - &actionExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, - run: (*parser).callonSidebarBlockRawContent509, - expr: &seqExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1904, col: 31, offset: 67955}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1904, col: 38, offset: 67962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent515, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1908, col: 44, offset: 68072}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1912, col: 27, offset: 68225}, - expr: &actionExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - run: (*parser).callonSidebarBlockRawContent524, - expr: &seqExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1912, col: 28, offset: 68226}, - expr: &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent533, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuotedStringElement90, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1912, col: 54, offset: 68252}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonSidebarBlockRawContent543, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonSidebarBlockRawContent549, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuotedStringElement95, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuotedStringElement97, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -41429,390 +54648,1455 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, - &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonDoubleQuotedStringElement101, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuotedStringElement105, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent563, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonDoubleQuotedStringElement111, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonDoubleQuotedStringElement113, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonDoubleQuotedStringElement116, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonDoubleQuotedStringElement118, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"<<\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonDoubleQuotedStringElement122, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonDoubleQuotedStringElement126, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", ignoreCase: false, - inverted: false, + want: "\",\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonDoubleQuotedStringElement132, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuotedStringElement137, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonDoubleQuotedStringElement139, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonDoubleQuotedStringElement142, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuotedStringElement146, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuotedStringElement153, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuotedStringElement158, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuotedStringElement160, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonDoubleQuotedStringElement164, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuotedStringElement168, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonDoubleQuotedStringElement175, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonDoubleQuotedStringElement180, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonDoubleQuotedStringElement182, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonDoubleQuotedStringElement186, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonDoubleQuotedStringElement190, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonDoubleQuotedStringElement196, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, }, }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonDoubleQuotedStringElement199, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonDoubleQuotedStringElement203, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, }, }, }, }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonDoubleQuotedStringElement207, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, - &actionExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - run: (*parser).callonSidebarBlockRawContent572, - expr: &seqExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - run: (*parser).callonSidebarBlockRawContent574, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2381, col: 11, offset: 80277}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 2382, col: 11, offset: 80299}, + name: "QuotedTextInDoubleQuotedString", + }, + &ruleRefExpr{ + pos: position{line: 2383, col: 11, offset: 80340}, + name: "SingleQuotedString", + }, + &actionExpr{ + pos: position{line: 2405, col: 41, offset: 80950}, + run: (*parser).callonDoubleQuotedStringElement212, + expr: &choiceExpr{ + pos: position{line: 2405, col: 42, offset: 80951}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2405, col: 42, offset: 80951}, + val: "[^\\r\\n\\t `]", + chars: []rune{'\r', '\n', '\t', ' ', '`'}, + ignoreCase: false, + inverted: true, + }, + &seqExpr{ + pos: position{line: 2405, col: 56, offset: 80965}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2405, col: 56, offset: 80965}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + ¬Expr{ + pos: position{line: 2405, col: 60, offset: 80969}, + expr: &litMatcher{ + pos: position{line: 2405, col: 61, offset: 80970}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", }, - &labeledExpr{ - pos: position{line: 2120, col: 5, offset: 75117}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 2120, col: 11, offset: 75123}, - expr: &actionExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - run: (*parser).callonSidebarBlockRawContent577, - expr: &seqExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2128, col: 25, offset: 75365}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonSidebarBlockRawContent580, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInDoubleQuotedString", + pos: position{line: 2389, col: 1, offset: 80491}, + expr: &actionExpr{ + pos: position{line: 2390, col: 5, offset: 80529}, + run: (*parser).callonQuotedTextInDoubleQuotedString1, + expr: &seqExpr{ + pos: position{line: 2390, col: 5, offset: 80529}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2390, col: 5, offset: 80529}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 2390, col: 16, offset: 80540}, + expr: &ruleRefExpr{ + pos: position{line: 2390, col: 17, offset: 80541}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 2391, col: 5, offset: 80567}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 2392, col: 9, offset: 80582}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2392, col: 9, offset: 80582}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 2393, col: 11, offset: 80601}, + name: "ItalicText", + }, + &actionExpr{ + pos: position{line: 2394, col: 12, offset: 80623}, + run: (*parser).callonQuotedTextInDoubleQuotedString10, + expr: &seqExpr{ + pos: position{line: 2394, col: 12, offset: 80623}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2394, col: 12, offset: 80623}, + expr: &litMatcher{ + pos: position{line: 2394, col: 13, offset: 80624}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + }, + &labeledExpr{ + pos: position{line: 2394, col: 19, offset: 80630}, + label: "element", + expr: &ruleRefExpr{ + pos: position{line: 2394, col: 28, offset: 80639}, + name: "MonospaceText", + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2395, col: 11, offset: 80688}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2396, col: 11, offset: 80712}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2397, col: 11, offset: 80738}, + name: "MarkedText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "AttributesGroup", + pos: position{line: 2440, col: 1, offset: 82208}, + expr: &actionExpr{ + pos: position{line: 2440, col: 20, offset: 82227}, + run: (*parser).callonAttributesGroup1, + expr: &seqExpr{ + pos: position{line: 2440, col: 20, offset: 82227}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2440, col: 20, offset: 82227}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2440, col: 29, offset: 82236}, + expr: &choiceExpr{ + pos: position{line: 2441, col: 5, offset: 82242}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + run: (*parser).callonAttributesGroup6, + expr: &oneOrMoreExpr{ + pos: position{line: 2864, col: 14, offset: 94865}, + expr: &charClassMatcher{ + pos: position{line: 2864, col: 14, offset: 94865}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonAttributesGroup9, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonAttributesGroup11, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonAttributesGroup13, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonAttributesGroup16, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonAttributesGroup18, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonAttributesGroup22, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, }, }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent588, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonAttributesGroup26, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonAttributesGroup32, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonAttributesGroup37, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonAttributesGroup39, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonAttributesGroup42, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonAttributesGroup46, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonAttributesGroup53, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonAttributesGroup58, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonAttributesGroup60, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonAttributesGroup64, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonAttributesGroup68, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonAttributesGroup75, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonAttributesGroup80, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonAttributesGroup82, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonAttributesGroup86, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonAttributesGroup90, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonAttributesGroup96, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", }, }, }, }, }, }, - }, - }, - &labeledExpr{ - pos: position{line: 2128, col: 36, offset: 75376}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - run: (*parser).callonSidebarBlockRawContent596, - expr: &oneOrMoreExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - expr: &charClassMatcher{ - pos: position{line: 2128, col: 45, offset: 75385}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonAttributesGroup99, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", ignoreCase: false, - inverted: false, + want: "\"<<\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonAttributesGroup103, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, }, }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, }, }, }, }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonAttributesGroup107, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, - &actionExpr{ - pos: position{line: 2080, col: 31, offset: 73460}, - run: (*parser).callonSidebarBlockRawContent604, - expr: &labeledExpr{ - pos: position{line: 2080, col: 31, offset: 73460}, - label: "lines", - expr: &actionExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - run: (*parser).callonSidebarBlockRawContent606, - expr: &seqExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2086, col: 5, offset: 73756}, - label: "firstLine", - expr: &actionExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - run: (*parser).callonSidebarBlockRawContent609, - expr: &seqExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2091, col: 35, offset: 73958}, - label: "line", - expr: &actionExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - run: (*parser).callonSidebarBlockRawContent612, - expr: &seqExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2091, col: 41, offset: 73964}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + }, + }, + &ruleRefExpr{ + pos: position{line: 2444, col: 7, offset: 82293}, + name: "Quote", + }, + &ruleRefExpr{ + pos: position{line: 2445, col: 7, offset: 82305}, + name: "InlinePassthrough", + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonAttributesGroup111, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonAttributesGroup113, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonAttributesGroup116, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonAttributesGroup120, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonAttributesGroup127, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonAttributesGroup132, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent617, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonAttributesGroup134, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, }, - &oneOrMoreExpr{ - pos: position{line: 2091, col: 48, offset: 73971}, - expr: &charClassMatcher{ - pos: position{line: 2091, col: 48, offset: 73971}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonAttributesGroup138, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonAttributesGroup142, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, - }, - }, - &labeledExpr{ - pos: position{line: 2087, col: 5, offset: 73803}, - label: "otherLines", - expr: &zeroOrMoreExpr{ - pos: position{line: 2087, col: 16, offset: 73814}, - expr: &actionExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - run: (*parser).callonSidebarBlockRawContent628, - expr: &seqExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2128, col: 25, offset: 75365}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonSidebarBlockRawContent631, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent639, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonAttributesGroup149, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonAttributesGroup154, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonAttributesGroup156, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, @@ -41821,51 +56105,70 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 2128, col: 36, offset: 75376}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - run: (*parser).callonSidebarBlockRawContent647, - expr: &oneOrMoreExpr{ - pos: position{line: 2128, col: 45, offset: 75385}, - expr: &charClassMatcher{ - pos: position{line: 2128, col: 45, offset: 75385}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonAttributesGroup160, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonAttributesGroup164, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, @@ -41873,129 +56176,292 @@ var g = &grammar{ }, }, }, - &actionExpr{ - pos: position{line: 2098, col: 39, offset: 74215}, - run: (*parser).callonSidebarBlockRawContent655, - expr: &seqExpr{ - pos: position{line: 2098, col: 39, offset: 74215}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonAttributesGroup170, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonAttributesGroup174, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 2098, col: 61, offset: 74237}, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2905, col: 12, offset: 96279}, + run: (*parser).callonAttributesGroup178, + expr: &anyMatcher{ + line: 2905, col: 12, offset: 96279, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + { + name: "ElementAttributesGroup", + pos: position{line: 2453, col: 1, offset: 82584}, + expr: &actionExpr{ + pos: position{line: 2453, col: 27, offset: 82610}, + run: (*parser).callonElementAttributesGroup1, + expr: &seqExpr{ + pos: position{line: 2453, col: 27, offset: 82610}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2453, col: 27, offset: 82610}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2453, col: 36, offset: 82619}, + expr: &choiceExpr{ + pos: position{line: 2454, col: 5, offset: 82625}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + run: (*parser).callonElementAttributesGroup6, + expr: &seqExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + expr: &charClassMatcher{ + pos: position{line: 2893, col: 5, offset: 95917}, + val: "[,;!?0-9\\pL]", + chars: []rune{',', ';', '!', '?'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &choiceExpr{ + pos: position{line: 2894, col: 6, offset: 95937}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonElementAttributesGroup11, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2894, col: 14, offset: 95945}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2894, col: 16, offset: 95947}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &charClassMatcher{ + pos: position{line: 2894, col: 16, offset: 95947}, + val: "[.�]", + chars: []rune{'.', '�'}, ignoreCase: false, - want: "\" \"", + inverted: false, }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent661, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonElementAttributesGroup16, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2098, col: 76, offset: 74252}, - label: "lines", - expr: &actionExpr{ - pos: position{line: 2103, col: 44, offset: 74559}, - run: (*parser).callonSidebarBlockRawContent667, - expr: &labeledExpr{ - pos: position{line: 2103, col: 44, offset: 74559}, - label: "lines", - expr: &zeroOrMoreExpr{ - pos: position{line: 2103, col: 50, offset: 74565}, - expr: &actionExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - run: (*parser).callonSidebarBlockRawContent670, - expr: &seqExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - label: "line", - expr: &actionExpr{ - pos: position{line: 2108, col: 11, offset: 74711}, - run: (*parser).callonSidebarBlockRawContent673, - expr: &seqExpr{ - pos: position{line: 2108, col: 11, offset: 74711}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2108, col: 11, offset: 74711}, - expr: &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2108, col: 34, offset: 74734}, - expr: &charClassMatcher{ - pos: position{line: 2108, col: 34, offset: 74734}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonElementAttributesGroup23, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonElementAttributesGroup25, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonElementAttributesGroup27, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonElementAttributesGroup30, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonElementAttributesGroup34, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonElementAttributesGroup41, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", ignoreCase: false, - inverted: false, + want: "\":\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonElementAttributesGroup46, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonElementAttributesGroup48, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, }, @@ -42003,775 +56469,655 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2098, col: 125, offset: 74301}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 2098, col: 126, offset: 74302}, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonElementAttributesGroup52, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", ignoreCase: false, - want: "\"....\"", + want: "\"{counter2:\"", }, - &zeroOrMoreExpr{ - pos: position{line: 2098, col: 148, offset: 74324}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent690, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonElementAttributesGroup56, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonElementAttributesGroup63, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonElementAttributesGroup68, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonElementAttributesGroup70, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 879, col: 6, offset: 28334}, - run: (*parser).callonSidebarBlockRawContent699, - expr: &seqExpr{ - pos: position{line: 879, col: 6, offset: 28334}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 879, col: 6, offset: 28334}, - label: "t", - expr: &choiceExpr{ - pos: position{line: 856, col: 19, offset: 27732}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 856, col: 19, offset: 27732}, - run: (*parser).callonSidebarBlockRawContent703, - expr: &litMatcher{ - pos: position{line: 856, col: 19, offset: 27732}, - val: "TIP", - ignoreCase: false, - want: "\"TIP\"", - }, - }, - &actionExpr{ - pos: position{line: 858, col: 5, offset: 27770}, - run: (*parser).callonSidebarBlockRawContent705, - expr: &litMatcher{ - pos: position{line: 858, col: 5, offset: 27770}, - val: "NOTE", + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", ignoreCase: false, - want: "\"NOTE\"", + want: "\"}\"", }, }, - &actionExpr{ - pos: position{line: 860, col: 5, offset: 27810}, - run: (*parser).callonSidebarBlockRawContent707, - expr: &litMatcher{ - pos: position{line: 860, col: 5, offset: 27810}, - val: "IMPORTANT", + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonElementAttributesGroup74, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", ignoreCase: false, - want: "\"IMPORTANT\"", + want: "\"{\"", }, - }, - &actionExpr{ - pos: position{line: 862, col: 5, offset: 27860}, - run: (*parser).callonSidebarBlockRawContent709, - expr: &litMatcher{ - pos: position{line: 862, col: 5, offset: 27860}, - val: "WARNING", - ignoreCase: false, - want: "\"WARNING\"", + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonElementAttributesGroup78, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, }, - }, - &actionExpr{ - pos: position{line: 864, col: 5, offset: 27906}, - run: (*parser).callonSidebarBlockRawContent711, - expr: &litMatcher{ - pos: position{line: 864, col: 5, offset: 27906}, - val: "CAUTION", + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", ignoreCase: false, - want: "\"CAUTION\"", + want: "\"}\"", }, }, }, }, }, - &litMatcher{ - pos: position{line: 879, col: 25, offset: 28353}, - val: ": ", - ignoreCase: false, - want: "\": \"", - }, - &labeledExpr{ - pos: position{line: 879, col: 30, offset: 28358}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 879, col: 36, offset: 28364}, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2457, col: 7, offset: 82682}, + name: "Quote", + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonElementAttributesGroup85, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonElementAttributesGroup87, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonElementAttributesGroup90, expr: &choiceExpr{ - pos: position{line: 879, col: 37, offset: 28365}, + pos: position{line: 535, col: 27, offset: 17411}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonSidebarBlockRawContent717, + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonElementAttributesGroup92, expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, + pos: position{line: 535, col: 27, offset: 17411}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent725, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", ignoreCase: false, - want: "\"//\"", + want: "\"<<\"", }, &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonSidebarBlockRawContent734, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonElementAttributesGroup96, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, ignoreCase: false, inverted: true, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonElementAttributesGroup100, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, - }, - }, - }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonSidebarBlockRawContent742, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent755, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent767, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent779, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent791, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonElementAttributesGroup106, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent803, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + inverted: true, }, }, }, }, }, - }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent815, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonElementAttributesGroup111, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonElementAttributesGroup113, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonElementAttributesGroup116, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonElementAttributesGroup120, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonElementAttributesGroup127, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonElementAttributesGroup132, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonElementAttributesGroup134, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonElementAttributesGroup138, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonElementAttributesGroup142, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonElementAttributesGroup149, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonElementAttributesGroup154, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonElementAttributesGroup156, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonElementAttributesGroup160, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonElementAttributesGroup164, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, }, }, }, }, }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonElementAttributesGroup170, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent827, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + want: "\"{\"", }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonElementAttributesGroup173, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonSidebarBlockRawContent835, + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonElementAttributesGroup177, expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, + pos: position{line: 2936, col: 7, offset: 97228}, expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, ignoreCase: false, inverted: true, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonSidebarBlockRawContent843, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", }, }, }, @@ -42779,773 +57125,957 @@ var g = &grammar{ }, }, }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonElementAttributesGroup181, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, - &actionExpr{ - pos: position{line: 884, col: 5, offset: 28625}, - run: (*parser).callonSidebarBlockRawContent844, - expr: &seqExpr{ - pos: position{line: 884, col: 5, offset: 28625}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 884, col: 5, offset: 28625}, - val: "> ", + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonElementAttributesGroup183, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonElementAttributesGroup187, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2905, col: 12, offset: 96279}, + run: (*parser).callonElementAttributesGroup191, + expr: &anyMatcher{ + line: 2905, col: 12, offset: 96279, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + { + name: "HeaderGroup", + pos: position{line: 2465, col: 1, offset: 82947}, + expr: &actionExpr{ + pos: position{line: 2466, col: 5, offset: 82967}, + run: (*parser).callonHeaderGroup1, + expr: &seqExpr{ + pos: position{line: 2466, col: 5, offset: 82967}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2466, col: 5, offset: 82967}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2466, col: 14, offset: 82976}, + expr: &ruleRefExpr{ + pos: position{line: 2466, col: 15, offset: 82977}, + name: "HeaderGroupElement", + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + { + name: "HeaderGroupElement", + pos: position{line: 2470, col: 1, offset: 83061}, + expr: &actionExpr{ + pos: position{line: 2471, col: 5, offset: 83087}, + run: (*parser).callonHeaderGroupElement1, + expr: &seqExpr{ + pos: position{line: 2471, col: 5, offset: 83087}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2471, col: 5, offset: 83087}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2472, col: 5, offset: 83096}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2473, col: 9, offset: 83114}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + run: (*parser).callonHeaderGroupElement8, + expr: &seqExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + expr: &charClassMatcher{ + pos: position{line: 2893, col: 5, offset: 95917}, + val: "[,;!?0-9\\pL]", + chars: []rune{',', ';', '!', '?'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &choiceExpr{ + pos: position{line: 2894, col: 6, offset: 95937}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonHeaderGroupElement13, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\"> \"", + inverted: false, }, - &labeledExpr{ - pos: position{line: 884, col: 10, offset: 28630}, - label: "content", - expr: &oneOrMoreExpr{ - pos: position{line: 899, col: 33, offset: 29398}, - expr: &actionExpr{ - pos: position{line: 899, col: 34, offset: 29399}, - run: (*parser).callonSidebarBlockRawContent849, - expr: &seqExpr{ - pos: position{line: 899, col: 34, offset: 29399}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 899, col: 34, offset: 29399}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonSidebarBlockRawContent852, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent860, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, + }, + &andExpr{ + pos: position{line: 2894, col: 14, offset: 95945}, + expr: &choiceExpr{ + pos: position{line: 2894, col: 16, offset: 95947}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2894, col: 16, offset: 95947}, + val: "[.�]", + chars: []rune{'.', '�'}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonHeaderGroupElement18, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - &zeroOrOneExpr{ - pos: position{line: 899, col: 45, offset: 29410}, - expr: &litMatcher{ - pos: position{line: 899, col: 45, offset: 29410}, - val: "> ", - ignoreCase: false, - want: "\"> \"", - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, - &labeledExpr{ - pos: position{line: 899, col: 51, offset: 29416}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonSidebarBlockRawContent870, - expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 12, offset: 1077}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonSidebarBlockRawContent876, - expr: &zeroOrMoreExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, }, - &actionExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - run: (*parser).callonSidebarBlockRawContent884, - expr: &seqExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - run: (*parser).callonSidebarBlockRawContent886, - }, - &labeledExpr{ - pos: position{line: 891, col: 7, offset: 29028}, - label: "content", - expr: &oneOrMoreExpr{ - pos: position{line: 891, col: 15, offset: 29036}, - expr: &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonSidebarBlockRawContent889, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent902, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent914, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent926, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent938, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonHeaderGroupElement25, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &ruleRefExpr{ + pos: position{line: 2475, col: 11, offset: 83151}, + name: "InlinePassthrough", + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonHeaderGroupElement28, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonHeaderGroupElement30, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonHeaderGroupElement33, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonHeaderGroupElement35, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonHeaderGroupElement39, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, }, }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent950, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonHeaderGroupElement43, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonHeaderGroupElement49, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent962, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, ignoreCase: false, - want: "\"\\t\"", + inverted: true, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonHeaderGroupElement54, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonHeaderGroupElement56, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent974, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonHeaderGroupElement59, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonHeaderGroupElement63, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonHeaderGroupElement70, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonHeaderGroupElement75, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonHeaderGroupElement77, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonHeaderGroupElement81, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonHeaderGroupElement85, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonHeaderGroupElement92, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonHeaderGroupElement97, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonHeaderGroupElement99, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonHeaderGroupElement103, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonHeaderGroupElement107, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonHeaderGroupElement113, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonSidebarBlockRawContent982, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonHeaderGroupElement116, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonHeaderGroupElement120, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, }, }, }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonHeaderGroupElement124, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2477, col: 11, offset: 83206}, + name: "Quote", + }, + &ruleRefExpr{ + pos: position{line: 2478, col: 11, offset: 83222}, + name: "Link", + }, + &ruleRefExpr{ + pos: position{line: 2479, col: 11, offset: 83237}, + name: "InlineIcon", + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonHeaderGroupElement129, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonHeaderGroupElement131, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonHeaderGroupElement134, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonHeaderGroupElement138, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonSidebarBlockRawContent990, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonHeaderGroupElement145, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonHeaderGroupElement150, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonHeaderGroupElement152, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, - }, - }, - }, - &actionExpr{ - pos: position{line: 895, col: 5, offset: 29222}, - run: (*parser).callonSidebarBlockRawContent991, - expr: &labeledExpr{ - pos: position{line: 895, col: 5, offset: 29222}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 895, col: 11, offset: 29228}, - expr: &choiceExpr{ - pos: position{line: 895, col: 12, offset: 29229}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonSidebarBlockRawContent995, - expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1916, col: 22, offset: 68317}, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonHeaderGroupElement156, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonHeaderGroupElement160, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonHeaderGroupElement167, expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 515, col: 17, offset: 16692}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", ignoreCase: false, - want: "\"////\"", + want: "\":\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 515, col: 28, offset: 16703}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent1003, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonHeaderGroupElement172, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonHeaderGroupElement174, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, @@ -43553,498 +58083,590 @@ var g = &grammar{ }, }, }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonHeaderGroupElement178, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonHeaderGroupElement182, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonHeaderGroupElement188, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonHeaderGroupElement192, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2639, col: 5, offset: 88039}, + run: (*parser).callonHeaderGroupElement196, + expr: &seqExpr{ + pos: position{line: 2639, col: 5, offset: 88039}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2639, col: 5, offset: 88039}, + run: (*parser).callonHeaderGroupElement198, + }, + &labeledExpr{ + pos: position{line: 2642, col: 5, offset: 88105}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2681, col: 11, offset: 89407}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2683, col: 15, offset: 89501}, + run: (*parser).callonHeaderGroupElement201, + expr: &litMatcher{ + pos: position{line: 2683, col: 15, offset: 89501}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2689, col: 14, offset: 89616}, + run: (*parser).callonHeaderGroupElement203, + expr: &litMatcher{ + pos: position{line: 2689, col: 14, offset: 89616}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2693, col: 14, offset: 89692}, + run: (*parser).callonHeaderGroupElement205, + expr: &litMatcher{ + pos: position{line: 2693, col: 14, offset: 89692}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2697, col: 15, offset: 89770}, + run: (*parser).callonHeaderGroupElement207, + expr: &litMatcher{ + pos: position{line: 2697, col: 15, offset: 89770}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2701, col: 13, offset: 89845}, + run: (*parser).callonHeaderGroupElement209, + expr: &litMatcher{ + pos: position{line: 2701, col: 13, offset: 89845}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + run: (*parser).callonHeaderGroupElement211, + expr: &seqExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2709, col: 31, offset: 90160}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2709, col: 35, offset: 90164}, + expr: &charClassMatcher{ + pos: position{line: 2709, col: 36, offset: 90165}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 228, col: 4, offset: 6749}, + run: (*parser).callonHeaderGroupElement217, + expr: &seqExpr{ + pos: position{line: 228, col: 4, offset: 6749}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 228, col: 4, offset: 6749}, + val: "[[", + ignoreCase: false, + want: "\"[[\"", + }, + &labeledExpr{ + pos: position{line: 229, col: 5, offset: 6759}, + label: "id", + expr: &actionExpr{ + pos: position{line: 230, col: 9, offset: 6772}, + run: (*parser).callonHeaderGroupElement221, + expr: &labeledExpr{ + pos: position{line: 230, col: 9, offset: 6772}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 230, col: 18, offset: 6781}, + expr: &choiceExpr{ + pos: position{line: 231, col: 13, offset: 6795}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 231, col: 14, offset: 6796}, + run: (*parser).callonHeaderGroupElement225, + expr: &oneOrMoreExpr{ + pos: position{line: 231, col: 14, offset: 6796}, + expr: &charClassMatcher{ + pos: position{line: 231, col: 14, offset: 6796}, + val: "[^=\\r\\n�{]]", + chars: []rune{'=', '\r', '\n', '�', '{', ']'}, ignoreCase: false, - want: "\"//\"", + inverted: true, }, - &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", - expr: &actionExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - run: (*parser).callonSidebarBlockRawContent1012, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonHeaderGroupElement228, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonHeaderGroupElement232, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, }, }, - }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonSidebarBlockRawContent1020, - expr: &seqExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 903, col: 21, offset: 29486}, - expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 19, offset: 59095}, - expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, - }, - }, - &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", - ignoreCase: false, - want: "\"```\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent1033, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonHeaderGroupElement236, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonHeaderGroupElement238, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonHeaderGroupElement241, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"{counter:\"", }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1856, col: 26, offset: 66120}, - val: "----", - ignoreCase: false, - want: "\"----\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1856, col: 33, offset: 66127}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent1045, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonHeaderGroupElement245, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1674, col: 26, offset: 59888}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1674, col: 26, offset: 59888}, - val: "====", - ignoreCase: false, - want: "\"====\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1674, col: 33, offset: 59895}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent1057, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonHeaderGroupElement252, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonHeaderGroupElement257, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonHeaderGroupElement259, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"}\"", }, }, }, }, - }, - &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", - ignoreCase: false, - want: "\"////\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent1069, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonHeaderGroupElement263, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", ignoreCase: false, - inverted: false, + want: "\"{counter2:\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonHeaderGroupElement267, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", - ignoreCase: false, - want: "\"____\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent1081, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonHeaderGroupElement274, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonHeaderGroupElement279, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonHeaderGroupElement281, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"}\"", }, }, }, }, - }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1788, col: 33, offset: 63740}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent1093, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonHeaderGroupElement285, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"{\"", }, - }, - }, - }, - }, - &seqExpr{ - pos: position{line: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", - ignoreCase: false, - want: "\"++++\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent1105, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonHeaderGroupElement289, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"}\"", }, }, }, @@ -44053,137 +58675,44 @@ var g = &grammar{ }, }, }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonSidebarBlockRawContent1113, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonSidebarBlockRawContent1121, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1821, col: 15, offset: 64664}, - run: (*parser).callonSidebarBlockRawContent1122, - expr: &choiceExpr{ - pos: position{line: 1792, col: 29, offset: 63829}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1792, col: 30, offset: 63830}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1792, col: 30, offset: 63830}, - val: "****", - ignoreCase: false, - want: "\"****\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 1792, col: 37, offset: 63837}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent1129, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + }, + }, + &actionExpr{ + pos: position{line: 236, col: 16, offset: 7032}, + run: (*parser).callonHeaderGroupElement295, + expr: &litMatcher{ + pos: position{line: 236, col: 16, offset: 7032}, + val: "{", + ignoreCase: false, + want: "\"{\"", }, }, }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, }, + &litMatcher{ + pos: position{line: 242, col: 5, offset: 7218}, + val: "]]", + ignoreCase: false, + want: "\"]]\"", + }, }, }, }, + &ruleRefExpr{ + pos: position{line: 2484, col: 11, offset: 83455}, + name: "InlineFootnote", + }, + &actionExpr{ + pos: position{line: 2905, col: 12, offset: 96279}, + run: (*parser).callonHeaderGroupElement299, + expr: &anyMatcher{ + line: 2905, col: 12, offset: 96279, + }, + }, }, }, }, @@ -44192,242 +58721,97 @@ var g = &grammar{ }, }, { - name: "InlineMacros", - pos: position{line: 1928, col: 1, offset: 68762}, - expr: &choiceExpr{ - pos: position{line: 1929, col: 5, offset: 68783}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1929, col: 5, offset: 68783}, - name: "InlineIcon", - }, - &ruleRefExpr{ - pos: position{line: 1930, col: 7, offset: 68800}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 1931, col: 7, offset: 68819}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 1932, col: 7, offset: 68831}, - name: "InlinePassthrough", - }, - &ruleRefExpr{ - pos: position{line: 1933, col: 7, offset: 68856}, - name: "InlineFootnote", - }, - &ruleRefExpr{ - pos: position{line: 1934, col: 7, offset: 68878}, - name: "CrossReference", - }, - &ruleRefExpr{ - pos: position{line: 1935, col: 7, offset: 68900}, - name: "InlineUserMacro", - }, - &actionExpr{ - pos: position{line: 237, col: 20, offset: 7607}, - run: (*parser).callonInlineMacros9, - expr: &seqExpr{ - pos: position{line: 237, col: 20, offset: 7607}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 237, col: 20, offset: 7607}, - val: "[[", - ignoreCase: false, - want: "\"[[\"", - }, - &labeledExpr{ - pos: position{line: 237, col: 25, offset: 7612}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonInlineMacros13, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 237, col: 33, offset: 7620}, - val: "]]", - ignoreCase: false, - want: "\"]]\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 237, col: 38, offset: 7625}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineMacros20, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2147, col: 23, offset: 75975}, - run: (*parser).callonInlineMacros22, - expr: &seqExpr{ - pos: position{line: 2147, col: 23, offset: 75975}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2147, col: 23, offset: 75975}, - val: "(((", - ignoreCase: false, - want: "\"(((\"", - }, - &labeledExpr{ - pos: position{line: 2147, col: 29, offset: 75981}, - label: "term1", - expr: &actionExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - run: (*parser).callonInlineMacros26, - expr: &oneOrMoreExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - expr: &choiceExpr{ - pos: position{line: 2154, col: 31, offset: 76313}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[ 0-9\\pL]", - chars: []rune{' '}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineMacros30, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2148, col: 5, offset: 76020}, - label: "term2", - expr: &zeroOrOneExpr{ - pos: position{line: 2148, col: 11, offset: 76026}, - expr: &actionExpr{ - pos: position{line: 2148, col: 12, offset: 76027}, - run: (*parser).callonInlineMacros34, + name: "MacrosGroup", + pos: position{line: 2490, col: 1, offset: 83574}, + expr: &actionExpr{ + pos: position{line: 2490, col: 16, offset: 83589}, + run: (*parser).callonMacrosGroup1, + expr: &seqExpr{ + pos: position{line: 2490, col: 16, offset: 83589}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2490, col: 16, offset: 83589}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2490, col: 25, offset: 83598}, + expr: &choiceExpr{ + pos: position{line: 2491, col: 5, offset: 83604}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + run: (*parser).callonMacrosGroup6, expr: &seqExpr{ - pos: position{line: 2148, col: 12, offset: 76027}, + pos: position{line: 2893, col: 5, offset: 95917}, exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 2148, col: 12, offset: 76027}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineMacros39, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + &oneOrMoreExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + expr: &charClassMatcher{ + pos: position{line: 2893, col: 5, offset: 95917}, + val: "[,;!?0-9\\pL]", + chars: []rune{',', ';', '!', '?'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, - &litMatcher{ - pos: position{line: 2148, col: 19, offset: 76034}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2148, col: 23, offset: 76038}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &choiceExpr{ + pos: position{line: 2894, col: 6, offset: 95937}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonMacrosGroup11, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineMacros45, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + inverted: false, }, }, - }, - }, - &labeledExpr{ - pos: position{line: 2148, col: 30, offset: 76045}, - label: "content", - expr: &actionExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - run: (*parser).callonInlineMacros48, - expr: &oneOrMoreExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, + &andExpr{ + pos: position{line: 2894, col: 14, offset: 95945}, expr: &choiceExpr{ - pos: position{line: 2154, col: 31, offset: 76313}, + pos: position{line: 2894, col: 16, offset: 95947}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[ 0-9\\pL]", - chars: []rune{' '}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + pos: position{line: 2894, col: 16, offset: 95947}, + val: "[.�]", + chars: []rune{'.', '�'}, ignoreCase: false, inverted: false, }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineMacros52, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonMacrosGroup16, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -44438,458 +58822,546 @@ var g = &grammar{ }, }, }, - }, - }, - &labeledExpr{ - pos: position{line: 2149, col: 5, offset: 76112}, - label: "term3", - expr: &zeroOrOneExpr{ - pos: position{line: 2149, col: 11, offset: 76118}, - expr: &actionExpr{ - pos: position{line: 2149, col: 12, offset: 76119}, - run: (*parser).callonInlineMacros56, + &ruleRefExpr{ + pos: position{line: 2492, col: 7, offset: 83621}, + name: "InlineMacro", + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonMacrosGroup24, expr: &seqExpr{ - pos: position{line: 2149, col: 12, offset: 76119}, + pos: position{line: 991, col: 23, offset: 31310}, exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 2149, col: 12, offset: 76119}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineMacros61, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, &litMatcher{ - pos: position{line: 2149, col: 19, offset: 76126}, - val: ",", + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", ignoreCase: false, - want: "\",\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2149, col: 23, offset: 76130}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineMacros67, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + want: "\"�\"", }, &labeledExpr{ - pos: position{line: 2149, col: 30, offset: 76137}, - label: "content", + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", expr: &actionExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - run: (*parser).callonInlineMacros70, + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonMacrosGroup28, expr: &oneOrMoreExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, - expr: &choiceExpr{ - pos: position{line: 2154, col: 31, offset: 76313}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[ 0-9\\pL]", - chars: []rune{' '}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineMacros74, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, }, }, + &actionExpr{ + pos: position{line: 2905, col: 12, offset: 96279}, + run: (*parser).callonMacrosGroup32, + expr: &anyMatcher{ + line: 2905, col: 12, offset: 96279, + }, + }, }, }, - &litMatcher{ - pos: position{line: 2150, col: 5, offset: 76204}, - val: ")))", - ignoreCase: false, - want: "\")))\"", - }, }, }, - }, - &ruleRefExpr{ - pos: position{line: 1938, col: 7, offset: 68970}, - name: "IndexTerm", + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, { - name: "InlinePassthroughSubs", - pos: position{line: 1945, col: 1, offset: 69208}, - expr: &seqExpr{ - pos: position{line: 1946, col: 5, offset: 69238}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 1946, col: 5, offset: 69238}, - expr: &choiceExpr{ - pos: position{line: 1946, col: 6, offset: 69239}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1946, col: 6, offset: 69239}, - name: "InlinePassthrough", - }, - &actionExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - run: (*parser).callonInlinePassthroughSubs5, + name: "NoneGroup", + pos: position{line: 2500, col: 1, offset: 83929}, + expr: &actionExpr{ + pos: position{line: 2500, col: 14, offset: 83942}, + run: (*parser).callonNoneGroup1, + expr: &seqExpr{ + pos: position{line: 2500, col: 14, offset: 83942}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2500, col: 14, offset: 83942}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2500, col: 23, offset: 83951}, + expr: &actionExpr{ + pos: position{line: 2505, col: 5, offset: 84059}, + run: (*parser).callonNoneGroup5, expr: &seqExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, + pos: position{line: 2505, col: 5, offset: 84059}, exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - expr: &charClassMatcher{ - pos: position{line: 2232, col: 5, offset: 78844}, - val: "[,?!;0-9\\pL]", - chars: []rune{',', '?', '!', ';'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + ¬Expr{ + pos: position{line: 2505, col: 5, offset: 84059}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, - &andExpr{ - pos: position{line: 2232, col: 19, offset: 78858}, - expr: &choiceExpr{ - pos: position{line: 2232, col: 21, offset: 78860}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2232, col: 21, offset: 78860}, - val: "[\\r\\n ]", - chars: []rune{'\r', '\n', ' '}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 2506, col: 5, offset: 84068}, + label: "element", + expr: &oneOrMoreExpr{ + pos: position{line: 2506, col: 13, offset: 84076}, + expr: &choiceExpr{ + pos: position{line: 2507, col: 9, offset: 84086}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + run: (*parser).callonNoneGroup13, + expr: &seqExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + expr: &charClassMatcher{ + pos: position{line: 2893, col: 5, offset: 95917}, + val: "[,;!?0-9\\pL]", + chars: []rune{',', ';', '!', '?'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &choiceExpr{ + pos: position{line: 2894, col: 6, offset: 95937}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonNoneGroup18, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2894, col: 14, offset: 95945}, + expr: &choiceExpr{ + pos: position{line: 2894, col: 16, offset: 95947}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2894, col: 16, offset: 95947}, + val: "[.�]", + chars: []rune{'.', '�'}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonNoneGroup23, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonNoneGroup30, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonNoneGroup34, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2905, col: 12, offset: 96279}, + run: (*parser).callonNoneGroup38, + expr: &anyMatcher{ + line: 2905, col: 12, offset: 96279, + }, }, }, }, }, }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonInlinePassthroughSubs14, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, }, }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonInlinePassthroughSubs23, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + { + name: "NormalGroup", + pos: position{line: 2515, col: 1, offset: 84484}, + expr: &actionExpr{ + pos: position{line: 2516, col: 5, offset: 84504}, + run: (*parser).callonNormalGroup1, + expr: &seqExpr{ + pos: position{line: 2516, col: 5, offset: 84504}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2516, col: 5, offset: 84504}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2516, col: 14, offset: 84513}, + expr: &ruleRefExpr{ + pos: position{line: 2516, col: 15, offset: 84514}, + name: "NormalGroupElement", + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, + }, + { + name: "NormalGroupElement", + pos: position{line: 2521, col: 1, offset: 84635}, + expr: &actionExpr{ + pos: position{line: 2522, col: 5, offset: 84662}, + run: (*parser).callonNormalGroupElement1, + expr: &seqExpr{ + pos: position{line: 2522, col: 5, offset: 84662}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2522, col: 5, offset: 84662}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2523, col: 5, offset: 84671}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2524, col: 9, offset: 84689}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + run: (*parser).callonNormalGroupElement8, + expr: &seqExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + expr: &charClassMatcher{ + pos: position{line: 2893, col: 5, offset: 95917}, + val: "[,;!?0-9\\pL]", + chars: []rune{',', ';', '!', '?'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, + &choiceExpr{ + pos: position{line: 2894, col: 6, offset: 95937}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonNormalGroupElement13, expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, }, + &andExpr{ + pos: position{line: 2894, col: 14, offset: 95945}, + expr: &choiceExpr{ + pos: position{line: 2894, col: 16, offset: 95947}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2894, col: 16, offset: 95947}, + val: "[.�]", + chars: []rune{'.', '�'}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonNormalGroupElement18, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, }, }, }, }, }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonInlinePassthroughSubs32, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonInlinePassthroughSubs36, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonNormalGroupElement25, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, - }, - &oneOrMoreExpr{ - pos: position{line: 1949, col: 7, offset: 69346}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlinePassthroughSubs43, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonNormalGroupElement27, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\r\"", }, }, }, }, - }, - &actionExpr{ - pos: position{line: 2237, col: 12, offset: 79050}, - run: (*parser).callonInlinePassthroughSubs45, - expr: &charClassMatcher{ - pos: position{line: 2237, col: 12, offset: 79050}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - { - name: "SpecialCharacterSubs", - pos: position{line: 1954, col: 1, offset: 69505}, - expr: &seqExpr{ - pos: position{line: 1955, col: 5, offset: 69534}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 1955, col: 5, offset: 69534}, - expr: &choiceExpr{ - pos: position{line: 1955, col: 6, offset: 69535}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - run: (*parser).callonSpecialCharacterSubs4, - expr: &seqExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - expr: &charClassMatcher{ - pos: position{line: 2232, col: 5, offset: 78844}, - val: "[,?!;0-9\\pL]", - chars: []rune{',', '?', '!', ';'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonNormalGroupElement32, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", ignoreCase: false, - inverted: false, + want: "\"�\"", }, - }, - &andExpr{ - pos: position{line: 2232, col: 19, offset: 78858}, - expr: &choiceExpr{ - pos: position{line: 2232, col: 21, offset: 78860}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2232, col: 21, offset: 78860}, - val: "[\\r\\n ]", - chars: []rune{'\r', '\n', ' '}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonNormalGroupElement36, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, }, }, - }, - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonSpecialCharacterSubs13, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &actionExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + run: (*parser).callonNormalGroupElement40, + expr: &seqExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + run: (*parser).callonNormalGroupElement42, + }, + &litMatcher{ + pos: position{line: 1002, col: 5, offset: 31813}, + val: "+", ignoreCase: false, - inverted: false, + want: "\"+\"", }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, + &zeroOrMoreExpr{ + pos: position{line: 1002, col: 9, offset: 31817}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonNormalGroupElement45, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + }, + &andExpr{ + pos: position{line: 1002, col: 16, offset: 31824}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonNormalGroupElement49, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, @@ -44897,45 +59369,67 @@ var g = &grammar{ }, }, }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonSpecialCharacterSubs22, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &actionExpr{ + pos: position{line: 2899, col: 16, offset: 96068}, + run: (*parser).callonNormalGroupElement56, + expr: &seqExpr{ + pos: position{line: 2899, col: 16, offset: 96068}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2899, col: 17, offset: 96069}, + val: "[.,;!?]", + chars: []rune{'.', ',', ';', '!', '?'}, ignoreCase: false, inverted: false, }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &andExpr{ + pos: position{line: 2899, col: 46, offset: 96098}, + expr: &choiceExpr{ + pos: position{line: 2899, col: 48, offset: 96100}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonNormalGroupElement61, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonNormalGroupElement63, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, @@ -44943,840 +59437,1014 @@ var g = &grammar{ }, }, }, - }, - &actionExpr{ - pos: position{line: 2203, col: 21, offset: 77750}, - run: (*parser).callonSpecialCharacterSubs31, - expr: &choiceExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, - run: (*parser).callonSpecialCharacterSubs33, - expr: &seqExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1538, col: 27, offset: 54613}, - val: "<<", - ignoreCase: false, - want: "\"<<\"", - }, - &labeledExpr{ - pos: position{line: 1538, col: 32, offset: 54618}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonSpecialCharacterSubs37, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, + &ruleRefExpr{ + pos: position{line: 2530, col: 11, offset: 84904}, + name: "Quote", + }, + &ruleRefExpr{ + pos: position{line: 2531, col: 11, offset: 84920}, + name: "InlinePassthrough", + }, + &ruleRefExpr{ + pos: position{line: 2532, col: 11, offset: 84948}, + name: "InlineMacro", + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonNormalGroupElement73, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonNormalGroupElement75, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonNormalGroupElement78, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonNormalGroupElement80, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonNormalGroupElement84, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonNormalGroupElement88, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonNormalGroupElement94, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonNormalGroupElement99, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonNormalGroupElement101, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonNormalGroupElement104, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonNormalGroupElement108, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonNormalGroupElement115, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonNormalGroupElement120, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonNormalGroupElement122, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonNormalGroupElement126, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonNormalGroupElement130, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonNormalGroupElement137, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonNormalGroupElement142, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonNormalGroupElement144, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonNormalGroupElement148, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonNormalGroupElement152, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonNormalGroupElement158, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonNormalGroupElement161, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonNormalGroupElement165, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, }, }, }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonNormalGroupElement169, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 1538, col: 40, offset: 54626}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSpecialCharacterSubs43, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonNormalGroupElement171, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonNormalGroupElement173, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonNormalGroupElement176, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonNormalGroupElement180, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonNormalGroupElement187, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonNormalGroupElement192, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonNormalGroupElement194, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", ignoreCase: false, - want: "\"\\t\"", + want: "\"}\"", }, }, }, }, - }, - &litMatcher{ - pos: position{line: 1538, col: 47, offset: 54633}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - &labeledExpr{ - pos: position{line: 1538, col: 51, offset: 54637}, - label: "label", - expr: &oneOrMoreExpr{ - pos: position{line: 1548, col: 24, offset: 55025}, - expr: &choiceExpr{ - pos: position{line: 1549, col: 5, offset: 55031}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, - run: (*parser).callonSpecialCharacterSubs49, - expr: &seqExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 1549, col: 6, offset: 55032}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 1549, col: 14, offset: 55040}, - expr: &charClassMatcher{ - pos: position{line: 1549, col: 14, offset: 55040}, - val: "[^\\r\\n{<>]", - chars: []rune{'\r', '\n', '{', '<', '>'}, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonNormalGroupElement198, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonNormalGroupElement202, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - inverted: true, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, }, }, }, }, }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonSpecialCharacterSubs54, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonSpecialCharacterSubs58, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonNormalGroupElement209, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonNormalGroupElement214, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonNormalGroupElement216, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, }, }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, }, }, }, - &actionExpr{ - pos: position{line: 1553, col: 6, offset: 55250}, - run: (*parser).callonSpecialCharacterSubs64, - expr: &litMatcher{ - pos: position{line: 1553, col: 6, offset: 55250}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", }, }, }, }, - }, - &litMatcher{ - pos: position{line: 1538, col: 79, offset: 54665}, - val: ">>", - ignoreCase: false, - want: "\">>\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1540, col: 5, offset: 54730}, - run: (*parser).callonSpecialCharacterSubs67, - expr: &seqExpr{ - pos: position{line: 1540, col: 5, offset: 54730}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1540, col: 5, offset: 54730}, - val: "<<", - ignoreCase: false, - want: "\"<<\"", - }, - &labeledExpr{ - pos: position{line: 1540, col: 10, offset: 54735}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonSpecialCharacterSubs71, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonNormalGroupElement220, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonNormalGroupElement224, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, }, - &litMatcher{ - pos: position{line: 1540, col: 18, offset: 54743}, - val: ">>", - ignoreCase: false, - want: "\">>\"", - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2206, col: 9, offset: 77913}, - run: (*parser).callonSpecialCharacterSubs75, - expr: &charClassMatcher{ - pos: position{line: 2206, col: 10, offset: 77914}, - val: "[<>&]", - chars: []rune{'<', '>', '&'}, - ignoreCase: false, - inverted: false, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonSpecialCharacterSubs77, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonSpecialCharacterSubs81, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 1958, col: 7, offset: 69640}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSpecialCharacterSubs88, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2237, col: 12, offset: 79050}, - run: (*parser).callonSpecialCharacterSubs90, - expr: &charClassMatcher{ - pos: position{line: 2237, col: 12, offset: 79050}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - { - name: "QuotedTextSubs", - pos: position{line: 1963, col: 1, offset: 69731}, - expr: &seqExpr{ - pos: position{line: 1964, col: 5, offset: 69754}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 1964, col: 5, offset: 69754}, - expr: &choiceExpr{ - pos: position{line: 1964, col: 6, offset: 69755}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - run: (*parser).callonQuotedTextSubs4, - expr: &seqExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - expr: &charClassMatcher{ - pos: position{line: 2232, col: 5, offset: 78844}, - val: "[,?!;0-9\\pL]", - chars: []rune{',', '?', '!', ';'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2232, col: 19, offset: 78858}, - expr: &choiceExpr{ - pos: position{line: 2232, col: 21, offset: 78860}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2232, col: 21, offset: 78860}, - val: "[\\r\\n ]", - chars: []rune{'\r', '\n', ' '}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, }, }, }, - }, - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonQuotedTextSubs13, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + &actionExpr{ + pos: position{line: 2683, col: 15, offset: 89501}, + run: (*parser).callonNormalGroupElement230, + expr: &litMatcher{ + pos: position{line: 2683, col: 15, offset: 89501}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", }, }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonQuotedTextSubs22, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, + &actionExpr{ + pos: position{line: 2689, col: 14, offset: 89616}, + run: (*parser).callonNormalGroupElement232, + expr: &litMatcher{ + pos: position{line: 2689, col: 14, offset: 89616}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", }, }, - }, - &oneOrMoreExpr{ - pos: position{line: 1965, col: 7, offset: 69902}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuotedTextSubs34, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + &actionExpr{ + pos: position{line: 2693, col: 14, offset: 89692}, + run: (*parser).callonNormalGroupElement234, + expr: &litMatcher{ + pos: position{line: 2693, col: 14, offset: 89692}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", }, }, - }, - &ruleRefExpr{ - pos: position{line: 1966, col: 7, offset: 69916}, - name: "QuotedText", - }, - &ruleRefExpr{ - pos: position{line: 1967, col: 7, offset: 69934}, - name: "QuotedString", - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonQuotedTextSubs38, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonQuotedTextSubs42, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, + &actionExpr{ + pos: position{line: 2697, col: 15, offset: 89770}, + run: (*parser).callonNormalGroupElement236, + expr: &litMatcher{ + pos: position{line: 2697, col: 15, offset: 89770}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", }, }, - }, - &actionExpr{ - pos: position{line: 2237, col: 12, offset: 79050}, - run: (*parser).callonQuotedTextSubs46, - expr: &charClassMatcher{ - pos: position{line: 2237, col: 12, offset: 79050}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - { - name: "AttributeSubs", - pos: position{line: 1973, col: 1, offset: 70060}, - expr: &seqExpr{ - pos: position{line: 1974, col: 5, offset: 70082}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 1974, col: 5, offset: 70082}, - expr: &choiceExpr{ - pos: position{line: 1974, col: 6, offset: 70083}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - run: (*parser).callonAttributeSubs4, - expr: &seqExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - expr: &charClassMatcher{ - pos: position{line: 2232, col: 5, offset: 78844}, - val: "[,?!;0-9\\pL]", - chars: []rune{',', '?', '!', ';'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2232, col: 19, offset: 78858}, - expr: &choiceExpr{ - pos: position{line: 2232, col: 21, offset: 78860}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2232, col: 21, offset: 78860}, - val: "[\\r\\n ]", - chars: []rune{'\r', '\n', ' '}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, + &actionExpr{ + pos: position{line: 2701, col: 13, offset: 89845}, + run: (*parser).callonNormalGroupElement238, + expr: &litMatcher{ + pos: position{line: 2701, col: 13, offset: 89845}, + val: "...", + ignoreCase: false, + want: "\"...\"", }, }, - }, - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonAttributeSubs13, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, + &actionExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + run: (*parser).callonNormalGroupElement240, + expr: &seqExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, val: "[0-9\\pL]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonAttributeSubs22, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &litMatcher{ + pos: position{line: 2709, col: 31, offset: 90160}, + val: "'", ignoreCase: false, - inverted: false, + want: "\"'\"", }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, + &andExpr{ + pos: position{line: 2709, col: 35, offset: 90164}, + expr: &charClassMatcher{ + pos: position{line: 2709, col: 36, offset: 90165}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, - }, - &oneOrMoreExpr{ - pos: position{line: 1975, col: 7, offset: 70140}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonAttributeSubs34, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + &actionExpr{ + pos: position{line: 2905, col: 12, offset: 96279}, + run: (*parser).callonNormalGroupElement246, + expr: &anyMatcher{ + line: 2905, col: 12, offset: 96279, }, }, }, - &actionExpr{ - pos: position{line: 221, col: 25, offset: 7126}, - run: (*parser).callonAttributeSubs36, + }, + }, + }, + }, + }, + }, + { + name: "PostReplacementsGroup", + pos: position{line: 2540, col: 1, offset: 85206}, + expr: &actionExpr{ + pos: position{line: 2541, col: 5, offset: 85237}, + run: (*parser).callonPostReplacementsGroup1, + expr: &seqExpr{ + pos: position{line: 2541, col: 5, offset: 85237}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2541, col: 5, offset: 85237}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2541, col: 14, offset: 85246}, + expr: &actionExpr{ + pos: position{line: 2547, col: 5, offset: 85414}, + run: (*parser).callonPostReplacementsGroup5, expr: &seqExpr{ - pos: position{line: 221, col: 25, offset: 7126}, + pos: position{line: 2547, col: 5, offset: 85414}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 221, col: 25, offset: 7126}, - val: "{counter:", - ignoreCase: false, - want: "\"{counter:\"", - }, - &labeledExpr{ - pos: position{line: 221, col: 37, offset: 7138}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonAttributeSubs40, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, + ¬Expr{ + pos: position{line: 2547, col: 5, offset: 85414}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, &labeledExpr{ - pos: position{line: 221, col: 56, offset: 7157}, - label: "start", - expr: &zeroOrOneExpr{ - pos: position{line: 221, col: 62, offset: 7163}, - expr: &actionExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - run: (*parser).callonAttributeSubs47, - expr: &seqExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &labeledExpr{ - pos: position{line: 229, col: 21, offset: 7430}, - label: "start", - expr: &choiceExpr{ - pos: position{line: 229, col: 28, offset: 7437}, + pos: position{line: 2548, col: 5, offset: 85423}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2549, col: 9, offset: 85441}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + run: (*parser).callonPostReplacementsGroup12, + expr: &seqExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + expr: &charClassMatcher{ + pos: position{line: 2893, col: 5, offset: 95917}, + val: "[,;!?0-9\\pL]", + chars: []rune{',', ';', '!', '?'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &choiceExpr{ + pos: position{line: 2894, col: 6, offset: 95937}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - run: (*parser).callonAttributeSubs52, + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonPostReplacementsGroup17, expr: &charClassMatcher{ - pos: position{line: 229, col: 28, offset: 7437}, - val: "[A-Za-z]", - ranges: []rune{'A', 'Z', 'a', 'z'}, + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, }, - &actionExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - run: (*parser).callonAttributeSubs54, - expr: &oneOrMoreExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - expr: &charClassMatcher{ - pos: position{line: 231, col: 9, offset: 7491}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + &andExpr{ + pos: position{line: 2894, col: 14, offset: 95945}, + expr: &choiceExpr{ + pos: position{line: 2894, col: 16, offset: 95947}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2894, col: 16, offset: 95947}, + val: "[.�]", + chars: []rune{'.', '�'}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonPostReplacementsGroup22, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, @@ -45785,526 +60453,342 @@ var g = &grammar{ }, }, }, - }, - }, - }, - &litMatcher{ - pos: position{line: 221, col: 78, offset: 7179}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 225, col: 25, offset: 7281}, - run: (*parser).callonAttributeSubs58, - expr: &seqExpr{ - pos: position{line: 225, col: 25, offset: 7281}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 225, col: 25, offset: 7281}, - val: "{counter2:", - ignoreCase: false, - want: "\"{counter2:\"", - }, - &labeledExpr{ - pos: position{line: 225, col: 38, offset: 7294}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonAttributeSubs62, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonPostReplacementsGroup29, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + }, + &actionExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + run: (*parser).callonPostReplacementsGroup31, + expr: &seqExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 999, col: 5, offset: 31756}, + run: (*parser).callonPostReplacementsGroup33, + }, + &litMatcher{ + pos: position{line: 1002, col: 5, offset: 31813}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1002, col: 9, offset: 31817}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonPostReplacementsGroup36, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &andExpr{ + pos: position{line: 1002, col: 16, offset: 31824}, + expr: &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonPostReplacementsGroup40, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, + }, }, }, }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 225, col: 57, offset: 7313}, - label: "start", - expr: &zeroOrOneExpr{ - pos: position{line: 225, col: 63, offset: 7319}, - expr: &actionExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - run: (*parser).callonAttributeSubs69, - expr: &seqExpr{ - pos: position{line: 229, col: 17, offset: 7426}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", - ignoreCase: false, - want: "\":\"", + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonPostReplacementsGroup47, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, - &labeledExpr{ - pos: position{line: 229, col: 21, offset: 7430}, - label: "start", - expr: &choiceExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 229, col: 28, offset: 7437}, - run: (*parser).callonAttributeSubs74, + }, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonPostReplacementsGroup52, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonPostReplacementsGroup56, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, expr: &charClassMatcher{ - pos: position{line: 229, col: 28, offset: 7437}, - val: "[A-Za-z]", - ranges: []rune{'A', 'Z', 'a', 'z'}, + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, inverted: false, }, }, - &actionExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - run: (*parser).callonAttributeSubs76, - expr: &oneOrMoreExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - expr: &charClassMatcher{ - pos: position{line: 231, col: 9, offset: 7491}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, }, }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, }, }, - }, - }, - }, - &litMatcher{ - pos: position{line: 225, col: 79, offset: 7335}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonAttributeSubs80, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonAttributeSubs84, - expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, + &actionExpr{ + pos: position{line: 2905, col: 12, offset: 96279}, + run: (*parser).callonPostReplacementsGroup60, + expr: &anyMatcher{ + line: 2905, col: 12, offset: 96279, }, }, }, }, }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonAttributeSubs90, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonAttributeSubs94, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, }, }, }, - &actionExpr{ - pos: position{line: 2237, col: 12, offset: 79050}, - run: (*parser).callonAttributeSubs98, - expr: &charClassMatcher{ - pos: position{line: 2237, col: 12, offset: 79050}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, }, { - name: "InlineMacroSubs", - pos: position{line: 1982, col: 1, offset: 70285}, - expr: &seqExpr{ - pos: position{line: 1983, col: 5, offset: 70309}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 1983, col: 5, offset: 70309}, - expr: &choiceExpr{ - pos: position{line: 1983, col: 6, offset: 70310}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - run: (*parser).callonInlineMacroSubs4, - expr: &seqExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - expr: &charClassMatcher{ - pos: position{line: 2232, col: 5, offset: 78844}, - val: "[,?!;0-9\\pL]", - chars: []rune{',', '?', '!', ';'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2232, col: 19, offset: 78858}, - expr: &choiceExpr{ - pos: position{line: 2232, col: 21, offset: 78860}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2232, col: 21, offset: 78860}, - val: "[\\r\\n ]", - chars: []rune{'\r', '\n', ' '}, + name: "QuotesGroup", + pos: position{line: 2560, col: 1, offset: 85767}, + expr: &actionExpr{ + pos: position{line: 2560, col: 16, offset: 85782}, + run: (*parser).callonQuotesGroup1, + expr: &seqExpr{ + pos: position{line: 2560, col: 16, offset: 85782}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2560, col: 16, offset: 85782}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2560, col: 25, offset: 85791}, + expr: &choiceExpr{ + pos: position{line: 2561, col: 5, offset: 85797}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + run: (*parser).callonQuotesGroup6, + expr: &seqExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + expr: &charClassMatcher{ + pos: position{line: 2893, col: 5, offset: 95917}, + val: "[,;!?0-9\\pL]", + chars: []rune{',', ';', '!', '?'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonInlineMacroSubs13, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &choiceExpr{ + pos: position{line: 2894, col: 6, offset: 95937}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonQuotesGroup11, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonInlineMacroSubs22, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &andExpr{ + pos: position{line: 2894, col: 14, offset: 95945}, + expr: &choiceExpr{ + pos: position{line: 2894, col: 16, offset: 95947}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2894, col: 16, offset: 95947}, + val: "[.�]", + chars: []rune{'.', '�'}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonQuotesGroup16, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, }, }, }, }, }, }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 1984, col: 7, offset: 70367}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineMacroSubs34, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + &ruleRefExpr{ + pos: position{line: 2562, col: 7, offset: 85814}, + name: "Quote", }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1985, col: 7, offset: 70381}, - name: "InlineMacros", - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonInlineMacroSubs37, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonInlineMacroSubs41, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonQuotesGroup24, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonQuotesGroup28, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", + }, + &actionExpr{ + pos: position{line: 2905, col: 12, offset: 96279}, + run: (*parser).callonQuotesGroup32, + expr: &anyMatcher{ + line: 2905, col: 12, offset: 96279, }, }, }, }, - &actionExpr{ - pos: position{line: 2237, col: 12, offset: 79050}, - run: (*parser).callonInlineMacroSubs45, - expr: &charClassMatcher{ - pos: position{line: 2237, col: 12, offset: 79050}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - { - name: "MarkdownQuoteMacroSubs", - pos: position{line: 1991, col: 1, offset: 70529}, - expr: &actionExpr{ - pos: position{line: 1991, col: 27, offset: 70555}, - run: (*parser).callonMarkdownQuoteMacroSubs1, - expr: &seqExpr{ - pos: position{line: 1991, col: 27, offset: 70555}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1991, col: 27, offset: 70555}, - label: "lines", - expr: &zeroOrMoreExpr{ - pos: position{line: 1991, col: 33, offset: 70561}, - expr: &ruleRefExpr{ - pos: position{line: 1991, col: 34, offset: 70562}, - name: "MarkdownQuoteLine", - }, }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2962, col: 8, offset: 97819}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2962, col: 9, offset: 97820, }, }, }, @@ -46312,56 +60796,99 @@ var g = &grammar{ }, }, { - name: "MarkdownQuoteLine", - pos: position{line: 1995, col: 1, offset: 70649}, + name: "ReplacementsGroup", + pos: position{line: 2569, col: 1, offset: 86058}, expr: &actionExpr{ - pos: position{line: 1996, col: 5, offset: 70675}, - run: (*parser).callonMarkdownQuoteLine1, + pos: position{line: 2569, col: 22, offset: 86079}, + run: (*parser).callonReplacementsGroup1, expr: &seqExpr{ - pos: position{line: 1996, col: 5, offset: 70675}, + pos: position{line: 2569, col: 22, offset: 86079}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1996, col: 5, offset: 70675}, + pos: position{line: 2569, col: 22, offset: 86079}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1996, col: 14, offset: 70684}, + pos: position{line: 2569, col: 31, offset: 86088}, expr: &choiceExpr{ - pos: position{line: 1996, col: 15, offset: 70685}, + pos: position{line: 2570, col: 5, offset: 86094}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - run: (*parser).callonMarkdownQuoteLine6, + pos: position{line: 2893, col: 5, offset: 95917}, + run: (*parser).callonReplacementsGroup6, expr: &seqExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, + pos: position{line: 2893, col: 5, offset: 95917}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, + pos: position{line: 2893, col: 5, offset: 95917}, expr: &charClassMatcher{ - pos: position{line: 2232, col: 5, offset: 78844}, - val: "[,?!;0-9\\pL]", - chars: []rune{',', '?', '!', ';'}, + pos: position{line: 2893, col: 5, offset: 95917}, + val: "[,;!?0-9\\pL]", + chars: []rune{',', ';', '!', '?'}, ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, }, - &andExpr{ - pos: position{line: 2232, col: 19, offset: 78858}, - expr: &choiceExpr{ - pos: position{line: 2232, col: 21, offset: 78860}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2232, col: 21, offset: 78860}, - val: "[\\r\\n ]", - chars: []rune{'\r', '\n', ' '}, + &choiceExpr{ + pos: position{line: 2894, col: 6, offset: 95937}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonReplacementsGroup11, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + &andExpr{ + pos: position{line: 2894, col: 14, offset: 95945}, + expr: &choiceExpr{ + pos: position{line: 2894, col: 16, offset: 95947}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2894, col: 16, offset: 95947}, + val: "[.�]", + chars: []rune{'.', '�'}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonReplacementsGroup16, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, @@ -46371,84 +60898,102 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonMarkdownQuoteLine15, + pos: position{line: 2639, col: 5, offset: 88039}, + run: (*parser).callonReplacementsGroup23, expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, + pos: position{line: 2639, col: 5, offset: 88039}, exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, + &andCodeExpr{ + pos: position{line: 2639, col: 5, offset: 88039}, + run: (*parser).callonReplacementsGroup25, }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, + &labeledExpr{ + pos: position{line: 2642, col: 5, offset: 88105}, + label: "element", expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, + pos: position{line: 2681, col: 11, offset: 89407}, alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2683, col: 15, offset: 89501}, + run: (*parser).callonReplacementsGroup28, + expr: &litMatcher{ + pos: position{line: 2683, col: 15, offset: 89501}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2689, col: 14, offset: 89616}, + run: (*parser).callonReplacementsGroup30, + expr: &litMatcher{ + pos: position{line: 2689, col: 14, offset: 89616}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", }, }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonMarkdownQuoteLine24, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2693, col: 14, offset: 89692}, + run: (*parser).callonReplacementsGroup32, + expr: &litMatcher{ + pos: position{line: 2693, col: 14, offset: 89692}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &actionExpr{ + pos: position{line: 2697, col: 15, offset: 89770}, + run: (*parser).callonReplacementsGroup34, + expr: &litMatcher{ + pos: position{line: 2697, col: 15, offset: 89770}, + val: "(R)", ignoreCase: false, - inverted: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2701, col: 13, offset: 89845}, + run: (*parser).callonReplacementsGroup36, + expr: &litMatcher{ + pos: position{line: 2701, col: 13, offset: 89845}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + run: (*parser).callonReplacementsGroup38, + expr: &seqExpr{ + pos: position{line: 2709, col: 22, offset: 90151}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2709, col: 31, offset: 90160}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2709, col: 35, offset: 90164}, + expr: &charClassMatcher{ + pos: position{line: 2709, col: 36, offset: 90165}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, @@ -46457,56 +61002,28 @@ var g = &grammar{ }, }, }, - &oneOrMoreExpr{ - pos: position{line: 1997, col: 7, offset: 70742}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonMarkdownQuoteLine36, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1998, col: 7, offset: 70756}, - name: "InlineMacros", - }, &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonMarkdownQuoteLine39, + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonReplacementsGroup44, expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 991, col: 23, offset: 31310}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 989, col: 32, offset: 31278}, val: "�", ignoreCase: false, want: "\"�\"", }, &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, + pos: position{line: 991, col: 51, offset: 31338}, label: "ref", expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonMarkdownQuoteLine43, + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonReplacementsGroup48, expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 991, col: 56, offset: 31343}, expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 991, col: 56, offset: 31343}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -46516,7 +61033,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, + pos: position{line: 989, col: 32, offset: 31278}, val: "�", ignoreCase: false, want: "\"�\"", @@ -46525,42 +61042,20 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 2237, col: 12, offset: 79050}, - run: (*parser).callonMarkdownQuoteLine47, - expr: &charClassMatcher{ - pos: position{line: 2237, col: 12, offset: 79050}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, + pos: position{line: 2905, col: 12, offset: 96279}, + run: (*parser).callonReplacementsGroup52, + expr: &anyMatcher{ + line: 2905, col: 12, offset: 96279, }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, @@ -46568,1222 +61063,2054 @@ var g = &grammar{ }, }, { - name: "MarkdownQuoteAttribution", - pos: position{line: 2004, col: 1, offset: 70889}, + name: "SpecialCharactersGroup", + pos: position{line: 2578, col: 1, offset: 86386}, expr: &actionExpr{ - pos: position{line: 2004, col: 29, offset: 70917}, - run: (*parser).callonMarkdownQuoteAttribution1, + pos: position{line: 2578, col: 27, offset: 86412}, + run: (*parser).callonSpecialCharactersGroup1, expr: &seqExpr{ - pos: position{line: 2004, col: 29, offset: 70917}, + pos: position{line: 2578, col: 27, offset: 86412}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2004, col: 29, offset: 70917}, - val: "-- ", - ignoreCase: false, - want: "\"-- \"", - }, &labeledExpr{ - pos: position{line: 2004, col: 35, offset: 70923}, - label: "author", - expr: &actionExpr{ - pos: position{line: 2004, col: 43, offset: 70931}, - run: (*parser).callonMarkdownQuoteAttribution5, - expr: &oneOrMoreExpr{ - pos: position{line: 2004, col: 44, offset: 70932}, - expr: &charClassMatcher{ - pos: position{line: 2004, col: 44, offset: 70932}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "ReplacementSubs", - pos: position{line: 2011, col: 1, offset: 71069}, - expr: &seqExpr{ - pos: position{line: 2012, col: 5, offset: 71093}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 2012, col: 5, offset: 71093}, - expr: &choiceExpr{ - pos: position{line: 2012, col: 6, offset: 71094}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - run: (*parser).callonReplacementSubs4, - expr: &seqExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - expr: &charClassMatcher{ - pos: position{line: 2232, col: 5, offset: 78844}, - val: "[,?!;0-9\\pL]", - chars: []rune{',', '?', '!', ';'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2232, col: 19, offset: 78858}, - expr: &choiceExpr{ - pos: position{line: 2232, col: 21, offset: 78860}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2232, col: 21, offset: 78860}, - val: "[\\r\\n ]", - chars: []rune{'\r', '\n', ' '}, + pos: position{line: 2578, col: 27, offset: 86412}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2578, col: 36, offset: 86421}, + expr: &choiceExpr{ + pos: position{line: 2579, col: 5, offset: 86427}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + run: (*parser).callonSpecialCharactersGroup6, + expr: &seqExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + expr: &charClassMatcher{ + pos: position{line: 2893, col: 5, offset: 95917}, + val: "[,;!?0-9\\pL]", + chars: []rune{',', ';', '!', '?'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonReplacementSubs13, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &choiceExpr{ + pos: position{line: 2894, col: 6, offset: 95937}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSpecialCharactersGroup11, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2894, col: 14, offset: 95945}, + expr: &choiceExpr{ + pos: position{line: 2894, col: 16, offset: 95947}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2894, col: 16, offset: 95947}, + val: "[.�]", + chars: []rune{'.', '�'}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonSpecialCharactersGroup16, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, }, }, }, }, }, }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonReplacementSubs22, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonSpecialCharactersGroup23, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonSpecialCharactersGroup25, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonSpecialCharactersGroup28, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonSpecialCharactersGroup30, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonSpecialCharactersGroup34, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonSpecialCharactersGroup38, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonSpecialCharactersGroup44, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSpecialCharactersGroup49, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonSpecialCharactersGroup51, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonSpecialCharactersGroup54, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSpecialCharactersGroup58, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSpecialCharactersGroup65, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSpecialCharactersGroup70, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSpecialCharactersGroup72, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonSpecialCharactersGroup76, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSpecialCharactersGroup80, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonSpecialCharactersGroup87, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonSpecialCharactersGroup92, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonSpecialCharactersGroup94, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonSpecialCharactersGroup98, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonSpecialCharactersGroup102, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonSpecialCharactersGroup108, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonSpecialCharactersGroup111, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonSpecialCharactersGroup115, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonSpecialCharactersGroup119, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, }, }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2013, col: 7, offset: 71151}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonReplacementSubs34, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2171, col: 15, offset: 76747}, - run: (*parser).callonReplacementSubs36, - expr: &litMatcher{ - pos: position{line: 2171, col: 15, offset: 76747}, - val: "`'", - ignoreCase: false, - want: "\"`'\"", - }, - }, - &actionExpr{ - pos: position{line: 2177, col: 14, offset: 76854}, - run: (*parser).callonReplacementSubs38, - expr: &litMatcher{ - pos: position{line: 2177, col: 14, offset: 76854}, - val: "(C)", - ignoreCase: false, - want: "\"(C)\"", - }, - }, - &actionExpr{ - pos: position{line: 2180, col: 14, offset: 76921}, - run: (*parser).callonReplacementSubs40, - expr: &litMatcher{ - pos: position{line: 2180, col: 14, offset: 76921}, - val: "(TM)", - ignoreCase: false, - want: "\"(TM)\"", - }, - }, - &actionExpr{ - pos: position{line: 2183, col: 15, offset: 76990}, - run: (*parser).callonReplacementSubs42, - expr: &litMatcher{ - pos: position{line: 2183, col: 15, offset: 76990}, - val: "(R)", - ignoreCase: false, - want: "\"(R)\"", - }, - }, - &actionExpr{ - pos: position{line: 2186, col: 13, offset: 77056}, - run: (*parser).callonReplacementSubs44, - expr: &litMatcher{ - pos: position{line: 2186, col: 13, offset: 77056}, - val: "...", - ignoreCase: false, - want: "\"...\"", - }, - }, - &actionExpr{ - pos: position{line: 2194, col: 22, offset: 77354}, - run: (*parser).callonReplacementSubs46, - expr: &seqExpr{ - pos: position{line: 2194, col: 22, offset: 77354}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - &litMatcher{ - pos: position{line: 2194, col: 31, offset: 77363}, - val: "'", - ignoreCase: false, - want: "\"'\"", - }, - &andExpr{ - pos: position{line: 2194, col: 35, offset: 77367}, - expr: &charClassMatcher{ - pos: position{line: 2194, col: 36, offset: 77368}, - val: "[\\pL]", - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonReplacementSubs52, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonReplacementSubs56, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonSpecialCharactersGroup121, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonSpecialCharactersGroup125, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", + }, + &actionExpr{ + pos: position{line: 2905, col: 12, offset: 96279}, + run: (*parser).callonSpecialCharactersGroup129, + expr: &anyMatcher{ + line: 2905, col: 12, offset: 96279, }, }, }, }, - &actionExpr{ - pos: position{line: 2237, col: 12, offset: 79050}, - run: (*parser).callonReplacementSubs60, - expr: &charClassMatcher{ - pos: position{line: 2237, col: 12, offset: 79050}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, }, { - name: "PostReplacementSubs", - pos: position{line: 2021, col: 1, offset: 71376}, - expr: &seqExpr{ - pos: position{line: 2022, col: 5, offset: 71404}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 2022, col: 5, offset: 71404}, - expr: &choiceExpr{ - pos: position{line: 2022, col: 6, offset: 71405}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - run: (*parser).callonPostReplacementSubs4, - expr: &seqExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - expr: &charClassMatcher{ - pos: position{line: 2232, col: 5, offset: 78844}, - val: "[,?!;0-9\\pL]", - chars: []rune{',', '?', '!', ';'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2232, col: 19, offset: 78858}, - expr: &choiceExpr{ - pos: position{line: 2232, col: 21, offset: 78860}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2232, col: 21, offset: 78860}, - val: "[\\r\\n ]", - chars: []rune{'\r', '\n', ' '}, + name: "VerbatimGroup", + pos: position{line: 2586, col: 1, offset: 86653}, + expr: &actionExpr{ + pos: position{line: 2586, col: 18, offset: 86670}, + run: (*parser).callonVerbatimGroup1, + expr: &seqExpr{ + pos: position{line: 2586, col: 18, offset: 86670}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2586, col: 18, offset: 86670}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2586, col: 27, offset: 86679}, + expr: &choiceExpr{ + pos: position{line: 2587, col: 5, offset: 86685}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + run: (*parser).callonVerbatimGroup6, + expr: &seqExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2893, col: 5, offset: 95917}, + expr: &charClassMatcher{ + pos: position{line: 2893, col: 5, offset: 95917}, + val: "[,;!?0-9\\pL]", + chars: []rune{',', ';', '!', '?'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonPostReplacementSubs13, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &choiceExpr{ + pos: position{line: 2894, col: 6, offset: 95937}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonVerbatimGroup11, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonPostReplacementSubs22, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &andExpr{ + pos: position{line: 2894, col: 14, offset: 95945}, + expr: &choiceExpr{ + pos: position{line: 2894, col: 16, offset: 95947}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2894, col: 16, offset: 95947}, + val: "[.�]", + chars: []rune{'.', '�'}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonVerbatimGroup16, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, + }, + }, }, }, }, }, }, }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonPostReplacementSubs31, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonPostReplacementSubs35, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, + &ruleRefExpr{ + pos: position{line: 2588, col: 7, offset: 86702}, + name: "Callout", }, - }, - }, - &actionExpr{ - pos: position{line: 995, col: 14, offset: 32701}, - run: (*parser).callonPostReplacementSubs39, - expr: &seqExpr{ - pos: position{line: 995, col: 14, offset: 32701}, - exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonPostReplacementSubs43, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonVerbatimGroup24, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonVerbatimGroup26, }, - }, - }, - &litMatcher{ - pos: position{line: 995, col: 20, offset: 32707}, - val: "+", - ignoreCase: false, - want: "\"+\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 995, col: 24, offset: 32711}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonPostReplacementSubs49, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonVerbatimGroup29, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonVerbatimGroup31, + expr: &seqExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonVerbatimGroup35, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonVerbatimGroup39, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonVerbatimGroup45, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonVerbatimGroup50, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonVerbatimGroup52, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonVerbatimGroup55, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonVerbatimGroup59, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonVerbatimGroup66, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonVerbatimGroup71, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonVerbatimGroup73, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonVerbatimGroup77, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonVerbatimGroup81, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonVerbatimGroup88, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonVerbatimGroup93, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonVerbatimGroup95, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonVerbatimGroup99, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonVerbatimGroup103, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonVerbatimGroup109, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonVerbatimGroup112, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonVerbatimGroup116, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonVerbatimGroup120, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, }, - &andExpr{ - pos: position{line: 995, col: 31, offset: 32718}, - expr: &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + &actionExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonVerbatimGroup122, + expr: &seqExpr{ + pos: position{line: 991, col: 23, offset: 31310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 991, col: 51, offset: 31338}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonVerbatimGroup126, + expr: &oneOrMoreExpr{ + pos: position{line: 991, col: 56, offset: 31343}, + expr: &charClassMatcher{ + pos: position{line: 991, col: 56, offset: 31343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, + &litMatcher{ + pos: position{line: 989, col: 32, offset: 31278}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, }, }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2025, col: 7, offset: 71530}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonPostReplacementSubs60, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &actionExpr{ + pos: position{line: 2905, col: 12, offset: 96279}, + run: (*parser).callonVerbatimGroup130, + expr: &anyMatcher{ + line: 2905, col: 12, offset: 96279, }, }, }, }, - &actionExpr{ - pos: position{line: 2237, col: 12, offset: 79050}, - run: (*parser).callonPostReplacementSubs62, - expr: &charClassMatcher{ - pos: position{line: 2237, col: 12, offset: 79050}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, }, }, }, }, }, { - name: "CalloutSubs", - pos: position{line: 2030, col: 1, offset: 71625}, - expr: &seqExpr{ - pos: position{line: 2031, col: 5, offset: 71645}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 2031, col: 5, offset: 71645}, - expr: &choiceExpr{ - pos: position{line: 2031, col: 6, offset: 71646}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - run: (*parser).callonCalloutSubs4, - expr: &seqExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - expr: &charClassMatcher{ - pos: position{line: 2232, col: 5, offset: 78844}, - val: "[,?!;0-9\\pL]", - chars: []rune{',', '?', '!', ';'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + name: "InlineMacro", + pos: position{line: 2595, col: 1, offset: 86971}, + expr: &actionExpr{ + pos: position{line: 2597, col: 5, offset: 87053}, + run: (*parser).callonInlineMacro1, + expr: &seqExpr{ + pos: position{line: 2597, col: 5, offset: 87053}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2597, col: 5, offset: 87053}, + run: (*parser).callonInlineMacro3, + }, + &labeledExpr{ + pos: position{line: 2600, col: 5, offset: 87113}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2601, col: 9, offset: 87131}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2601, col: 9, offset: 87131}, + name: "InlineIcon", + }, + &ruleRefExpr{ + pos: position{line: 2602, col: 11, offset: 87152}, + name: "InlineImage", + }, + &ruleRefExpr{ + pos: position{line: 2603, col: 11, offset: 87175}, + name: "Link", + }, + &ruleRefExpr{ + pos: position{line: 2604, col: 11, offset: 87191}, + name: "InlinePassthrough", + }, + &ruleRefExpr{ + pos: position{line: 2605, col: 11, offset: 87220}, + name: "InlineFootnote", + }, + &ruleRefExpr{ + pos: position{line: 2606, col: 11, offset: 87246}, + name: "CrossReference", + }, + &ruleRefExpr{ + pos: position{line: 2607, col: 11, offset: 87272}, + name: "InlineUserMacro", + }, + &actionExpr{ + pos: position{line: 1174, col: 20, offset: 37252}, + run: (*parser).callonInlineMacro13, + expr: &seqExpr{ + pos: position{line: 1174, col: 20, offset: 37252}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1174, col: 20, offset: 37252}, + val: "[[", ignoreCase: false, - inverted: false, + want: "\"[[\"", }, - }, - &andExpr{ - pos: position{line: 2232, col: 19, offset: 78858}, - expr: &choiceExpr{ - pos: position{line: 2232, col: 21, offset: 78860}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2232, col: 21, offset: 78860}, - val: "[\\r\\n ]", - chars: []rune{'\r', '\n', ' '}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 1174, col: 25, offset: 37257}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonInlineMacro17, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, }, }, }, }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonCalloutSubs13, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &litMatcher{ + pos: position{line: 1174, col: 33, offset: 37265}, + val: "]]", ignoreCase: false, - inverted: false, + want: "\"]]\"", }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, + &zeroOrMoreExpr{ + pos: position{line: 1174, col: 38, offset: 37270}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlineMacro22, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, inverted: false, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, }, }, }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonCalloutSubs22, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &actionExpr{ + pos: position{line: 1191, col: 23, offset: 37957}, + run: (*parser).callonInlineMacro24, + expr: &seqExpr{ + pos: position{line: 1191, col: 23, offset: 37957}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1191, col: 23, offset: 37957}, + val: "(((", ignoreCase: false, - inverted: false, + want: "\"(((\"", }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 1191, col: 29, offset: 37963}, + label: "term1", + expr: &actionExpr{ + pos: position{line: 1198, col: 30, offset: 38294}, + run: (*parser).callonInlineMacro28, + expr: &oneOrMoreExpr{ + pos: position{line: 1198, col: 30, offset: 38294}, + expr: &choiceExpr{ + pos: position{line: 1198, col: 31, offset: 38295}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlineMacro32, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonCalloutSubs31, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonCalloutSubs35, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 1192, col: 5, offset: 38002}, + label: "term2", + expr: &zeroOrOneExpr{ + pos: position{line: 1192, col: 11, offset: 38008}, + expr: &actionExpr{ + pos: position{line: 1192, col: 12, offset: 38009}, + run: (*parser).callonInlineMacro36, + expr: &seqExpr{ + pos: position{line: 1192, col: 12, offset: 38009}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1192, col: 12, offset: 38009}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlineMacro39, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 1192, col: 19, offset: 38016}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1192, col: 23, offset: 38020}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlineMacro43, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1192, col: 30, offset: 38027}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1198, col: 30, offset: 38294}, + run: (*parser).callonInlineMacro46, + expr: &oneOrMoreExpr{ + pos: position{line: 1198, col: 30, offset: 38294}, + expr: &choiceExpr{ + pos: position{line: 1198, col: 31, offset: 38295}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlineMacro50, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2033, col: 7, offset: 71728}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonCalloutSubs42, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 2034, col: 7, offset: 71741}, - name: "Callout", - }, - &actionExpr{ - pos: position{line: 2237, col: 12, offset: 79050}, - run: (*parser).callonCalloutSubs45, - expr: &charClassMatcher{ - pos: position{line: 2237, col: 12, offset: 79050}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - { - name: "NoneSubs", - pos: position{line: 2039, col: 1, offset: 71831}, - expr: &seqExpr{ - pos: position{line: 2039, col: 13, offset: 71843}, - exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 2039, col: 13, offset: 71843}, - expr: &choiceExpr{ - pos: position{line: 2040, col: 5, offset: 71849}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonNoneSubs4, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonNoneSubs8, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 1193, col: 5, offset: 38094}, + label: "term3", + expr: &zeroOrOneExpr{ + pos: position{line: 1193, col: 11, offset: 38100}, + expr: &actionExpr{ + pos: position{line: 1193, col: 12, offset: 38101}, + run: (*parser).callonInlineMacro54, + expr: &seqExpr{ + pos: position{line: 1193, col: 12, offset: 38101}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1193, col: 12, offset: 38101}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlineMacro57, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 1193, col: 19, offset: 38108}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1193, col: 23, offset: 38112}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlineMacro61, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1193, col: 30, offset: 38119}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1198, col: 30, offset: 38294}, + run: (*parser).callonInlineMacro64, + expr: &oneOrMoreExpr{ + pos: position{line: 1198, col: 30, offset: 38294}, + expr: &choiceExpr{ + pos: position{line: 1198, col: 31, offset: 38295}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlineMacro68, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2041, col: 8, offset: 71876}, - run: (*parser).callonNoneSubs12, - expr: &seqExpr{ - pos: position{line: 2041, col: 8, offset: 71876}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2041, col: 8, offset: 71876}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2041, col: 13, offset: 71881}, - expr: &charClassMatcher{ - pos: position{line: 2041, col: 13, offset: 71881}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 1194, col: 5, offset: 38186}, + val: ")))", ignoreCase: false, - inverted: true, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + want: "\")))\"", }, }, }, }, + &ruleRefExpr{ + pos: position{line: 2610, col: 11, offset: 87354}, + name: "IndexTerm", + }, + &ruleRefExpr{ + pos: position{line: 2611, col: 11, offset: 87374}, + name: "InlineUserMacro", + }, }, }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, }, { - name: "Table", - pos: position{line: 2048, col: 1, offset: 72188}, + name: "InlinePassthrough", + pos: position{line: 2615, col: 1, offset: 87436}, expr: &actionExpr{ - pos: position{line: 2048, col: 10, offset: 72197}, - run: (*parser).callonTable1, + pos: position{line: 2617, col: 5, offset: 87524}, + run: (*parser).callonInlinePassthrough1, expr: &seqExpr{ - pos: position{line: 2048, col: 10, offset: 72197}, + pos: position{line: 2617, col: 5, offset: 87524}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2057, col: 19, offset: 72477}, - val: "|===", - ignoreCase: false, - want: "\"|===\"", + &andCodeExpr{ + pos: position{line: 2617, col: 5, offset: 87524}, + run: (*parser).callonInlinePassthrough3, }, - &zeroOrMoreExpr{ - pos: position{line: 2057, col: 26, offset: 72484}, + &labeledExpr{ + pos: position{line: 2620, col: 5, offset: 87596}, + label: "element", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2621, col: 9, offset: 87614}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonTable7, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2049, col: 5, offset: 72216}, - label: "header", - expr: &zeroOrOneExpr{ - pos: position{line: 2049, col: 12, offset: 72223}, - expr: &ruleRefExpr{ - pos: position{line: 2049, col: 13, offset: 72224}, - name: "TableLineHeader", - }, - }, - }, - &labeledExpr{ - pos: position{line: 2050, col: 5, offset: 72246}, - label: "lines", - expr: &zeroOrMoreExpr{ - pos: position{line: 2050, col: 11, offset: 72252}, - expr: &ruleRefExpr{ - pos: position{line: 2050, col: 12, offset: 72253}, - name: "TableLine", - }, - }, - }, - &choiceExpr{ - pos: position{line: 2051, col: 6, offset: 72270}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 2057, col: 19, offset: 72477}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2057, col: 19, offset: 72477}, - val: "|===", - ignoreCase: false, - want: "\"|===\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2057, col: 26, offset: 72484}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonTable26, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 1260, col: 26, offset: 41476}, + run: (*parser).callonInlinePassthrough6, + expr: &seqExpr{ + pos: position{line: 1260, col: 26, offset: 41476}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1258, col: 32, offset: 41444}, + val: "+++", + ignoreCase: false, + want: "\"+++\"", + }, + &labeledExpr{ + pos: position{line: 1260, col: 54, offset: 41504}, + label: "content", + expr: &choiceExpr{ + pos: position{line: 1264, col: 33, offset: 41717}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1264, col: 34, offset: 41718}, + run: (*parser).callonInlinePassthrough11, + expr: &zeroOrMoreExpr{ + pos: position{line: 1264, col: 34, offset: 41718}, + expr: &seqExpr{ + pos: position{line: 1264, col: 35, offset: 41719}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1264, col: 35, offset: 41719}, + expr: &litMatcher{ + pos: position{line: 1258, col: 32, offset: 41444}, + val: "+++", + ignoreCase: false, + want: "\"+++\"", + }, + }, + &anyMatcher{ + line: 1264, col: 64, offset: 41748, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1266, col: 11, offset: 41921}, + run: (*parser).callonInlinePassthrough17, + expr: &zeroOrOneExpr{ + pos: position{line: 1266, col: 11, offset: 41921}, + expr: &seqExpr{ + pos: position{line: 1266, col: 12, offset: 41922}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1266, col: 12, offset: 41922}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlinePassthrough21, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + ¬Expr{ + pos: position{line: 1266, col: 19, offset: 41929}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonInlinePassthrough24, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1266, col: 28, offset: 41938}, + expr: &litMatcher{ + pos: position{line: 1258, col: 32, offset: 41444}, + val: "+++", + ignoreCase: false, + want: "\"+++\"", + }, + }, + &anyMatcher{ + line: 1266, col: 57, offset: 41967, + }, + }, + }, + }, + }, }, }, }, + &litMatcher{ + pos: position{line: 1258, col: 32, offset: 41444}, + val: "+++", + ignoreCase: false, + want: "\"+++\"", + }, + ¬Expr{ + pos: position{line: 1260, col: 121, offset: 41571}, + expr: &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + }, + &actionExpr{ + pos: position{line: 1248, col: 26, offset: 40759}, + run: (*parser).callonInlinePassthrough35, + expr: &seqExpr{ + pos: position{line: 1248, col: 26, offset: 40759}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 1246, col: 32, offset: 40729}, + val: "+", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"+\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &labeledExpr{ + pos: position{line: 1248, col: 54, offset: 40787}, + label: "content", + expr: &choiceExpr{ + pos: position{line: 1252, col: 33, offset: 41000}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1252, col: 34, offset: 41001}, + run: (*parser).callonInlinePassthrough40, + expr: &seqExpr{ + pos: position{line: 1252, col: 34, offset: 41001}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1252, col: 35, offset: 41002}, + expr: &litMatcher{ + pos: position{line: 1246, col: 32, offset: 40729}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + }, + ¬Expr{ + pos: position{line: 1252, col: 64, offset: 41031}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlinePassthrough45, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + ¬Expr{ + pos: position{line: 1252, col: 71, offset: 41038}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonInlinePassthrough48, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1252, col: 80, offset: 41047, + }, + &zeroOrMoreExpr{ + pos: position{line: 1252, col: 83, offset: 41050}, + expr: &seqExpr{ + pos: position{line: 1252, col: 84, offset: 41051}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1252, col: 84, offset: 41051}, + expr: &seqExpr{ + pos: position{line: 1252, col: 86, offset: 41053}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + run: (*parser).callonInlinePassthrough58, + expr: &oneOrMoreExpr{ + pos: position{line: 2953, col: 11, offset: 97615}, + expr: &charClassMatcher{ + pos: position{line: 2953, col: 12, offset: 97616}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 1246, col: 32, offset: 40729}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1252, col: 122, offset: 41089}, + expr: &litMatcher{ + pos: position{line: 1246, col: 32, offset: 40729}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + }, + ¬Expr{ + pos: position{line: 1252, col: 151, offset: 41118}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonInlinePassthrough65, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1252, col: 160, offset: 41127, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1254, col: 11, offset: 41277}, + run: (*parser).callonInlinePassthrough71, + expr: &seqExpr{ + pos: position{line: 1254, col: 12, offset: 41278}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1254, col: 12, offset: 41278}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonInlinePassthrough74, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + ¬Expr{ + pos: position{line: 1254, col: 19, offset: 41285}, + expr: &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonInlinePassthrough77, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1254, col: 28, offset: 41294}, + expr: &litMatcher{ + pos: position{line: 1246, col: 32, offset: 40729}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + }, + &anyMatcher{ + line: 1254, col: 57, offset: 41323, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1246, col: 32, offset: 40729}, + val: "+", ignoreCase: false, - inverted: false, + want: "\"+\"", }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + pos: position{line: 1248, col: 121, offset: 40854}, + expr: &charClassMatcher{ + pos: position{line: 2860, col: 13, offset: 94791}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &ruleRefExpr{ + pos: position{line: 2621, col: 57, offset: 87662}, + name: "PassthroughMacro", }, }, }, @@ -47793,173 +63120,31 @@ var g = &grammar{ }, }, { - name: "TableLineHeader", - pos: position{line: 2060, col: 1, offset: 72559}, + name: "Quote", + pos: position{line: 2626, col: 1, offset: 87722}, expr: &actionExpr{ - pos: position{line: 2060, col: 20, offset: 72578}, - run: (*parser).callonTableLineHeader1, + pos: position{line: 2628, col: 5, offset: 87798}, + run: (*parser).callonQuote1, expr: &seqExpr{ - pos: position{line: 2060, col: 20, offset: 72578}, + pos: position{line: 2628, col: 5, offset: 87798}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2060, col: 20, offset: 72578}, - expr: &seqExpr{ - pos: position{line: 2057, col: 19, offset: 72477}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2057, col: 19, offset: 72477}, - val: "|===", - ignoreCase: false, - want: "\"|===\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2057, col: 26, offset: 72484}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonTableLineHeader9, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, + &andCodeExpr{ + pos: position{line: 2628, col: 5, offset: 87798}, + run: (*parser).callonQuote3, }, &labeledExpr{ - pos: position{line: 2060, col: 36, offset: 72594}, - label: "cells", - expr: &oneOrMoreExpr{ - pos: position{line: 2060, col: 42, offset: 72600}, - expr: &ruleRefExpr{ - pos: position{line: 2060, col: 43, offset: 72601}, - name: "TableCell", - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonTableLineHeader24, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonTableLineHeader32, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + pos: position{line: 2631, col: 5, offset: 87858}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2632, col: 9, offset: 87876}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2632, col: 9, offset: 87876}, + name: "QuotedText", }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + &ruleRefExpr{ + pos: position{line: 2633, col: 11, offset: 87898}, + name: "QuotedString", }, }, }, @@ -47969,350 +63154,381 @@ var g = &grammar{ }, }, { - name: "TableLine", - pos: position{line: 2064, col: 1, offset: 72685}, + name: "TableColumnsAttribute", + pos: position{line: 2778, col: 1, offset: 91906}, expr: &actionExpr{ - pos: position{line: 2064, col: 14, offset: 72698}, - run: (*parser).callonTableLine1, + pos: position{line: 2778, col: 26, offset: 91931}, + run: (*parser).callonTableColumnsAttribute1, expr: &seqExpr{ - pos: position{line: 2064, col: 14, offset: 72698}, + pos: position{line: 2778, col: 26, offset: 91931}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2064, col: 14, offset: 72698}, - expr: &seqExpr{ - pos: position{line: 2057, col: 19, offset: 72477}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2057, col: 19, offset: 72477}, - val: "|===", - ignoreCase: false, - want: "\"|===\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2057, col: 26, offset: 72484}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonTableLine9, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 2778, col: 26, offset: 91931}, + label: "cols", + expr: &zeroOrMoreExpr{ + pos: position{line: 2778, col: 31, offset: 91936}, + expr: &actionExpr{ + pos: position{line: 2783, col: 5, offset: 91999}, + run: (*parser).callonTableColumnsAttribute5, + expr: &seqExpr{ + pos: position{line: 2783, col: 5, offset: 91999}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2783, col: 5, offset: 91999}, + expr: ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 2786, col: 5, offset: 92123}, + label: "multiplier", + expr: &zeroOrOneExpr{ + pos: position{line: 2786, col: 16, offset: 92134}, + expr: &actionExpr{ + pos: position{line: 2786, col: 17, offset: 92135}, + run: (*parser).callonTableColumnsAttribute12, + expr: &seqExpr{ + pos: position{line: 2786, col: 17, offset: 92135}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2786, col: 17, offset: 92135}, + label: "n", + expr: &actionExpr{ + pos: position{line: 2944, col: 11, offset: 97430}, + run: (*parser).callonTableColumnsAttribute15, + expr: &seqExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + expr: &litMatcher{ + pos: position{line: 2944, col: 12, offset: 97431}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2944, col: 17, offset: 97436}, + expr: &actionExpr{ + pos: position{line: 2940, col: 10, offset: 97370}, + run: (*parser).callonTableColumnsAttribute20, + expr: &charClassMatcher{ + pos: position{line: 2940, col: 10, offset: 97370}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2786, col: 26, offset: 92144}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 2787, col: 5, offset: 92172}, + label: "halign", + expr: &zeroOrOneExpr{ + pos: position{line: 2787, col: 12, offset: 92179}, + expr: &choiceExpr{ + pos: position{line: 2788, col: 9, offset: 92189}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2788, col: 9, offset: 92189}, + run: (*parser).callonTableColumnsAttribute26, + expr: &litMatcher{ + pos: position{line: 2788, col: 9, offset: 92189}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + }, + &actionExpr{ + pos: position{line: 2789, col: 11, offset: 92236}, + run: (*parser).callonTableColumnsAttribute28, + expr: &litMatcher{ + pos: position{line: 2789, col: 11, offset: 92236}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + }, + &actionExpr{ + pos: position{line: 2790, col: 11, offset: 92284}, + run: (*parser).callonTableColumnsAttribute30, + expr: &litMatcher{ + pos: position{line: 2790, col: 11, offset: 92284}, + val: "^", + ignoreCase: false, + want: "\"^\"", + }, + }, + }, + }, }, }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 2064, col: 30, offset: 72714}, - label: "cells", - expr: &oneOrMoreExpr{ - pos: position{line: 2064, col: 36, offset: 72720}, - expr: &ruleRefExpr{ - pos: position{line: 2064, col: 37, offset: 72721}, - name: "TableCell", - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2064, col: 53, offset: 72737}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonTableLine25, - expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2161, col: 14, offset: 76486}, - expr: ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 2792, col: 5, offset: 92334}, + label: "valign", + expr: &zeroOrOneExpr{ + pos: position{line: 2792, col: 12, offset: 92341}, + expr: &choiceExpr{ + pos: position{line: 2793, col: 9, offset: 92351}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2793, col: 9, offset: 92351}, + run: (*parser).callonTableColumnsAttribute35, + expr: &litMatcher{ + pos: position{line: 2793, col: 9, offset: 92351}, + val: ".<", + ignoreCase: false, + want: "\".<\"", + }, + }, + &actionExpr{ + pos: position{line: 2794, col: 11, offset: 92398}, + run: (*parser).callonTableColumnsAttribute37, + expr: &litMatcher{ + pos: position{line: 2794, col: 11, offset: 92398}, + val: ".>", + ignoreCase: false, + want: "\".>\"", + }, + }, + &actionExpr{ + pos: position{line: 2795, col: 11, offset: 92448}, + run: (*parser).callonTableColumnsAttribute39, + expr: &litMatcher{ + pos: position{line: 2795, col: 11, offset: 92448}, + val: ".^", + ignoreCase: false, + want: "\".^\"", + }, + }, + }, + }, }, }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &labeledExpr{ + pos: position{line: 2797, col: 5, offset: 92499}, + label: "weight", + expr: &zeroOrOneExpr{ + pos: position{line: 2797, col: 12, offset: 92506}, + expr: &choiceExpr{ + pos: position{line: 2797, col: 13, offset: 92507}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2944, col: 11, offset: 97430}, + run: (*parser).callonTableColumnsAttribute44, + expr: &seqExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2944, col: 12, offset: 97431}, + expr: &litMatcher{ + pos: position{line: 2944, col: 12, offset: 97431}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2944, col: 17, offset: 97436}, + expr: &actionExpr{ + pos: position{line: 2940, col: 10, offset: 97370}, + run: (*parser).callonTableColumnsAttribute49, + expr: &charClassMatcher{ + pos: position{line: 2940, col: 10, offset: 97370}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2797, col: 23, offset: 92517}, + run: (*parser).callonTableColumnsAttribute51, + expr: &litMatcher{ + pos: position{line: 2797, col: 23, offset: 92517}, + val: "~", + ignoreCase: false, + want: "\"~\"", + }, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonTableLine33, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + }, + &labeledExpr{ + pos: position{line: 2798, col: 5, offset: 92559}, + label: "style", + expr: &zeroOrOneExpr{ + pos: position{line: 2798, col: 11, offset: 92565}, + expr: &actionExpr{ + pos: position{line: 2798, col: 12, offset: 92566}, + run: (*parser).callonTableColumnsAttribute55, + expr: &charClassMatcher{ + pos: position{line: 2798, col: 12, offset: 92566}, + val: "[adehlms]", + chars: []rune{'a', 'd', 'e', 'h', 'l', 'm', 's'}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &labeledExpr{ + pos: position{line: 2800, col: 5, offset: 92696}, + label: "comma", + expr: &zeroOrOneExpr{ + pos: position{line: 2800, col: 11, offset: 92702}, + expr: &litMatcher{ + pos: position{line: 2800, col: 12, offset: 92703}, + val: ",", + ignoreCase: false, + want: "\",\"", }, }, }, + &andCodeExpr{ + pos: position{line: 2801, col: 5, offset: 92713}, + run: (*parser).callonTableColumnsAttribute60, + }, }, }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, }, { - name: "TableCell", - pos: position{line: 2068, col: 1, offset: 72806}, + name: "UserMacroBlock", + pos: position{line: 2825, col: 1, offset: 93643}, expr: &actionExpr{ - pos: position{line: 2068, col: 14, offset: 72819}, - run: (*parser).callonTableCell1, + pos: position{line: 2826, col: 5, offset: 93666}, + run: (*parser).callonUserMacroBlock1, expr: &seqExpr{ - pos: position{line: 2068, col: 14, offset: 72819}, + pos: position{line: 2826, col: 5, offset: 93666}, exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2826, col: 5, offset: 93666}, + label: "name", + expr: &actionExpr{ + pos: position{line: 2849, col: 18, offset: 94455}, + run: (*parser).callonUserMacroBlock4, + expr: &oneOrMoreExpr{ + pos: position{line: 2849, col: 19, offset: 94456}, + expr: &charClassMatcher{ + pos: position{line: 2849, col: 19, offset: 94456}, + val: "[_-0-9\\pL]", + chars: []rune{'_', '-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 2827, col: 5, offset: 93692}, + run: (*parser).callonUserMacroBlock7, + }, &litMatcher{ - pos: position{line: 2055, col: 23, offset: 72447}, - val: "|", + pos: position{line: 2831, col: 5, offset: 93832}, + val: "::", ignoreCase: false, - want: "\"|\"", + want: "\"::\"", }, - &zeroOrMoreExpr{ - pos: position{line: 2055, col: 27, offset: 72451}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + &labeledExpr{ + pos: position{line: 2832, col: 5, offset: 93842}, + label: "value", + expr: &actionExpr{ + pos: position{line: 2853, col: 19, offset: 94531}, + run: (*parser).callonUserMacroBlock10, + expr: &zeroOrMoreExpr{ + pos: position{line: 2853, col: 19, offset: 94531}, + expr: &charClassMatcher{ + pos: position{line: 2853, col: 19, offset: 94531}, + val: "[^:[ \\r\\n]", + chars: []rune{':', '[', ' ', '\r', '\n'}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonTableCell7, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + inverted: true, }, }, }, }, &labeledExpr{ - pos: position{line: 2068, col: 33, offset: 72838}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 2068, col: 42, offset: 72847}, - expr: &seqExpr{ - pos: position{line: 2068, col: 43, offset: 72848}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2068, col: 43, offset: 72848}, - expr: &seqExpr{ - pos: position{line: 2055, col: 23, offset: 72447}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2055, col: 23, offset: 72447}, - val: "|", - ignoreCase: false, - want: "\"|\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 2055, col: 27, offset: 72451}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonTableCell18, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - }, - }, - }, - ¬Expr{ - pos: position{line: 2068, col: 63, offset: 72868}, - expr: &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + pos: position{line: 2833, col: 5, offset: 93870}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 2833, col: 23, offset: 93888}, + name: "InlineAttributes", + }, + }, + &choiceExpr{ + pos: position{line: 2965, col: 8, offset: 97869}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2958, col: 12, offset: 97729}, + run: (*parser).callonUserMacroBlock16, + expr: &choiceExpr{ + pos: position{line: 2958, col: 13, offset: 97730}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2958, col: 13, offset: 97730}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - }, - &zeroOrMoreExpr{ - pos: position{line: 2068, col: 68, offset: 72873}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonTableCell29, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 20, offset: 97737}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, - }, - &ruleRefExpr{ - pos: position{line: 2068, col: 75, offset: 72880}, - name: "InlineElement", - }, - &zeroOrMoreExpr{ - pos: position{line: 2068, col: 89, offset: 72894}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonTableCell35, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + &litMatcher{ + pos: position{line: 2958, col: 29, offset: 97746}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, + ¬Expr{ + pos: position{line: 2962, col: 8, offset: 97819}, + expr: &anyMatcher{ + line: 2962, col: 9, offset: 97820, + }, + }, }, }, }, @@ -48320,511 +63536,937 @@ var g = &grammar{ }, }, { - name: "IndexTerm", - pos: position{line: 2137, col: 1, offset: 75620}, + name: "InlineUserMacro", + pos: position{line: 2837, col: 1, offset: 94042}, expr: &actionExpr{ - pos: position{line: 2137, col: 14, offset: 75633}, - run: (*parser).callonIndexTerm1, + pos: position{line: 2838, col: 5, offset: 94066}, + run: (*parser).callonInlineUserMacro1, expr: &seqExpr{ - pos: position{line: 2137, col: 14, offset: 75633}, + pos: position{line: 2838, col: 5, offset: 94066}, exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2838, col: 5, offset: 94066}, + label: "name", + expr: &actionExpr{ + pos: position{line: 2849, col: 18, offset: 94455}, + run: (*parser).callonInlineUserMacro4, + expr: &oneOrMoreExpr{ + pos: position{line: 2849, col: 19, offset: 94456}, + expr: &charClassMatcher{ + pos: position{line: 2849, col: 19, offset: 94456}, + val: "[_-0-9\\pL]", + chars: []rune{'_', '-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 2839, col: 5, offset: 94092}, + run: (*parser).callonInlineUserMacro7, + }, &litMatcher{ - pos: position{line: 2137, col: 14, offset: 75633}, - val: "((", + pos: position{line: 2843, col: 5, offset: 94232}, + val: ":", ignoreCase: false, - want: "\"((\"", + want: "\":\"", }, &labeledExpr{ - pos: position{line: 2137, col: 19, offset: 75638}, - label: "term", - expr: &ruleRefExpr{ - pos: position{line: 2137, col: 25, offset: 75644}, - name: "IndexTermContent", + pos: position{line: 2844, col: 5, offset: 94241}, + label: "value", + expr: &actionExpr{ + pos: position{line: 2853, col: 19, offset: 94531}, + run: (*parser).callonInlineUserMacro10, + expr: &zeroOrMoreExpr{ + pos: position{line: 2853, col: 19, offset: 94531}, + expr: &charClassMatcher{ + pos: position{line: 2853, col: 19, offset: 94531}, + val: "[^:[ \\r\\n]", + chars: []rune{':', '[', ' ', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, }, }, - &litMatcher{ - pos: position{line: 2137, col: 43, offset: 75662}, - val: "))", - ignoreCase: false, - want: "\"))\"", + &labeledExpr{ + pos: position{line: 2845, col: 5, offset: 94269}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 2845, col: 23, offset: 94287}, + name: "InlineAttributes", + }, }, }, }, }, }, { - name: "IndexTermContent", - pos: position{line: 2141, col: 1, offset: 75727}, + name: "FileLocation", + pos: position{line: 2909, col: 1, offset: 96346}, expr: &actionExpr{ - pos: position{line: 2141, col: 21, offset: 75747}, - run: (*parser).callonIndexTermContent1, + pos: position{line: 2909, col: 17, offset: 96362}, + run: (*parser).callonFileLocation1, expr: &labeledExpr{ - pos: position{line: 2141, col: 21, offset: 75747}, - label: "elements", + pos: position{line: 2909, col: 17, offset: 96362}, + label: "path", expr: &oneOrMoreExpr{ - pos: position{line: 2141, col: 30, offset: 75756}, + pos: position{line: 2909, col: 22, offset: 96367}, expr: &choiceExpr{ - pos: position{line: 2141, col: 31, offset: 75757}, + pos: position{line: 2909, col: 23, offset: 96368}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonIndexTermContent5, - expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, - expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonIndexTermContent14, - expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, - expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, - val: "[=*_`]", - chars: []rune{'=', '*', '_', '`'}, - ignoreCase: false, - inverted: false, - }, - &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, + pos: position{line: 2921, col: 13, offset: 96772}, + run: (*parser).callonFileLocation5, + expr: &labeledExpr{ + pos: position{line: 2921, col: 13, offset: 96772}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2921, col: 22, offset: 96781}, + expr: &choiceExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, + run: (*parser).callonFileLocation9, + expr: &oneOrMoreExpr{ + pos: position{line: 2922, col: 5, offset: 96787}, expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + pos: position{line: 2922, col: 6, offset: 96788}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, ignoreCase: false, - inverted: false, + inverted: true, }, }, }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 2141, col: 38, offset: 75764}, - name: "QuotedString", - }, - &ruleRefExpr{ - pos: position{line: 2141, col: 53, offset: 75779}, - name: "QuotedText", - }, - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonIndexTermContent26, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - &actionExpr{ - pos: position{line: 2203, col: 21, offset: 77750}, - run: (*parser).callonIndexTermContent28, - expr: &choiceExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, - run: (*parser).callonIndexTermContent30, - expr: &seqExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1538, col: 27, offset: 54613}, - val: "<<", - ignoreCase: false, - want: "\"<<\"", - }, - &labeledExpr{ - pos: position{line: 1538, col: 32, offset: 54618}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonIndexTermContent34, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 1538, col: 40, offset: 54626}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonIndexTermContent40, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonFileLocation12, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonFileLocation14, }, - }, - }, - &litMatcher{ - pos: position{line: 1538, col: 47, offset: 54633}, - val: ",", - ignoreCase: false, - want: "\",\"", - }, - &labeledExpr{ - pos: position{line: 1538, col: 51, offset: 54637}, - label: "label", - expr: &oneOrMoreExpr{ - pos: position{line: 1548, col: 24, offset: 55025}, - expr: &choiceExpr{ - pos: position{line: 1549, col: 5, offset: 55031}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, - run: (*parser).callonIndexTermContent46, - expr: &seqExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, - exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 1549, col: 6, offset: 55032}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonFileLocation17, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonFileLocation21, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonFileLocation28, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonFileLocation33, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonFileLocation35, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, - &oneOrMoreExpr{ - pos: position{line: 1549, col: 14, offset: 55040}, - expr: &charClassMatcher{ - pos: position{line: 1549, col: 14, offset: 55040}, - val: "[^\\r\\n{<>]", - chars: []rune{'\r', '\n', '{', '<', '>'}, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonFileLocation39, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonFileLocation43, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonFileLocation50, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonFileLocation55, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonFileLocation57, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonFileLocation61, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonFileLocation65, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", ignoreCase: false, - inverted: true, + want: "\"}\"", }, }, }, }, }, - &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonIndexTermContent51, - expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonIndexTermContent55, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonFileLocation71, + expr: &seqExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2650, col: 5, offset: 88260}, + run: (*parser).callonFileLocation73, + }, + &labeledExpr{ + pos: position{line: 2653, col: 5, offset: 88331}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2655, col: 9, offset: 88429}, + run: (*parser).callonFileLocation76, + expr: &choiceExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 535, col: 27, offset: 17411}, + run: (*parser).callonFileLocation78, expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, + pos: position{line: 535, col: 27, offset: 17411}, exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, - val: "[_0-9\\pL]", - chars: []rune{'_'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &litMatcher{ + pos: position{line: 535, col: 27, offset: 17411}, + val: "<<", ignoreCase: false, - inverted: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 32, offset: 17416}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonFileLocation82, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, }, &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, - expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, + pos: position{line: 535, col: 40, offset: 17424}, + expr: &actionExpr{ + pos: position{line: 2948, col: 10, offset: 97506}, + run: (*parser).callonFileLocation86, + expr: &charClassMatcher{ + pos: position{line: 2948, col: 11, offset: 97507}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 535, col: 47, offset: 17431}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 535, col: 51, offset: 17435}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 545, col: 24, offset: 17848}, + expr: &choiceExpr{ + pos: position{line: 546, col: 5, offset: 17854}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + run: (*parser).callonFileLocation92, + expr: &seqExpr{ + pos: position{line: 546, col: 6, offset: 17855}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 546, col: 6, offset: 17855}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 546, col: 14, offset: 17863}, + expr: &charClassMatcher{ + pos: position{line: 546, col: 14, offset: 17863}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonFileLocation97, + expr: &seqExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 493, col: 5, offset: 15857}, + run: (*parser).callonFileLocation99, + }, + &labeledExpr{ + pos: position{line: 496, col: 5, offset: 15921}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 496, col: 14, offset: 15930}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + run: (*parser).callonFileLocation102, + expr: &seqExpr{ + pos: position{line: 507, col: 25, offset: 16392}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 507, col: 25, offset: 16392}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 507, col: 37, offset: 16404}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonFileLocation106, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 507, col: 56, offset: 16423}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 507, col: 62, offset: 16429}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonFileLocation113, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonFileLocation118, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonFileLocation120, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 507, col: 78, offset: 16445}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + run: (*parser).callonFileLocation124, + expr: &seqExpr{ + pos: position{line: 511, col: 25, offset: 16547}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 511, col: 25, offset: 16547}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 511, col: 38, offset: 16560}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonFileLocation128, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 511, col: 57, offset: 16579}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 511, col: 63, offset: 16585}, + expr: &actionExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + run: (*parser).callonFileLocation135, + expr: &seqExpr{ + pos: position{line: 515, col: 17, offset: 16692}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 515, col: 17, offset: 16692}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 515, col: 21, offset: 16696}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 515, col: 28, offset: 16703}, + run: (*parser).callonFileLocation140, + expr: &charClassMatcher{ + pos: position{line: 515, col: 28, offset: 16703}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + run: (*parser).callonFileLocation142, + expr: &oneOrMoreExpr{ + pos: position{line: 517, col: 9, offset: 16757}, + expr: &charClassMatcher{ + pos: position{line: 517, col: 9, offset: 16757}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 511, col: 79, offset: 16601}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + run: (*parser).callonFileLocation146, + expr: &seqExpr{ + pos: position{line: 500, col: 31, offset: 16047}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 500, col: 31, offset: 16047}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 500, col: 35, offset: 16051}, + label: "name", + expr: &actionExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + run: (*parser).callonFileLocation150, + expr: &seqExpr{ + pos: position{line: 162, col: 18, offset: 4814}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 162, col: 18, offset: 4814}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 162, col: 28, offset: 4824}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 29, offset: 4825}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 500, col: 54, offset: 16070}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 550, col: 8, offset: 18087}, + run: (*parser).callonFileLocation156, + expr: &litMatcher{ + pos: position{line: 550, col: 8, offset: 18087}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, }, }, + &litMatcher{ + pos: position{line: 535, col: 79, offset: 17463}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + run: (*parser).callonFileLocation159, + expr: &seqExpr{ + pos: position{line: 537, col: 9, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 537, col: 9, offset: 17536}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 537, col: 14, offset: 17541}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + run: (*parser).callonFileLocation163, + expr: &oneOrMoreExpr{ + pos: position{line: 2936, col: 7, offset: 97228}, + expr: &charClassMatcher{ + pos: position{line: 2936, col: 7, offset: 97228}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 537, col: 22, offset: 17549}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, }, - }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", }, }, }, - }, - &actionExpr{ - pos: position{line: 1553, col: 6, offset: 55250}, - run: (*parser).callonIndexTermContent61, - expr: &litMatcher{ - pos: position{line: 1553, col: 6, offset: 55250}, - val: "{", - ignoreCase: false, - want: "\"{\"", + &actionExpr{ + pos: position{line: 2658, col: 11, offset: 88533}, + run: (*parser).callonFileLocation167, + expr: &charClassMatcher{ + pos: position{line: 2658, col: 12, offset: 88534}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, }, }, }, }, }, }, - &litMatcher{ - pos: position{line: 1538, col: 79, offset: 54665}, - val: ">>", - ignoreCase: false, - want: "\">>\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1540, col: 5, offset: 54730}, - run: (*parser).callonIndexTermContent64, - expr: &seqExpr{ - pos: position{line: 1540, col: 5, offset: 54730}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1540, col: 5, offset: 54730}, - val: "<<", - ignoreCase: false, - want: "\"<<\"", - }, - &labeledExpr{ - pos: position{line: 1540, col: 10, offset: 54735}, - label: "id", - expr: &actionExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - run: (*parser).callonIndexTermContent68, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1540, col: 18, offset: 54743}, - val: ">>", - ignoreCase: false, - want: "\">>\"", - }, }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2206, col: 9, offset: 77913}, - run: (*parser).callonIndexTermContent72, - expr: &charClassMatcher{ - pos: position{line: 2206, col: 10, offset: 77914}, - val: "[<>&]", - chars: []rune{'<', '>', '&'}, - ignoreCase: false, - inverted: false, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonIndexTermContent74, - expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonIndexTermContent78, - expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, + &actionExpr{ + pos: position{line: 2928, col: 7, offset: 97012}, + run: (*parser).callonFileLocation169, + expr: &litMatcher{ + pos: position{line: 2928, col: 7, offset: 97012}, + val: "{", ignoreCase: false, - inverted: false, + want: "\"{\"", }, }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 2141, col: 114, offset: 75840}, - run: (*parser).callonIndexTermContent82, - expr: &seqExpr{ - pos: position{line: 2141, col: 115, offset: 75841}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 2141, col: 115, offset: 75841}, - expr: &litMatcher{ - pos: position{line: 2141, col: 116, offset: 75842}, - val: "))", - ignoreCase: false, - want: "\"))\"", - }, - }, - &anyMatcher{ - line: 2141, col: 121, offset: 75847, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "FileLocation", - pos: position{line: 2241, col: 1, offset: 79115}, - expr: &actionExpr{ - pos: position{line: 2241, col: 17, offset: 79131}, - run: (*parser).callonFileLocation1, - expr: &labeledExpr{ - pos: position{line: 2241, col: 17, offset: 79131}, - label: "path", - expr: &oneOrMoreExpr{ - pos: position{line: 2241, col: 22, offset: 79136}, - expr: &choiceExpr{ - pos: position{line: 2241, col: 23, offset: 79137}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - run: (*parser).callonFileLocation5, - expr: &oneOrMoreExpr{ - pos: position{line: 2253, col: 13, offset: 79512}, - expr: &charClassMatcher{ - pos: position{line: 2253, col: 14, offset: 79513}, - val: "[^\\r\\n[]� ]", - chars: []rune{'\r', '\n', '[', ']', '�', ' '}, - ignoreCase: false, - inverted: true, }, }, }, &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonFileLocation8, + pos: position{line: 991, col: 23, offset: 31310}, + run: (*parser).callonFileLocation171, expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 991, col: 23, offset: 31310}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 989, col: 32, offset: 31278}, val: "�", ignoreCase: false, want: "\"�\"", }, &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, + pos: position{line: 991, col: 51, offset: 31338}, label: "ref", expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonFileLocation12, + pos: position{line: 991, col: 56, offset: 31343}, + run: (*parser).callonFileLocation175, expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 991, col: 56, offset: 31343}, expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 991, col: 56, offset: 31343}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -48834,7 +64476,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, + pos: position{line: 989, col: 32, offset: 31278}, val: "�", ignoreCase: false, want: "\"�\"", @@ -48851,16178 +64493,34264 @@ var g = &grammar{ }, } -func (c *current) onRawSource9() (interface{}, error) { +func (c *current) onDocumentFragment23() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment23() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment23() +} + +func (c *current) onDocumentFragment30() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonDocumentFragment30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment30() +} + +func (c *current) onDocumentFragment33(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonDocumentFragment33() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment33(stack["depth"]) +} + +func (c *current) onDocumentFragment27(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewOrderedListElementPrefix(types.Arabic) + case 2: + return types.NewOrderedListElementPrefix(types.LowerAlpha) + case 3: + return types.NewOrderedListElementPrefix(types.LowerRoman) + case 4: + return types.NewOrderedListElementPrefix(types.UpperAlpha) + default: + return types.NewOrderedListElementPrefix(types.UpperRoman) + } + +} + +func (p *parser) callonDocumentFragment27() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment27(stack["depth"]) +} + +func (c *current) onDocumentFragment34() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + +} + +func (p *parser) callonDocumentFragment34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment34() +} + +func (c *current) onDocumentFragment39() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + +} + +func (p *parser) callonDocumentFragment39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment39() +} + +func (c *current) onDocumentFragment43() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + +} + +func (p *parser) callonDocumentFragment43() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment43() +} + +func (c *current) onDocumentFragment47() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + +} + +func (p *parser) callonDocumentFragment47() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment47() +} + +func (c *current) onDocumentFragment52() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + +} + +func (p *parser) callonDocumentFragment52() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment52() +} + +func (c *current) onDocumentFragment57(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment57() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment57(stack["prefix"]) +} + +func (c *current) onDocumentFragment20(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonDocumentFragment20() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment20(stack["prefix"]) +} + +func (c *current) onDocumentFragment65() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment65() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment65() +} + +func (c *current) onDocumentFragment72() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonDocumentFragment72() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment72() +} + +func (c *current) onDocumentFragment75(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonDocumentFragment75() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment75(stack["depth"]) +} + +func (c *current) onDocumentFragment69(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewUnorderedListElementPrefix(types.OneAsterisk) + case 2: + return types.NewUnorderedListElementPrefix(types.TwoAsterisks) + case 3: + return types.NewUnorderedListElementPrefix(types.ThreeAsterisks) + case 4: + return types.NewUnorderedListElementPrefix(types.FourAsterisks) + default: + return types.NewUnorderedListElementPrefix(types.FiveAsterisks) + } + +} + +func (p *parser) callonDocumentFragment69() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment69(stack["depth"]) +} + +func (c *current) onDocumentFragment77() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + +} + +func (p *parser) callonDocumentFragment77() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment77() +} + +func (c *current) onDocumentFragment79(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment79() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment79(stack["prefix"]) +} + +func (c *current) onDocumentFragment62(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonDocumentFragment62() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment62(stack["prefix"]) +} + +func (c *current) onDocumentFragment85() (interface{}, error) { + return types.Tip, nil +} + +func (p *parser) callonDocumentFragment85() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment85() +} + +func (c *current) onDocumentFragment87() (interface{}, error) { + return types.Note, nil +} + +func (p *parser) callonDocumentFragment87() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment87() +} + +func (c *current) onDocumentFragment89() (interface{}, error) { + return types.Important, nil +} + +func (p *parser) callonDocumentFragment89() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment89() +} + +func (c *current) onDocumentFragment91() (interface{}, error) { + return types.Warning, nil +} + +func (p *parser) callonDocumentFragment91() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment91() +} + +func (c *current) onDocumentFragment93() (interface{}, error) { + return types.Caution, nil +} + +func (p *parser) callonDocumentFragment93() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment93() +} + +func (c *current) onDocumentFragment99() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment99() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment99() +} + +func (c *current) onDocumentFragment102(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment102() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment102(stack["content"]) +} + +func (c *current) onDocumentFragment104() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment104() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment104() +} + +func (c *current) onDocumentFragment96(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment96() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment96(stack["content"]) +} + +func (c *current) onDocumentFragment111(firstLine interface{}) (bool, error) { + // also, make sure that there is no LabeledListElement delimiter (`::` - `::::`) + // in the middle of the line (with space afterwards) + // or at the end of the line + return !strings.Contains(string(firstLine.(types.RawLine)), ":: ") && + !strings.HasSuffix(string(firstLine.(types.RawLine)), "::"), nil + +} + +func (p *parser) callonDocumentFragment111() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment111(stack["firstLine"]) +} + +func (c *current) onDocumentFragment126() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment126() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment126() +} + +func (c *current) onDocumentFragment129() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment129() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment129() +} + +func (c *current) onDocumentFragment120() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment120() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment120() +} + +func (c *current) onDocumentFragment140() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment140() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment140() +} + +func (c *current) onDocumentFragment142() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment142() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment142() +} + +func (c *current) onDocumentFragment155() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment155() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment155() +} + +func (c *current) onDocumentFragment159() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment159() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment159() +} + +func (c *current) onDocumentFragment149(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + +} + +func (p *parser) callonDocumentFragment149() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment149(stack["content"]) +} + +func (c *current) onDocumentFragment169() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment169() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment169() +} + +func (c *current) onDocumentFragment172(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment172() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment172(stack["content"]) +} + +func (c *current) onDocumentFragment174() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment174() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment174() +} + +func (c *current) onDocumentFragment166(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment166() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment166(stack["content"]) +} + +func (c *current) onDocumentFragment114(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonDocumentFragment114() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment114(stack["line"]) +} + +func (c *current) onDocumentFragment14(firstLine, otherLines interface{}) (interface{}, error) { + return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...)...) + +} + +func (p *parser) callonDocumentFragment14() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment14(stack["firstLine"], stack["otherLines"]) +} + +func (c *current) onDocumentFragment185() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment185() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment185() +} + +func (c *current) onDocumentFragment195() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment195() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment195() +} + +func (c *current) onDocumentFragment204() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment204() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment204() +} + +func (c *current) onDocumentFragment213() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonDocumentFragment213() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment213() +} + +func (c *current) onDocumentFragment218() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonDocumentFragment218() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment218() +} + +func (c *current) onDocumentFragment225() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment225() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment225() +} + +func (c *current) onDocumentFragment237() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment237() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment237() +} + +func (c *current) onDocumentFragment239() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonDocumentFragment239() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment239() +} + +func (c *current) onDocumentFragment232(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonDocumentFragment232() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment232(stack["start"]) +} + +func (c *current) onDocumentFragment221(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonDocumentFragment221() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment221(stack["name"], stack["start"]) +} + +func (c *current) onDocumentFragment247() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment247() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment247() +} + +func (c *current) onDocumentFragment259() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment259() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment259() +} + +func (c *current) onDocumentFragment261() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonDocumentFragment261() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment261() +} + +func (c *current) onDocumentFragment254(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonDocumentFragment254() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment254(stack["start"]) +} + +func (c *current) onDocumentFragment243(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonDocumentFragment243() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment243(stack["name"], stack["start"]) +} + +func (c *current) onDocumentFragment269() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment269() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment269() +} + +func (c *current) onDocumentFragment265(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonDocumentFragment265() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment265(stack["name"]) +} + +func (c *current) onDocumentFragment216(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonDocumentFragment216() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment216(stack["element"]) +} + +func (c *current) onDocumentFragment275() (interface{}, error) { + // standalone '{' + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonDocumentFragment275() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment275() +} + +func (c *current) onDocumentFragment200(element interface{}) (interface{}, error) { + + return element, nil + +} + +func (p *parser) callonDocumentFragment200() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment200(stack["element"]) +} + +func (c *current) onDocumentFragment193(elements interface{}) (interface{}, error) { + return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil + +} + +func (p *parser) callonDocumentFragment193() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment193(stack["elements"]) +} + +func (c *current) onDocumentFragment278() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment278() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment278() +} + +func (c *current) onDocumentFragment181(name, value interface{}) (interface{}, error) { + d := types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) + return d, nil + +} + +func (p *parser) callonDocumentFragment181() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment181(stack["name"], stack["value"]) +} + +func (c *current) onDocumentFragment289() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment289() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment289() +} + +func (c *current) onDocumentFragment296() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment296() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment296() +} + +func (c *current) onDocumentFragment299() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment299() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment299() +} + +func (c *current) onDocumentFragment285(name interface{}) (interface{}, error) { + return types.NewAttributeReset(name.(string)) +} + +func (p *parser) callonDocumentFragment285() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment285(stack["name"]) +} + +func (c *current) onDocumentFragment310() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment310() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment310() +} + +func (c *current) onDocumentFragment317() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment317() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment317() +} + +func (c *current) onDocumentFragment320() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment320() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment320() +} + +func (c *current) onDocumentFragment306(name interface{}) (interface{}, error) { + return types.NewAttributeReset(name.(string)) +} + +func (p *parser) callonDocumentFragment306() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment306(stack["name"]) +} + +func (c *current) onDocumentFragment329() (bool, error) { + return c.isDocumentHeaderAllowed(), nil + +} + +func (p *parser) callonDocumentFragment329() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment329() +} + +func (c *current) onDocumentFragment337() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment337() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment337() +} + +func (c *current) onDocumentFragment340() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment340() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment340() +} + +func (c *current) onDocumentFragment331() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment331() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment331() +} + +func (c *current) onDocumentFragment351() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment351() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment351() +} + +func (c *current) onDocumentFragment355() (interface{}, error) { + // can't have empty title, that may collide with example block delimiter (`====`) + return []interface{}{ + types.RawLine(c.text), + }, nil +} + +func (p *parser) callonDocumentFragment355() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment355() +} + +func (c *current) onDocumentFragment359() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment359() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment359() +} + +func (c *current) onDocumentFragment348(title interface{}) (interface{}, error) { + return title, nil + +} + +func (p *parser) callonDocumentFragment348() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment348(stack["title"]) +} + +func (c *current) onDocumentFragment377() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment377() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment377() +} + +func (c *current) onDocumentFragment380() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment380() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment380() +} + +func (c *current) onDocumentFragment371() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment371() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment371() +} + +func (c *current) onDocumentFragment395() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment395() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment395() +} + +func (c *current) onDocumentFragment399() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment399() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment399() +} + +func (c *current) onDocumentFragment389(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + +} + +func (p *parser) callonDocumentFragment389() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment389(stack["content"]) +} + +func (c *current) onDocumentFragment408() (bool, error) { + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Comment), nil + +} + +func (p *parser) callonDocumentFragment408() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment408() +} + +func (c *current) onDocumentFragment411() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment411() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment411() +} + +func (c *current) onDocumentFragment414() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment414() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment414() +} + +func (c *current) onDocumentFragment421() (bool, error) { + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Comment) + return true, nil + +} + +func (p *parser) callonDocumentFragment421() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment421() +} + +func (c *current) onDocumentFragment431() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment431() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment431() +} + +func (c *current) onDocumentFragment434() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment434() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment434() +} + +func (c *current) onDocumentFragment450() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment450() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment450() +} + +func (c *current) onDocumentFragment454() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment454() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment454() +} + +func (c *current) onDocumentFragment444(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment444() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment444(stack["content"]) +} + +func (c *current) onDocumentFragment424(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonDocumentFragment424() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment424(stack["line"]) +} + +func (c *current) onDocumentFragment466() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment466() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment466() +} + +func (c *current) onDocumentFragment469() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment469() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment469() +} + +func (c *current) onDocumentFragment406(content interface{}) (interface{}, error) { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Comment, content.([]interface{})) + +} + +func (p *parser) callonDocumentFragment406() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment406(stack["content"]) +} + +func (c *current) onDocumentFragment482() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment482() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment482() +} + +func (c *current) onDocumentFragment499() (interface{}, error) { + // no space allowed + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment499() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment499() +} + +func (c *current) onDocumentFragment503() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment503() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment503() +} + +func (c *current) onDocumentFragment507() (interface{}, error) { + // no space allowed + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment507() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment507() +} + +func (c *current) onDocumentFragment511() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment511() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment511() +} + +func (c *current) onDocumentFragment515() (interface{}, error) { + // spaces allowed + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment515() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment515() +} + +func (c *current) onDocumentFragment519() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment519() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment519() +} + +func (c *current) onDocumentFragment496(part1, part2, part3 interface{}) (interface{}, error) { + return types.NewDocumentAuthorFullName(part1.(string), part2, part3) + +} + +func (p *parser) callonDocumentFragment496() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment496(stack["part1"], stack["part2"], stack["part3"]) +} + +func (c *current) onDocumentFragment530() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment530() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment530() +} + +func (c *current) onDocumentFragment523(email interface{}) (interface{}, error) { + return email, nil + +} + +func (p *parser) callonDocumentFragment523() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment523(stack["email"]) +} + +func (c *current) onDocumentFragment535() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment535() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment535() +} + +func (c *current) onDocumentFragment540() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment540() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment540() +} + +func (c *current) onDocumentFragment542(fullName, email interface{}) (bool, error) { + // at least 1 of [fullName, email] must be defined + return fullName != nil || email != nil, nil + +} + +func (p *parser) callonDocumentFragment542() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment542(stack["fullName"], stack["email"]) +} + +func (c *current) onDocumentFragment492(fullName, email interface{}) (interface{}, error) { + return types.NewDocumentAuthor(fullName, email) + +} + +func (p *parser) callonDocumentFragment492() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment492(stack["fullName"], stack["email"]) +} + +func (c *current) onDocumentFragment486(authors interface{}) (interface{}, error) { + return types.NewDocumentAuthors(authors.([]interface{})...) +} + +func (p *parser) callonDocumentFragment486() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment486(stack["authors"]) +} + +func (c *current) onDocumentFragment547() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment547() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment547() +} + +func (c *current) onDocumentFragment557() (interface{}, error) { + // no space allowed + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment557() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment557() +} + +func (c *current) onDocumentFragment561() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment561() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment561() +} + +func (c *current) onDocumentFragment565() (interface{}, error) { + // no space allowed + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment565() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment565() +} + +func (c *current) onDocumentFragment569() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment569() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment569() +} + +func (c *current) onDocumentFragment573() (interface{}, error) { + // spaces allowed + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment573() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment573() +} + +func (c *current) onDocumentFragment577() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment577() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment577() +} + +func (c *current) onDocumentFragment554(part1, part2, part3 interface{}) (interface{}, error) { + return types.NewDocumentAuthorFullName(part1.(string), part2, part3) + +} + +func (p *parser) callonDocumentFragment554() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment554(stack["part1"], stack["part2"], stack["part3"]) +} + +func (c *current) onDocumentFragment588() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment588() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment588() +} + +func (c *current) onDocumentFragment581(email interface{}) (interface{}, error) { + return email, nil + +} + +func (p *parser) callonDocumentFragment581() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment581(stack["email"]) +} + +func (c *current) onDocumentFragment593() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment593() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment593() +} + +func (c *current) onDocumentFragment598() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment598() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment598() +} + +func (c *current) onDocumentFragment600(fullName, email interface{}) (bool, error) { + // at least 1 of [fullName, email] must be defined + return fullName != nil || email != nil, nil + +} + +func (p *parser) callonDocumentFragment600() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment600(stack["fullName"], stack["email"]) +} + +func (c *current) onDocumentFragment550(fullName, email interface{}) (interface{}, error) { + return types.NewDocumentAuthor(fullName, email) + +} + +func (p *parser) callonDocumentFragment550() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment550(stack["fullName"], stack["email"]) +} + +func (c *current) onDocumentFragment543(author interface{}) (interface{}, error) { + return types.NewDocumentAuthors(author) +} + +func (p *parser) callonDocumentFragment543() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment543(stack["author"]) +} + +func (c *current) onDocumentFragment602() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment602() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment602() +} + +func (c *current) onDocumentFragment479(authors interface{}) (interface{}, error) { + return authors, nil +} + +func (p *parser) callonDocumentFragment479() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment479(stack["authors"]) +} + +func (c *current) onDocumentFragment617() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment617() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment617() +} + +func (c *current) onDocumentFragment621() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment621() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment621() +} + +func (c *current) onDocumentFragment611(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + +} + +func (p *parser) callonDocumentFragment611() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment611(stack["content"]) +} + +func (c *current) onDocumentFragment630() (bool, error) { + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Comment), nil + +} + +func (p *parser) callonDocumentFragment630() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment630() +} + +func (c *current) onDocumentFragment633() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment633() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment633() +} + +func (c *current) onDocumentFragment636() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment636() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment636() +} + +func (c *current) onDocumentFragment643() (bool, error) { + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Comment) + return true, nil + +} + +func (p *parser) callonDocumentFragment643() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment643() +} + +func (c *current) onDocumentFragment653() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment653() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment653() +} + +func (c *current) onDocumentFragment656() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment656() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment656() +} + +func (c *current) onDocumentFragment672() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment672() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment672() +} + +func (c *current) onDocumentFragment676() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment676() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment676() +} + +func (c *current) onDocumentFragment666(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment666() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment666(stack["content"]) +} + +func (c *current) onDocumentFragment646(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonDocumentFragment646() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment646(stack["line"]) +} + +func (c *current) onDocumentFragment688() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment688() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment688() +} + +func (c *current) onDocumentFragment691() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment691() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment691() +} + +func (c *current) onDocumentFragment628(content interface{}) (interface{}, error) { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Comment, content.([]interface{})) + +} + +func (p *parser) callonDocumentFragment628() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment628(stack["content"]) +} + +func (c *current) onDocumentFragment705() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment705() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment705() +} + +func (c *current) onDocumentFragment718() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment718() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment718() +} + +func (c *current) onDocumentFragment715() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment715() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment715() +} + +func (c *current) onDocumentFragment726() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment726() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment726() +} + +func (c *current) onDocumentFragment731() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment731() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment731() +} + +func (c *current) onDocumentFragment722() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment722() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment722() +} + +func (c *current) onDocumentFragment739() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment739() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment739() +} + +func (c *current) onDocumentFragment746() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment746() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment746() +} + +func (c *current) onDocumentFragment711(revnumber, revdate, revremark interface{}) (interface{}, error) { + return types.NewDocumentRevision(revnumber, revdate, revremark) + +} + +func (p *parser) callonDocumentFragment711() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment711(stack["revnumber"], stack["revdate"], stack["revremark"]) +} + +func (c *current) onDocumentFragment752() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment752() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment752() +} + +func (c *current) onDocumentFragment759() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment759() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment759() +} + +func (c *current) onDocumentFragment749(revdate, revremark interface{}) (interface{}, error) { + return types.NewDocumentRevision(nil, revdate, revremark) + +} + +func (p *parser) callonDocumentFragment749() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment749(stack["revdate"], stack["revremark"]) +} + +func (c *current) onDocumentFragment763() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment763() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment763() +} + +func (c *current) onDocumentFragment702(revision interface{}) (interface{}, error) { + return revision, nil +} + +func (p *parser) callonDocumentFragment702() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment702(stack["revision"]) +} + +func (c *current) onDocumentFragment368(authors, revision interface{}) (interface{}, error) { + return types.NewDocumentInformation(authors.(types.DocumentAuthors), revision) + +} + +func (p *parser) callonDocumentFragment368() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment368(stack["authors"], stack["revision"]) +} + +func (c *current) onDocumentFragment777() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment777() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment777() +} + +func (c *current) onDocumentFragment787() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment787() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment787() +} + +func (c *current) onDocumentFragment796() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment796() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment796() +} + +func (c *current) onDocumentFragment805() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonDocumentFragment805() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment805() +} + +func (c *current) onDocumentFragment810() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonDocumentFragment810() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment810() +} + +func (c *current) onDocumentFragment817() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment817() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment817() +} + +func (c *current) onDocumentFragment829() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment829() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment829() +} + +func (c *current) onDocumentFragment831() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonDocumentFragment831() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment831() +} + +func (c *current) onDocumentFragment824(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonDocumentFragment824() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment824(stack["start"]) +} + +func (c *current) onDocumentFragment813(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonDocumentFragment813() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment813(stack["name"], stack["start"]) +} + +func (c *current) onDocumentFragment839() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment839() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment839() +} + +func (c *current) onDocumentFragment851() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment851() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment851() +} + +func (c *current) onDocumentFragment853() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonDocumentFragment853() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment853() +} + +func (c *current) onDocumentFragment846(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonDocumentFragment846() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment846(stack["start"]) +} + +func (c *current) onDocumentFragment835(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonDocumentFragment835() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment835(stack["name"], stack["start"]) +} + +func (c *current) onDocumentFragment861() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment861() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment861() +} + +func (c *current) onDocumentFragment857(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonDocumentFragment857() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment857(stack["name"]) +} + +func (c *current) onDocumentFragment808(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonDocumentFragment808() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment808(stack["element"]) +} + +func (c *current) onDocumentFragment867() (interface{}, error) { + // standalone '{' + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonDocumentFragment867() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment867() +} + +func (c *current) onDocumentFragment792(element interface{}) (interface{}, error) { + + return element, nil + +} + +func (p *parser) callonDocumentFragment792() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment792(stack["element"]) +} + +func (c *current) onDocumentFragment785(elements interface{}) (interface{}, error) { + return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil + +} + +func (p *parser) callonDocumentFragment785() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment785(stack["elements"]) +} + +func (c *current) onDocumentFragment870() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment870() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment870() +} + +func (c *current) onDocumentFragment773(name, value interface{}) (interface{}, error) { + d := types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) + return d, nil + +} + +func (p *parser) callonDocumentFragment773() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment773(stack["name"], stack["value"]) +} + +func (c *current) onDocumentFragment881() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment881() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment881() +} + +func (c *current) onDocumentFragment888() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment888() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment888() +} + +func (c *current) onDocumentFragment891() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment891() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment891() +} + +func (c *current) onDocumentFragment877(name interface{}) (interface{}, error) { + return types.NewAttributeReset(name.(string)) +} + +func (p *parser) callonDocumentFragment877() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment877(stack["name"]) +} + +func (c *current) onDocumentFragment902() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment902() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment902() +} + +func (c *current) onDocumentFragment909() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment909() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment909() +} + +func (c *current) onDocumentFragment912() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment912() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment912() +} + +func (c *current) onDocumentFragment898(name interface{}) (interface{}, error) { + return types.NewAttributeReset(name.(string)) +} + +func (p *parser) callonDocumentFragment898() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment898(stack["name"]) +} + +func (c *current) onDocumentFragment327(title, info, extraAttrs interface{}) (interface{}, error) { + c.setFrontMatterAllowed(false) // not allowed anymore + c.setDocumentHeaderAllowed(false) // not allowed anymore + return types.NewDocumentHeader(title.([]interface{}), info, extraAttrs.([]interface{})) + +} + +func (p *parser) callonDocumentFragment327() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment327(stack["title"], stack["info"], stack["extraAttrs"]) +} + +func (c *current) onDocumentFragment925() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment925() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment925() +} + +func (c *current) onDocumentFragment928() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment928() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment928() +} + +func (c *current) onDocumentFragment919() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment919() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment919() +} + +func (c *current) onDocumentFragment937() (bool, error) { + + return !c.isWithinDelimitedBlock(), nil + +} + +func (p *parser) callonDocumentFragment937() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment937() +} + +func (c *current) onDocumentFragment939() (interface{}, error) { + + // `=` is level 0, `==` is level 1, etc. + return (len(c.text) - 1), nil + +} + +func (p *parser) callonDocumentFragment939() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment939() +} + +func (c *current) onDocumentFragment942(level interface{}) (bool, error) { + + // use a predicate to make sure that only `=` (level 0) to `======` (level 5) are allowed + return level.(int) <= 5, nil + +} + +func (p *parser) callonDocumentFragment942() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment942(stack["level"]) +} + +func (c *current) onDocumentFragment943(level interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment943() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment943(stack["level"]) +} + +func (c *current) onDocumentFragment947() (interface{}, error) { + // can't have empty title, that may collide with example block delimiter (`====`) + return []interface{}{ + types.RawLine(c.text), + }, nil +} + +func (p *parser) callonDocumentFragment947() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment947() +} + +func (c *current) onDocumentFragment951() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment951() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment951() +} + +func (c *current) onDocumentFragment935(level, title interface{}) (interface{}, error) { + return types.NewRawSection(level.(int), title.([]interface{})) + +} + +func (p *parser) callonDocumentFragment935() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment935(stack["level"], stack["title"]) +} + +func (c *current) onDocumentFragment959() (interface{}, error) { + // TODO: Space* before EOF + return types.NewThematicBreak() + +} + +func (p *parser) callonDocumentFragment959() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment959() +} + +func (c *current) onDocumentFragment975() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment975() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment975() +} + +func (c *current) onDocumentFragment978() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment978() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment978() +} + +func (c *current) onDocumentFragment995() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment995() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment995() +} + +func (c *current) onDocumentFragment1001() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1001() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1001() +} + +func (c *current) onDocumentFragment999(content interface{}) (interface{}, error) { + return types.NewRawContent(content.(string)) + +} + +func (p *parser) callonDocumentFragment999() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment999(stack["content"]) +} + +func (c *current) onDocumentFragment991(content interface{}) (interface{}, error) { + return types.NewTableCell(content.(types.RawContent)) + +} + +func (p *parser) callonDocumentFragment991() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment991(stack["content"]) +} + +func (c *current) onDocumentFragment1005() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1005() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1005() +} + +func (c *current) onDocumentFragment1019() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1019() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1019() +} + +func (c *current) onDocumentFragment1022() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1022() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1022() +} + +func (c *current) onDocumentFragment1013() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment1013() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1013() +} + +func (c *current) onDocumentFragment987(cells interface{}) (interface{}, error) { + return types.NewTableRow(cells.([]interface{})) + +} + +func (p *parser) callonDocumentFragment987() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment987(stack["cells"]) +} + +func (c *current) onDocumentFragment1039() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1039() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1039() +} + +func (c *current) onDocumentFragment1042() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1042() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1042() +} + +func (c *current) onDocumentFragment1063() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1063() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1063() +} + +func (c *current) onDocumentFragment1066() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1066() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1066() +} + +func (c *current) onDocumentFragment1082() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1082() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1082() +} + +func (c *current) onDocumentFragment1085() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1085() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1085() +} + +func (c *current) onDocumentFragment1076() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment1076() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1076() +} + +func (c *current) onDocumentFragment1094() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1094() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1094() +} + +func (c *current) onDocumentFragment1100() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1100() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1100() +} + +func (c *current) onDocumentFragment1098(content interface{}) (interface{}, error) { + return types.NewRawContent(content.(string)) + +} + +func (p *parser) callonDocumentFragment1098() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1098(stack["content"]) +} + +func (c *current) onDocumentFragment1056(content interface{}) (interface{}, error) { + return types.NewTableCell(content.(types.RawContent)) + +} + +func (p *parser) callonDocumentFragment1056() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1056(stack["content"]) +} + +func (c *current) onDocumentFragment1104() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1104() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1104() +} + +func (c *current) onDocumentFragment1053(cell interface{}) (interface{}, error) { + return cell, nil + +} + +func (p *parser) callonDocumentFragment1053() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1053(stack["cell"]) +} + +func (c *current) onDocumentFragment1119() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1119() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1119() +} + +func (c *current) onDocumentFragment1122() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1122() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1122() +} + +func (c *current) onDocumentFragment1113() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment1113() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1113() +} + +func (c *current) onDocumentFragment1134() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1134() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1134() +} + +func (c *current) onDocumentFragment1137() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1137() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1137() +} + +func (c *current) onDocumentFragment1032(cells interface{}) (interface{}, error) { + return types.NewTableRow(cells.([]interface{})) + +} + +func (p *parser) callonDocumentFragment1032() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1032(stack["cells"]) +} + +func (c *current) onDocumentFragment1153() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1153() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1153() +} + +func (c *current) onDocumentFragment1156() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1156() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1156() +} + +func (c *current) onDocumentFragment1174() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1174() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1174() +} + +func (c *current) onDocumentFragment1177() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1177() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1177() +} + +func (c *current) onDocumentFragment1193() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1193() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1193() +} + +func (c *current) onDocumentFragment1196() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1196() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1196() +} + +func (c *current) onDocumentFragment1187() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment1187() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1187() +} + +func (c *current) onDocumentFragment1205() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1205() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1205() +} + +func (c *current) onDocumentFragment1211() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1211() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1211() +} + +func (c *current) onDocumentFragment1209(content interface{}) (interface{}, error) { + return types.NewRawContent(content.(string)) + +} + +func (p *parser) callonDocumentFragment1209() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1209(stack["content"]) +} + +func (c *current) onDocumentFragment1167(content interface{}) (interface{}, error) { + return types.NewTableCell(content.(types.RawContent)) + +} + +func (p *parser) callonDocumentFragment1167() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1167(stack["content"]) +} + +func (c *current) onDocumentFragment1215() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1215() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1215() +} + +func (c *current) onDocumentFragment1229() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1229() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1229() +} + +func (c *current) onDocumentFragment1232() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1232() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1232() +} + +func (c *current) onDocumentFragment1223() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment1223() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1223() +} + +func (c *current) onDocumentFragment1146(cells interface{}) (interface{}, error) { + return types.NewTableRow(cells.([]interface{})) + +} + +func (p *parser) callonDocumentFragment1146() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1146(stack["cells"]) +} + +func (c *current) onDocumentFragment1243() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1243() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1243() +} + +func (c *current) onDocumentFragment1246() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1246() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1246() +} + +func (c *current) onDocumentFragment971(header, rows interface{}) (interface{}, error) { + return types.NewTable(header, rows.([]interface{})) + +} + +func (p *parser) callonDocumentFragment971() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment971(stack["header"], stack["rows"]) +} + +func (c *current) onDocumentFragment1261() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1261() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1261() +} + +func (c *current) onDocumentFragment1265() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1265() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1265() +} + +func (c *current) onDocumentFragment1255(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + +} + +func (p *parser) callonDocumentFragment1255() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1255(stack["content"]) +} + +func (c *current) onDocumentFragment1276() (interface{}, error) { + return types.Tip, nil +} + +func (p *parser) callonDocumentFragment1276() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1276() +} + +func (c *current) onDocumentFragment1278() (interface{}, error) { + return types.Note, nil +} + +func (p *parser) callonDocumentFragment1278() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1278() +} + +func (c *current) onDocumentFragment1280() (interface{}, error) { + return types.Important, nil +} + +func (p *parser) callonDocumentFragment1280() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1280() +} + +func (c *current) onDocumentFragment1282() (interface{}, error) { + return types.Warning, nil +} + +func (p *parser) callonDocumentFragment1282() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1282() +} + +func (c *current) onDocumentFragment1284() (interface{}, error) { + return types.Caution, nil +} + +func (p *parser) callonDocumentFragment1284() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1284() +} + +func (c *current) onDocumentFragment1291() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1291() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1291() +} + +func (c *current) onDocumentFragment1294(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment1294() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1294(stack["content"]) +} + +func (c *current) onDocumentFragment1296() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1296() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1296() +} + +func (c *current) onDocumentFragment1288(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment1288() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1288(stack["content"]) +} + +func (c *current) onDocumentFragment1311() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1311() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1311() +} + +func (c *current) onDocumentFragment1313() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1313() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1313() +} + +func (c *current) onDocumentFragment1326() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1326() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1326() +} + +func (c *current) onDocumentFragment1330() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1330() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1330() +} + +func (c *current) onDocumentFragment1320(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + +} + +func (p *parser) callonDocumentFragment1320() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1320(stack["content"]) +} + +func (c *current) onDocumentFragment1340() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1340() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1340() +} + +func (c *current) onDocumentFragment1343(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment1343() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1343(stack["content"]) +} + +func (c *current) onDocumentFragment1345() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1345() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1345() +} + +func (c *current) onDocumentFragment1337(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment1337() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1337(stack["content"]) +} + +func (c *current) onDocumentFragment1305(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonDocumentFragment1305() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1305(stack["line"]) +} + +func (c *current) onDocumentFragment1272(kind, firstLine, otherLines interface{}) (interface{}, error) { + + return types.NewAdmonitionParagraph(kind.(string), append([]interface{}{firstLine}, otherLines.([]interface{})...)) + +} + +func (p *parser) callonDocumentFragment1272() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1272(stack["kind"], stack["firstLine"], stack["otherLines"]) +} + +func (c *current) onDocumentFragment1360() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1360() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1360() +} + +func (c *current) onDocumentFragment1358() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1358() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1358() +} + +func (c *current) onDocumentFragment1365(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment1365() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1365(stack["content"]) +} + +func (c *current) onDocumentFragment1367() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1367() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1367() +} + +func (c *current) onDocumentFragment1355(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment1355() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1355(stack["content"]) +} + +func (c *current) onDocumentFragment1383() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1383() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1383() +} + +func (c *current) onDocumentFragment1387() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1387() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1387() +} + +func (c *current) onDocumentFragment1377(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + +} + +func (p *parser) callonDocumentFragment1377() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1377(stack["content"]) +} + +func (c *current) onDocumentFragment1397() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1397() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1397() +} + +func (c *current) onDocumentFragment1400(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment1400() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1400(stack["content"]) +} + +func (c *current) onDocumentFragment1402() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1402() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1402() +} + +func (c *current) onDocumentFragment1394(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment1394() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1394(stack["content"]) +} + +func (c *current) onDocumentFragment1352(firstLine, otherLines interface{}) (interface{}, error) { + + return types.NewLiteralParagraph(types.LiteralBlockWithSpacesOnFirstLine, append([]interface{}{firstLine}, otherLines.([]interface{})...)) + +} + +func (p *parser) callonDocumentFragment1352() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1352(stack["firstLine"], stack["otherLines"]) +} + +func (c *current) onDocumentFragment1411() (bool, error) { + return c.isFrontMatterAllowed(), nil + +} + +func (p *parser) callonDocumentFragment1411() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1411() +} + +func (c *current) onDocumentFragment1417() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1417() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1417() +} + +func (c *current) onDocumentFragment1420() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1420() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1420() +} + +func (c *current) onDocumentFragment1437() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1437() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1437() +} + +func (c *current) onDocumentFragment1440() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1440() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1440() +} + +func (c *current) onDocumentFragment1429() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1429() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1429() +} + +func (c *current) onDocumentFragment1450() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1450() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1450() +} + +func (c *current) onDocumentFragment1453() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1453() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1453() +} + +func (c *current) onDocumentFragment1413(content interface{}) (interface{}, error) { + return types.NewYamlFrontMatter(content.(string)) +} + +func (p *parser) callonDocumentFragment1413() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1413(stack["content"]) +} + +func (c *current) onDocumentFragment1409(frontmatter interface{}) (interface{}, error) { + c.setFrontMatterAllowed(false) // not allowed anymore + return frontmatter, nil + +} + +func (p *parser) callonDocumentFragment1409() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1409(stack["frontmatter"]) +} + +func (c *current) onDocumentFragment1466() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1466() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1466() +} + +func (c *current) onDocumentFragment1469(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment1469() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1469(stack["content"]) +} + +func (c *current) onDocumentFragment1471() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1471() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1471() +} + +func (c *current) onDocumentFragment1463(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment1463() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1463(stack["content"]) +} + +func (c *current) onDocumentFragment1489() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1489() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1489() +} + +func (c *current) onDocumentFragment1491() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1491() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1491() +} + +func (c *current) onDocumentFragment1504() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1504() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1504() +} + +func (c *current) onDocumentFragment1508() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1508() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1508() +} + +func (c *current) onDocumentFragment1498(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + +} + +func (p *parser) callonDocumentFragment1498() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1498(stack["content"]) +} + +func (c *current) onDocumentFragment1518() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1518() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1518() +} + +func (c *current) onDocumentFragment1521(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment1521() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1521(stack["content"]) +} + +func (c *current) onDocumentFragment1523() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment1523() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1523() +} + +func (c *current) onDocumentFragment1515(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment1515() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1515(stack["content"]) +} + +func (c *current) onDocumentFragment1480(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonDocumentFragment1480() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1480(stack["line"]) +} + +func (c *current) onDocumentFragment1460(firstLine, otherLines interface{}) (interface{}, error) { + return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...)...) + +} + +func (p *parser) callonDocumentFragment1460() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1460(stack["firstLine"], stack["otherLines"]) +} + +func (c *current) onDocumentFragment1(attributes, element interface{}) (interface{}, error) { + c.setFrontMatterAllowed(false) // not allowed anymore + c.setDocumentHeaderAllowed(false) // not allowed anymore + + if element, ok := element.(types.BlockWithAttributes); ok && attributes != nil { + element.AddAttributes(attributes.(types.Attributes)) + } + return element, nil + +} + +func (p *parser) callonDocumentFragment1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1(stack["attributes"], stack["element"]) +} + +func (c *current) onDocumentFragmentWithinVerbatimBlock13() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragmentWithinVerbatimBlock13() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragmentWithinVerbatimBlock13() +} + +func (c *current) onDocumentFragmentWithinVerbatimBlock17() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDocumentFragmentWithinVerbatimBlock17() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragmentWithinVerbatimBlock17() +} + +func (c *current) onDocumentFragmentWithinVerbatimBlock7(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragmentWithinVerbatimBlock7() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragmentWithinVerbatimBlock7(stack["content"]) +} + +func (c *current) onDocumentFragmentWithinVerbatimBlock1(elements interface{}) (interface{}, error) { + return elements, nil + +} + +func (p *parser) callonDocumentFragmentWithinVerbatimBlock1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragmentWithinVerbatimBlock1(stack["elements"]) +} + +func (c *current) onDelimitedBlockElements10() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDelimitedBlockElements10() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlockElements10() +} + +func (c *current) onDelimitedBlockElements6(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonDelimitedBlockElements6() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlockElements6(stack["ref"]) +} + +func (c *current) onDelimitedBlockElements1(elements interface{}) (interface{}, error) { + return elements, nil + +} + +func (p *parser) callonDelimitedBlockElements1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlockElements1(stack["elements"]) +} + +func (c *current) onBlockAttributes16() (interface{}, error) { + // spaces, commas and dots are allowed in this syntax + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonBlockAttributes16() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes16() +} + +func (c *current) onBlockAttributes23() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonBlockAttributes23() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes23() +} + +func (c *current) onBlockAttributes19(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonBlockAttributes19() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes19(stack["ref"]) +} + +func (c *current) onBlockAttributes29() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonBlockAttributes29() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes29() +} + +func (c *current) onBlockAttributes36() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes36() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes36() +} + +func (c *current) onBlockAttributes48() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes48() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes48() +} + +func (c *current) onBlockAttributes50() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonBlockAttributes50() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes50() +} + +func (c *current) onBlockAttributes43(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonBlockAttributes43() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes43(stack["start"]) +} + +func (c *current) onBlockAttributes32(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonBlockAttributes32() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes32(stack["name"], stack["start"]) +} + +func (c *current) onBlockAttributes58() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes58() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes58() +} + +func (c *current) onBlockAttributes70() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes70() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes70() +} + +func (c *current) onBlockAttributes72() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonBlockAttributes72() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes72() +} + +func (c *current) onBlockAttributes65(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonBlockAttributes65() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes65(stack["start"]) +} + +func (c *current) onBlockAttributes54(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonBlockAttributes54() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes54(stack["name"], stack["start"]) +} + +func (c *current) onBlockAttributes80() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes80() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes80() +} + +func (c *current) onBlockAttributes76(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonBlockAttributes76() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes76(stack["name"]) +} + +func (c *current) onBlockAttributes27(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonBlockAttributes27() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes27(stack["element"]) +} + +func (c *current) onBlockAttributes86() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonBlockAttributes86() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes86() +} + +func (c *current) onBlockAttributes12(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + +} + +func (p *parser) callonBlockAttributes12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes12(stack["elements"]) +} + +func (c *current) onBlockAttributes8(id interface{}) (interface{}, error) { + return types.NewIDAttribute(id) + +} + +func (p *parser) callonBlockAttributes8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes8(stack["id"]) +} + +func (c *current) onBlockAttributes90() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes90() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes90() +} + +func (c *current) onBlockAttributes93() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonBlockAttributes93() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes93() +} + +func (c *current) onBlockAttributes5(anchor interface{}) (interface{}, error) { + return anchor, nil + +} + +func (p *parser) callonBlockAttributes5() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes5(stack["anchor"]) +} + +func (c *current) onBlockAttributes114() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonBlockAttributes114() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes114() +} + +func (c *current) onBlockAttributes121() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonBlockAttributes121() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes121() +} + +func (c *current) onBlockAttributes117(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonBlockAttributes117() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes117(stack["ref"]) +} + +func (c *current) onBlockAttributes127() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonBlockAttributes127() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes127() +} + +func (c *current) onBlockAttributes134() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes134() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes134() +} + +func (c *current) onBlockAttributes146() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes146() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes146() +} + +func (c *current) onBlockAttributes148() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonBlockAttributes148() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes148() +} + +func (c *current) onBlockAttributes141(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonBlockAttributes141() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes141(stack["start"]) +} + +func (c *current) onBlockAttributes130(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonBlockAttributes130() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes130(stack["name"], stack["start"]) +} + +func (c *current) onBlockAttributes156() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes156() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes156() +} + +func (c *current) onBlockAttributes168() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes168() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes168() +} + +func (c *current) onBlockAttributes170() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonBlockAttributes170() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes170() +} + +func (c *current) onBlockAttributes163(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonBlockAttributes163() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes163(stack["start"]) +} + +func (c *current) onBlockAttributes152(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonBlockAttributes152() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes152(stack["name"], stack["start"]) +} + +func (c *current) onBlockAttributes178() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes178() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes178() +} + +func (c *current) onBlockAttributes174(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonBlockAttributes174() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes174(stack["name"]) +} + +func (c *current) onBlockAttributes125(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonBlockAttributes125() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes125(stack["element"]) +} + +func (c *current) onBlockAttributes184() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonBlockAttributes184() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes184() +} + +func (c *current) onBlockAttributes107(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + +} + +func (p *parser) callonBlockAttributes107() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes107(stack["elements"]) +} + +func (c *current) onBlockAttributes103(title interface{}) (interface{}, error) { + return types.NewTitleAttribute(title) + +} + +func (p *parser) callonBlockAttributes103() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes103(stack["title"]) +} + +func (c *current) onBlockAttributes187() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes187() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes187() +} + +func (c *current) onBlockAttributes190() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonBlockAttributes190() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes190() +} + +func (c *current) onBlockAttributes100(title interface{}) (interface{}, error) { + return title, nil + +} + +func (p *parser) callonBlockAttributes100() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes100(stack["title"]) +} + +func (c *current) onBlockAttributes202() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes202() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes202() +} + +func (c *current) onBlockAttributes205() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonBlockAttributes205() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes205() +} + +func (c *current) onBlockAttributes197(attributes interface{}) (interface{}, error) { + return attributes, nil + +} + +func (p *parser) callonBlockAttributes197() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes197(stack["attributes"]) +} + +func (c *current) onBlockAttributes1(attributes interface{}) (interface{}, error) { + // c.unsetCurrentSubstitution() + return types.MergeAttributes(attributes.([]interface{})...) + +} + +func (p *parser) callonBlockAttributes1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes1(stack["attributes"]) +} + +func (c *current) onInlineAttributes6(attribute interface{}) (interface{}, error) { + return attribute, nil + +} + +func (p *parser) callonInlineAttributes6() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineAttributes6(stack["attribute"]) +} + +func (c *current) onInlineAttributes1(attributes interface{}) (interface{}, error) { + return types.NewAttributes(attributes.([]interface{})...) + +} + +func (p *parser) callonInlineAttributes1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineAttributes1(stack["attributes"]) +} + +func (c *current) onLongHandAttributes25() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes25() +} + +func (c *current) onLongHandAttributes28() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes28() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes28() +} + +func (c *current) onLongHandAttributes32() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes32() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes32() +} + +func (c *current) onLongHandAttributes39() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes39() +} + +func (c *current) onLongHandAttributes51() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes51() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes51() +} + +func (c *current) onLongHandAttributes53() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes53() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes53() +} + +func (c *current) onLongHandAttributes46(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes46() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes46(stack["start"]) +} + +func (c *current) onLongHandAttributes35(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes35() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes35(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes61() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes61() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes61() +} + +func (c *current) onLongHandAttributes73() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes73() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes73() +} + +func (c *current) onLongHandAttributes75() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes75() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes75() +} + +func (c *current) onLongHandAttributes68(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes68() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes68(stack["start"]) +} + +func (c *current) onLongHandAttributes57(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes57() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes57(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes83() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes83() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes83() +} + +func (c *current) onLongHandAttributes79(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes79() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes79(stack["name"]) +} + +func (c *current) onLongHandAttributes30(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes30(stack["element"]) +} + +func (c *current) onLongHandAttributes89() (interface{}, error) { + + return types.NewStringElement(`'`) // escaped single quote + +} + +func (p *parser) callonLongHandAttributes89() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes89() +} + +func (c *current) onLongHandAttributes93() (interface{}, error) { + // quoted string delimiters or standalone backslash + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonLongHandAttributes93() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes93() +} + +func (c *current) onLongHandAttributes95() (interface{}, error) { + // = and , signs are allowed within '' quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes95() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes95() +} + +func (c *current) onLongHandAttributes21(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes21() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes21(stack["elements"]) +} + +func (c *current) onLongHandAttributes15(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes15(stack["content"]) +} + +func (c *current) onLongHandAttributes109() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes109() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes109() +} + +func (c *current) onLongHandAttributes112() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes112() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes112() +} + +func (c *current) onLongHandAttributes116() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes116() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes116() +} + +func (c *current) onLongHandAttributes123() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes123() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes123() +} + +func (c *current) onLongHandAttributes135() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes135() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes135() +} + +func (c *current) onLongHandAttributes137() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes137() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes137() +} + +func (c *current) onLongHandAttributes130(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes130() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes130(stack["start"]) +} + +func (c *current) onLongHandAttributes119(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes119() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes119(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes145() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes145() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes145() +} + +func (c *current) onLongHandAttributes157() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes157() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes157() +} + +func (c *current) onLongHandAttributes159() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes159() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes159() +} + +func (c *current) onLongHandAttributes152(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes152() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes152(stack["start"]) +} + +func (c *current) onLongHandAttributes141(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes141() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes141(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes167() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes167() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes167() +} + +func (c *current) onLongHandAttributes163(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes163() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes163(stack["name"]) +} + +func (c *current) onLongHandAttributes114(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes114() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes114(stack["element"]) +} + +func (c *current) onLongHandAttributes173() (interface{}, error) { + + return types.NewStringElement(`"`) // escaped double quote + +} + +func (p *parser) callonLongHandAttributes173() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes173() +} + +func (c *current) onLongHandAttributes178() (interface{}, error) { + // quoted string delimiters or standalone backslash or standalone backtick + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonLongHandAttributes178() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes178() +} + +func (c *current) onLongHandAttributes180() (interface{}, error) { + // = and , signs are allowed within " quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes180() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes180() +} + +func (c *current) onLongHandAttributes105(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes105() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes105(stack["elements"]) +} + +func (c *current) onLongHandAttributes188() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes188() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes188() +} + +func (c *current) onLongHandAttributes99(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes99() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes99(stack["content"]) +} + +func (c *current) onLongHandAttributes196() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes196() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes196() +} + +func (c *current) onLongHandAttributes203() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonLongHandAttributes203() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes203() +} + +func (c *current) onLongHandAttributes199(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonLongHandAttributes199() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes199(stack["ref"]) +} + +func (c *current) onLongHandAttributes209() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes209() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes209() +} + +func (c *current) onLongHandAttributes216() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes216() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes216() +} + +func (c *current) onLongHandAttributes228() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes228() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes228() +} + +func (c *current) onLongHandAttributes230() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes230() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes230() +} + +func (c *current) onLongHandAttributes223(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes223() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes223(stack["start"]) +} + +func (c *current) onLongHandAttributes212(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes212() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes212(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes238() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes238() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes238() +} + +func (c *current) onLongHandAttributes250() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes250() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes250() +} + +func (c *current) onLongHandAttributes252() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes252() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes252() +} + +func (c *current) onLongHandAttributes245(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes245() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes245(stack["start"]) +} + +func (c *current) onLongHandAttributes234(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes234() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes234(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes260() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes260() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes260() +} + +func (c *current) onLongHandAttributes256(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes256() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes256(stack["name"]) +} + +func (c *current) onLongHandAttributes207(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes207() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes207(stack["element"]) +} + +func (c *current) onLongHandAttributes266() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes266() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes266() +} + +func (c *current) onLongHandAttributes272() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes272() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes272() +} + +func (c *current) onLongHandAttributes191(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + +} + +func (p *parser) callonLongHandAttributes191() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes191(stack["elements"]) +} + +func (c *current) onLongHandAttributes12(value interface{}) (interface{}, error) { + return types.NewPositionalAttribute(value) + +} + +func (p *parser) callonLongHandAttributes12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes12(stack["value"]) +} + +func (c *current) onLongHandAttributes300() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes300() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes300() +} + +func (c *current) onLongHandAttributes303() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes303() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes303() +} + +func (c *current) onLongHandAttributes307() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes307() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes307() +} + +func (c *current) onLongHandAttributes314() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes314() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes314() +} + +func (c *current) onLongHandAttributes326() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes326() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes326() +} + +func (c *current) onLongHandAttributes328() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes328() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes328() +} + +func (c *current) onLongHandAttributes321(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes321() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes321(stack["start"]) +} + +func (c *current) onLongHandAttributes310(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes310() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes310(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes336() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes336() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes336() +} + +func (c *current) onLongHandAttributes348() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes348() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes348() +} + +func (c *current) onLongHandAttributes350() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes350() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes350() +} + +func (c *current) onLongHandAttributes343(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes343() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes343(stack["start"]) +} + +func (c *current) onLongHandAttributes332(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes332() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes332(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes358() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes358() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes358() +} + +func (c *current) onLongHandAttributes354(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes354() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes354(stack["name"]) +} + +func (c *current) onLongHandAttributes305(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes305() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes305(stack["element"]) +} + +func (c *current) onLongHandAttributes364() (interface{}, error) { + + return types.NewStringElement(`'`) // escaped single quote + +} + +func (p *parser) callonLongHandAttributes364() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes364() +} + +func (c *current) onLongHandAttributes368() (interface{}, error) { + // quoted string delimiters or standalone backslash + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonLongHandAttributes368() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes368() +} + +func (c *current) onLongHandAttributes370() (interface{}, error) { + // = and , signs are allowed within '' quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes370() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes370() +} + +func (c *current) onLongHandAttributes296(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes296() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes296(stack["elements"]) +} + +func (c *current) onLongHandAttributes290(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes290() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes290(stack["content"]) +} + +func (c *current) onLongHandAttributes384() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes384() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes384() +} + +func (c *current) onLongHandAttributes387() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes387() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes387() +} + +func (c *current) onLongHandAttributes391() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes391() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes391() +} + +func (c *current) onLongHandAttributes398() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes398() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes398() +} + +func (c *current) onLongHandAttributes410() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes410() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes410() +} + +func (c *current) onLongHandAttributes412() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes412() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes412() +} + +func (c *current) onLongHandAttributes405(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes405() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes405(stack["start"]) +} + +func (c *current) onLongHandAttributes394(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes394() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes394(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes420() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes420() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes420() +} + +func (c *current) onLongHandAttributes432() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes432() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes432() +} + +func (c *current) onLongHandAttributes434() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes434() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes434() +} + +func (c *current) onLongHandAttributes427(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes427() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes427(stack["start"]) +} + +func (c *current) onLongHandAttributes416(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes416() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes416(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes442() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes442() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes442() +} + +func (c *current) onLongHandAttributes438(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes438() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes438(stack["name"]) +} + +func (c *current) onLongHandAttributes389(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes389() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes389(stack["element"]) +} + +func (c *current) onLongHandAttributes448() (interface{}, error) { + + return types.NewStringElement(`"`) // escaped double quote + +} + +func (p *parser) callonLongHandAttributes448() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes448() +} + +func (c *current) onLongHandAttributes453() (interface{}, error) { + // quoted string delimiters or standalone backslash or standalone backtick + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonLongHandAttributes453() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes453() +} + +func (c *current) onLongHandAttributes455() (interface{}, error) { + // = and , signs are allowed within " quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes455() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes455() +} + +func (c *current) onLongHandAttributes380(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes380() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes380(stack["elements"]) +} + +func (c *current) onLongHandAttributes463() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes463() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes463() +} + +func (c *current) onLongHandAttributes374(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes374() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes374(stack["content"]) +} + +func (c *current) onLongHandAttributes471() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes471() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes471() +} + +func (c *current) onLongHandAttributes478() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonLongHandAttributes478() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes478() +} + +func (c *current) onLongHandAttributes474(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonLongHandAttributes474() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes474(stack["ref"]) +} + +func (c *current) onLongHandAttributes484() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes484() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes484() +} + +func (c *current) onLongHandAttributes491() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes491() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes491() +} + +func (c *current) onLongHandAttributes503() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes503() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes503() +} + +func (c *current) onLongHandAttributes505() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes505() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes505() +} + +func (c *current) onLongHandAttributes498(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes498() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes498(stack["start"]) +} + +func (c *current) onLongHandAttributes487(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes487() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes487(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes513() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes513() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes513() +} + +func (c *current) onLongHandAttributes525() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes525() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes525() +} + +func (c *current) onLongHandAttributes527() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes527() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes527() +} + +func (c *current) onLongHandAttributes520(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes520() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes520(stack["start"]) +} + +func (c *current) onLongHandAttributes509(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes509() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes509(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes535() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes535() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes535() +} + +func (c *current) onLongHandAttributes531(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes531() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes531(stack["name"]) +} + +func (c *current) onLongHandAttributes482(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes482() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes482(stack["element"]) +} + +func (c *current) onLongHandAttributes541() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes541() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes541() +} + +func (c *current) onLongHandAttributes547() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes547() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes547() +} + +func (c *current) onLongHandAttributes466(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + +} + +func (p *parser) callonLongHandAttributes466() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes466(stack["elements"]) +} + +func (c *current) onLongHandAttributes285(id interface{}) (interface{}, error) { + return types.NewIDAttribute(id) + +} + +func (p *parser) callonLongHandAttributes285() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes285(stack["id"]) +} + +func (c *current) onLongHandAttributes565() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes565() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes565() +} + +func (c *current) onLongHandAttributes568() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes568() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes568() +} + +func (c *current) onLongHandAttributes572() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes572() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes572() +} + +func (c *current) onLongHandAttributes579() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes579() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes579() +} + +func (c *current) onLongHandAttributes591() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes591() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes591() +} + +func (c *current) onLongHandAttributes593() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes593() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes593() +} + +func (c *current) onLongHandAttributes586(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes586() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes586(stack["start"]) +} + +func (c *current) onLongHandAttributes575(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes575() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes575(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes601() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes601() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes601() +} + +func (c *current) onLongHandAttributes613() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes613() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes613() +} + +func (c *current) onLongHandAttributes615() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes615() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes615() +} + +func (c *current) onLongHandAttributes608(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes608() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes608(stack["start"]) +} + +func (c *current) onLongHandAttributes597(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes597() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes597(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes623() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes623() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes623() +} + +func (c *current) onLongHandAttributes619(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes619() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes619(stack["name"]) +} + +func (c *current) onLongHandAttributes570(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes570() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes570(stack["element"]) +} + +func (c *current) onLongHandAttributes629() (interface{}, error) { + + return types.NewStringElement(`'`) // escaped single quote + +} + +func (p *parser) callonLongHandAttributes629() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes629() +} + +func (c *current) onLongHandAttributes633() (interface{}, error) { + // quoted string delimiters or standalone backslash + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonLongHandAttributes633() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes633() +} + +func (c *current) onLongHandAttributes635() (interface{}, error) { + // = and , signs are allowed within '' quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes635() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes635() +} + +func (c *current) onLongHandAttributes561(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes561() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes561(stack["elements"]) +} + +func (c *current) onLongHandAttributes555(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes555() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes555(stack["content"]) +} + +func (c *current) onLongHandAttributes649() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes649() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes649() +} + +func (c *current) onLongHandAttributes652() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes652() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes652() +} + +func (c *current) onLongHandAttributes656() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes656() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes656() +} + +func (c *current) onLongHandAttributes663() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes663() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes663() +} + +func (c *current) onLongHandAttributes675() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes675() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes675() +} + +func (c *current) onLongHandAttributes677() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes677() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes677() +} + +func (c *current) onLongHandAttributes670(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes670() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes670(stack["start"]) +} + +func (c *current) onLongHandAttributes659(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes659() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes659(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes685() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes685() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes685() +} + +func (c *current) onLongHandAttributes697() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes697() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes697() +} + +func (c *current) onLongHandAttributes699() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes699() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes699() +} + +func (c *current) onLongHandAttributes692(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes692() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes692(stack["start"]) +} + +func (c *current) onLongHandAttributes681(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes681() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes681(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes707() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes707() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes707() +} + +func (c *current) onLongHandAttributes703(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes703() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes703(stack["name"]) +} + +func (c *current) onLongHandAttributes654(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes654() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes654(stack["element"]) +} + +func (c *current) onLongHandAttributes713() (interface{}, error) { + + return types.NewStringElement(`"`) // escaped double quote + +} + +func (p *parser) callonLongHandAttributes713() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes713() +} + +func (c *current) onLongHandAttributes718() (interface{}, error) { + // quoted string delimiters or standalone backslash or standalone backtick + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonLongHandAttributes718() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes718() +} + +func (c *current) onLongHandAttributes720() (interface{}, error) { + // = and , signs are allowed within " quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes720() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes720() +} + +func (c *current) onLongHandAttributes645(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes645() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes645(stack["elements"]) +} + +func (c *current) onLongHandAttributes728() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes728() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes728() +} + +func (c *current) onLongHandAttributes639(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes639() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes639(stack["content"]) +} + +func (c *current) onLongHandAttributes736() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes736() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes736() +} + +func (c *current) onLongHandAttributes743() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonLongHandAttributes743() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes743() +} + +func (c *current) onLongHandAttributes739(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonLongHandAttributes739() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes739(stack["ref"]) +} + +func (c *current) onLongHandAttributes749() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes749() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes749() +} + +func (c *current) onLongHandAttributes756() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes756() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes756() +} + +func (c *current) onLongHandAttributes768() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes768() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes768() +} + +func (c *current) onLongHandAttributes770() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes770() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes770() +} + +func (c *current) onLongHandAttributes763(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes763() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes763(stack["start"]) +} + +func (c *current) onLongHandAttributes752(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes752() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes752(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes778() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes778() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes778() +} + +func (c *current) onLongHandAttributes790() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes790() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes790() +} + +func (c *current) onLongHandAttributes792() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes792() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes792() +} + +func (c *current) onLongHandAttributes785(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes785() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes785(stack["start"]) +} + +func (c *current) onLongHandAttributes774(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes774() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes774(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes800() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes800() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes800() +} + +func (c *current) onLongHandAttributes796(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes796() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes796(stack["name"]) +} + +func (c *current) onLongHandAttributes747(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes747() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes747(stack["element"]) +} + +func (c *current) onLongHandAttributes806() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes806() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes806() +} + +func (c *current) onLongHandAttributes812() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes812() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes812() +} + +func (c *current) onLongHandAttributes731(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + +} + +func (p *parser) callonLongHandAttributes731() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes731(stack["elements"]) +} + +func (c *current) onLongHandAttributes550(option interface{}) (interface{}, error) { + return types.NewOptionAttribute(option) + +} + +func (p *parser) callonLongHandAttributes550() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes550(stack["option"]) +} + +func (c *current) onLongHandAttributes830() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes830() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes830() +} + +func (c *current) onLongHandAttributes833() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes833() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes833() +} + +func (c *current) onLongHandAttributes837() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes837() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes837() +} + +func (c *current) onLongHandAttributes844() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes844() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes844() +} + +func (c *current) onLongHandAttributes856() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes856() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes856() +} + +func (c *current) onLongHandAttributes858() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes858() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes858() +} + +func (c *current) onLongHandAttributes851(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes851() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes851(stack["start"]) +} + +func (c *current) onLongHandAttributes840(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes840() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes840(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes866() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes866() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes866() +} + +func (c *current) onLongHandAttributes878() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes878() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes878() +} + +func (c *current) onLongHandAttributes880() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes880() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes880() +} + +func (c *current) onLongHandAttributes873(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes873() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes873(stack["start"]) +} + +func (c *current) onLongHandAttributes862(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes862() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes862(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes888() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes888() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes888() +} + +func (c *current) onLongHandAttributes884(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes884() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes884(stack["name"]) +} + +func (c *current) onLongHandAttributes835(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes835() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes835(stack["element"]) +} + +func (c *current) onLongHandAttributes894() (interface{}, error) { + + return types.NewStringElement(`'`) // escaped single quote + +} + +func (p *parser) callonLongHandAttributes894() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes894() +} + +func (c *current) onLongHandAttributes898() (interface{}, error) { + // quoted string delimiters or standalone backslash + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonLongHandAttributes898() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes898() +} + +func (c *current) onLongHandAttributes900() (interface{}, error) { + // = and , signs are allowed within '' quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes900() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes900() +} + +func (c *current) onLongHandAttributes826(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes826() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes826(stack["elements"]) +} + +func (c *current) onLongHandAttributes820(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes820() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes820(stack["content"]) +} + +func (c *current) onLongHandAttributes914() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes914() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes914() +} + +func (c *current) onLongHandAttributes917() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes917() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes917() +} + +func (c *current) onLongHandAttributes921() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes921() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes921() +} + +func (c *current) onLongHandAttributes928() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes928() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes928() +} + +func (c *current) onLongHandAttributes940() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes940() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes940() +} + +func (c *current) onLongHandAttributes942() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes942() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes942() +} + +func (c *current) onLongHandAttributes935(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes935() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes935(stack["start"]) +} + +func (c *current) onLongHandAttributes924(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes924() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes924(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes950() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes950() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes950() +} + +func (c *current) onLongHandAttributes962() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes962() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes962() +} + +func (c *current) onLongHandAttributes964() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes964() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes964() +} + +func (c *current) onLongHandAttributes957(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes957() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes957(stack["start"]) +} + +func (c *current) onLongHandAttributes946(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes946() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes946(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes972() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes972() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes972() +} + +func (c *current) onLongHandAttributes968(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes968() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes968(stack["name"]) +} + +func (c *current) onLongHandAttributes919(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes919() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes919(stack["element"]) +} + +func (c *current) onLongHandAttributes978() (interface{}, error) { + + return types.NewStringElement(`"`) // escaped double quote + +} + +func (p *parser) callonLongHandAttributes978() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes978() +} + +func (c *current) onLongHandAttributes983() (interface{}, error) { + // quoted string delimiters or standalone backslash or standalone backtick + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonLongHandAttributes983() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes983() +} + +func (c *current) onLongHandAttributes985() (interface{}, error) { + // = and , signs are allowed within " quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes985() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes985() +} + +func (c *current) onLongHandAttributes910(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes910() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes910(stack["elements"]) +} + +func (c *current) onLongHandAttributes993() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes993() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes993() +} + +func (c *current) onLongHandAttributes904(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes904() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes904(stack["content"]) +} + +func (c *current) onLongHandAttributes1001() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes1001() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1001() +} + +func (c *current) onLongHandAttributes1008() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonLongHandAttributes1008() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1008() +} + +func (c *current) onLongHandAttributes1004(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonLongHandAttributes1004() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1004(stack["ref"]) +} + +func (c *current) onLongHandAttributes1014() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes1014() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1014() +} + +func (c *current) onLongHandAttributes1021() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes1021() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1021() +} + +func (c *current) onLongHandAttributes1033() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes1033() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1033() +} + +func (c *current) onLongHandAttributes1035() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes1035() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1035() +} + +func (c *current) onLongHandAttributes1028(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes1028() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1028(stack["start"]) +} + +func (c *current) onLongHandAttributes1017(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes1017() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1017(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes1043() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes1043() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1043() +} + +func (c *current) onLongHandAttributes1055() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes1055() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1055() +} + +func (c *current) onLongHandAttributes1057() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes1057() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1057() +} + +func (c *current) onLongHandAttributes1050(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes1050() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1050(stack["start"]) +} + +func (c *current) onLongHandAttributes1039(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes1039() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1039(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes1065() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes1065() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1065() +} + +func (c *current) onLongHandAttributes1061(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes1061() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1061(stack["name"]) +} + +func (c *current) onLongHandAttributes1012(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes1012() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1012(stack["element"]) +} + +func (c *current) onLongHandAttributes1071() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes1071() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1071() +} + +func (c *current) onLongHandAttributes1077() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes1077() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1077() +} + +func (c *current) onLongHandAttributes996(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + +} + +func (p *parser) callonLongHandAttributes996() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes996(stack["elements"]) +} + +func (c *current) onLongHandAttributes815(role interface{}) (interface{}, error) { + return types.NewRoleAttribute(role) + +} + +func (p *parser) callonLongHandAttributes815() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes815(stack["role"]) +} + +func (c *current) onLongHandAttributes277(extra interface{}) (interface{}, error) { + return extra, nil + +} + +func (p *parser) callonLongHandAttributes277() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes277(stack["extra"]) +} + +func (c *current) onLongHandAttributes1084() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes1084() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1084() +} + +func (c *current) onLongHandAttributes1086(main, extras interface{}) (bool, error) { + // make sure there was a match + return main != nil || len(extras.([]interface{})) > 0, nil + +} + +func (p *parser) callonLongHandAttributes1086() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1086(stack["main"], stack["extras"]) +} + +func (c *current) onLongHandAttributes8(main, extras interface{}) (interface{}, error) { + attrs := []interface{}{} + if main != nil { + attrs = append(attrs, main) + } + if len(extras.([]interface{})) > 0 { + attrs = append(attrs, extras.([]interface{})...) + } + return attrs, nil + +} + +func (p *parser) callonLongHandAttributes8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes8(stack["main"], stack["extras"]) +} + +func (c *current) onLongHandAttributes1(firstPositionalAttributes, otherAttributes interface{}) (interface{}, error) { + attributes := []interface{}{} + if firstPositionalAttributes != nil { + attributes = append(attributes, firstPositionalAttributes.([]interface{})...) + } + if len(otherAttributes.([]interface{})) > 0 { + attributes = append(attributes, otherAttributes.([]interface{})...) + } + return types.NewAttributes(attributes...) + +} + +func (p *parser) callonLongHandAttributes1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1(stack["firstPositionalAttributes"], stack["otherAttributes"]) +} + +func (c *current) onPositionalAttribute11() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonPositionalAttribute11() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPositionalAttribute11() +} + +func (c *current) onPositionalAttribute2(value interface{}) (interface{}, error) { + // TODO: see if we can just use `((",")? / &"]")` instead (ie, no need to check for Space*) + return types.NewPositionalAttribute(value) + +} + +func (p *parser) callonPositionalAttribute2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPositionalAttribute2(stack["value"]) +} + +func (c *current) onPositionalAttribute20() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonPositionalAttribute20() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPositionalAttribute20() +} + +func (c *current) onPositionalAttribute26() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonPositionalAttribute26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPositionalAttribute26() +} + +func (c *current) onPositionalAttribute30(value interface{}) (bool, error) { + // here we can't rely on `c.text` if the content is empty + // (in such a case, `c.text` contains the char sequence of the previous + // rule that matched) + return !types.AllNilEntries(value.([]interface{})), nil + +} + +func (p *parser) callonPositionalAttribute30() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPositionalAttribute30(stack["value"]) +} + +func (c *current) onPositionalAttribute15(value interface{}) (interface{}, error) { + + return types.NewPositionalAttribute(nil) + +} + +func (p *parser) callonPositionalAttribute15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPositionalAttribute15(stack["value"]) +} + +func (c *current) onNamedAttribute7() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonNamedAttribute7() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onNamedAttribute7() +} + +func (c *current) onNamedAttribute12() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonNamedAttribute12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onNamedAttribute12() +} + +func (c *current) onNamedAttribute4() (interface{}, error) { + return strings.TrimSpace(string(c.text)), nil + +} + +func (p *parser) callonNamedAttribute4() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onNamedAttribute4() +} + +func (c *current) onNamedAttribute16() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonNamedAttribute16() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onNamedAttribute16() +} + +func (c *current) onNamedAttribute24() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonNamedAttribute24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onNamedAttribute24() +} + +func (c *current) onNamedAttribute1(key, value interface{}) (interface{}, error) { + // TODO: include `,` or expect `]` + return types.NewNamedAttribute(key.(string), value) + +} + +func (p *parser) callonNamedAttribute1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onNamedAttribute1(stack["key"], stack["value"]) +} + +func (c *current) onAttributeRawValue15() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue15() +} + +func (c *current) onAttributeRawValue18() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue18() +} + +func (c *current) onAttributeRawValue22() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonAttributeRawValue22() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue22() +} + +func (c *current) onAttributeRawValue29() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue29() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue29() +} + +func (c *current) onAttributeRawValue41() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue41() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue41() +} + +func (c *current) onAttributeRawValue43() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonAttributeRawValue43() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue43() +} + +func (c *current) onAttributeRawValue36(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonAttributeRawValue36() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue36(stack["start"]) +} + +func (c *current) onAttributeRawValue25(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonAttributeRawValue25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue25(stack["name"], stack["start"]) +} + +func (c *current) onAttributeRawValue51() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue51() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue51() +} + +func (c *current) onAttributeRawValue63() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue63() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue63() +} + +func (c *current) onAttributeRawValue65() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonAttributeRawValue65() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue65() +} + +func (c *current) onAttributeRawValue58(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonAttributeRawValue58() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue58(stack["start"]) +} + +func (c *current) onAttributeRawValue47(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonAttributeRawValue47() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue47(stack["name"], stack["start"]) +} + +func (c *current) onAttributeRawValue73() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue73() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue73() +} + +func (c *current) onAttributeRawValue69(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonAttributeRawValue69() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue69(stack["name"]) +} + +func (c *current) onAttributeRawValue20(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonAttributeRawValue20() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue20(stack["element"]) +} + +func (c *current) onAttributeRawValue79() (interface{}, error) { + + return types.NewStringElement(`'`) // escaped single quote + +} + +func (p *parser) callonAttributeRawValue79() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue79() +} + +func (c *current) onAttributeRawValue83() (interface{}, error) { + // quoted string delimiters or standalone backslash + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonAttributeRawValue83() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue83() +} + +func (c *current) onAttributeRawValue85() (interface{}, error) { + // = and , signs are allowed within '' quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonAttributeRawValue85() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue85() +} + +func (c *current) onAttributeRawValue11(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonAttributeRawValue11() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue11(stack["elements"]) +} + +func (c *current) onAttributeRawValue5(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonAttributeRawValue5() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue5(stack["content"]) +} + +func (c *current) onAttributeRawValue99() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue99() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue99() +} + +func (c *current) onAttributeRawValue102() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue102() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue102() +} + +func (c *current) onAttributeRawValue106() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonAttributeRawValue106() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue106() +} + +func (c *current) onAttributeRawValue113() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue113() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue113() +} + +func (c *current) onAttributeRawValue125() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue125() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue125() +} + +func (c *current) onAttributeRawValue127() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonAttributeRawValue127() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue127() +} + +func (c *current) onAttributeRawValue120(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonAttributeRawValue120() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue120(stack["start"]) +} + +func (c *current) onAttributeRawValue109(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonAttributeRawValue109() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue109(stack["name"], stack["start"]) +} + +func (c *current) onAttributeRawValue135() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue135() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue135() +} + +func (c *current) onAttributeRawValue147() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue147() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue147() +} + +func (c *current) onAttributeRawValue149() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonAttributeRawValue149() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue149() +} + +func (c *current) onAttributeRawValue142(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonAttributeRawValue142() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue142(stack["start"]) +} + +func (c *current) onAttributeRawValue131(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonAttributeRawValue131() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue131(stack["name"], stack["start"]) +} + +func (c *current) onAttributeRawValue157() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue157() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue157() +} + +func (c *current) onAttributeRawValue153(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonAttributeRawValue153() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue153(stack["name"]) +} + +func (c *current) onAttributeRawValue104(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonAttributeRawValue104() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue104(stack["element"]) +} + +func (c *current) onAttributeRawValue163() (interface{}, error) { + + return types.NewStringElement(`"`) // escaped double quote + +} + +func (p *parser) callonAttributeRawValue163() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue163() +} + +func (c *current) onAttributeRawValue168() (interface{}, error) { + // quoted string delimiters or standalone backslash or standalone backtick + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonAttributeRawValue168() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue168() +} + +func (c *current) onAttributeRawValue170() (interface{}, error) { + // = and , signs are allowed within " quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonAttributeRawValue170() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue170() +} + +func (c *current) onAttributeRawValue95(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonAttributeRawValue95() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue95(stack["elements"]) +} + +func (c *current) onAttributeRawValue178() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue178() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue178() +} + +func (c *current) onAttributeRawValue89(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonAttributeRawValue89() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue89(stack["content"]) +} + +func (c *current) onAttributeRawValue186() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue186() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue186() +} + +func (c *current) onAttributeRawValue1(value interface{}) (interface{}, error) { + return value, nil + +} + +func (p *parser) callonAttributeRawValue1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue1(stack["value"]) +} + +func (c *current) onUnquotedAttributeRawValue4() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue4() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue4() +} + +func (c *current) onUnquotedAttributeRawValue17() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonUnquotedAttributeRawValue17() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue17() +} + +func (c *current) onUnquotedAttributeRawValue13(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonUnquotedAttributeRawValue13() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue13(stack["ref"]) +} + +func (c *current) onUnquotedAttributeRawValue23() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonUnquotedAttributeRawValue23() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue23() +} + +func (c *current) onUnquotedAttributeRawValue30() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue30() +} + +func (c *current) onUnquotedAttributeRawValue42() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue42() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue42() +} + +func (c *current) onUnquotedAttributeRawValue44() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonUnquotedAttributeRawValue44() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue44() +} + +func (c *current) onUnquotedAttributeRawValue37(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonUnquotedAttributeRawValue37() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue37(stack["start"]) +} + +func (c *current) onUnquotedAttributeRawValue26(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonUnquotedAttributeRawValue26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue26(stack["name"], stack["start"]) +} + +func (c *current) onUnquotedAttributeRawValue52() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue52() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue52() +} + +func (c *current) onUnquotedAttributeRawValue64() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue64() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue64() +} + +func (c *current) onUnquotedAttributeRawValue66() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonUnquotedAttributeRawValue66() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue66() +} + +func (c *current) onUnquotedAttributeRawValue59(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonUnquotedAttributeRawValue59() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue59(stack["start"]) +} + +func (c *current) onUnquotedAttributeRawValue48(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonUnquotedAttributeRawValue48() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue48(stack["name"], stack["start"]) +} + +func (c *current) onUnquotedAttributeRawValue74() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue74() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue74() +} + +func (c *current) onUnquotedAttributeRawValue70(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonUnquotedAttributeRawValue70() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue70(stack["name"]) +} + +func (c *current) onUnquotedAttributeRawValue21(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonUnquotedAttributeRawValue21() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue21(stack["element"]) +} + +func (c *current) onUnquotedAttributeRawValue80() (interface{}, error) { + // not within brackets and stop on space + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue80() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue80() +} + +func (c *current) onUnquotedAttributeRawValue83() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue83() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue83() +} + +func (c *current) onUnquotedAttributeRawValue1(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue1(stack["elements"]) +} + +func (c *current) onCrossReference6() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonCrossReference6() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference6() +} + +func (c *current) onCrossReference10() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonCrossReference10() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference10() +} + +func (c *current) onCrossReference16() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonCrossReference16() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference16() +} + +func (c *current) onCrossReference23() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonCrossReference23() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference23() +} + +func (c *current) onCrossReference30() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonCrossReference30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference30() +} + +func (c *current) onCrossReference42() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonCrossReference42() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference42() +} + +func (c *current) onCrossReference44() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonCrossReference44() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference44() +} + +func (c *current) onCrossReference37(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonCrossReference37() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference37(stack["start"]) +} + +func (c *current) onCrossReference26(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonCrossReference26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference26(stack["name"], stack["start"]) +} + +func (c *current) onCrossReference52() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonCrossReference52() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference52() +} + +func (c *current) onCrossReference64() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonCrossReference64() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference64() +} + +func (c *current) onCrossReference66() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonCrossReference66() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference66() +} + +func (c *current) onCrossReference59(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonCrossReference59() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference59(stack["start"]) +} + +func (c *current) onCrossReference48(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonCrossReference48() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference48(stack["name"], stack["start"]) +} + +func (c *current) onCrossReference74() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonCrossReference74() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference74() +} + +func (c *current) onCrossReference70(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonCrossReference70() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference70(stack["name"]) +} + +func (c *current) onCrossReference21(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonCrossReference21() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference21(stack["element"]) +} + +func (c *current) onCrossReference80() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonCrossReference80() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference80() +} + +func (c *current) onCrossReference2(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + +} + +func (p *parser) callonCrossReference2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference2(stack["id"], stack["label"]) +} + +func (c *current) onCrossReference87() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonCrossReference87() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference87() +} + +func (c *current) onCrossReference83(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonCrossReference83() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference83(stack["id"]) +} + +func (c *current) onExternalCrossReference13() (interface{}, error) { + // not supported for now: EOL, space, "{", "[", "]" + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference13() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference13() +} + +func (c *current) onExternalCrossReference18() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonExternalCrossReference18() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference18() +} + +func (c *current) onExternalCrossReference25() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference25() +} + +func (c *current) onExternalCrossReference37() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference37() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference37() +} + +func (c *current) onExternalCrossReference39() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference39() +} + +func (c *current) onExternalCrossReference32(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonExternalCrossReference32() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference32(stack["start"]) +} + +func (c *current) onExternalCrossReference21(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonExternalCrossReference21() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference21(stack["name"], stack["start"]) +} + +func (c *current) onExternalCrossReference47() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference47() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference47() +} + +func (c *current) onExternalCrossReference59() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference59() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference59() +} + +func (c *current) onExternalCrossReference61() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference61() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference61() +} + +func (c *current) onExternalCrossReference54(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonExternalCrossReference54() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference54(stack["start"]) +} + +func (c *current) onExternalCrossReference43(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonExternalCrossReference43() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference43(stack["name"], stack["start"]) +} + +func (c *current) onExternalCrossReference69() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference69() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference69() +} + +func (c *current) onExternalCrossReference65(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonExternalCrossReference65() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference65(stack["name"]) +} + +func (c *current) onExternalCrossReference16(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonExternalCrossReference16() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference16(stack["element"]) +} + +func (c *current) onExternalCrossReference77() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + +} + +func (p *parser) callonExternalCrossReference77() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference77() +} + +func (c *current) onExternalCrossReference86() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference86() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference86() +} + +func (c *current) onExternalCrossReference90() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference90() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference90() +} + +func (c *current) onExternalCrossReference96() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference96() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference96() +} + +func (c *current) onExternalCrossReference103() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonExternalCrossReference103() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference103() +} + +func (c *current) onExternalCrossReference110() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference110() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference110() +} + +func (c *current) onExternalCrossReference122() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference122() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference122() +} + +func (c *current) onExternalCrossReference124() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference124() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference124() +} + +func (c *current) onExternalCrossReference117(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonExternalCrossReference117() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference117(stack["start"]) +} + +func (c *current) onExternalCrossReference106(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonExternalCrossReference106() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference106(stack["name"], stack["start"]) +} + +func (c *current) onExternalCrossReference132() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference132() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference132() +} + +func (c *current) onExternalCrossReference144() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference144() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference144() +} + +func (c *current) onExternalCrossReference146() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference146() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference146() +} + +func (c *current) onExternalCrossReference139(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonExternalCrossReference139() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference139(stack["start"]) +} + +func (c *current) onExternalCrossReference128(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonExternalCrossReference128() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference128(stack["name"], stack["start"]) +} + +func (c *current) onExternalCrossReference154() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference154() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference154() +} + +func (c *current) onExternalCrossReference150(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonExternalCrossReference150() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference150(stack["name"]) +} + +func (c *current) onExternalCrossReference101(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonExternalCrossReference101() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference101(stack["element"]) +} + +func (c *current) onExternalCrossReference160() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference160() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference160() +} + +func (c *current) onExternalCrossReference82(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + +} + +func (p *parser) callonExternalCrossReference82() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference82(stack["id"], stack["label"]) +} + +func (c *current) onExternalCrossReference167() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference167() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference167() +} + +func (c *current) onExternalCrossReference163(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonExternalCrossReference163() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference163(stack["id"]) +} + +func (c *current) onExternalCrossReference80() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference80() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference80() +} + +func (c *current) onExternalCrossReference171() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference171() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference171() +} + +func (c *current) onExternalCrossReference75(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonExternalCrossReference75() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference75(stack["element"]) +} + +func (c *current) onExternalCrossReference173() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference173() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference173() +} + +func (c *current) onExternalCrossReference9(elements interface{}) (interface{}, error) { + return types.NewInlineElements(elements.([]interface{})) + +} + +func (p *parser) callonExternalCrossReference9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference9(stack["elements"]) +} + +func (c *current) onExternalCrossReference179() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonExternalCrossReference179() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference179() +} + +func (c *current) onExternalCrossReference175(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonExternalCrossReference175() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference175(stack["ref"]) +} + +func (c *current) onExternalCrossReference5(path interface{}) (interface{}, error) { + return types.NewLocation("", path.([]interface{})) + +} + +func (p *parser) callonExternalCrossReference5() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference5(stack["path"]) +} + +func (c *current) onExternalCrossReference1(url, inlineAttributes interface{}) (interface{}, error) { + return types.NewExternalCrossReference(url.(*types.Location), inlineAttributes.(types.Attributes)) + +} + +func (p *parser) callonExternalCrossReference1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference1(stack["url"], stack["inlineAttributes"]) +} + +func (c *current) onDelimitedBlock4() (bool, error) { + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Comment), nil + +} + +func (p *parser) callonDelimitedBlock4() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock4() +} + +func (c *current) onDelimitedBlock7() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock7() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock7() +} + +func (c *current) onDelimitedBlock10() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDelimitedBlock10() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock10() +} + +func (c *current) onDelimitedBlock17() (bool, error) { + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Comment) + return true, nil + +} + +func (p *parser) callonDelimitedBlock17() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock17() +} + +func (c *current) onDelimitedBlock27() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock27() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock27() +} + +func (c *current) onDelimitedBlock30() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDelimitedBlock30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock30() +} + +func (c *current) onDelimitedBlock46() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock46() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock46() +} + +func (c *current) onDelimitedBlock50() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDelimitedBlock50() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock50() +} + +func (c *current) onDelimitedBlock40(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDelimitedBlock40() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock40(stack["content"]) +} + +func (c *current) onDelimitedBlock20(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonDelimitedBlock20() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock20(stack["line"]) +} + +func (c *current) onDelimitedBlock62() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock62() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock62() +} + +func (c *current) onDelimitedBlock65() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDelimitedBlock65() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock65() +} + +func (c *current) onDelimitedBlock2(content interface{}) (interface{}, error) { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Comment, content.([]interface{})) + +} + +func (p *parser) callonDelimitedBlock2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock2(stack["content"]) +} + +func (c *current) onDelimitedBlock90() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock90() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock90() +} + +func (c *current) onDelimitedBlock93() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDelimitedBlock93() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock93() +} + +func (c *current) onDelimitedBlock84() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDelimitedBlock84() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock84() +} + +func (c *current) onDelimitedBlock102() (interface{}, error) { + + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock102() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock102() +} + +func (c *current) onDelimitedBlock106() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDelimitedBlock106() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock106() +} + +func (c *current) onDelimitedBlock81(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDelimitedBlock81() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock81(stack["content"]) +} + +func (c *current) onDelimitedBlock125() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock125() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock125() +} + +func (c *current) onDelimitedBlock128() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDelimitedBlock128() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock128() +} + +func (c *current) onDelimitedBlock119() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDelimitedBlock119() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock119() +} + +func (c *current) onDelimitedBlock137() (interface{}, error) { + + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock137() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock137() +} + +func (c *current) onDelimitedBlock141() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDelimitedBlock141() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock141() +} + +func (c *current) onDelimitedBlock116(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDelimitedBlock116() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock116(stack["content"]) +} + +func (c *current) onDelimitedBlock151() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock151() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock151() +} + +func (c *current) onDelimitedBlock154(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDelimitedBlock154() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock154(stack["content"]) +} + +func (c *current) onDelimitedBlock156() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonDelimitedBlock156() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock156() +} + +func (c *current) onDelimitedBlock148(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDelimitedBlock148() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock148(stack["content"]) +} + +func (c *current) onDelimitedBlock78(firstLine, otherLines interface{}) (interface{}, error) { + return types.NewDelimitedBlock(types.MarkdownQuote, append([]interface{}{firstLine}, otherLines.([]interface{})...)) + +} + +func (p *parser) callonDelimitedBlock78() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock78(stack["firstLine"], stack["otherLines"]) +} + +func (c *current) onExampleBlock3() (bool, error) { + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Example), nil + +} + +func (p *parser) callonExampleBlock3() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlock3() +} + +func (c *current) onExampleBlock6() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExampleBlock6() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlock6() +} + +func (c *current) onExampleBlock9() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExampleBlock9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlock9() +} + +func (c *current) onExampleBlock16() (bool, error) { + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Example) + return true, nil + +} + +func (p *parser) callonExampleBlock16() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlock16() +} + +func (c *current) onExampleBlock23() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExampleBlock23() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlock23() +} + +func (c *current) onExampleBlock26() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExampleBlock26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlock26() +} + +func (c *current) onExampleBlock1(content interface{}) (interface{}, error) { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Example, content.([]interface{})) + +} + +func (p *parser) callonExampleBlock1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlock1(stack["content"]) +} + +func (c *current) onExampleBlockContent9() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExampleBlockContent9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlockContent9() +} + +func (c *current) onExampleBlockContent12() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExampleBlockContent12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlockContent12() +} + +func (c *current) onExampleBlockContent30() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonExampleBlockContent30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlockContent30() +} + +func (c *current) onExampleBlockContent34() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExampleBlockContent34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlockContent34() +} + +func (c *current) onExampleBlockContent24(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonExampleBlockContent24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlockContent24(stack["content"]) +} + +func (c *current) onExampleBlockContent2(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonExampleBlockContent2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlockContent2(stack["line"]) +} + +func (c *current) onFencedBlock3() (bool, error) { + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Fenced), nil + +} + +func (p *parser) callonFencedBlock3() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlock3() +} + +func (c *current) onFencedBlock6() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonFencedBlock6() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlock6() +} + +func (c *current) onFencedBlock9() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonFencedBlock9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlock9() +} + +func (c *current) onFencedBlock16() (bool, error) { + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Fenced) + return true, nil + +} + +func (p *parser) callonFencedBlock16() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlock16() +} + +func (c *current) onFencedBlock23() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonFencedBlock23() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlock23() +} + +func (c *current) onFencedBlock26() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonFencedBlock26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlock26() +} + +func (c *current) onFencedBlock1(content interface{}) (interface{}, error) { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Fenced, content.([]interface{})) + +} + +func (p *parser) callonFencedBlock1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlock1(stack["content"]) +} + +func (c *current) onFencedBlockContent9() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonFencedBlockContent9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlockContent9() +} + +func (c *current) onFencedBlockContent12() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonFencedBlockContent12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlockContent12() +} + +func (c *current) onFencedBlockContent30() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonFencedBlockContent30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlockContent30() +} + +func (c *current) onFencedBlockContent34() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonFencedBlockContent34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlockContent34() +} + +func (c *current) onFencedBlockContent24(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonFencedBlockContent24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlockContent24(stack["content"]) +} + +func (c *current) onFencedBlockContent2(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonFencedBlockContent2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlockContent2(stack["line"]) +} + +func (c *current) onListingBlock3() (bool, error) { + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Listing), nil + +} + +func (p *parser) callonListingBlock3() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlock3() +} + +func (c *current) onListingBlock6() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListingBlock6() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlock6() +} + +func (c *current) onListingBlock9() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListingBlock9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlock9() +} + +func (c *current) onListingBlock16() (bool, error) { + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Listing) + return true, nil + +} + +func (p *parser) callonListingBlock16() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlock16() +} + +func (c *current) onListingBlock23() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListingBlock23() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlock23() +} + +func (c *current) onListingBlock26() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListingBlock26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlock26() +} + +func (c *current) onListingBlock1(content interface{}) (interface{}, error) { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Listing, content.([]interface{})) + +} + +func (p *parser) callonListingBlock1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlock1(stack["content"]) +} + +func (c *current) onListingBlockContent9() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListingBlockContent9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlockContent9() +} + +func (c *current) onListingBlockContent12() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListingBlockContent12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlockContent12() +} + +func (c *current) onListingBlockContent30() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonListingBlockContent30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlockContent30() +} + +func (c *current) onListingBlockContent34() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListingBlockContent34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlockContent34() +} + +func (c *current) onListingBlockContent24(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonListingBlockContent24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlockContent24(stack["content"]) +} + +func (c *current) onListingBlockContent2(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonListingBlockContent2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlockContent2(stack["line"]) +} + +func (c *current) onLiteralBlock5() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLiteralBlock5() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlock5() +} + +func (c *current) onLiteralBlock8() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonLiteralBlock8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlock8() +} + +func (c *current) onLiteralBlock15() (bool, error) { + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Literal), nil + +} + +func (p *parser) callonLiteralBlock15() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlock15() +} + +func (c *current) onLiteralBlock18(content interface{}) (bool, error) { + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Literal) + return true, nil + +} + +func (p *parser) callonLiteralBlock18() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlock18(stack["content"]) +} + +func (c *current) onLiteralBlock24() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLiteralBlock24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlock24() +} + +func (c *current) onLiteralBlock27() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonLiteralBlock27() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlock27() +} + +func (c *current) onLiteralBlock1(content interface{}) (interface{}, error) { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Literal, content.([]interface{})) + +} + +func (p *parser) callonLiteralBlock1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlock1(stack["content"]) +} + +func (c *current) onLiteralBlockContent9() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonLiteralBlockContent9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlockContent9() +} + +func (c *current) onLiteralBlockContent12() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonLiteralBlockContent12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlockContent12() +} + +func (c *current) onLiteralBlockContent30() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonLiteralBlockContent30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlockContent30() +} + +func (c *current) onLiteralBlockContent34() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonLiteralBlockContent34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlockContent34() +} + +func (c *current) onLiteralBlockContent24(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonLiteralBlockContent24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlockContent24(stack["content"]) +} + +func (c *current) onLiteralBlockContent2(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonLiteralBlockContent2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlockContent2(stack["line"]) +} + +func (c *current) onMarkdownQuoteAttribution5() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonMarkdownQuoteAttribution5() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onMarkdownQuoteAttribution5() +} + +func (c *current) onMarkdownQuoteAttribution9() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonMarkdownQuoteAttribution9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onMarkdownQuoteAttribution9() +} + +func (c *current) onMarkdownQuoteAttribution1(author interface{}) (interface{}, error) { + return author, nil + +} + +func (p *parser) callonMarkdownQuoteAttribution1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onMarkdownQuoteAttribution1(stack["author"]) +} + +func (c *current) onPassthroughBlock3() (bool, error) { + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Passthrough), nil + +} + +func (p *parser) callonPassthroughBlock3() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlock3() +} + +func (c *current) onPassthroughBlock6() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonPassthroughBlock6() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlock6() +} + +func (c *current) onPassthroughBlock9() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonPassthroughBlock9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlock9() +} + +func (c *current) onPassthroughBlock16() (bool, error) { + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Passthrough) + return true, nil + +} + +func (p *parser) callonPassthroughBlock16() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlock16() +} + +func (c *current) onPassthroughBlock24() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonPassthroughBlock24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlock24() +} + +func (c *current) onPassthroughBlock27() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonPassthroughBlock27() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlock27() +} + +func (c *current) onPassthroughBlock1(content interface{}) (interface{}, error) { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Passthrough, content.([]interface{})) + +} + +func (p *parser) callonPassthroughBlock1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlock1(stack["content"]) +} + +func (c *current) onPassthroughBlockContent9() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonPassthroughBlockContent9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlockContent9() +} + +func (c *current) onPassthroughBlockContent12() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonPassthroughBlockContent12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlockContent12() +} + +func (c *current) onPassthroughBlockContent30() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonPassthroughBlockContent30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlockContent30() +} + +func (c *current) onPassthroughBlockContent34() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonPassthroughBlockContent34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlockContent34() +} + +func (c *current) onPassthroughBlockContent24(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonPassthroughBlockContent24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlockContent24(stack["content"]) +} + +func (c *current) onPassthroughBlockContent2(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonPassthroughBlockContent2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlockContent2(stack["line"]) +} + +func (c *current) onQuoteBlock3() (bool, error) { + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Quote), nil + +} + +func (p *parser) callonQuoteBlock3() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlock3() +} + +func (c *current) onQuoteBlock6() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonQuoteBlock6() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlock6() +} + +func (c *current) onQuoteBlock9() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonQuoteBlock9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlock9() +} + +func (c *current) onQuoteBlock16() (bool, error) { + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Quote) + return true, nil + +} + +func (p *parser) callonQuoteBlock16() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlock16() +} + +func (c *current) onQuoteBlock23() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonQuoteBlock23() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlock23() +} + +func (c *current) onQuoteBlock26() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonQuoteBlock26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlock26() +} + +func (c *current) onQuoteBlock1(content interface{}) (interface{}, error) { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Quote, content.([]interface{})) + +} + +func (p *parser) callonQuoteBlock1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlock1(stack["content"]) +} + +func (c *current) onQuoteBlockContent9() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonQuoteBlockContent9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlockContent9() +} + +func (c *current) onQuoteBlockContent12() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonQuoteBlockContent12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlockContent12() +} + +func (c *current) onQuoteBlockContent30() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonQuoteBlockContent30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlockContent30() +} + +func (c *current) onQuoteBlockContent34() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonQuoteBlockContent34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlockContent34() +} + +func (c *current) onQuoteBlockContent24(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonQuoteBlockContent24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlockContent24(stack["content"]) +} + +func (c *current) onQuoteBlockContent2(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonQuoteBlockContent2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlockContent2(stack["line"]) +} + +func (c *current) onSidebarBlock3() (bool, error) { + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Sidebar), nil + +} + +func (p *parser) callonSidebarBlock3() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlock3() +} + +func (c *current) onSidebarBlock6() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonSidebarBlock6() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlock6() +} + +func (c *current) onSidebarBlock9() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonSidebarBlock9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlock9() +} + +func (c *current) onSidebarBlock16() (bool, error) { + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Sidebar) + return true, nil + +} + +func (p *parser) callonSidebarBlock16() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlock16() +} + +func (c *current) onSidebarBlock23() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonSidebarBlock23() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlock23() +} + +func (c *current) onSidebarBlock26() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonSidebarBlock26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlock26() +} + +func (c *current) onSidebarBlock1(content interface{}) (interface{}, error) { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Sidebar, content.([]interface{})) + +} + +func (p *parser) callonSidebarBlock1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlock1(stack["content"]) +} + +func (c *current) onSidebarBlockContent9() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonSidebarBlockContent9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlockContent9() +} + +func (c *current) onSidebarBlockContent12() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonSidebarBlockContent12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlockContent12() +} + +func (c *current) onSidebarBlockContent30() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonSidebarBlockContent30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlockContent30() +} + +func (c *current) onSidebarBlockContent34() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonSidebarBlockContent34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlockContent34() +} + +func (c *current) onSidebarBlockContent24(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonSidebarBlockContent24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlockContent24(stack["content"]) +} + +func (c *current) onSidebarBlockContent2(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonSidebarBlockContent2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlockContent2(stack["line"]) +} + +func (c *current) onFileInclusion3() (bool, error) { + // skip if disabled + return c.isRuleEnabled(FileInclusion) + +} + +func (p *parser) callonFileInclusion3() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion3() +} + +func (c *current) onFileInclusion4() error { + // force/enable attribute substitution + // log.Debug("entering FileInclusion rule") + return c.setCurrentSubstitution("attributes") + +} + +func (p *parser) callonFileInclusion4() error { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion4() +} + +func (c *current) onFileInclusion18() (interface{}, error) { + // not supported for now: EOL, space, "{", "[", "]" + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonFileInclusion18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion18() +} + +func (c *current) onFileInclusion23() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonFileInclusion23() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion23() +} + +func (c *current) onFileInclusion30() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion30() +} + +func (c *current) onFileInclusion42() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion42() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion42() +} + +func (c *current) onFileInclusion44() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonFileInclusion44() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion44() +} + +func (c *current) onFileInclusion37(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonFileInclusion37() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion37(stack["start"]) +} + +func (c *current) onFileInclusion26(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonFileInclusion26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion26(stack["name"], stack["start"]) +} + +func (c *current) onFileInclusion52() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion52() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion52() +} + +func (c *current) onFileInclusion64() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion64() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion64() +} + +func (c *current) onFileInclusion66() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonFileInclusion66() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion66() +} + +func (c *current) onFileInclusion59(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonFileInclusion59() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion59(stack["start"]) +} + +func (c *current) onFileInclusion48(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonFileInclusion48() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion48(stack["name"], stack["start"]) +} + +func (c *current) onFileInclusion74() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion74() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion74() +} + +func (c *current) onFileInclusion70(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonFileInclusion70() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion70(stack["name"]) +} + +func (c *current) onFileInclusion21(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonFileInclusion21() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion21(stack["element"]) +} + +func (c *current) onFileInclusion82() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + +} + +func (p *parser) callonFileInclusion82() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion82() +} + +func (c *current) onFileInclusion91() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion91() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion91() +} + +func (c *current) onFileInclusion95() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion95() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion95() +} + +func (c *current) onFileInclusion101() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonFileInclusion101() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion101() +} + +func (c *current) onFileInclusion108() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonFileInclusion108() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion108() +} + +func (c *current) onFileInclusion115() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion115() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion115() +} + +func (c *current) onFileInclusion127() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion127() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion127() +} + +func (c *current) onFileInclusion129() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonFileInclusion129() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion129() +} + +func (c *current) onFileInclusion122(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonFileInclusion122() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion122(stack["start"]) +} + +func (c *current) onFileInclusion111(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonFileInclusion111() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion111(stack["name"], stack["start"]) +} + +func (c *current) onFileInclusion137() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion137() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion137() +} + +func (c *current) onFileInclusion149() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion149() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion149() +} + +func (c *current) onFileInclusion151() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonFileInclusion151() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion151() +} + +func (c *current) onFileInclusion144(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonFileInclusion144() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion144(stack["start"]) +} + +func (c *current) onFileInclusion133(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonFileInclusion133() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion133(stack["name"], stack["start"]) +} + +func (c *current) onFileInclusion159() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion159() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion159() +} + +func (c *current) onFileInclusion155(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonFileInclusion155() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion155(stack["name"]) +} + +func (c *current) onFileInclusion106(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonFileInclusion106() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion106(stack["element"]) +} + +func (c *current) onFileInclusion165() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonFileInclusion165() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion165() +} + +func (c *current) onFileInclusion87(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + +} + +func (p *parser) callonFileInclusion87() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion87(stack["id"], stack["label"]) +} + +func (c *current) onFileInclusion172() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion172() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion172() +} + +func (c *current) onFileInclusion168(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonFileInclusion168() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion168(stack["id"]) +} + +func (c *current) onFileInclusion85() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonFileInclusion85() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion85() +} + +func (c *current) onFileInclusion176() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonFileInclusion176() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion176() +} + +func (c *current) onFileInclusion80(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonFileInclusion80() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion80(stack["element"]) +} + +func (c *current) onFileInclusion178() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonFileInclusion178() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion178() +} + +func (c *current) onFileInclusion14(elements interface{}) (interface{}, error) { + return types.NewInlineElements(elements.([]interface{})) + +} + +func (p *parser) callonFileInclusion14() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion14(stack["elements"]) +} + +func (c *current) onFileInclusion184() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonFileInclusion184() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion184() +} + +func (c *current) onFileInclusion180(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonFileInclusion180() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion180(stack["ref"]) +} + +func (c *current) onFileInclusion10(path interface{}) (interface{}, error) { + return types.NewLocation("", path.([]interface{})) + +} + +func (p *parser) callonFileInclusion10() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion10(stack["path"]) +} + +func (c *current) onFileInclusion6(path, inlineAttributes interface{}) (interface{}, error) { + + return types.NewFileInclusion(path.(*types.Location), inlineAttributes.(types.Attributes), string(c.text)) + +} + +func (p *parser) callonFileInclusion6() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion6(stack["path"], stack["inlineAttributes"]) +} + +func (c *current) onFileInclusion191() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion191() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion191() +} + +func (c *current) onFileInclusion194() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonFileInclusion194() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion194() +} + +func (c *current) onFileInclusion1(incl interface{}) (interface{}, error) { + return incl.(*types.FileInclusion), nil + +} + +func (p *parser) callonFileInclusion1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion1(stack["incl"]) +} + +func (c *current) onLineRanges17() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLineRanges17() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges17() +} + +func (c *current) onLineRanges12() (interface{}, error) { + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLineRanges12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges12() +} + +func (c *current) onLineRanges26() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLineRanges26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges26() +} + +func (c *current) onLineRanges21() (interface{}, error) { + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLineRanges21() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges21() +} + +func (c *current) onLineRanges9(start, end interface{}) (interface{}, error) { + // eg: lines=12..14 + return types.NewLineRange(start.(int), end.(int)) + +} + +func (p *parser) callonLineRanges9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges9(stack["start"], stack["end"]) +} + +func (c *current) onLineRanges35() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLineRanges35() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges35() +} + +func (c *current) onLineRanges30() (interface{}, error) { + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLineRanges30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges30() +} + +func (c *current) onLineRanges28(singleline interface{}) (interface{}, error) { + // eg: lines=12 + return types.NewLineRange(singleline.(int), singleline.(int)) + +} + +func (p *parser) callonLineRanges28() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges28(stack["singleline"]) +} + +func (c *current) onLineRanges52() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLineRanges52() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges52() +} + +func (c *current) onLineRanges47() (interface{}, error) { + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLineRanges47() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges47() +} + +func (c *current) onLineRanges61() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLineRanges61() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges61() +} + +func (c *current) onLineRanges56() (interface{}, error) { + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLineRanges56() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges56() +} + +func (c *current) onLineRanges44(start, end interface{}) (interface{}, error) { + // eg: lines=12..14 + return types.NewLineRange(start.(int), end.(int)) + +} + +func (p *parser) callonLineRanges44() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges44(stack["start"], stack["end"]) +} + +func (c *current) onLineRanges70() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLineRanges70() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges70() +} + +func (c *current) onLineRanges65() (interface{}, error) { + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLineRanges65() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges65() +} + +func (c *current) onLineRanges63(singleline interface{}) (interface{}, error) { + // eg: lines=12 + return types.NewLineRange(singleline.(int), singleline.(int)) + +} + +func (p *parser) callonLineRanges63() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges63(stack["singleline"]) +} + +func (c *current) onLineRanges39(other interface{}) (interface{}, error) { + return other, nil + +} + +func (p *parser) callonLineRanges39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges39(stack["other"]) +} + +func (c *current) onLineRanges5(first, others interface{}) (interface{}, error) { + return append([]interface{}{first}, others.([]interface{})...), nil + +} + +func (p *parser) callonLineRanges5() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges5(stack["first"], stack["others"]) +} + +func (c *current) onLineRanges80() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLineRanges80() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges80() +} + +func (c *current) onLineRanges75() (interface{}, error) { + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLineRanges75() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges75() +} + +func (c *current) onLineRanges89() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLineRanges89() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges89() +} + +func (c *current) onLineRanges84() (interface{}, error) { + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLineRanges84() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges84() +} + +func (c *current) onLineRanges72(start, end interface{}) (interface{}, error) { + // eg: lines=12..14 + return types.NewLineRange(start.(int), end.(int)) + +} + +func (p *parser) callonLineRanges72() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges72(stack["start"], stack["end"]) +} + +func (c *current) onLineRanges98() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLineRanges98() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges98() +} + +func (c *current) onLineRanges93() (interface{}, error) { + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLineRanges93() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges93() +} + +func (c *current) onLineRanges91(singleline interface{}) (interface{}, error) { + // eg: lines=12 + return types.NewLineRange(singleline.(int), singleline.(int)) + +} + +func (p *parser) callonLineRanges91() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges91(stack["singleline"]) +} + +func (c *current) onLineRanges1(value interface{}) (interface{}, error) { + // must make sure that the whole content is parsed + return value, nil + +} + +func (p *parser) callonLineRanges1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLineRanges1(stack["value"]) +} + +func (c *current) onTagRanges11() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonTagRanges11() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges11() +} + +func (c *current) onTagRanges17() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonTagRanges17() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges17() +} + +func (c *current) onTagRanges20(stars interface{}) (bool, error) { + + // use a predicate to make sure that only `*` and `**` are allowed + return len(stars.(string)) <= 2, nil + +} + +func (p *parser) callonTagRanges20() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges20(stack["stars"]) +} + +func (c *current) onTagRanges14(stars interface{}) (interface{}, error) { + return stars, nil + +} + +func (p *parser) callonTagRanges14() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges14(stack["stars"]) +} + +func (c *current) onTagRanges8(tag interface{}) (interface{}, error) { + return types.NewTagRange(tag.(string), true) + +} + +func (p *parser) callonTagRanges8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges8(stack["tag"]) +} + +func (c *current) onTagRanges26() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonTagRanges26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges26() +} + +func (c *current) onTagRanges32() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonTagRanges32() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges32() +} + +func (c *current) onTagRanges35(stars interface{}) (bool, error) { + + // use a predicate to make sure that only `*` and `**` are allowed + return len(stars.(string)) <= 2, nil + +} + +func (p *parser) callonTagRanges35() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges35(stack["stars"]) +} + +func (c *current) onTagRanges29(stars interface{}) (interface{}, error) { + return stars, nil + +} + +func (p *parser) callonTagRanges29() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges29(stack["stars"]) +} + +func (c *current) onTagRanges21(tag interface{}) (interface{}, error) { + return types.NewTagRange(tag.(string), false) + +} + +func (p *parser) callonTagRanges21() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges21(stack["tag"]) +} + +func (c *current) onTagRanges46() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonTagRanges46() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges46() +} + +func (c *current) onTagRanges52() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonTagRanges52() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges52() +} + +func (c *current) onTagRanges55(stars interface{}) (bool, error) { + + // use a predicate to make sure that only `*` and `**` are allowed + return len(stars.(string)) <= 2, nil + +} + +func (p *parser) callonTagRanges55() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges55(stack["stars"]) +} + +func (c *current) onTagRanges49(stars interface{}) (interface{}, error) { + return stars, nil + +} + +func (p *parser) callonTagRanges49() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges49(stack["stars"]) +} + +func (c *current) onTagRanges43(tag interface{}) (interface{}, error) { + return types.NewTagRange(tag.(string), true) + +} + +func (p *parser) callonTagRanges43() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges43(stack["tag"]) +} + +func (c *current) onTagRanges61() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonTagRanges61() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges61() +} + +func (c *current) onTagRanges67() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonTagRanges67() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges67() +} + +func (c *current) onTagRanges70(stars interface{}) (bool, error) { + + // use a predicate to make sure that only `*` and `**` are allowed + return len(stars.(string)) <= 2, nil + +} + +func (p *parser) callonTagRanges70() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges70(stack["stars"]) +} + +func (c *current) onTagRanges64(stars interface{}) (interface{}, error) { + return stars, nil + +} + +func (p *parser) callonTagRanges64() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges64(stack["stars"]) +} + +func (c *current) onTagRanges56(tag interface{}) (interface{}, error) { + return types.NewTagRange(tag.(string), false) + +} + +func (p *parser) callonTagRanges56() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges56(stack["tag"]) +} + +func (c *current) onTagRanges38(other interface{}) (interface{}, error) { + return other, nil + +} + +func (p *parser) callonTagRanges38() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges38(stack["other"]) +} + +func (c *current) onTagRanges4(first, others interface{}) (interface{}, error) { + return append([]interface{}{first}, others.([]interface{})...), nil + +} + +func (p *parser) callonTagRanges4() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges4(stack["first"], stack["others"]) +} + +func (c *current) onTagRanges1(value interface{}) (interface{}, error) { + // must make sure that the whole content is parsed + return value, nil + +} + +func (p *parser) callonTagRanges1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onTagRanges1(stack["value"]) +} + +func (c *current) onIncludedFileLine11() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIncludedFileLine11() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIncludedFileLine11() +} + +func (c *current) onIncludedFileLine10() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonIncludedFileLine10() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIncludedFileLine10() +} + +func (c *current) onIncludedFileLine6(tag interface{}) (interface{}, error) { + return types.NewIncludedFileStartTag(tag.(string)) + +} + +func (p *parser) callonIncludedFileLine6() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIncludedFileLine6(stack["tag"]) +} + +func (c *current) onIncludedFileLine20() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIncludedFileLine20() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIncludedFileLine20() +} + +func (c *current) onIncludedFileLine19() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonIncludedFileLine19() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIncludedFileLine19() +} + +func (c *current) onIncludedFileLine15(tag interface{}) (interface{}, error) { + return types.NewIncludedFileEndTag(tag.(string)) + +} + +func (p *parser) callonIncludedFileLine15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIncludedFileLine15(stack["tag"]) +} + +func (c *current) onIncludedFileLine24() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonIncludedFileLine24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIncludedFileLine24() +} + +func (c *current) onIncludedFileLine27() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonIncludedFileLine27() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIncludedFileLine27() +} + +func (c *current) onIncludedFileLine1(content interface{}) (interface{}, error) { + return types.NewIncludedFileLine(content.([]interface{})) + +} + +func (p *parser) callonIncludedFileLine1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIncludedFileLine1(stack["content"]) +} + +func (c *current) onInlineElement9() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonInlineElement9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement9() +} + +func (c *current) onInlineElement14() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonInlineElement14() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement14() +} + +func (c *current) onInlineElement4() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineElement4() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement4() +} + +func (c *current) onInlineElement21() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonInlineElement21() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement21() +} + +func (c *current) onInlineElement26() (bool, error) { + + return c.isPreceededBySpace(), nil + +} + +func (p *parser) callonInlineElement26() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement26() +} + +func (c *current) onInlineElement29() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonInlineElement29() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement29() +} + +func (c *current) onInlineElement33() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonInlineElement33() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement33() +} + +func (c *current) onInlineElement24() (interface{}, error) { + return types.NewLineBreak() + +} + +func (p *parser) callonInlineElement24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement24() +} + +func (c *current) onInlineElement43() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonInlineElement43() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement43() +} + +func (c *current) onInlineElement53() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + +} + +func (p *parser) callonInlineElement53() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement53() +} + +func (c *current) onInlineElement62() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonInlineElement62() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement62() +} + +func (c *current) onInlineElement66() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonInlineElement66() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement66() +} + +func (c *current) onInlineElement72() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineElement72() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement72() +} + +func (c *current) onInlineElement79() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonInlineElement79() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement79() +} + +func (c *current) onInlineElement86() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement86() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement86() +} + +func (c *current) onInlineElement98() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement98() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement98() +} + +func (c *current) onInlineElement100() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineElement100() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement100() +} + +func (c *current) onInlineElement93(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineElement93() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement93(stack["start"]) +} + +func (c *current) onInlineElement82(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonInlineElement82() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement82(stack["name"], stack["start"]) +} + +func (c *current) onInlineElement108() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement108() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement108() +} + +func (c *current) onInlineElement120() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement120() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement120() +} + +func (c *current) onInlineElement122() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineElement122() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement122() +} + +func (c *current) onInlineElement115(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineElement115() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement115(stack["start"]) +} + +func (c *current) onInlineElement104(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonInlineElement104() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement104(stack["name"], stack["start"]) +} + +func (c *current) onInlineElement130() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement130() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement130() +} + +func (c *current) onInlineElement126(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonInlineElement126() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement126(stack["name"]) +} + +func (c *current) onInlineElement77(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonInlineElement77() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement77(stack["element"]) +} + +func (c *current) onInlineElement136() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineElement136() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement136() +} + +func (c *current) onInlineElement58(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + +} + +func (p *parser) callonInlineElement58() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement58(stack["id"], stack["label"]) +} + +func (c *current) onInlineElement143() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonInlineElement143() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement143() +} + +func (c *current) onInlineElement139(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonInlineElement139() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement139(stack["id"]) +} + +func (c *current) onInlineElement56() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineElement56() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement56() +} + +func (c *current) onInlineElement147() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonInlineElement147() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement147() +} + +func (c *current) onInlineElement51(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonInlineElement51() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement51(stack["element"]) +} + +func (c *current) onInlineElement152() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonInlineElement152() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement152() +} + +func (c *current) onInlineElement159() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement159() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement159() +} + +func (c *current) onInlineElement171() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement171() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement171() +} + +func (c *current) onInlineElement173() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineElement173() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement173() +} + +func (c *current) onInlineElement166(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineElement166() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement166(stack["start"]) +} + +func (c *current) onInlineElement155(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonInlineElement155() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement155(stack["name"], stack["start"]) +} + +func (c *current) onInlineElement181() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement181() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement181() +} + +func (c *current) onInlineElement193() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement193() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement193() +} + +func (c *current) onInlineElement195() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineElement195() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement195() +} + +func (c *current) onInlineElement188(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineElement188() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement188(stack["start"]) +} + +func (c *current) onInlineElement177(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonInlineElement177() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement177(stack["name"], stack["start"]) +} + +func (c *current) onInlineElement203() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement203() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement203() +} + +func (c *current) onInlineElement199(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonInlineElement199() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement199(stack["name"]) +} + +func (c *current) onInlineElement150(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonInlineElement150() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement150(stack["element"]) +} + +func (c *current) onInlineElement210() (interface{}, error) { + return types.NewStringElement("\u2019") + +} + +func (p *parser) callonInlineElement210() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement210() +} + +func (c *current) onInlineElement212() (interface{}, error) { + return types.NewStringElement("\u00a9") + +} + +func (p *parser) callonInlineElement212() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement212() +} + +func (c *current) onInlineElement214() (interface{}, error) { + return types.NewStringElement("\u2122") + +} + +func (p *parser) callonInlineElement214() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement214() +} + +func (c *current) onInlineElement216() (interface{}, error) { + return types.NewStringElement("\u00ae") + +} + +func (p *parser) callonInlineElement216() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement216() +} + +func (c *current) onInlineElement218() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + +} + +func (p *parser) callonInlineElement218() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement218() +} + +func (c *current) onInlineElement220() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + +} + +func (p *parser) callonInlineElement220() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement220() +} + +func (c *current) onInlineElement230() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonInlineElement230() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement230() +} + +func (c *current) onInlineElement226(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonInlineElement226() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement226(stack["ref"]) +} + +func (c *current) onInlineElement234() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineElement234() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement234() +} + +func (c *current) onInlineElement1(element interface{}) (interface{}, error) { + c.trackSpaceSuffix(element) + return element, nil +} + +func (p *parser) callonInlineElement1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement1(stack["element"]) +} + +func (c *current) onIndexTerm1(term interface{}) (interface{}, error) { + return types.NewIndexTerm(term.([]interface{})) +} + +func (p *parser) callonIndexTerm1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTerm1(stack["term"]) +} + +func (c *current) onIndexTermContent5() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonIndexTermContent5() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent5() +} + +func (c *current) onIndexTermContent14() (interface{}, error) { + // allow ` + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonIndexTermContent14() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent14() +} + +func (c *current) onIndexTermContent25() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent25() +} + +func (c *current) onIndexTermContent29() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + +} + +func (p *parser) callonIndexTermContent29() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent29() +} + +func (c *current) onIndexTermContent38() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent38() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent38() +} + +func (c *current) onIndexTermContent42() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent42() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent42() +} + +func (c *current) onIndexTermContent48() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonIndexTermContent48() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent48() +} + +func (c *current) onIndexTermContent55() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonIndexTermContent55() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent55() +} + +func (c *current) onIndexTermContent62() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent62() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent62() +} + +func (c *current) onIndexTermContent74() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent74() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent74() +} + +func (c *current) onIndexTermContent76() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonIndexTermContent76() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent76() +} + +func (c *current) onIndexTermContent69(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonIndexTermContent69() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent69(stack["start"]) +} + +func (c *current) onIndexTermContent58(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonIndexTermContent58() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent58(stack["name"], stack["start"]) +} + +func (c *current) onIndexTermContent84() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent84() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent84() +} + +func (c *current) onIndexTermContent96() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent96() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent96() +} + +func (c *current) onIndexTermContent98() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonIndexTermContent98() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent98() +} + +func (c *current) onIndexTermContent91(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonIndexTermContent91() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent91(stack["start"]) +} + +func (c *current) onIndexTermContent80(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonIndexTermContent80() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent80(stack["name"], stack["start"]) +} + +func (c *current) onIndexTermContent106() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent106() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent106() +} + +func (c *current) onIndexTermContent102(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonIndexTermContent102() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent102(stack["name"]) +} + +func (c *current) onIndexTermContent53(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonIndexTermContent53() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent53(stack["element"]) +} + +func (c *current) onIndexTermContent112() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonIndexTermContent112() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent112() +} + +func (c *current) onIndexTermContent34(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + +} + +func (p *parser) callonIndexTermContent34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent34(stack["id"], stack["label"]) +} + +func (c *current) onIndexTermContent119() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent119() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent119() +} + +func (c *current) onIndexTermContent115(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonIndexTermContent115() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent115(stack["id"]) +} + +func (c *current) onIndexTermContent32() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonIndexTermContent32() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent32() +} + +func (c *current) onIndexTermContent123() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonIndexTermContent123() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent123() +} + +func (c *current) onIndexTermContent27(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonIndexTermContent27() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent27(stack["element"]) +} + +func (c *current) onIndexTermContent129() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonIndexTermContent129() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent129() +} + +func (c *current) onIndexTermContent125(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonIndexTermContent125() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent125(stack["ref"]) +} + +func (c *current) onIndexTermContent133() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonIndexTermContent133() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent133() +} + +func (c *current) onIndexTermContent1(elements interface{}) (interface{}, error) { + return types.NewInlineElements(elements.([]interface{})) +} + +func (p *parser) callonIndexTermContent1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent1(stack["elements"]) +} + +func (c *current) onImageBlock3() (bool, error) { + // AttrPositional1 must not be set + return types.HasNotAttribute(c.globalStore.getAttributes(), types.AttrPositional1), nil + +} + +func (p *parser) callonImageBlock3() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock3() +} + +func (c *current) onImageBlock23() (interface{}, error) { + // not supported for now: EOL, space, "{", "[", "]" + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonImageBlock23() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock23() +} + +func (c *current) onImageBlock28() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonImageBlock28() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock28() +} + +func (c *current) onImageBlock35() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock35() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock35() +} + +func (c *current) onImageBlock47() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock47() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock47() +} + +func (c *current) onImageBlock49() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonImageBlock49() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock49() +} + +func (c *current) onImageBlock42(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonImageBlock42() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock42(stack["start"]) +} + +func (c *current) onImageBlock31(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonImageBlock31() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock31(stack["name"], stack["start"]) +} + +func (c *current) onImageBlock57() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock57() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock57() +} + +func (c *current) onImageBlock69() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock69() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock69() +} + +func (c *current) onImageBlock71() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonImageBlock71() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock71() +} + +func (c *current) onImageBlock64(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonImageBlock64() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock64(stack["start"]) +} + +func (c *current) onImageBlock53(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonImageBlock53() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock53(stack["name"], stack["start"]) +} + +func (c *current) onImageBlock79() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock79() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock79() +} + +func (c *current) onImageBlock75(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonImageBlock75() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock75(stack["name"]) +} + +func (c *current) onImageBlock26(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonImageBlock26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock26(stack["element"]) +} + +func (c *current) onImageBlock87() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + +} + +func (p *parser) callonImageBlock87() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock87() +} + +func (c *current) onImageBlock96() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonImageBlock96() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock96() +} + +func (c *current) onImageBlock100() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonImageBlock100() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock100() +} + +func (c *current) onImageBlock106() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonImageBlock106() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock106() +} + +func (c *current) onImageBlock113() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonImageBlock113() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock113() +} + +func (c *current) onImageBlock120() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock120() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock120() +} + +func (c *current) onImageBlock132() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock132() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock132() +} + +func (c *current) onImageBlock134() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonImageBlock134() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock134() +} + +func (c *current) onImageBlock127(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonImageBlock127() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock127(stack["start"]) +} + +func (c *current) onImageBlock116(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonImageBlock116() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock116(stack["name"], stack["start"]) +} + +func (c *current) onImageBlock142() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock142() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock142() +} + +func (c *current) onImageBlock154() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock154() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock154() +} + +func (c *current) onImageBlock156() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonImageBlock156() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock156() +} + +func (c *current) onImageBlock149(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonImageBlock149() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock149(stack["start"]) +} + +func (c *current) onImageBlock138(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonImageBlock138() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock138(stack["name"], stack["start"]) +} + +func (c *current) onImageBlock164() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock164() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock164() +} + +func (c *current) onImageBlock160(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonImageBlock160() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock160(stack["name"]) +} + +func (c *current) onImageBlock111(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonImageBlock111() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock111(stack["element"]) +} + +func (c *current) onImageBlock170() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonImageBlock170() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock170() +} + +func (c *current) onImageBlock92(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + +} + +func (p *parser) callonImageBlock92() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock92(stack["id"], stack["label"]) +} + +func (c *current) onImageBlock177() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonImageBlock177() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock177() +} + +func (c *current) onImageBlock173(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonImageBlock173() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock173(stack["id"]) +} + +func (c *current) onImageBlock90() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonImageBlock90() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock90() +} + +func (c *current) onImageBlock181() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonImageBlock181() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock181() +} + +func (c *current) onImageBlock85(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonImageBlock85() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock85(stack["element"]) +} + +func (c *current) onImageBlock183() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonImageBlock183() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock183() +} + +func (c *current) onImageBlock19(elements interface{}) (interface{}, error) { + return types.NewInlineElements(elements.([]interface{})) + +} + +func (p *parser) callonImageBlock19() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock19(stack["elements"]) +} + +func (c *current) onImageBlock189() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonImageBlock189() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock189() +} + +func (c *current) onImageBlock185(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonImageBlock185() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock185(stack["ref"]) +} + +func (c *current) onImageBlock6(scheme, path interface{}) (interface{}, error) { + return types.NewLocation(scheme, path.([]interface{})) + +} + +func (p *parser) callonImageBlock6() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock6(stack["scheme"], stack["path"]) +} + +func (c *current) onImageBlock196() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonImageBlock196() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock196() +} + +func (c *current) onImageBlock199() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonImageBlock199() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock199() +} + +func (c *current) onImageBlock1(path, inlineAttributes interface{}) (interface{}, error) { + // c.unsetCurrentSubstitution() + // 'imagesdir' attribute is added after applying the attribute substitutions on the image location + return types.NewImageBlock(path.(*types.Location), inlineAttributes.(types.Attributes), c.globalStore.getAttributes()) + +} + +func (p *parser) callonImageBlock1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock1(stack["path"], stack["inlineAttributes"]) +} + +func (c *current) onInlineImage24() (interface{}, error) { + // not supported for now: EOL, space, "{", "[", "]" + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineImage24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage24() +} + +func (c *current) onInlineImage29() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonInlineImage29() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage29() +} + +func (c *current) onInlineImage36() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage36() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage36() +} + +func (c *current) onInlineImage48() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage48() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage48() +} + +func (c *current) onInlineImage50() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineImage50() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage50() +} + +func (c *current) onInlineImage43(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineImage43() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage43(stack["start"]) +} + +func (c *current) onInlineImage32(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonInlineImage32() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage32(stack["name"], stack["start"]) +} + +func (c *current) onInlineImage58() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage58() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage58() +} + +func (c *current) onInlineImage70() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage70() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage70() +} + +func (c *current) onInlineImage72() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineImage72() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage72() +} + +func (c *current) onInlineImage65(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineImage65() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage65(stack["start"]) +} + +func (c *current) onInlineImage54(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonInlineImage54() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage54(stack["name"], stack["start"]) +} + +func (c *current) onInlineImage80() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage80() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage80() +} + +func (c *current) onInlineImage76(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonInlineImage76() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage76(stack["name"]) +} + +func (c *current) onInlineImage27(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonInlineImage27() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage27(stack["element"]) +} + +func (c *current) onInlineImage88() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + +} + +func (p *parser) callonInlineImage88() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage88() +} + +func (c *current) onInlineImage97() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonInlineImage97() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage97() +} + +func (c *current) onInlineImage101() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonInlineImage101() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage101() +} + +func (c *current) onInlineImage107() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineImage107() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage107() +} + +func (c *current) onInlineImage114() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonInlineImage114() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage114() +} + +func (c *current) onInlineImage121() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage121() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage121() +} + +func (c *current) onInlineImage133() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage133() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage133() +} + +func (c *current) onInlineImage135() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineImage135() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage135() +} + +func (c *current) onInlineImage128(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineImage128() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage128(stack["start"]) +} + +func (c *current) onInlineImage117(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonInlineImage117() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage117(stack["name"], stack["start"]) +} + +func (c *current) onInlineImage143() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage143() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage143() +} + +func (c *current) onInlineImage155() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage155() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage155() +} + +func (c *current) onInlineImage157() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineImage157() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage157() +} + +func (c *current) onInlineImage150(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineImage150() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage150(stack["start"]) +} + +func (c *current) onInlineImage139(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonInlineImage139() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage139(stack["name"], stack["start"]) +} + +func (c *current) onInlineImage165() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage165() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage165() +} + +func (c *current) onInlineImage161(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonInlineImage161() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage161(stack["name"]) +} + +func (c *current) onInlineImage112(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonInlineImage112() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage112(stack["element"]) +} + +func (c *current) onInlineImage171() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineImage171() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage171() +} + +func (c *current) onInlineImage93(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + +} + +func (p *parser) callonInlineImage93() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage93(stack["id"], stack["label"]) +} + +func (c *current) onInlineImage178() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonInlineImage178() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage178() +} + +func (c *current) onInlineImage174(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonInlineImage174() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage174(stack["id"]) +} + +func (c *current) onInlineImage91() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineImage91() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage91() +} + +func (c *current) onInlineImage182() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonInlineImage182() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage182() +} + +func (c *current) onInlineImage86(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonInlineImage86() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage86(stack["element"]) +} + +func (c *current) onInlineImage184() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineImage184() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage184() +} + +func (c *current) onInlineImage20(elements interface{}) (interface{}, error) { + return types.NewInlineElements(elements.([]interface{})) + +} + +func (p *parser) callonInlineImage20() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage20(stack["elements"]) +} + +func (c *current) onInlineImage190() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonInlineImage190() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage190() +} + +func (c *current) onInlineImage186(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonInlineImage186() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage186(stack["ref"]) +} + +func (c *current) onInlineImage7(scheme, path interface{}) (interface{}, error) { + return types.NewLocation(scheme, path.([]interface{})) + +} + +func (p *parser) callonInlineImage7() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage7(stack["scheme"], stack["path"]) +} + +func (c *current) onInlineImage1(path, inlineAttributes interface{}) (interface{}, error) { + return types.NewInlineImage(path.(*types.Location), inlineAttributes.(types.Attributes), c.globalStore["imagesdir"]) + +} + +func (p *parser) callonInlineImage1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage1(stack["path"], stack["inlineAttributes"]) +} + +func (c *current) onInlineIcon5() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonInlineIcon5() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineIcon5() +} + +func (c *current) onInlineIcon1(icon, attributes interface{}) (interface{}, error) { + return types.NewIcon(icon.(string), attributes) + +} + +func (p *parser) callonInlineIcon1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineIcon1(stack["icon"], stack["attributes"]) +} + +func (c *current) onInlineFootnote2(content interface{}) (interface{}, error) { + return types.NewFootnote("", content) + +} + +func (p *parser) callonInlineFootnote2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineFootnote2(stack["content"]) +} + +func (c *current) onInlineFootnote12() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineFootnote12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineFootnote12() +} + +func (c *current) onInlineFootnote8(ref, content interface{}) (interface{}, error) { + // TODO: use only this rule with `ref:(FootnoteRef)?` + return types.NewFootnote(ref.(string), content) + +} + +func (p *parser) callonInlineFootnote8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineFootnote8(stack["ref"], stack["content"]) +} + +func (c *current) onFootnoteContent1(elements interface{}) (interface{}, error) { + // footnote content may span multiple lines + return types.NewInlineElements(elements.([]interface{})) + +} + +func (p *parser) callonFootnoteContent1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFootnoteContent1(stack["elements"]) +} + +func (c *current) onPassthroughMacro7() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonPassthroughMacro7() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughMacro7() +} + +func (c *current) onPassthroughMacro2(content interface{}) (interface{}, error) { + return types.NewInlinePassthrough(types.PassthroughMacro, []interface{}{content}) + +} + +func (p *parser) callonPassthroughMacro2() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughMacro2(stack["content"]) +} + +func (c *current) onPassthroughMacro17() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonPassthroughMacro17() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughMacro17() +} + +func (c *current) onPassthroughMacro10(content interface{}) (interface{}, error) { + return types.NewInlinePassthrough(types.PassthroughMacro, content.([]interface{})) + +} + +func (p *parser) callonPassthroughMacro10() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughMacro10(stack["content"]) +} + +func (c *current) onRelativeLink22() (interface{}, error) { + // not supported for now: EOL, space, "{", "[", "]" + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonRelativeLink22() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink22() +} + +func (c *current) onRelativeLink27() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonRelativeLink27() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink27() +} + +func (c *current) onRelativeLink34() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink34() +} + +func (c *current) onRelativeLink46() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink46() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink46() +} + +func (c *current) onRelativeLink48() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonRelativeLink48() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink48() +} + +func (c *current) onRelativeLink41(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonRelativeLink41() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink41(stack["start"]) +} + +func (c *current) onRelativeLink30(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonRelativeLink30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink30(stack["name"], stack["start"]) +} + +func (c *current) onRelativeLink56() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink56() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink56() +} + +func (c *current) onRelativeLink68() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink68() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink68() +} + +func (c *current) onRelativeLink70() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonRelativeLink70() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink70() +} + +func (c *current) onRelativeLink63(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonRelativeLink63() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink63(stack["start"]) +} + +func (c *current) onRelativeLink52(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonRelativeLink52() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink52(stack["name"], stack["start"]) +} + +func (c *current) onRelativeLink78() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink78() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink78() +} + +func (c *current) onRelativeLink74(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonRelativeLink74() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink74(stack["name"]) +} + +func (c *current) onRelativeLink25(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonRelativeLink25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink25(stack["element"]) +} + +func (c *current) onRelativeLink86() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + +} + +func (p *parser) callonRelativeLink86() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink86() +} + +func (c *current) onRelativeLink95() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink95() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink95() +} + +func (c *current) onRelativeLink99() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink99() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink99() +} + +func (c *current) onRelativeLink105() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonRelativeLink105() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink105() +} + +func (c *current) onRelativeLink112() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonRelativeLink112() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink112() +} + +func (c *current) onRelativeLink119() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink119() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink119() +} + +func (c *current) onRelativeLink131() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink131() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink131() +} + +func (c *current) onRelativeLink133() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonRelativeLink133() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink133() +} + +func (c *current) onRelativeLink126(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonRelativeLink126() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink126(stack["start"]) +} + +func (c *current) onRelativeLink115(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonRelativeLink115() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink115(stack["name"], stack["start"]) +} + +func (c *current) onRelativeLink141() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink141() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink141() +} + +func (c *current) onRelativeLink153() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink153() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink153() +} + +func (c *current) onRelativeLink155() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonRelativeLink155() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink155() +} + +func (c *current) onRelativeLink148(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonRelativeLink148() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink148(stack["start"]) +} + +func (c *current) onRelativeLink137(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonRelativeLink137() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink137(stack["name"], stack["start"]) +} + +func (c *current) onRelativeLink163() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink163() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink163() +} + +func (c *current) onRelativeLink159(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonRelativeLink159() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink159(stack["name"]) +} + +func (c *current) onRelativeLink110(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonRelativeLink110() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink110(stack["element"]) +} + +func (c *current) onRelativeLink169() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonRelativeLink169() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink169() +} + +func (c *current) onRelativeLink91(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + +} + +func (p *parser) callonRelativeLink91() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink91(stack["id"], stack["label"]) +} + +func (c *current) onRelativeLink176() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink176() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink176() +} + +func (c *current) onRelativeLink172(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonRelativeLink172() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink172(stack["id"]) +} + +func (c *current) onRelativeLink89() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonRelativeLink89() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink89() +} + +func (c *current) onRelativeLink180() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonRelativeLink180() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink180() +} + +func (c *current) onRelativeLink84(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonRelativeLink84() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink84(stack["element"]) +} + +func (c *current) onRelativeLink182() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonRelativeLink182() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink182() +} + +func (c *current) onRelativeLink18(elements interface{}) (interface{}, error) { + return types.NewInlineElements(elements.([]interface{})) + +} + +func (p *parser) callonRelativeLink18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink18(stack["elements"]) +} + +func (c *current) onRelativeLink188() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonRelativeLink188() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink188() +} + +func (c *current) onRelativeLink184(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonRelativeLink184() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink184(stack["ref"]) +} + +func (c *current) onRelativeLink5(scheme, path interface{}) (interface{}, error) { + return types.NewLocation(scheme, path.([]interface{})) + +} + +func (p *parser) callonRelativeLink5() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink5(stack["scheme"], stack["path"]) +} + +func (c *current) onRelativeLink1(url, inlineAttributes interface{}) (interface{}, error) { + return types.NewInlineLink(url.(*types.Location), inlineAttributes.(types.Attributes)) + +} + +func (p *parser) callonRelativeLink1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink1(stack["url"], stack["inlineAttributes"]) +} + +func (c *current) onExternalLink22() (interface{}, error) { + // not supported for now: EOL, space, "{", "[", "]" + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalLink22() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink22() +} + +func (c *current) onExternalLink27() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonExternalLink27() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink27() +} + +func (c *current) onExternalLink34() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink34() +} + +func (c *current) onExternalLink46() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink46() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink46() +} + +func (c *current) onExternalLink48() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonExternalLink48() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink48() +} + +func (c *current) onExternalLink41(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonExternalLink41() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink41(stack["start"]) +} + +func (c *current) onExternalLink30(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonExternalLink30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink30(stack["name"], stack["start"]) +} + +func (c *current) onExternalLink56() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink56() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink56() +} + +func (c *current) onExternalLink68() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink68() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink68() +} + +func (c *current) onExternalLink70() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonExternalLink70() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink70() +} + +func (c *current) onExternalLink63(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonExternalLink63() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink63(stack["start"]) +} + +func (c *current) onExternalLink52(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonExternalLink52() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink52(stack["name"], stack["start"]) +} + +func (c *current) onExternalLink78() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink78() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink78() +} + +func (c *current) onExternalLink74(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonExternalLink74() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink74(stack["name"]) +} + +func (c *current) onExternalLink25(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonExternalLink25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink25(stack["element"]) +} + +func (c *current) onExternalLink86() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + +} + +func (p *parser) callonExternalLink86() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink86() +} + +func (c *current) onExternalLink95() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonExternalLink95() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink95() +} + +func (c *current) onExternalLink99() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExternalLink99() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink99() +} + +func (c *current) onExternalLink105() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalLink105() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink105() +} + +func (c *current) onExternalLink112() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonExternalLink112() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink112() +} + +func (c *current) onExternalLink119() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink119() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink119() +} + +func (c *current) onExternalLink131() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink131() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink131() +} + +func (c *current) onExternalLink133() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonExternalLink133() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink133() +} + +func (c *current) onExternalLink126(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonExternalLink126() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink126(stack["start"]) +} + +func (c *current) onExternalLink115(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonExternalLink115() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink115(stack["name"], stack["start"]) +} + +func (c *current) onExternalLink141() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink141() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink141() +} + +func (c *current) onExternalLink153() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink153() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink153() +} + +func (c *current) onExternalLink155() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonExternalLink155() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink155() +} + +func (c *current) onExternalLink148(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonExternalLink148() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink148(stack["start"]) +} + +func (c *current) onExternalLink137(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonExternalLink137() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink137(stack["name"], stack["start"]) +} + +func (c *current) onExternalLink163() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink163() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink163() +} + +func (c *current) onExternalLink159(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonExternalLink159() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink159(stack["name"]) +} + +func (c *current) onExternalLink110(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonExternalLink110() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink110(stack["element"]) +} + +func (c *current) onExternalLink169() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalLink169() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink169() +} + +func (c *current) onExternalLink91(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + +} + +func (p *parser) callonExternalLink91() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink91(stack["id"], stack["label"]) +} + +func (c *current) onExternalLink176() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonExternalLink176() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink176() +} + +func (c *current) onExternalLink172(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonExternalLink172() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink172(stack["id"]) +} + +func (c *current) onExternalLink89() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalLink89() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink89() +} + +func (c *current) onExternalLink180() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonExternalLink180() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink180() +} + +func (c *current) onExternalLink84(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonExternalLink84() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink84(stack["element"]) +} + +func (c *current) onExternalLink182() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalLink182() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink182() +} + +func (c *current) onExternalLink18(elements interface{}) (interface{}, error) { + return types.NewInlineElements(elements.([]interface{})) + +} + +func (p *parser) callonExternalLink18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink18(stack["elements"]) +} + +func (c *current) onExternalLink188() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonExternalLink188() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink188() +} + +func (c *current) onExternalLink184(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonExternalLink184() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink184(stack["ref"]) +} + +func (c *current) onExternalLink4(scheme, path interface{}) (interface{}, error) { + return types.NewLocation(scheme, path.([]interface{})) + +} + +func (p *parser) callonExternalLink4() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink4(stack["scheme"], stack["path"]) +} + +func (c *current) onExternalLink1(url, inlineAttributes interface{}) (interface{}, error) { + return types.NewInlineLink(url.(*types.Location), inlineAttributes) + +} + +func (p *parser) callonExternalLink1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink1(stack["url"], stack["inlineAttributes"]) +} + +func (c *current) onListElements11() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements11() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements11() +} + +func (c *current) onListElements18() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonListElements18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements18() +} + +func (c *current) onListElements21(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonListElements21() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements21(stack["depth"]) +} + +func (c *current) onListElements15(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewOrderedListElementPrefix(types.Arabic) + case 2: + return types.NewOrderedListElementPrefix(types.LowerAlpha) + case 3: + return types.NewOrderedListElementPrefix(types.LowerRoman) + case 4: + return types.NewOrderedListElementPrefix(types.UpperAlpha) + default: + return types.NewOrderedListElementPrefix(types.UpperRoman) + } + +} + +func (p *parser) callonListElements15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements15(stack["depth"]) +} + +func (c *current) onListElements22() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + +} + +func (p *parser) callonListElements22() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements22() +} + +func (c *current) onListElements27() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + +} + +func (p *parser) callonListElements27() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements27() +} + +func (c *current) onListElements31() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + +} + +func (p *parser) callonListElements31() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements31() +} + +func (c *current) onListElements35() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + +} + +func (p *parser) callonListElements35() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements35() +} + +func (c *current) onListElements40() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + +} + +func (p *parser) callonListElements40() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements40() +} + +func (c *current) onListElements45(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonListElements45() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements45(stack["prefix"]) +} + +func (c *current) onListElements8(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonListElements8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements8(stack["prefix"]) +} + +func (c *current) onListElements52() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonListElements52() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements52() +} + +func (c *current) onListElements56() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements56() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements56() +} + +func (c *current) onListElements49(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) + +} + +func (p *parser) callonListElements49() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements49(stack["rawline"]) +} + +func (c *current) onListElements5(prefix, content interface{}) (interface{}, error) { + return types.NewOrderedListElement(prefix.(types.OrderedListElementPrefix), content) + +} + +func (p *parser) callonListElements5() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements5(stack["prefix"], stack["content"]) +} + +func (c *current) onListElements69() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements69() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements69() +} + +func (c *current) onListElements76() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonListElements76() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements76() +} + +func (c *current) onListElements79(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonListElements79() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements79(stack["depth"]) +} + +func (c *current) onListElements73(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewUnorderedListElementPrefix(types.OneAsterisk) + case 2: + return types.NewUnorderedListElementPrefix(types.TwoAsterisks) + case 3: + return types.NewUnorderedListElementPrefix(types.ThreeAsterisks) + case 4: + return types.NewUnorderedListElementPrefix(types.FourAsterisks) + default: + return types.NewUnorderedListElementPrefix(types.FiveAsterisks) + } + +} + +func (p *parser) callonListElements73() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements73(stack["depth"]) +} + +func (c *current) onListElements81() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + +} + +func (p *parser) callonListElements81() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements81() +} + +func (c *current) onListElements83(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonListElements83() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements83(stack["prefix"]) +} + +func (c *current) onListElements66(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonListElements66() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements66(stack["prefix"]) +} + +func (c *current) onListElements94() (interface{}, error) { + return types.Unchecked, nil +} + +func (p *parser) callonListElements94() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements94() +} + +func (c *current) onListElements96() (interface{}, error) { + return types.Checked, nil +} + +func (p *parser) callonListElements96() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements96() +} + +func (c *current) onListElements98() (interface{}, error) { + return types.Checked, nil +} + +func (p *parser) callonListElements98() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements98() +} + +func (c *current) onListElements100(style interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonListElements100() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements100(stack["style"]) +} + +func (c *current) onListElements88(style interface{}) (interface{}, error) { + return style, nil + +} + +func (p *parser) callonListElements88() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements88(stack["style"]) +} + +func (c *current) onListElements107() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonListElements107() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements107() +} + +func (c *current) onListElements111() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements111() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements111() +} + +func (c *current) onListElements104(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) + +} + +func (p *parser) callonListElements104() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements104(stack["rawline"]) +} + +func (c *current) onListElements63(prefix, checkstyle, content interface{}) (interface{}, error) { + return types.NewUnorderedListElement(prefix.(types.UnorderedListElementPrefix), checkstyle, content) + +} + +func (p *parser) callonListElements63() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements63(stack["prefix"], stack["checkstyle"], stack["content"]) +} + +func (c *current) onListElements125() (interface{}, error) { + return strconv.Atoi(string(c.text)) +} + +func (p *parser) callonListElements125() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements125() +} + +func (c *current) onListElements129(ref interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonListElements129() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements129(stack["ref"]) +} + +func (c *current) onListElements121(ref interface{}) (interface{}, error) { + return ref, nil + +} + +func (p *parser) callonListElements121() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements121(stack["ref"]) +} + +func (c *current) onListElements136() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements136() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements136() +} + +func (c *current) onListElements140() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements140() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements140() +} + +func (c *current) onListElements133(rawline interface{}) (interface{}, error) { + return types.NewRawLine(rawline.(string)) + +} + +func (p *parser) callonListElements133() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements133(stack["rawline"]) +} + +func (c *current) onListElements118(ref, description interface{}) (interface{}, error) { + return types.NewCalloutListElement(ref.(int), description.(types.RawLine)) + +} + +func (p *parser) callonListElements118() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements118(stack["ref"], stack["description"]) +} + +func (c *current) onListElements157() (interface{}, error) { + + return string(c.text), nil + +} + +func (p *parser) callonListElements157() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements157() +} + +func (c *current) onListElements160(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil + +} + +func (p *parser) callonListElements160() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements160(stack["separator"]) +} + +func (c *current) onListElements154(separator interface{}) (interface{}, error) { + return separator, nil + +} + +func (p *parser) callonListElements154() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements154(stack["separator"]) +} + +func (c *current) onListElements163() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements163() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements163() +} + +func (c *current) onListElements150() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonListElements150() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements150() +} + +func (c *current) onListElements175() (interface{}, error) { + + return string(c.text), nil + +} + +func (p *parser) callonListElements175() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements175() +} + +func (c *current) onListElements178(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil + +} + +func (p *parser) callonListElements178() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements178(stack["separator"]) +} + +func (c *current) onListElements172(separator interface{}) (interface{}, error) { + return separator, nil + +} + +func (p *parser) callonListElements172() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements172(stack["separator"]) +} + +func (c *current) onListElements184() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements184() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements184() +} + +func (c *current) onListElements187() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements187() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements187() +} + +func (c *current) onListElements201() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements201() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements201() +} + +func (c *current) onListElements204() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements204() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements204() +} + +func (c *current) onListElements195() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonListElements195() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements195() +} + +func (c *current) onListElements222() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements222() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements222() +} + +func (c *current) onListElements225() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements225() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements225() +} + +func (c *current) onListElements216() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonListElements216() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements216() +} + +func (c *current) onListElements236() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements236() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements236() +} + +func (c *current) onListElements238() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements238() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements238() +} + +func (c *current) onListElements247() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements247() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements247() +} + +func (c *current) onListElements254() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonListElements254() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements254() +} + +func (c *current) onListElements257(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonListElements257() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements257(stack["depth"]) +} + +func (c *current) onListElements251(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewOrderedListElementPrefix(types.Arabic) + case 2: + return types.NewOrderedListElementPrefix(types.LowerAlpha) + case 3: + return types.NewOrderedListElementPrefix(types.LowerRoman) + case 4: + return types.NewOrderedListElementPrefix(types.UpperAlpha) + default: + return types.NewOrderedListElementPrefix(types.UpperRoman) + } + +} + +func (p *parser) callonListElements251() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements251(stack["depth"]) +} + +func (c *current) onListElements258() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + +} + +func (p *parser) callonListElements258() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements258() +} + +func (c *current) onListElements263() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + +} + +func (p *parser) callonListElements263() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements263() +} + +func (c *current) onListElements267() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + +} + +func (p *parser) callonListElements267() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements267() +} + +func (c *current) onListElements271() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + +} + +func (p *parser) callonListElements271() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements271() +} + +func (c *current) onListElements276() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + +} + +func (p *parser) callonListElements276() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements276() +} + +func (c *current) onListElements281(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonListElements281() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements281(stack["prefix"]) +} + +func (c *current) onListElements244(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonListElements244() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements244(stack["prefix"]) +} + +func (c *current) onListElements288() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements288() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements288() +} + +func (c *current) onListElements295() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonListElements295() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements295() +} + +func (c *current) onListElements298(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonListElements298() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements298(stack["depth"]) +} + +func (c *current) onListElements292(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewUnorderedListElementPrefix(types.OneAsterisk) + case 2: + return types.NewUnorderedListElementPrefix(types.TwoAsterisks) + case 3: + return types.NewUnorderedListElementPrefix(types.ThreeAsterisks) + case 4: + return types.NewUnorderedListElementPrefix(types.FourAsterisks) + default: + return types.NewUnorderedListElementPrefix(types.FiveAsterisks) + } + +} + +func (p *parser) callonListElements292() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements292(stack["depth"]) +} + +func (c *current) onListElements300() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + +} + +func (p *parser) callonListElements300() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements300() +} + +func (c *current) onListElements302(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonListElements302() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements302(stack["prefix"]) +} + +func (c *current) onListElements285(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonListElements285() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements285(stack["prefix"]) +} + +func (c *current) onListElements310() (interface{}, error) { + return strconv.Atoi(string(c.text)) +} + +func (p *parser) callonListElements310() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements310() +} + +func (c *current) onListElements314(ref interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonListElements314() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements314(stack["ref"]) +} + +func (c *current) onListElements306(ref interface{}) (interface{}, error) { + return ref, nil + +} + +func (p *parser) callonListElements306() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements306(stack["ref"]) +} + +func (c *current) onListElements326() (interface{}, error) { + + return string(c.text), nil + +} + +func (p *parser) callonListElements326() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements326() +} + +func (c *current) onListElements329(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil + +} + +func (p *parser) callonListElements329() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements329(stack["separator"]) +} + +func (c *current) onListElements323(separator interface{}) (interface{}, error) { + return separator, nil + +} + +func (p *parser) callonListElements323() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements323(stack["separator"]) +} + +func (c *current) onListElements332() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements332() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements332() +} + +func (c *current) onListElements319() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonListElements319() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements319() +} + +func (c *current) onListElements343() (interface{}, error) { + + return string(c.text), nil + +} + +func (p *parser) callonListElements343() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements343() +} + +func (c *current) onListElements346(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil + +} + +func (p *parser) callonListElements346() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements346(stack["separator"]) +} + +func (c *current) onListElements340(separator interface{}) (interface{}, error) { + return separator, nil + +} + +func (p *parser) callonListElements340() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements340(stack["separator"]) +} + +func (c *current) onListElements357() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements357() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements357() +} + +func (c *current) onListElements360() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements360() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements360() +} + +func (c *current) onListElements370() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements370() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements370() +} + +func (c *current) onListElements373() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements373() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements373() +} + +func (c *current) onListElements383() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements383() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements383() +} + +func (c *current) onListElements386() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements386() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements386() +} + +func (c *current) onListElements396() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements396() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements396() +} + +func (c *current) onListElements399() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements399() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements399() +} + +func (c *current) onListElements409() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements409() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements409() +} + +func (c *current) onListElements412() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements412() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements412() +} + +func (c *current) onListElements422() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements422() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements422() +} + +func (c *current) onListElements425() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements425() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements425() +} + +func (c *current) onListElements435() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements435() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements435() +} + +func (c *current) onListElements438() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements438() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements438() +} + +func (c *current) onListElements448() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonListElements448() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements448() +} + +func (c *current) onListElements451() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements451() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements451() +} + +func (c *current) onListElements348(delimiter interface{}) (interface{}, error) { + return delimiter, nil + +} + +func (p *parser) callonListElements348() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements348(stack["delimiter"]) +} + +func (c *current) onListElements459() (interface{}, error) { + return strings.TrimSpace(string(c.text)), nil + +} + +func (p *parser) callonListElements459() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements459() +} + +func (c *current) onListElements463() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements463() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements463() +} + +func (c *current) onListElements213(content interface{}) (interface{}, error) { + // do not retain the EOL chars + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonListElements213() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements213(stack["content"]) +} + +func (c *current) onListElements181(content interface{}) (interface{}, error) { + if content == nil { + return nil, nil + } + return types.NewParagraph(content) + +} + +func (p *parser) callonListElements181() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements181(stack["content"]) +} + +func (c *current) onListElements472() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonListElements472() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements472() +} + +func (c *current) onListElements476() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonListElements476() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements476() +} + +func (c *current) onListElements480() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElements480() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements480() +} + +func (c *current) onListElements470(content interface{}) (interface{}, error) { + return types.NewParagraph(content) + +} + +func (p *parser) callonListElements470() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements470(stack["content"]) +} + +func (c *current) onListElements147(term, separator, description interface{}) (interface{}, error) { + return types.NewLabeledListElement(len(separator.(string))-1, term, description) + +} + +func (p *parser) callonListElements147() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements147(stack["term"], stack["separator"], stack["description"]) +} + +func (c *current) onListElements1(firstElement, extraElements interface{}) (interface{}, error) { + return types.NewListElements(append([]interface{}{firstElement}, extraElements.([]interface{})...)) + +} + +func (p *parser) callonListElements1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements1(stack["firstElement"], stack["extraElements"]) +} + +func (c *current) onExtraListElements1(elements interface{}) (interface{}, error) { + return types.Flatten(elements.([]interface{})), nil +} + +func (p *parser) callonExtraListElements1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElements1(stack["elements"]) +} + +func (c *current) onExtraListElement17() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement17() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement17() +} + +func (c *current) onExtraListElement20() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExtraListElement20() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement20() +} + +func (c *current) onExtraListElement11() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonExtraListElement11() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement11() +} + +func (c *current) onExtraListElement34() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement34() +} + +func (c *current) onExtraListElement41() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonExtraListElement41() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement41() +} + +func (c *current) onExtraListElement44(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonExtraListElement44() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement44(stack["depth"]) +} + +func (c *current) onExtraListElement38(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewOrderedListElementPrefix(types.Arabic) + case 2: + return types.NewOrderedListElementPrefix(types.LowerAlpha) + case 3: + return types.NewOrderedListElementPrefix(types.LowerRoman) + case 4: + return types.NewOrderedListElementPrefix(types.UpperAlpha) + default: + return types.NewOrderedListElementPrefix(types.UpperRoman) + } + +} + +func (p *parser) callonExtraListElement38() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement38(stack["depth"]) +} + +func (c *current) onExtraListElement45() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + +} + +func (p *parser) callonExtraListElement45() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement45() +} + +func (c *current) onExtraListElement50() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + +} + +func (p *parser) callonExtraListElement50() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement50() +} + +func (c *current) onExtraListElement54() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + +} + +func (p *parser) callonExtraListElement54() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement54() +} + +func (c *current) onExtraListElement58() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + +} + +func (p *parser) callonExtraListElement58() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement58() +} + +func (c *current) onExtraListElement63() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + +} + +func (p *parser) callonExtraListElement63() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement63() +} + +func (c *current) onExtraListElement68(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement68() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement68(stack["prefix"]) +} + +func (c *current) onExtraListElement31(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonExtraListElement31() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement31(stack["prefix"]) +} + +func (c *current) onExtraListElement75() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonExtraListElement75() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement75() +} + +func (c *current) onExtraListElement79() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExtraListElement79() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement79() +} + +func (c *current) onExtraListElement72(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) + +} + +func (p *parser) callonExtraListElement72() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement72(stack["rawline"]) +} + +func (c *current) onExtraListElement28(prefix, content interface{}) (interface{}, error) { + return types.NewOrderedListElement(prefix.(types.OrderedListElementPrefix), content) + +} + +func (p *parser) callonExtraListElement28() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement28(stack["prefix"], stack["content"]) +} + +func (c *current) onExtraListElement8(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonExtraListElement8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement8(stack["element"]) +} + +func (c *current) onExtraListElement98() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement98() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement98() +} + +func (c *current) onExtraListElement105() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonExtraListElement105() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement105() +} + +func (c *current) onExtraListElement108(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonExtraListElement108() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement108(stack["depth"]) +} + +func (c *current) onExtraListElement102(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewOrderedListElementPrefix(types.Arabic) + case 2: + return types.NewOrderedListElementPrefix(types.LowerAlpha) + case 3: + return types.NewOrderedListElementPrefix(types.LowerRoman) + case 4: + return types.NewOrderedListElementPrefix(types.UpperAlpha) + default: + return types.NewOrderedListElementPrefix(types.UpperRoman) + } + +} + +func (p *parser) callonExtraListElement102() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement102(stack["depth"]) +} + +func (c *current) onExtraListElement109() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + +} + +func (p *parser) callonExtraListElement109() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement109() +} + +func (c *current) onExtraListElement114() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + +} + +func (p *parser) callonExtraListElement114() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement114() +} + +func (c *current) onExtraListElement118() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + +} + +func (p *parser) callonExtraListElement118() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement118() +} + +func (c *current) onExtraListElement122() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + +} + +func (p *parser) callonExtraListElement122() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement122() +} + +func (c *current) onExtraListElement127() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + +} + +func (p *parser) callonExtraListElement127() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement127() +} + +func (c *current) onExtraListElement132(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement132() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement132(stack["prefix"]) +} + +func (c *current) onExtraListElement95(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonExtraListElement95() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement95(stack["prefix"]) +} + +func (c *current) onExtraListElement139() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonExtraListElement139() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement139() +} + +func (c *current) onExtraListElement143() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExtraListElement143() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement143() +} + +func (c *current) onExtraListElement136(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) + +} + +func (p *parser) callonExtraListElement136() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement136(stack["rawline"]) +} + +func (c *current) onExtraListElement92(prefix, content interface{}) (interface{}, error) { + return types.NewOrderedListElement(prefix.(types.OrderedListElementPrefix), content) + +} + +func (p *parser) callonExtraListElement92() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement92(stack["prefix"], stack["content"]) +} + +func (c *current) onExtraListElement86(attributes, element interface{}) (interface{}, error) { + return append(attributes.([]interface{}), element), nil + +} + +func (p *parser) callonExtraListElement86() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement86(stack["attributes"], stack["element"]) +} + +func (c *current) onExtraListElement159() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement159() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement159() +} + +func (c *current) onExtraListElement162() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExtraListElement162() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement162() +} + +func (c *current) onExtraListElement153() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonExtraListElement153() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement153() +} + +func (c *current) onExtraListElement176() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement176() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement176() +} + +func (c *current) onExtraListElement183() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonExtraListElement183() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement183() +} + +func (c *current) onExtraListElement186(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonExtraListElement186() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement186(stack["depth"]) +} + +func (c *current) onExtraListElement180(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewUnorderedListElementPrefix(types.OneAsterisk) + case 2: + return types.NewUnorderedListElementPrefix(types.TwoAsterisks) + case 3: + return types.NewUnorderedListElementPrefix(types.ThreeAsterisks) + case 4: + return types.NewUnorderedListElementPrefix(types.FourAsterisks) + default: + return types.NewUnorderedListElementPrefix(types.FiveAsterisks) + } + +} + +func (p *parser) callonExtraListElement180() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement180(stack["depth"]) +} + +func (c *current) onExtraListElement188() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + +} + +func (p *parser) callonExtraListElement188() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement188() +} + +func (c *current) onExtraListElement190(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement190() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement190(stack["prefix"]) +} + +func (c *current) onExtraListElement173(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonExtraListElement173() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement173(stack["prefix"]) +} + +func (c *current) onExtraListElement201() (interface{}, error) { + return types.Unchecked, nil +} + +func (p *parser) callonExtraListElement201() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement201() +} + +func (c *current) onExtraListElement203() (interface{}, error) { + return types.Checked, nil +} + +func (p *parser) callonExtraListElement203() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement203() +} + +func (c *current) onExtraListElement205() (interface{}, error) { + return types.Checked, nil +} + +func (p *parser) callonExtraListElement205() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement205() +} + +func (c *current) onExtraListElement207(style interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement207() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement207(stack["style"]) +} + +func (c *current) onExtraListElement195(style interface{}) (interface{}, error) { + return style, nil + +} + +func (p *parser) callonExtraListElement195() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement195(stack["style"]) +} + +func (c *current) onExtraListElement214() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonExtraListElement214() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement214() +} + +func (c *current) onExtraListElement218() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExtraListElement218() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement218() +} + +func (c *current) onExtraListElement211(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) + +} + +func (p *parser) callonExtraListElement211() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement211(stack["rawline"]) +} + +func (c *current) onExtraListElement170(prefix, checkstyle, content interface{}) (interface{}, error) { + return types.NewUnorderedListElement(prefix.(types.UnorderedListElementPrefix), checkstyle, content) + +} + +func (p *parser) callonExtraListElement170() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement170(stack["prefix"], stack["checkstyle"], stack["content"]) +} + +func (c *current) onExtraListElement150(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonExtraListElement150() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement150(stack["element"]) +} + +func (c *current) onExtraListElement237() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement237() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement237() +} + +func (c *current) onExtraListElement244() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonExtraListElement244() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement244() +} + +func (c *current) onExtraListElement247(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonExtraListElement247() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement247(stack["depth"]) +} + +func (c *current) onExtraListElement241(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewUnorderedListElementPrefix(types.OneAsterisk) + case 2: + return types.NewUnorderedListElementPrefix(types.TwoAsterisks) + case 3: + return types.NewUnorderedListElementPrefix(types.ThreeAsterisks) + case 4: + return types.NewUnorderedListElementPrefix(types.FourAsterisks) + default: + return types.NewUnorderedListElementPrefix(types.FiveAsterisks) + } + +} + +func (p *parser) callonExtraListElement241() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement241(stack["depth"]) +} + +func (c *current) onExtraListElement249() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + +} + +func (p *parser) callonExtraListElement249() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement249() +} + +func (c *current) onExtraListElement251(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement251() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement251(stack["prefix"]) +} + +func (c *current) onExtraListElement234(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonExtraListElement234() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement234(stack["prefix"]) +} + +func (c *current) onExtraListElement262() (interface{}, error) { + return types.Unchecked, nil +} + +func (p *parser) callonExtraListElement262() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement262() +} + +func (c *current) onExtraListElement264() (interface{}, error) { + return types.Checked, nil +} + +func (p *parser) callonExtraListElement264() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement264() +} + +func (c *current) onExtraListElement266() (interface{}, error) { + return types.Checked, nil +} + +func (p *parser) callonExtraListElement266() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement266() +} + +func (c *current) onExtraListElement268(style interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + +} + +func (p *parser) callonExtraListElement268() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement268(stack["style"]) } -func (p *parser) callonRawSource9() (interface{}, error) { +func (c *current) onExtraListElement256(style interface{}) (interface{}, error) { + return style, nil + +} + +func (p *parser) callonExtraListElement256() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement256(stack["style"]) +} + +func (c *current) onExtraListElement275() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonExtraListElement275() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource9() + return p.cur.onExtraListElement275() } -func (c *current) onRawSource22() (interface{}, error) { +func (c *current) onExtraListElement279() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonRawSource22() (interface{}, error) { +func (p *parser) callonExtraListElement279() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource22() + return p.cur.onExtraListElement279() } -func (c *current) onRawSource27() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onExtraListElement272(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) + +} + +func (p *parser) callonExtraListElement272() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement272(stack["rawline"]) +} + +func (c *current) onExtraListElement231(prefix, checkstyle, content interface{}) (interface{}, error) { + return types.NewUnorderedListElement(prefix.(types.UnorderedListElementPrefix), checkstyle, content) + +} + +func (p *parser) callonExtraListElement231() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement231(stack["prefix"], stack["checkstyle"], stack["content"]) +} + +func (c *current) onExtraListElement225(attributes, element interface{}) (interface{}, error) { + return append(attributes.([]interface{}), element), nil + +} + +func (p *parser) callonExtraListElement225() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement225(stack["attributes"], stack["element"]) +} + +func (c *current) onExtraListElement295() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement295() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement295() +} + +func (c *current) onExtraListElement298() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExtraListElement298() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement298() +} + +func (c *current) onExtraListElement289() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonExtraListElement289() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement289() +} + +func (c *current) onExtraListElement313() (interface{}, error) { + return strconv.Atoi(string(c.text)) +} + +func (p *parser) callonExtraListElement313() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement313() +} + +func (c *current) onExtraListElement317(ref interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement317() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement317(stack["ref"]) +} + +func (c *current) onExtraListElement309(ref interface{}) (interface{}, error) { + return ref, nil } -func (p *parser) callonRawSource27() (interface{}, error) { +func (p *parser) callonExtraListElement309() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource27() + return p.cur.onExtraListElement309(stack["ref"]) } -func (c *current) onRawSource34() (interface{}, error) { +func (c *current) onExtraListElement324() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonRawSource34() (interface{}, error) { +func (p *parser) callonExtraListElement324() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource34() + return p.cur.onExtraListElement324() } -func (c *current) onRawSource46() (interface{}, error) { +func (c *current) onExtraListElement328() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil +} + +func (p *parser) callonExtraListElement328() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement328() +} + +func (c *current) onExtraListElement321(rawline interface{}) (interface{}, error) { + return types.NewRawLine(rawline.(string)) } -func (p *parser) callonRawSource46() (interface{}, error) { +func (p *parser) callonExtraListElement321() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource46() + return p.cur.onExtraListElement321(stack["rawline"]) } -func (c *current) onRawSource48() (interface{}, error) { +func (c *current) onExtraListElement306(ref, description interface{}) (interface{}, error) { + return types.NewCalloutListElement(ref.(int), description.(types.RawLine)) +} + +func (p *parser) callonExtraListElement306() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement306(stack["ref"], stack["description"]) +} + +func (c *current) onExtraListElement286(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonExtraListElement286() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement286(stack["element"]) +} + +func (c *current) onExtraListElement348() (interface{}, error) { return strconv.Atoi(string(c.text)) +} + +func (p *parser) callonExtraListElement348() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement348() +} + +func (c *current) onExtraListElement352(ref interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil } -func (p *parser) callonRawSource48() (interface{}, error) { +func (p *parser) callonExtraListElement352() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource48() + return p.cur.onExtraListElement352(stack["ref"]) } -func (c *current) onRawSource41(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onExtraListElement344(ref interface{}) (interface{}, error) { + return ref, nil } -func (p *parser) callonRawSource41() (interface{}, error) { +func (p *parser) callonExtraListElement344() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource41(stack["start"]) + return p.cur.onExtraListElement344(stack["ref"]) } -func (c *current) onRawSource30(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), false, start) +func (c *current) onExtraListElement359() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement359() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement359() +} + +func (c *current) onExtraListElement363() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExtraListElement363() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement363() +} + +func (c *current) onExtraListElement356(rawline interface{}) (interface{}, error) { + return types.NewRawLine(rawline.(string)) + +} + +func (p *parser) callonExtraListElement356() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement356(stack["rawline"]) +} + +func (c *current) onExtraListElement341(ref, description interface{}) (interface{}, error) { + return types.NewCalloutListElement(ref.(int), description.(types.RawLine)) + +} + +func (p *parser) callonExtraListElement341() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement341(stack["ref"], stack["description"]) +} + +func (c *current) onExtraListElement335(attributes, element interface{}) (interface{}, error) { + return append(attributes.([]interface{}), element), nil + } -func (p *parser) callonRawSource30() (interface{}, error) { +func (p *parser) callonExtraListElement335() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource30(stack["name"], stack["start"]) + return p.cur.onExtraListElement335(stack["attributes"], stack["element"]) } -func (c *current) onRawSource56() (interface{}, error) { +func (c *current) onExtraListElement380() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonRawSource56() (interface{}, error) { +func (p *parser) callonExtraListElement380() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource56() + return p.cur.onExtraListElement380() } -func (c *current) onRawSource68() (interface{}, error) { +func (c *current) onExtraListElement383() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil +} + +func (p *parser) callonExtraListElement383() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement383() +} + +func (c *current) onExtraListElement374() (interface{}, error) { + return types.NewBlankLine() } -func (p *parser) callonRawSource68() (interface{}, error) { +func (p *parser) callonExtraListElement374() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource68() + return p.cur.onExtraListElement374() } -func (c *current) onRawSource70() (interface{}, error) { +func (c *current) onExtraListElement401() (interface{}, error) { - return strconv.Atoi(string(c.text)) + return string(c.text), nil } -func (p *parser) callonRawSource70() (interface{}, error) { +func (p *parser) callonExtraListElement401() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource70() + return p.cur.onExtraListElement401() } -func (c *current) onRawSource63(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onExtraListElement404(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil } -func (p *parser) callonRawSource63() (interface{}, error) { +func (p *parser) callonExtraListElement404() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource63(stack["start"]) + return p.cur.onExtraListElement404(stack["separator"]) } -func (c *current) onRawSource52(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), true, nil) +func (c *current) onExtraListElement398(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonRawSource52() (interface{}, error) { +func (p *parser) callonExtraListElement398() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource52(stack["name"], stack["start"]) + return p.cur.onExtraListElement398(stack["separator"]) } -func (c *current) onRawSource78() (interface{}, error) { +func (c *current) onExtraListElement407() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonRawSource78() (interface{}, error) { +func (p *parser) callonExtraListElement407() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource78() + return p.cur.onExtraListElement407() } -func (c *current) onRawSource74(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onExtraListElement394() (interface{}, error) { + return types.NewRawLine(string(c.text)) + } -func (p *parser) callonRawSource74() (interface{}, error) { +func (p *parser) callonExtraListElement394() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource74(stack["name"]) + return p.cur.onExtraListElement394() } -func (c *current) onRawSource84() (interface{}, error) { - // standalone '{' - return types.NewStringElement(string(c.text)) +func (c *current) onExtraListElement419() (interface{}, error) { + + return string(c.text), nil } -func (p *parser) callonRawSource84() (interface{}, error) { +func (p *parser) callonExtraListElement419() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource84() + return p.cur.onExtraListElement419() } -func (c *current) onRawSource17(elements interface{}) (interface{}, error) { - return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil +func (c *current) onExtraListElement422(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil + } -func (p *parser) callonRawSource17() (interface{}, error) { +func (p *parser) callonExtraListElement422() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource17(stack["elements"]) + return p.cur.onExtraListElement422(stack["separator"]) } -func (c *current) onRawSource5(name, value interface{}) (interface{}, error) { - return types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) +func (c *current) onExtraListElement416(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonRawSource5() (interface{}, error) { +func (p *parser) callonExtraListElement416() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource5(stack["name"], stack["value"]) + return p.cur.onExtraListElement416(stack["separator"]) } -func (c *current) onRawSource94() (interface{}, error) { +func (c *current) onExtraListElement428() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} - // `=` is level 0, etc. - return (len(c.text) - 1), nil +func (p *parser) callonExtraListElement428() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement428() +} +func (c *current) onExtraListElement431() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonRawSource94() (interface{}, error) { +func (p *parser) callonExtraListElement431() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource94() + return p.cur.onExtraListElement431() } -func (c *current) onRawSource97(level interface{}) (bool, error) { +func (c *current) onExtraListElement445() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} - // use a predicate to make sure that only `=` (level 0) to `======` (level 5) are allowed - return level.(int) <= 5, nil +func (p *parser) callonExtraListElement445() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement445() +} + +func (c *current) onExtraListElement448() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExtraListElement448() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement448() +} + +func (c *current) onExtraListElement439() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonExtraListElement439() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement439() +} + +func (c *current) onExtraListElement466() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement466() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement466() +} + +func (c *current) onExtraListElement469() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExtraListElement469() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement469() +} + +func (c *current) onExtraListElement460() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonExtraListElement460() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement460() +} + +func (c *current) onExtraListElement480() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement480() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement480() +} + +func (c *current) onExtraListElement482() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExtraListElement482() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement482() +} + +func (c *current) onExtraListElement491() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement491() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement491() +} + +func (c *current) onExtraListElement498() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonExtraListElement498() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement498() +} + +func (c *current) onExtraListElement501(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonExtraListElement501() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement501(stack["depth"]) +} + +func (c *current) onExtraListElement495(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewOrderedListElementPrefix(types.Arabic) + case 2: + return types.NewOrderedListElementPrefix(types.LowerAlpha) + case 3: + return types.NewOrderedListElementPrefix(types.LowerRoman) + case 4: + return types.NewOrderedListElementPrefix(types.UpperAlpha) + default: + return types.NewOrderedListElementPrefix(types.UpperRoman) + } + +} + +func (p *parser) callonExtraListElement495() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement495(stack["depth"]) +} + +func (c *current) onExtraListElement502() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + +} + +func (p *parser) callonExtraListElement502() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement502() +} + +func (c *current) onExtraListElement507() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + +} + +func (p *parser) callonExtraListElement507() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement507() +} + +func (c *current) onExtraListElement511() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + +} + +func (p *parser) callonExtraListElement511() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement511() +} + +func (c *current) onExtraListElement515() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + +} + +func (p *parser) callonExtraListElement515() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement515() +} + +func (c *current) onExtraListElement520() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + +} + +func (p *parser) callonExtraListElement520() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement520() +} + +func (c *current) onExtraListElement525(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement525() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement525(stack["prefix"]) +} + +func (c *current) onExtraListElement488(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonExtraListElement488() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement488(stack["prefix"]) +} + +func (c *current) onExtraListElement532() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement532() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement532() +} + +func (c *current) onExtraListElement539() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonExtraListElement539() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement539() +} + +func (c *current) onExtraListElement542(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonExtraListElement542() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement542(stack["depth"]) +} + +func (c *current) onExtraListElement536(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewUnorderedListElementPrefix(types.OneAsterisk) + case 2: + return types.NewUnorderedListElementPrefix(types.TwoAsterisks) + case 3: + return types.NewUnorderedListElementPrefix(types.ThreeAsterisks) + case 4: + return types.NewUnorderedListElementPrefix(types.FourAsterisks) + default: + return types.NewUnorderedListElementPrefix(types.FiveAsterisks) + } + +} + +func (p *parser) callonExtraListElement536() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement536(stack["depth"]) +} + +func (c *current) onExtraListElement544() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + +} + +func (p *parser) callonExtraListElement544() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement544() +} + +func (c *current) onExtraListElement546(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement546() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement546(stack["prefix"]) +} + +func (c *current) onExtraListElement529(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonExtraListElement529() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement529(stack["prefix"]) +} + +func (c *current) onExtraListElement554() (interface{}, error) { + return strconv.Atoi(string(c.text)) +} + +func (p *parser) callonExtraListElement554() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement554() +} + +func (c *current) onExtraListElement558(ref interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement558() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement558(stack["ref"]) +} + +func (c *current) onExtraListElement550(ref interface{}) (interface{}, error) { + return ref, nil + +} + +func (p *parser) callonExtraListElement550() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement550(stack["ref"]) +} + +func (c *current) onExtraListElement570() (interface{}, error) { + + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement570() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement570() +} + +func (c *current) onExtraListElement573(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil + +} + +func (p *parser) callonExtraListElement573() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement573(stack["separator"]) +} + +func (c *current) onExtraListElement567(separator interface{}) (interface{}, error) { + return separator, nil + +} + +func (p *parser) callonExtraListElement567() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement567(stack["separator"]) +} + +func (c *current) onExtraListElement576() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonExtraListElement576() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement576() +} + +func (c *current) onExtraListElement563() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonExtraListElement563() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement563() +} + +func (c *current) onExtraListElement587() (interface{}, error) { + + return string(c.text), nil + +} + +func (p *parser) callonExtraListElement587() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement587() +} + +func (c *current) onExtraListElement590(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil + +} + +func (p *parser) callonExtraListElement590() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement590(stack["separator"]) +} + +func (c *current) onExtraListElement584(separator interface{}) (interface{}, error) { + return separator, nil + +} + +func (p *parser) callonExtraListElement584() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExtraListElement584(stack["separator"]) +} + +func (c *current) onExtraListElement601() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonRawSource97() (bool, error) { +func (p *parser) callonExtraListElement601() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource97(stack["level"]) + return p.cur.onExtraListElement601() } -func (c *current) onRawSource101() (interface{}, error) { +func (c *current) onExtraListElement604() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonRawSource101() (interface{}, error) { +func (p *parser) callonExtraListElement604() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource101() + return p.cur.onExtraListElement604() } -func (c *current) onRawSource104() (interface{}, error) { - +func (c *current) onExtraListElement614() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonRawSource104() (interface{}, error) { +func (p *parser) callonExtraListElement614() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource104() + return p.cur.onExtraListElement614() } -func (c *current) onRawSource91(level, title interface{}) (interface{}, error) { - return types.NewRawSection(level.(int), title.(string)) +func (c *current) onExtraListElement617() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonRawSource91() (interface{}, error) { +func (p *parser) callonExtraListElement617() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource91(stack["level"], stack["title"]) + return p.cur.onExtraListElement617() } -func (c *current) onRawSource119() (interface{}, error) { - +func (c *current) onExtraListElement627() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil } -func (p *parser) callonRawSource119() (interface{}, error) { +func (p *parser) callonExtraListElement627() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource119() + return p.cur.onExtraListElement627() } -func (c *current) onRawSource113(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) - +func (c *current) onExtraListElement630() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonRawSource113() (interface{}, error) { +func (p *parser) callonExtraListElement630() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource113(stack["content"]) + return p.cur.onExtraListElement630() } -func (c *current) onRawSource1(lines interface{}) (interface{}, error) { - return lines.([]interface{}), nil +func (c *current) onExtraListElement640() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonRawSource1() (interface{}, error) { +func (p *parser) callonExtraListElement640() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource1(stack["lines"]) + return p.cur.onExtraListElement640() } -func (c *current) onRawDocument11() (interface{}, error) { +func (c *current) onExtraListElement643() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonRawDocument11() (interface{}, error) { +func (p *parser) callonExtraListElement643() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawDocument11() + return p.cur.onExtraListElement643() } -func (c *current) onRawDocument30() (interface{}, error) { +func (c *current) onExtraListElement653() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonRawDocument30() (interface{}, error) { +func (p *parser) callonExtraListElement653() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawDocument30() + return p.cur.onExtraListElement653() } -func (c *current) onRawDocument20() (interface{}, error) { +func (c *current) onExtraListElement656() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonRawDocument20() (interface{}, error) { +func (p *parser) callonExtraListElement656() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawDocument20() + return p.cur.onExtraListElement656() } -func (c *current) onRawDocument42() (interface{}, error) { +func (c *current) onExtraListElement666() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonRawDocument42() (interface{}, error) { +func (p *parser) callonExtraListElement666() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawDocument42() + return p.cur.onExtraListElement666() } -func (c *current) onRawDocument5(content interface{}) (interface{}, error) { - return types.NewYamlFrontMatter(content.(string)) +func (c *current) onExtraListElement669() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonRawDocument5() (interface{}, error) { +func (p *parser) callonExtraListElement669() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawDocument5(stack["content"]) + return p.cur.onExtraListElement669() } -func (c *current) onRawDocument1(frontmatter, blocks interface{}) (interface{}, error) { - return types.NewRawDocument(frontmatter, blocks.([]interface{})) +func (c *current) onExtraListElement679() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonRawDocument1() (interface{}, error) { +func (p *parser) callonExtraListElement679() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawDocument1(stack["frontmatter"], stack["blocks"]) + return p.cur.onExtraListElement679() } -func (c *current) onDocumentBlocks15() (interface{}, error) { +func (c *current) onExtraListElement682() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlocks15() (interface{}, error) { +func (p *parser) callonExtraListElement682() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks15() + return p.cur.onExtraListElement682() } -func (c *current) onDocumentBlocks31() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ +func (c *current) onExtraListElement692() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlocks31() (interface{}, error) { +func (p *parser) callonExtraListElement692() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks31() + return p.cur.onExtraListElement692() } -func (c *current) onDocumentBlocks38() (interface{}, error) { +func (c *current) onExtraListElement695() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlocks38() (interface{}, error) { +func (p *parser) callonExtraListElement695() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks38() + return p.cur.onExtraListElement695() } -func (c *current) onDocumentBlocks27(id interface{}) (interface{}, error) { - // no EOL here since there can be multiple InlineElementID on the same line - return types.NewInlineIDAttribute(id.(string)) +func (c *current) onExtraListElement592(delimiter interface{}) (interface{}, error) { + return delimiter, nil + } -func (p *parser) callonDocumentBlocks27() (interface{}, error) { +func (p *parser) callonExtraListElement592() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks27(stack["id"]) + return p.cur.onExtraListElement592(stack["delimiter"]) } -func (c *current) onDocumentBlocks43() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onExtraListElement703() (interface{}, error) { + return strings.TrimSpace(string(c.text)), nil } -func (p *parser) callonDocumentBlocks43() (interface{}, error) { +func (p *parser) callonExtraListElement703() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks43() + return p.cur.onExtraListElement703() } -func (c *current) onDocumentBlocks52() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) - +func (c *current) onExtraListElement707() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlocks52() (interface{}, error) { +func (p *parser) callonExtraListElement707() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks52() + return p.cur.onExtraListElement707() } -func (c *current) onDocumentBlocks65() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement457(content interface{}) (interface{}, error) { + // do not retain the EOL chars + return types.NewRawLine(content.(string)) + } -func (p *parser) callonDocumentBlocks65() (interface{}, error) { +func (p *parser) callonExtraListElement457() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks65() + return p.cur.onExtraListElement457(stack["content"]) } -func (c *current) onDocumentBlocks71() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement425(content interface{}) (interface{}, error) { + if content == nil { + return nil, nil + } + return types.NewParagraph(content) + } -func (p *parser) callonDocumentBlocks71() (interface{}, error) { +func (p *parser) callonExtraListElement425() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks71() + return p.cur.onExtraListElement425(stack["content"]) } -func (c *current) onDocumentBlocks61() (interface{}, error) { - return types.NewLineBreak() +func (c *current) onExtraListElement716() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + } -func (p *parser) callonDocumentBlocks61() (interface{}, error) { +func (p *parser) callonExtraListElement716() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks61() + return p.cur.onExtraListElement716() } -func (c *current) onDocumentBlocks82() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement720() (interface{}, error) { + return types.NewRawLine(string(c.text)) + } -func (p *parser) callonDocumentBlocks82() (interface{}, error) { +func (p *parser) callonExtraListElement720() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks82() + return p.cur.onExtraListElement720() } -func (c *current) onDocumentBlocks88() (interface{}, error) { +func (c *current) onExtraListElement724() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlocks88() (interface{}, error) { +func (p *parser) callonExtraListElement724() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks88() + return p.cur.onExtraListElement724() } -func (c *current) onDocumentBlocks84(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onExtraListElement714(content interface{}) (interface{}, error) { + return types.NewParagraph(content) + } -func (p *parser) callonDocumentBlocks84() (interface{}, error) { +func (p *parser) callonExtraListElement714() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks84(stack["ref"]) + return p.cur.onExtraListElement714(stack["content"]) } -func (c *current) onDocumentBlocks92() (interface{}, error) { +func (c *current) onExtraListElement391(term, separator, description interface{}) (interface{}, error) { + return types.NewLabeledListElement(len(separator.(string))-1, term, description) - return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks92() (interface{}, error) { +func (p *parser) callonExtraListElement391() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks92() + return p.cur.onExtraListElement391(stack["term"], stack["separator"], stack["description"]) } -func (c *current) onDocumentBlocks40(element interface{}) (interface{}, error) { +func (c *current) onExtraListElement371(element interface{}) (interface{}, error) { return element, nil + } -func (p *parser) callonDocumentBlocks40() (interface{}, error) { +func (p *parser) callonExtraListElement371() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks40(stack["element"]) + return p.cur.onExtraListElement371(stack["element"]) } -func (c *current) onDocumentBlocks18(elements interface{}) (interface{}, error) { - // absorbs heading and trailing spaces - return types.NewInlineElements(elements.([]interface{})) +func (c *current) onExtraListElement747() (interface{}, error) { + + return string(c.text), nil + } -func (p *parser) callonDocumentBlocks18() (interface{}, error) { +func (p *parser) callonExtraListElement747() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks18(stack["elements"]) + return p.cur.onExtraListElement747() } -func (c *current) onDocumentBlocks100() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onExtraListElement750(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil + } -func (p *parser) callonDocumentBlocks100() (interface{}, error) { +func (p *parser) callonExtraListElement750() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks100() + return p.cur.onExtraListElement750(stack["separator"]) } -func (c *current) onDocumentBlocks107() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement744(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlocks107() (interface{}, error) { +func (p *parser) callonExtraListElement744() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks107() + return p.cur.onExtraListElement744(stack["separator"]) } -func (c *current) onDocumentBlocks96(id interface{}) (interface{}, error) { - // no EOL here since there can be multiple InlineElementID on the same line - return types.NewInlineIDAttribute(id.(string)) +func (c *current) onExtraListElement753() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlocks96() (interface{}, error) { +func (p *parser) callonExtraListElement753() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks96(stack["id"]) + return p.cur.onExtraListElement753() } -func (c *current) onDocumentBlocks120() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement740() (interface{}, error) { + return types.NewRawLine(string(c.text)) + } -func (p *parser) callonDocumentBlocks120() (interface{}, error) { +func (p *parser) callonExtraListElement740() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks120() + return p.cur.onExtraListElement740() } -func (c *current) onDocumentBlocks130() (interface{}, error) { +func (c *current) onExtraListElement765() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlocks130() (interface{}, error) { +func (p *parser) callonExtraListElement765() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks130() + return p.cur.onExtraListElement765() } -func (c *current) onDocumentBlocks139() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement768(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil + } -func (p *parser) callonDocumentBlocks139() (interface{}, error) { +func (p *parser) callonExtraListElement768() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks139() + return p.cur.onExtraListElement768(stack["separator"]) } -func (c *current) onDocumentBlocks122(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onExtraListElement762(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlocks122() (interface{}, error) { +func (p *parser) callonExtraListElement762() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks122(stack["content"]) + return p.cur.onExtraListElement762(stack["separator"]) } -func (c *current) onDocumentBlocks153() (interface{}, error) { +func (c *current) onExtraListElement774() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlocks153() (interface{}, error) { +func (p *parser) callonExtraListElement774() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks153() + return p.cur.onExtraListElement774() } -func (c *current) onDocumentBlocks171() (interface{}, error) { +func (c *current) onExtraListElement777() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlocks171() (interface{}, error) { +func (p *parser) callonExtraListElement777() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks171() + return p.cur.onExtraListElement777() } -func (c *current) onDocumentBlocks187() (interface{}, error) { - +func (c *current) onExtraListElement791() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil } -func (p *parser) callonDocumentBlocks187() (interface{}, error) { +func (p *parser) callonExtraListElement791() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks187() + return p.cur.onExtraListElement791() } -func (c *current) onDocumentBlocks181(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) - +func (c *current) onExtraListElement794() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlocks181() (interface{}, error) { +func (p *parser) callonExtraListElement794() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks181(stack["content"]) + return p.cur.onExtraListElement794() } -func (c *current) onDocumentBlocks162(line interface{}) (interface{}, error) { +func (c *current) onExtraListElement785() (interface{}, error) { + return types.NewBlankLine() - return line, nil } -func (p *parser) callonDocumentBlocks162() (interface{}, error) { +func (p *parser) callonExtraListElement785() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks162(stack["line"]) + return p.cur.onExtraListElement785() } -func (c *current) onDocumentBlocks201() (interface{}, error) { +func (c *current) onExtraListElement812() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlocks201() (interface{}, error) { +func (p *parser) callonExtraListElement812() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks201() + return p.cur.onExtraListElement812() } -func (c *current) onDocumentBlocks147(content interface{}) (interface{}, error) { - return types.NewCommentBlock(content.([]interface{}), nil) +func (c *current) onExtraListElement815() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlocks147() (interface{}, error) { +func (p *parser) callonExtraListElement815() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks147(stack["content"]) + return p.cur.onExtraListElement815() } -func (c *current) onDocumentBlocks218() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement806() (interface{}, error) { + return types.NewBlankLine() + } -func (p *parser) callonDocumentBlocks218() (interface{}, error) { +func (p *parser) callonExtraListElement806() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks218() + return p.cur.onExtraListElement806() } -func (c *current) onDocumentBlocks229() (interface{}, error) { +func (c *current) onExtraListElement826() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlocks229() (interface{}, error) { +func (p *parser) callonExtraListElement826() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks229() + return p.cur.onExtraListElement826() } -func (c *current) onDocumentBlocks232() (interface{}, error) { +func (c *current) onExtraListElement828() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlocks232() (interface{}, error) { +func (p *parser) callonExtraListElement828() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks232() + return p.cur.onExtraListElement828() } -func (c *current) onDocumentBlocks241() (interface{}, error) { +func (c *current) onExtraListElement837() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlocks241() (interface{}, error) { +func (p *parser) callonExtraListElement837() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks241() + return p.cur.onExtraListElement837() } -func (c *current) onDocumentBlocks237(email interface{}) (interface{}, error) { - return email, nil +func (c *current) onExtraListElement844() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + } -func (p *parser) callonDocumentBlocks237() (interface{}, error) { +func (p *parser) callonExtraListElement844() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks237(stack["email"]) + return p.cur.onExtraListElement844() } -func (c *current) onDocumentBlocks248() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement847(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil + } -func (p *parser) callonDocumentBlocks248() (interface{}, error) { +func (p *parser) callonExtraListElement847() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks248() + return p.cur.onExtraListElement847(stack["depth"]) } -func (c *current) onDocumentBlocks255() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement841(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewOrderedListElementPrefix(types.Arabic) + case 2: + return types.NewOrderedListElementPrefix(types.LowerAlpha) + case 3: + return types.NewOrderedListElementPrefix(types.LowerRoman) + case 4: + return types.NewOrderedListElementPrefix(types.UpperAlpha) + default: + return types.NewOrderedListElementPrefix(types.UpperRoman) + } + } -func (p *parser) callonDocumentBlocks255() (interface{}, error) { +func (p *parser) callonExtraListElement841() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks255() + return p.cur.onExtraListElement841(stack["depth"]) } -func (c *current) onDocumentBlocks224(fullname, email interface{}) (interface{}, error) { - return types.NewDocumentAuthor(fullname, email) +func (c *current) onExtraListElement848() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + } -func (p *parser) callonDocumentBlocks224() (interface{}, error) { +func (p *parser) callonExtraListElement848() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks224(stack["fullname"], stack["email"]) + return p.cur.onExtraListElement848() } -func (c *current) onDocumentBlocks213(authors interface{}) (interface{}, error) { - return types.NewDocumentAuthors(authors.([]interface{})) +func (c *current) onExtraListElement853() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + } -func (p *parser) callonDocumentBlocks213() (interface{}, error) { +func (p *parser) callonExtraListElement853() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks213(stack["authors"]) + return p.cur.onExtraListElement853() } -func (c *current) onDocumentBlocks267() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement857() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + } -func (p *parser) callonDocumentBlocks267() (interface{}, error) { +func (p *parser) callonExtraListElement857() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks267() + return p.cur.onExtraListElement857() } -func (c *current) onDocumentBlocks276() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement861() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + } -func (p *parser) callonDocumentBlocks276() (interface{}, error) { +func (p *parser) callonExtraListElement861() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks276() + return p.cur.onExtraListElement861() } -func (c *current) onDocumentBlocks279() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement866() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + } -func (p *parser) callonDocumentBlocks279() (interface{}, error) { +func (p *parser) callonExtraListElement866() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks279() + return p.cur.onExtraListElement866() } -func (c *current) onDocumentBlocks288() (interface{}, error) { +func (c *current) onExtraListElement871(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonDocumentBlocks288() (interface{}, error) { +func (p *parser) callonExtraListElement871() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks288() + return p.cur.onExtraListElement871(stack["prefix"]) } -func (c *current) onDocumentBlocks284(email interface{}) (interface{}, error) { - return email, nil +func (c *current) onExtraListElement834(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonDocumentBlocks284() (interface{}, error) { +func (p *parser) callonExtraListElement834() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks284(stack["email"]) + return p.cur.onExtraListElement834(stack["prefix"]) } -func (c *current) onDocumentBlocks295() (interface{}, error) { +func (c *current) onExtraListElement878() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlocks295() (interface{}, error) { +func (p *parser) callonExtraListElement878() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks295() + return p.cur.onExtraListElement878() } -func (c *current) onDocumentBlocks302() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement885() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + } -func (p *parser) callonDocumentBlocks302() (interface{}, error) { +func (p *parser) callonExtraListElement885() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks302() + return p.cur.onExtraListElement885() } -func (c *current) onDocumentBlocks271(fullname, email interface{}) (interface{}, error) { - return types.NewDocumentAuthor(fullname, email) +func (c *current) onExtraListElement888(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + } -func (p *parser) callonDocumentBlocks271() (interface{}, error) { +func (p *parser) callonExtraListElement888() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks271(stack["fullname"], stack["email"]) + return p.cur.onExtraListElement888(stack["depth"]) } -func (c *current) onDocumentBlocks262(author interface{}) (interface{}, error) { - return []types.DocumentAuthor{author.(types.DocumentAuthor)}, nil +func (c *current) onExtraListElement882(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewUnorderedListElementPrefix(types.OneAsterisk) + case 2: + return types.NewUnorderedListElementPrefix(types.TwoAsterisks) + case 3: + return types.NewUnorderedListElementPrefix(types.ThreeAsterisks) + case 4: + return types.NewUnorderedListElementPrefix(types.FourAsterisks) + default: + return types.NewUnorderedListElementPrefix(types.FiveAsterisks) + } + } -func (p *parser) callonDocumentBlocks262() (interface{}, error) { +func (p *parser) callonExtraListElement882() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks262(stack["author"]) + return p.cur.onExtraListElement882(stack["depth"]) } -func (c *current) onDocumentBlocks315() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement890() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + } -func (p *parser) callonDocumentBlocks315() (interface{}, error) { +func (p *parser) callonExtraListElement890() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks315() + return p.cur.onExtraListElement890() } -func (c *current) onDocumentBlocks325() (interface{}, error) { +func (c *current) onExtraListElement892(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonDocumentBlocks325() (interface{}, error) { +func (p *parser) callonExtraListElement892() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks325() + return p.cur.onExtraListElement892(stack["prefix"]) } -func (c *current) onDocumentBlocks334() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement875(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonDocumentBlocks334() (interface{}, error) { +func (p *parser) callonExtraListElement875() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks334() + return p.cur.onExtraListElement875(stack["prefix"]) } -func (c *current) onDocumentBlocks317(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onExtraListElement900() (interface{}, error) { + return strconv.Atoi(string(c.text)) } -func (p *parser) callonDocumentBlocks317() (interface{}, error) { +func (p *parser) callonExtraListElement900() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks317(stack["content"]) + return p.cur.onExtraListElement900() } -func (c *current) onDocumentBlocks348() (interface{}, error) { +func (c *current) onExtraListElement904(ref interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonDocumentBlocks348() (interface{}, error) { +func (p *parser) callonExtraListElement904() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks348() + return p.cur.onExtraListElement904(stack["ref"]) } -func (c *current) onDocumentBlocks366() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement896(ref interface{}) (interface{}, error) { + return ref, nil + } -func (p *parser) callonDocumentBlocks366() (interface{}, error) { +func (p *parser) callonExtraListElement896() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks366() + return p.cur.onExtraListElement896(stack["ref"]) } -func (c *current) onDocumentBlocks382() (interface{}, error) { +func (c *current) onExtraListElement916() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonDocumentBlocks382() (interface{}, error) { +func (p *parser) callonExtraListElement916() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks382() + return p.cur.onExtraListElement916() } -func (c *current) onDocumentBlocks376(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onExtraListElement919(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil } -func (p *parser) callonDocumentBlocks376() (interface{}, error) { +func (p *parser) callonExtraListElement919() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks376(stack["content"]) + return p.cur.onExtraListElement919(stack["separator"]) } -func (c *current) onDocumentBlocks357(line interface{}) (interface{}, error) { +func (c *current) onExtraListElement913(separator interface{}) (interface{}, error) { + return separator, nil - return line, nil } -func (p *parser) callonDocumentBlocks357() (interface{}, error) { +func (p *parser) callonExtraListElement913() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks357(stack["line"]) + return p.cur.onExtraListElement913(stack["separator"]) } -func (c *current) onDocumentBlocks396() (interface{}, error) { +func (c *current) onExtraListElement922() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlocks396() (interface{}, error) { +func (p *parser) callonExtraListElement922() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks396() + return p.cur.onExtraListElement922() } -func (c *current) onDocumentBlocks342(content interface{}) (interface{}, error) { - return types.NewCommentBlock(content.([]interface{}), nil) +func (c *current) onExtraListElement909() (interface{}, error) { + return types.NewRawLine(string(c.text)) + } -func (p *parser) callonDocumentBlocks342() (interface{}, error) { +func (p *parser) callonExtraListElement909() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks342(stack["content"]) + return p.cur.onExtraListElement909() } -func (c *current) onDocumentBlocks412() (interface{}, error) { +func (c *current) onExtraListElement933() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlocks412() (interface{}, error) { +func (p *parser) callonExtraListElement933() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks412() + return p.cur.onExtraListElement933() } -func (c *current) onDocumentBlocks425() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onExtraListElement936(separator interface{}) (bool, error) { -func (p *parser) callonDocumentBlocks425() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onDocumentBlocks425() -} + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil -func (c *current) onDocumentBlocks422() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonDocumentBlocks422() (interface{}, error) { +func (p *parser) callonExtraListElement936() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks422() + return p.cur.onExtraListElement936(stack["separator"]) } -func (c *current) onDocumentBlocks433() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement930(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlocks433() (interface{}, error) { +func (p *parser) callonExtraListElement930() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks433() + return p.cur.onExtraListElement930(stack["separator"]) } -func (c *current) onDocumentBlocks440() (interface{}, error) { +func (c *current) onExtraListElement947() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlocks440() (interface{}, error) { +func (p *parser) callonExtraListElement947() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks440() + return p.cur.onExtraListElement947() } -func (c *current) onDocumentBlocks429() (interface{}, error) { +func (c *current) onExtraListElement950() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlocks429() (interface{}, error) { +func (p *parser) callonExtraListElement950() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks429() + return p.cur.onExtraListElement950() } -func (c *current) onDocumentBlocks448() (interface{}, error) { +func (c *current) onExtraListElement960() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlocks448() (interface{}, error) { +func (p *parser) callonExtraListElement960() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks448() + return p.cur.onExtraListElement960() } -func (c *current) onDocumentBlocks455() (interface{}, error) { +func (c *current) onExtraListElement963() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlocks455() (interface{}, error) { +func (p *parser) callonExtraListElement963() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks455() + return p.cur.onExtraListElement963() } -func (c *current) onDocumentBlocks418(revnumber, revdate, revremark interface{}) (interface{}, error) { - return types.NewDocumentRevision(revnumber, revdate, revremark) +func (c *current) onExtraListElement973() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonDocumentBlocks418() (interface{}, error) { +func (p *parser) callonExtraListElement973() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks418(stack["revnumber"], stack["revdate"], stack["revremark"]) + return p.cur.onExtraListElement973() } -func (c *current) onDocumentBlocks461() (interface{}, error) { +func (c *current) onExtraListElement976() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlocks461() (interface{}, error) { +func (p *parser) callonExtraListElement976() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks461() + return p.cur.onExtraListElement976() } -func (c *current) onDocumentBlocks468() (interface{}, error) { +func (c *current) onExtraListElement986() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlocks468() (interface{}, error) { +func (p *parser) callonExtraListElement986() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks468() + return p.cur.onExtraListElement986() } -func (c *current) onDocumentBlocks458(revdate, revremark interface{}) (interface{}, error) { - return types.NewDocumentRevision(nil, revdate, revremark) - +func (c *current) onExtraListElement989() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlocks458() (interface{}, error) { +func (p *parser) callonExtraListElement989() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks458(stack["revdate"], stack["revremark"]) + return p.cur.onExtraListElement989() } -func (c *current) onDocumentBlocks407(revision interface{}) (interface{}, error) { - return revision, nil +func (c *current) onExtraListElement999() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonDocumentBlocks407() (interface{}, error) { +func (p *parser) callonExtraListElement999() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks407(stack["revision"]) + return p.cur.onExtraListElement999() } -func (c *current) onDocumentBlocks9(title, id, authors, revision interface{}) (interface{}, error) { - return types.NewDocumentHeader(title.([]interface{}), authors, revision) +func (c *current) onExtraListElement1002() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlocks9() (interface{}, error) { +func (p *parser) callonExtraListElement1002() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks9(stack["title"], stack["id"], stack["authors"], stack["revision"]) + return p.cur.onExtraListElement1002() } -func (c *current) onDocumentBlocks1(header, blocks interface{}) (interface{}, error) { - if header != nil && blocks != nil { - return append([]interface{}{header}, blocks.([]interface{})...), nil - } else if blocks != nil { - return blocks.([]interface{}), nil - } - return []interface{}{}, nil +func (c *current) onExtraListElement1012() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonDocumentBlocks1() (interface{}, error) { +func (p *parser) callonExtraListElement1012() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks1(stack["header"], stack["blocks"]) + return p.cur.onExtraListElement1012() } -func (c *current) onDocumentBlock9(attributes interface{}) error { - c.globalStore.pushAttributes(attributes) - return nil - +func (c *current) onExtraListElement1015() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock9() error { +func (p *parser) callonExtraListElement1015() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock9(stack["attributes"]) + return p.cur.onExtraListElement1015() } -func (c *current) onDocumentBlock15() (bool, error) { - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Literal), nil +func (c *current) onExtraListElement1025() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonDocumentBlock15() (bool, error) { +func (p *parser) callonExtraListElement1025() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock15() + return p.cur.onExtraListElement1025() } -func (c *current) onDocumentBlock24() (interface{}, error) { - - return types.NewStringElement(string(c.text)) - +func (c *current) onExtraListElement1028() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock24() (interface{}, error) { +func (p *parser) callonExtraListElement1028() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock24() + return p.cur.onExtraListElement1028() } -func (c *current) onDocumentBlock33() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onExtraListElement1038() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonDocumentBlock33() (interface{}, error) { +func (p *parser) callonExtraListElement1038() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock33() + return p.cur.onExtraListElement1038() } -func (c *current) onDocumentBlock20(elements interface{}) (interface{}, error) { +func (c *current) onExtraListElement1041() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlock20() (interface{}, error) { +func (p *parser) callonExtraListElement1041() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock20(stack["elements"]) + return p.cur.onExtraListElement1041() } -func (c *current) onDocumentBlock17(content interface{}) (interface{}, error) { +func (c *current) onExtraListElement938(delimiter interface{}) (interface{}, error) { + return delimiter, nil - return types.NewRawLine(content.(string)) } -func (p *parser) callonDocumentBlock17() (interface{}, error) { +func (p *parser) callonExtraListElement938() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock17(stack["content"]) + return p.cur.onExtraListElement938(stack["delimiter"]) } -func (c *current) onDocumentBlock60() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement1049() (interface{}, error) { + return strings.TrimSpace(string(c.text)), nil + } -func (p *parser) callonDocumentBlock60() (interface{}, error) { +func (p *parser) callonExtraListElement1049() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock60() + return p.cur.onExtraListElement1049() } -func (c *current) onDocumentBlock69() (interface{}, error) { +func (c *current) onExtraListElement1053() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlock69() (interface{}, error) { +func (p *parser) callonExtraListElement1053() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock69() + return p.cur.onExtraListElement1053() } -func (c *current) onDocumentBlock52(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onExtraListElement803(content interface{}) (interface{}, error) { + // do not retain the EOL chars + return types.NewRawLine(content.(string)) + } -func (p *parser) callonDocumentBlock52() (interface{}, error) { +func (p *parser) callonExtraListElement803() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock52(stack["content"]) + return p.cur.onExtraListElement803(stack["content"]) } -func (c *current) onDocumentBlock90() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement771(content interface{}) (interface{}, error) { + if content == nil { + return nil, nil + } + return types.NewParagraph(content) + } -func (p *parser) callonDocumentBlock90() (interface{}, error) { +func (p *parser) callonExtraListElement771() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock90() + return p.cur.onExtraListElement771(stack["content"]) } -func (c *current) onDocumentBlock102() (interface{}, error) { +func (c *current) onExtraListElement1062() (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonDocumentBlock102() (interface{}, error) { +func (p *parser) callonExtraListElement1062() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock102() + return p.cur.onExtraListElement1062() } -func (c *current) onDocumentBlock114() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement1066() (interface{}, error) { + return types.NewRawLine(string(c.text)) + } -func (p *parser) callonDocumentBlock114() (interface{}, error) { +func (p *parser) callonExtraListElement1066() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock114() + return p.cur.onExtraListElement1066() } -func (c *current) onDocumentBlock126() (interface{}, error) { +func (c *current) onExtraListElement1070() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlock126() (interface{}, error) { +func (p *parser) callonExtraListElement1070() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock126() + return p.cur.onExtraListElement1070() } -func (c *current) onDocumentBlock138() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement1060(content interface{}) (interface{}, error) { + return types.NewParagraph(content) + } -func (p *parser) callonDocumentBlock138() (interface{}, error) { +func (p *parser) callonExtraListElement1060() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock138() + return p.cur.onExtraListElement1060(stack["content"]) } -func (c *current) onDocumentBlock150() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement737(term, separator, description interface{}) (interface{}, error) { + return types.NewLabeledListElement(len(separator.(string))-1, term, description) + } -func (p *parser) callonDocumentBlock150() (interface{}, error) { +func (p *parser) callonExtraListElement737() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock150() + return p.cur.onExtraListElement737(stack["term"], stack["separator"], stack["description"]) } -func (c *current) onDocumentBlock162() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement731(attributes, element interface{}) (interface{}, error) { + return append(attributes.([]interface{}), element), nil + } -func (p *parser) callonDocumentBlock162() (interface{}, error) { +func (p *parser) callonExtraListElement731() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock162() + return p.cur.onExtraListElement731(stack["attributes"], stack["element"]) } -func (c *current) onDocumentBlock170() (interface{}, error) { - +func (c *current) onExtraListElement1083() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock170() (interface{}, error) { +func (p *parser) callonExtraListElement1083() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock170() + return p.cur.onExtraListElement1083() } -func (c *current) onDocumentBlock178(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil - +func (c *current) onExtraListElement1087() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock178() (bool, error) { +func (p *parser) callonExtraListElement1087() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock178(stack["content"]) + return p.cur.onExtraListElement1087() } -func (c *current) onDocumentBlock77(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onExtraListElement1077(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) } -func (p *parser) callonDocumentBlock77() (interface{}, error) { +func (p *parser) callonExtraListElement1077() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock77(stack["content"]) + return p.cur.onExtraListElement1077(stack["content"]) } -func (c *current) onDocumentBlock13(firstLine, otherLines interface{}) (interface{}, error) { - - return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...), c.globalStore.getAttributes()) +func (c *current) onExtraListElement1105() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonDocumentBlock13() (interface{}, error) { +func (p *parser) callonExtraListElement1105() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock13(stack["firstLine"], stack["otherLines"]) + return p.cur.onExtraListElement1105() } -func (c *current) onDocumentBlock187() (interface{}, error) { +func (c *current) onExtraListElement1108() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlock187() (interface{}, error) { +func (p *parser) callonExtraListElement1108() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock187() + return p.cur.onExtraListElement1108() } -func (c *current) onDocumentBlock179() (interface{}, error) { +func (c *current) onExtraListElement1099() (interface{}, error) { return types.NewBlankLine() + } -func (p *parser) callonDocumentBlock179() (interface{}, error) { +func (p *parser) callonExtraListElement1099() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock179() + return p.cur.onExtraListElement1099() } -func (c *current) onDocumentBlock197() (interface{}, error) { - - // `=` is level 0, etc. - return (len(c.text) - 1), nil +func (c *current) onExtraListElement1119() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonDocumentBlock197() (interface{}, error) { +func (p *parser) callonExtraListElement1119() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock197() + return p.cur.onExtraListElement1119() } -func (c *current) onDocumentBlock200(level interface{}) (bool, error) { - - // use a predicate to make sure that only `=` (level 0) to `======` (level 5) are allowed - return level.(int) <= 5, nil - +func (c *current) onExtraListElement1121() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock200() (bool, error) { +func (p *parser) callonExtraListElement1121() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock200(stack["level"]) + return p.cur.onExtraListElement1121() } -func (c *current) onDocumentBlock204() (interface{}, error) { +func (c *current) onExtraListElement1130() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlock204() (interface{}, error) { +func (p *parser) callonExtraListElement1130() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock204() + return p.cur.onExtraListElement1130() } -func (c *current) onDocumentBlock220() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onExtraListElement1137() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + } -func (p *parser) callonDocumentBlock220() (interface{}, error) { +func (p *parser) callonExtraListElement1137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock220() + return p.cur.onExtraListElement1137() } -func (c *current) onDocumentBlock227() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement1140(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil + } -func (p *parser) callonDocumentBlock227() (interface{}, error) { +func (p *parser) callonExtraListElement1140() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock227() + return p.cur.onExtraListElement1140(stack["depth"]) } -func (c *current) onDocumentBlock216(id interface{}) (interface{}, error) { - // no EOL here since there can be multiple InlineElementID on the same line - return types.NewInlineIDAttribute(id.(string)) +func (c *current) onExtraListElement1134(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewOrderedListElementPrefix(types.Arabic) + case 2: + return types.NewOrderedListElementPrefix(types.LowerAlpha) + case 3: + return types.NewOrderedListElementPrefix(types.LowerRoman) + case 4: + return types.NewOrderedListElementPrefix(types.UpperAlpha) + default: + return types.NewOrderedListElementPrefix(types.UpperRoman) + } + } -func (p *parser) callonDocumentBlock216() (interface{}, error) { +func (p *parser) callonExtraListElement1134() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock216(stack["id"]) + return p.cur.onExtraListElement1134(stack["depth"]) } -func (c *current) onDocumentBlock232() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onExtraListElement1141() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) } -func (p *parser) callonDocumentBlock232() (interface{}, error) { +func (p *parser) callonExtraListElement1141() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock232() + return p.cur.onExtraListElement1141() } -func (c *current) onDocumentBlock241() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onExtraListElement1146() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) } -func (p *parser) callonDocumentBlock241() (interface{}, error) { +func (p *parser) callonExtraListElement1146() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock241() + return p.cur.onExtraListElement1146() } -func (c *current) onDocumentBlock254() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement1150() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + } -func (p *parser) callonDocumentBlock254() (interface{}, error) { +func (p *parser) callonExtraListElement1150() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock254() + return p.cur.onExtraListElement1150() } -func (c *current) onDocumentBlock260() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement1154() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + } -func (p *parser) callonDocumentBlock260() (interface{}, error) { +func (p *parser) callonExtraListElement1154() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock260() + return p.cur.onExtraListElement1154() } -func (c *current) onDocumentBlock250() (interface{}, error) { - return types.NewLineBreak() +func (c *current) onExtraListElement1159() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + } -func (p *parser) callonDocumentBlock250() (interface{}, error) { +func (p *parser) callonExtraListElement1159() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock250() + return p.cur.onExtraListElement1159() } -func (c *current) onDocumentBlock271() (interface{}, error) { +func (c *current) onExtraListElement1164(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonDocumentBlock271() (interface{}, error) { +func (p *parser) callonExtraListElement1164() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock271() + return p.cur.onExtraListElement1164(stack["prefix"]) } -func (c *current) onDocumentBlock277() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement1127(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonDocumentBlock277() (interface{}, error) { +func (p *parser) callonExtraListElement1127() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock277() + return p.cur.onExtraListElement1127(stack["prefix"]) } -func (c *current) onDocumentBlock273(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onExtraListElement1171() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonDocumentBlock273() (interface{}, error) { +func (p *parser) callonExtraListElement1171() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock273(stack["ref"]) + return p.cur.onExtraListElement1171() } -func (c *current) onDocumentBlock281() (interface{}, error) { +func (c *current) onExtraListElement1178() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil - return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock281() (interface{}, error) { +func (p *parser) callonExtraListElement1178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock281() + return p.cur.onExtraListElement1178() } -func (c *current) onDocumentBlock229(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onExtraListElement1181(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + } -func (p *parser) callonDocumentBlock229() (interface{}, error) { +func (p *parser) callonExtraListElement1181() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock229(stack["element"]) + return p.cur.onExtraListElement1181(stack["depth"]) } -func (c *current) onDocumentBlock207(elements interface{}) (interface{}, error) { - // absorbs heading and trailing spaces - return types.NewInlineElements(elements.([]interface{})) +func (c *current) onExtraListElement1175(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewUnorderedListElementPrefix(types.OneAsterisk) + case 2: + return types.NewUnorderedListElementPrefix(types.TwoAsterisks) + case 3: + return types.NewUnorderedListElementPrefix(types.ThreeAsterisks) + case 4: + return types.NewUnorderedListElementPrefix(types.FourAsterisks) + default: + return types.NewUnorderedListElementPrefix(types.FiveAsterisks) + } + } -func (p *parser) callonDocumentBlock207() (interface{}, error) { +func (p *parser) callonExtraListElement1175() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock207(stack["elements"]) + return p.cur.onExtraListElement1175(stack["depth"]) } -func (c *current) onDocumentBlock289() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onExtraListElement1183() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + } -func (p *parser) callonDocumentBlock289() (interface{}, error) { +func (p *parser) callonExtraListElement1183() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock289() + return p.cur.onExtraListElement1183() } -func (c *current) onDocumentBlock296() (interface{}, error) { +func (c *current) onExtraListElement1185(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonDocumentBlock296() (interface{}, error) { +func (p *parser) callonExtraListElement1185() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock296() + return p.cur.onExtraListElement1185(stack["prefix"]) } -func (c *current) onDocumentBlock285(id interface{}) (interface{}, error) { - // no EOL here since there can be multiple InlineElementID on the same line - return types.NewInlineIDAttribute(id.(string)) +func (c *current) onExtraListElement1168(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonDocumentBlock285() (interface{}, error) { +func (p *parser) callonExtraListElement1168() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock285(stack["id"]) + return p.cur.onExtraListElement1168(stack["prefix"]) } -func (c *current) onDocumentBlock194(level, title, id interface{}) (interface{}, error) { - return types.NewSection(level.(int), title.([]interface{}), id.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onExtraListElement1193() (interface{}, error) { + return strconv.Atoi(string(c.text)) } -func (p *parser) callonDocumentBlock194() (interface{}, error) { +func (p *parser) callonExtraListElement1193() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock194(stack["level"], stack["title"], stack["id"]) + return p.cur.onExtraListElement1193() } -func (c *current) onDocumentBlock313() (interface{}, error) { +func (c *current) onExtraListElement1197(ref interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonDocumentBlock313() (interface{}, error) { +func (p *parser) callonExtraListElement1197() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock313() + return p.cur.onExtraListElement1197(stack["ref"]) } -func (c *current) onDocumentBlock322() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement1189(ref interface{}) (interface{}, error) { + return ref, nil + } -func (p *parser) callonDocumentBlock322() (interface{}, error) { +func (p *parser) callonExtraListElement1189() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock322() + return p.cur.onExtraListElement1189(stack["ref"]) } -func (c *current) onDocumentBlock305(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) -} +func (c *current) onExtraListElement1209() (interface{}, error) { -func (p *parser) callonDocumentBlock305() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onDocumentBlock305(stack["content"]) -} + return string(c.text), nil -func (c *current) onDocumentBlock331() (interface{}, error) { - return types.NewThematicBreak() } -func (p *parser) callonDocumentBlock331() (interface{}, error) { +func (p *parser) callonExtraListElement1209() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock331() + return p.cur.onExtraListElement1209() } -func (c *current) onDocumentBlock351() (bool, error) { - attrs := c.globalStore.getAttributes() - return types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Literal), nil +func (c *current) onExtraListElement1212(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil } -func (p *parser) callonDocumentBlock351() (bool, error) { +func (p *parser) callonExtraListElement1212() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock351() + return p.cur.onExtraListElement1212(stack["separator"]) } -func (c *current) onDocumentBlock365() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement1206(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlock365() (interface{}, error) { +func (p *parser) callonExtraListElement1206() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock365() + return p.cur.onExtraListElement1206(stack["separator"]) } -func (c *current) onDocumentBlock357() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onExtraListElement1215() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock357() (interface{}, error) { +func (p *parser) callonExtraListElement1215() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock357() + return p.cur.onExtraListElement1215() } -func (c *current) onDocumentBlock373() (interface{}, error) { +func (c *current) onExtraListElement1202() (interface{}, error) { return types.NewRawLine(string(c.text)) + } -func (p *parser) callonDocumentBlock373() (interface{}, error) { +func (p *parser) callonExtraListElement1202() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock373() + return p.cur.onExtraListElement1202() } -func (c *current) onDocumentBlock354(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onExtraListElement1226() (interface{}, error) { + + return string(c.text), nil + } -func (p *parser) callonDocumentBlock354() (interface{}, error) { +func (p *parser) callonExtraListElement1226() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock354(stack["content"]) + return p.cur.onExtraListElement1226() } -func (c *current) onDocumentBlock349(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithAttribute, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onExtraListElement1229(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil } -func (p *parser) callonDocumentBlock349() (interface{}, error) { +func (p *parser) callonExtraListElement1229() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock349(stack["lines"]) + return p.cur.onExtraListElement1229(stack["separator"]) } -func (c *current) onDocumentBlock394() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement1223(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlock394() (interface{}, error) { +func (p *parser) callonExtraListElement1223() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock394() + return p.cur.onExtraListElement1223(stack["separator"]) } -func (c *current) onDocumentBlock389() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onExtraListElement1240() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonDocumentBlock389() (interface{}, error) { +func (p *parser) callonExtraListElement1240() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock389() + return p.cur.onExtraListElement1240() } -func (c *current) onDocumentBlock386(line interface{}) (interface{}, error) { - // do not include the trailing 'EOL' on the first line - return line, nil +func (c *current) onExtraListElement1243() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock386() (interface{}, error) { +func (p *parser) callonExtraListElement1243() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock386(stack["line"]) + return p.cur.onExtraListElement1243() } -func (c *current) onDocumentBlock416() (interface{}, error) { +func (c *current) onExtraListElement1253() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlock416() (interface{}, error) { +func (p *parser) callonExtraListElement1253() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock416() + return p.cur.onExtraListElement1253() } -func (c *current) onDocumentBlock408() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onExtraListElement1256() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock408() (interface{}, error) { +func (p *parser) callonExtraListElement1256() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock408() + return p.cur.onExtraListElement1256() } -func (c *current) onDocumentBlock424() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onExtraListElement1266() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonDocumentBlock424() (interface{}, error) { +func (p *parser) callonExtraListElement1266() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock424() + return p.cur.onExtraListElement1266() } -func (c *current) onDocumentBlock405(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onExtraListElement1269() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock405() (interface{}, error) { +func (p *parser) callonExtraListElement1269() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock405(stack["content"]) + return p.cur.onExtraListElement1269() } -func (c *current) onDocumentBlock383(firstLine, otherLines interface{}) (interface{}, error) { +func (c *current) onExtraListElement1279() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil } -func (p *parser) callonDocumentBlock383() (interface{}, error) { +func (p *parser) callonExtraListElement1279() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock383(stack["firstLine"], stack["otherLines"]) + return p.cur.onExtraListElement1279() } -func (c *current) onDocumentBlock381(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithSpacesOnFirstLine, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onExtraListElement1282() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock381() (interface{}, error) { +func (p *parser) callonExtraListElement1282() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock381(stack["lines"]) + return p.cur.onExtraListElement1282() } -func (c *current) onDocumentBlock438() (interface{}, error) { +func (c *current) onExtraListElement1292() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlock438() (interface{}, error) { +func (p *parser) callonExtraListElement1292() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock438() + return p.cur.onExtraListElement1292() } -func (c *current) onDocumentBlock450() (interface{}, error) { - return types.NewRawLine(string(c.text)) - +func (c *current) onExtraListElement1295() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock450() (interface{}, error) { +func (p *parser) callonExtraListElement1295() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock450() + return p.cur.onExtraListElement1295() } -func (c *current) onDocumentBlock447(line interface{}) (interface{}, error) { +func (c *current) onExtraListElement1305() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil - return line, nil // do not include the trailing 'EOL' } -func (p *parser) callonDocumentBlock447() (interface{}, error) { +func (p *parser) callonExtraListElement1305() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock447(stack["line"]) + return p.cur.onExtraListElement1305() } -func (c *current) onDocumentBlock444(lines interface{}) (interface{}, error) { - return lines.([]interface{}), nil +func (c *current) onExtraListElement1308() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock444() (interface{}, error) { +func (p *parser) callonExtraListElement1308() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock444(stack["lines"]) + return p.cur.onExtraListElement1308() } -func (c *current) onDocumentBlock467() (interface{}, error) { +func (c *current) onExtraListElement1318() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlock467() (interface{}, error) { +func (p *parser) callonExtraListElement1318() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock467() + return p.cur.onExtraListElement1318() } -func (c *current) onDocumentBlock432(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithDelimiter, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onExtraListElement1321() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock432() (interface{}, error) { +func (p *parser) callonExtraListElement1321() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock432(stack["lines"]) + return p.cur.onExtraListElement1321() } -func (c *current) onDocumentBlock480() (interface{}, error) { +func (c *current) onExtraListElement1331() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlock480() (interface{}, error) { +func (p *parser) callonExtraListElement1331() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock480() + return p.cur.onExtraListElement1331() } -func (c *current) onDocumentBlock493() (interface{}, error) { +func (c *current) onExtraListElement1334() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlock493() (interface{}, error) { +func (p *parser) callonExtraListElement1334() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock493() + return p.cur.onExtraListElement1334() } -func (c *current) onDocumentBlock498() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onExtraListElement1231(delimiter interface{}) (interface{}, error) { + return delimiter, nil } -func (p *parser) callonDocumentBlock498() (interface{}, error) { +func (p *parser) callonExtraListElement1231() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock498() + return p.cur.onExtraListElement1231(stack["delimiter"]) } -func (c *current) onDocumentBlock505() (interface{}, error) { - return string(c.text), nil +func (c *current) onExtraListElement1342() (interface{}, error) { + return strings.TrimSpace(string(c.text)), nil + } -func (p *parser) callonDocumentBlock505() (interface{}, error) { +func (p *parser) callonExtraListElement1342() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock505() + return p.cur.onExtraListElement1342() } -func (c *current) onDocumentBlock517() (interface{}, error) { +func (c *current) onExtraListElement1346() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil - } -func (p *parser) callonDocumentBlock517() (interface{}, error) { +func (p *parser) callonExtraListElement1346() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock517() + return p.cur.onExtraListElement1346() } -func (c *current) onDocumentBlock519() (interface{}, error) { - - return strconv.Atoi(string(c.text)) +func (c *current) onExtraListElement1096(content interface{}) (interface{}, error) { + // do not retain the EOL chars + return types.NewRawLine(content.(string)) } -func (p *parser) callonDocumentBlock519() (interface{}, error) { +func (p *parser) callonExtraListElement1096() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock519() + return p.cur.onExtraListElement1096(stack["content"]) } -func (c *current) onDocumentBlock512(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onExtraListElement1094(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonDocumentBlock512() (interface{}, error) { +func (p *parser) callonExtraListElement1094() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock512(stack["start"]) + return p.cur.onExtraListElement1094(stack["element"]) } -func (c *current) onDocumentBlock501(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), false, start) +func (c *current) onExtraListElement1(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonDocumentBlock501() (interface{}, error) { +func (p *parser) callonExtraListElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock501(stack["name"], stack["start"]) + return p.cur.onExtraListElement1(stack["element"]) } -func (c *current) onDocumentBlock527() (interface{}, error) { +func (c *current) onListElementContinuation7() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlock527() (interface{}, error) { +func (p *parser) callonListElementContinuation7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock527() + return p.cur.onListElementContinuation7() } -func (c *current) onDocumentBlock539() (interface{}, error) { +func (c *current) onListElementContinuation9() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil - } -func (p *parser) callonDocumentBlock539() (interface{}, error) { +func (p *parser) callonListElementContinuation9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock539() + return p.cur.onListElementContinuation9() } -func (c *current) onDocumentBlock541() (interface{}, error) { - - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuation16() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonDocumentBlock541() (interface{}, error) { +func (p *parser) callonListElementContinuation16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock541() + return p.cur.onListElementContinuation16() } -func (c *current) onDocumentBlock534(start interface{}) (interface{}, error) { - return start, nil - +func (c *current) onListElementContinuation18(offset interface{}) (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock534() (interface{}, error) { +func (p *parser) callonListElementContinuation18() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock534(stack["start"]) + return p.cur.onListElementContinuation18(stack["offset"]) } -func (c *current) onDocumentBlock523(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), true, nil) +func (c *current) onListElementContinuation1(offset, element interface{}) (interface{}, error) { + return types.NewListElementContinuation(len(offset.([]interface{})), element) + } -func (p *parser) callonDocumentBlock523() (interface{}, error) { +func (p *parser) callonListElementContinuation1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock523(stack["name"], stack["start"]) + return p.cur.onListElementContinuation1(stack["offset"], stack["element"]) } -func (c *current) onDocumentBlock549() (interface{}, error) { +func (c *current) onListElementContinuationElement14() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlock549() (interface{}, error) { +func (p *parser) callonListElementContinuationElement14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock549() + return p.cur.onListElementContinuationElement14() } -func (c *current) onDocumentBlock545(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onListElementContinuationElement21() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + } -func (p *parser) callonDocumentBlock545() (interface{}, error) { +func (p *parser) callonListElementContinuationElement21() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock545(stack["name"]) + return p.cur.onListElementContinuationElement21() } -func (c *current) onDocumentBlock555() (interface{}, error) { - // standalone '{' - return types.NewStringElement(string(c.text)) +func (c *current) onListElementContinuationElement24(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil } -func (p *parser) callonDocumentBlock555() (interface{}, error) { +func (p *parser) callonListElementContinuationElement24() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock555() + return p.cur.onListElementContinuationElement24(stack["depth"]) } -func (c *current) onDocumentBlock488(elements interface{}) (interface{}, error) { - return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil +func (c *current) onListElementContinuationElement18(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewOrderedListElementPrefix(types.Arabic) + case 2: + return types.NewOrderedListElementPrefix(types.LowerAlpha) + case 3: + return types.NewOrderedListElementPrefix(types.LowerRoman) + case 4: + return types.NewOrderedListElementPrefix(types.UpperAlpha) + default: + return types.NewOrderedListElementPrefix(types.UpperRoman) + } + } -func (p *parser) callonDocumentBlock488() (interface{}, error) { +func (p *parser) callonListElementContinuationElement18() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock488(stack["elements"]) + return p.cur.onListElementContinuationElement18(stack["depth"]) } -func (c *current) onDocumentBlock476(name, value interface{}) (interface{}, error) { - return types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) +func (c *current) onListElementContinuationElement25() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + } -func (p *parser) callonDocumentBlock476() (interface{}, error) { +func (p *parser) callonListElementContinuationElement25() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock476(stack["name"], stack["value"]) + return p.cur.onListElementContinuationElement25() } -func (c *current) onDocumentBlock566() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement30() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + } -func (p *parser) callonDocumentBlock566() (interface{}, error) { +func (p *parser) callonListElementContinuationElement30() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock566() + return p.cur.onListElementContinuationElement30() } -func (c *current) onDocumentBlock575() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement34() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + } -func (p *parser) callonDocumentBlock575() (interface{}, error) { +func (p *parser) callonListElementContinuationElement34() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock575() + return p.cur.onListElementContinuationElement34() } -func (c *current) onDocumentBlock562(name interface{}) (interface{}, error) { - return types.NewAttributeReset(name.(string)) +func (c *current) onListElementContinuationElement38() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + } -func (p *parser) callonDocumentBlock562() (interface{}, error) { +func (p *parser) callonListElementContinuationElement38() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock562(stack["name"]) + return p.cur.onListElementContinuationElement38() } -func (c *current) onDocumentBlock586() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement43() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + } -func (p *parser) callonDocumentBlock586() (interface{}, error) { +func (p *parser) callonListElementContinuationElement43() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock586() + return p.cur.onListElementContinuationElement43() } -func (c *current) onDocumentBlock595() (interface{}, error) { +func (c *current) onListElementContinuationElement48(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonDocumentBlock595() (interface{}, error) { +func (p *parser) callonListElementContinuationElement48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock595() + return p.cur.onListElementContinuationElement48(stack["prefix"]) } -func (c *current) onDocumentBlock582(name interface{}) (interface{}, error) { - return types.NewAttributeReset(name.(string)) +func (c *current) onListElementContinuationElement11(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonDocumentBlock582() (interface{}, error) { +func (p *parser) callonListElementContinuationElement11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock582(stack["name"]) + return p.cur.onListElementContinuationElement11(stack["prefix"]) } -func (c *current) onDocumentBlock614() (interface{}, error) { - return types.Tip, nil +func (c *current) onListElementContinuationElement55() (interface{}, error) { + return types.NewRawLine(string(c.text)) + } -func (p *parser) callonDocumentBlock614() (interface{}, error) { +func (p *parser) callonListElementContinuationElement55() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock614() + return p.cur.onListElementContinuationElement55() } -func (c *current) onDocumentBlock616() (interface{}, error) { - return types.Note, nil +func (c *current) onListElementContinuationElement59() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock616() (interface{}, error) { +func (p *parser) callonListElementContinuationElement59() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock616() + return p.cur.onListElementContinuationElement59() } -func (c *current) onDocumentBlock618() (interface{}, error) { - return types.Important, nil +func (c *current) onListElementContinuationElement52(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) + } -func (p *parser) callonDocumentBlock618() (interface{}, error) { +func (p *parser) callonListElementContinuationElement52() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock618() + return p.cur.onListElementContinuationElement52(stack["rawline"]) } -func (c *current) onDocumentBlock620() (interface{}, error) { - return types.Warning, nil +func (c *current) onListElementContinuationElement8(prefix, content interface{}) (interface{}, error) { + return types.NewOrderedListElement(prefix.(types.OrderedListElementPrefix), content) + } -func (p *parser) callonDocumentBlock620() (interface{}, error) { +func (p *parser) callonListElementContinuationElement8() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock620() + return p.cur.onListElementContinuationElement8(stack["prefix"], stack["content"]) } -func (c *current) onDocumentBlock622() (interface{}, error) { - return types.Caution, nil +func (c *current) onListElementContinuationElement72() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonDocumentBlock622() (interface{}, error) { +func (p *parser) callonListElementContinuationElement72() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock622() + return p.cur.onListElementContinuationElement72() } -func (c *current) onDocumentBlock636() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement79() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + } -func (p *parser) callonDocumentBlock636() (interface{}, error) { +func (p *parser) callonListElementContinuationElement79() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock636() + return p.cur.onListElementContinuationElement79() } -func (c *current) onDocumentBlock645() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement82(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + } -func (p *parser) callonDocumentBlock645() (interface{}, error) { +func (p *parser) callonListElementContinuationElement82() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock645() + return p.cur.onListElementContinuationElement82(stack["depth"]) } -func (c *current) onDocumentBlock628(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onListElementContinuationElement76(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewUnorderedListElementPrefix(types.OneAsterisk) + case 2: + return types.NewUnorderedListElementPrefix(types.TwoAsterisks) + case 3: + return types.NewUnorderedListElementPrefix(types.ThreeAsterisks) + case 4: + return types.NewUnorderedListElementPrefix(types.FourAsterisks) + default: + return types.NewUnorderedListElementPrefix(types.FiveAsterisks) + } + } -func (p *parser) callonDocumentBlock628() (interface{}, error) { +func (p *parser) callonListElementContinuationElement76() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock628(stack["content"]) + return p.cur.onListElementContinuationElement76(stack["depth"]) } -func (c *current) onDocumentBlock666() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement84() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + } -func (p *parser) callonDocumentBlock666() (interface{}, error) { +func (p *parser) callonListElementContinuationElement84() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock666() + return p.cur.onListElementContinuationElement84() } -func (c *current) onDocumentBlock678() (interface{}, error) { +func (c *current) onListElementContinuationElement86(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonDocumentBlock678() (interface{}, error) { +func (p *parser) callonListElementContinuationElement86() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock678() + return p.cur.onListElementContinuationElement86(stack["prefix"]) } -func (c *current) onDocumentBlock690() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement69(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonDocumentBlock690() (interface{}, error) { +func (p *parser) callonListElementContinuationElement69() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock690() + return p.cur.onListElementContinuationElement69(stack["prefix"]) } -func (c *current) onDocumentBlock702() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement97() (interface{}, error) { + return types.Unchecked, nil } -func (p *parser) callonDocumentBlock702() (interface{}, error) { +func (p *parser) callonListElementContinuationElement97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock702() + return p.cur.onListElementContinuationElement97() } -func (c *current) onDocumentBlock714() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement99() (interface{}, error) { + return types.Checked, nil } -func (p *parser) callonDocumentBlock714() (interface{}, error) { +func (p *parser) callonListElementContinuationElement99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock714() + return p.cur.onListElementContinuationElement99() } -func (c *current) onDocumentBlock726() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement101() (interface{}, error) { + return types.Checked, nil } -func (p *parser) callonDocumentBlock726() (interface{}, error) { +func (p *parser) callonListElementContinuationElement101() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock726() + return p.cur.onListElementContinuationElement101() } -func (c *current) onDocumentBlock738() (interface{}, error) { +func (c *current) onListElementContinuationElement103(style interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonDocumentBlock738() (interface{}, error) { +func (p *parser) callonListElementContinuationElement103() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock738() + return p.cur.onListElementContinuationElement103(stack["style"]) } -func (c *current) onDocumentBlock746() (interface{}, error) { +func (c *current) onListElementContinuationElement91(style interface{}) (interface{}, error) { + return style, nil - return string(c.text), nil } -func (p *parser) callonDocumentBlock746() (interface{}, error) { +func (p *parser) callonListElementContinuationElement91() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock746() + return p.cur.onListElementContinuationElement91(stack["style"]) } -func (c *current) onDocumentBlock754(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onListElementContinuationElement110() (interface{}, error) { + return types.NewRawLine(string(c.text)) } -func (p *parser) callonDocumentBlock754() (bool, error) { +func (p *parser) callonListElementContinuationElement110() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock754(stack["content"]) + return p.cur.onListElementContinuationElement110() } -func (c *current) onDocumentBlock653(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) - +func (c *current) onListElementContinuationElement114() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock653() (interface{}, error) { +func (p *parser) callonListElementContinuationElement114() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock653(stack["content"]) + return p.cur.onListElementContinuationElement114() } -func (c *current) onDocumentBlock610(t, lines interface{}) (interface{}, error) { - - return types.NewAdmonitionParagraph(lines.([]interface{}), t.(string), c.globalStore.getAttributes()) +func (c *current) onListElementContinuationElement107(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) } -func (p *parser) callonDocumentBlock610() (interface{}, error) { +func (p *parser) callonListElementContinuationElement107() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock610(stack["t"], stack["lines"]) + return p.cur.onListElementContinuationElement107(stack["rawline"]) } -func (c *current) onDocumentBlock771() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement66(prefix, checkstyle, content interface{}) (interface{}, error) { + return types.NewUnorderedListElement(prefix.(types.UnorderedListElementPrefix), checkstyle, content) + } -func (p *parser) callonDocumentBlock771() (interface{}, error) { +func (p *parser) callonListElementContinuationElement66() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock771() + return p.cur.onListElementContinuationElement66(stack["prefix"], stack["checkstyle"], stack["content"]) } -func (c *current) onDocumentBlock763() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onListElementContinuationElement128() (interface{}, error) { + return strconv.Atoi(string(c.text)) } -func (p *parser) callonDocumentBlock763() (interface{}, error) { +func (p *parser) callonListElementContinuationElement128() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock763() + return p.cur.onListElementContinuationElement128() } -func (c *current) onDocumentBlock787() (interface{}, error) { - +func (c *current) onListElementContinuationElement132(ref interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil } -func (p *parser) callonDocumentBlock787() (interface{}, error) { +func (p *parser) callonListElementContinuationElement132() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock787() + return p.cur.onListElementContinuationElement132(stack["ref"]) } -func (c *current) onDocumentBlock781(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onListElementContinuationElement124(ref interface{}) (interface{}, error) { + return ref, nil } -func (p *parser) callonDocumentBlock781() (interface{}, error) { +func (p *parser) callonListElementContinuationElement124() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock781(stack["content"]) + return p.cur.onListElementContinuationElement124(stack["ref"]) } -func (c *current) onDocumentBlock760(content interface{}) (interface{}, error) { +func (c *current) onListElementContinuationElement139() (interface{}, error) { + return string(c.text), nil - return content, nil } -func (p *parser) callonDocumentBlock760() (interface{}, error) { +func (p *parser) callonListElementContinuationElement139() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock760(stack["content"]) + return p.cur.onListElementContinuationElement139() } -func (c *current) onDocumentBlock755(content interface{}) (interface{}, error) { - return types.NewMarkdownQuoteBlock(content.([]interface{}), c.globalStore.getAttributes()) - +func (c *current) onListElementContinuationElement143() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock755() (interface{}, error) { +func (p *parser) callonListElementContinuationElement143() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock755(stack["content"]) + return p.cur.onListElementContinuationElement143() } -func (c *current) onDocumentBlock797() (bool, error) { - // verify that one of the attributes is `kind:passthrough` - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Passthrough), nil +func (c *current) onListElementContinuationElement136(rawline interface{}) (interface{}, error) { + return types.NewRawLine(rawline.(string)) } -func (p *parser) callonDocumentBlock797() (bool, error) { +func (p *parser) callonListElementContinuationElement136() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock797() + return p.cur.onListElementContinuationElement136(stack["rawline"]) } -func (c *current) onDocumentBlock813() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement121(ref, description interface{}) (interface{}, error) { + return types.NewCalloutListElement(ref.(int), description.(types.RawLine)) + } -func (p *parser) callonDocumentBlock813() (interface{}, error) { +func (p *parser) callonListElementContinuationElement121() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock813() + return p.cur.onListElementContinuationElement121(stack["ref"], stack["description"]) } -func (c *current) onDocumentBlock825() (interface{}, error) { +func (c *current) onListElementContinuationElement160() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlock825() (interface{}, error) { +func (p *parser) callonListElementContinuationElement160() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock825() + return p.cur.onListElementContinuationElement160() } -func (c *current) onDocumentBlock837() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement163(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil + } -func (p *parser) callonDocumentBlock837() (interface{}, error) { +func (p *parser) callonListElementContinuationElement163() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock837() + return p.cur.onListElementContinuationElement163(stack["separator"]) } -func (c *current) onDocumentBlock849() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement157(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlock849() (interface{}, error) { +func (p *parser) callonListElementContinuationElement157() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock849() + return p.cur.onListElementContinuationElement157(stack["separator"]) } -func (c *current) onDocumentBlock861() (interface{}, error) { +func (c *current) onListElementContinuationElement166() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlock861() (interface{}, error) { +func (p *parser) callonListElementContinuationElement166() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock861() + return p.cur.onListElementContinuationElement166() } -func (c *current) onDocumentBlock873() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement153() (interface{}, error) { + return types.NewRawLine(string(c.text)) + } -func (p *parser) callonDocumentBlock873() (interface{}, error) { +func (p *parser) callonListElementContinuationElement153() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock873() + return p.cur.onListElementContinuationElement153() } -func (c *current) onDocumentBlock885() (interface{}, error) { +func (c *current) onListElementContinuationElement178() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlock885() (interface{}, error) { +func (p *parser) callonListElementContinuationElement178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock885() + return p.cur.onListElementContinuationElement178() } -func (c *current) onDocumentBlock893() (interface{}, error) { +func (c *current) onListElementContinuationElement181(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil - return string(c.text), nil } -func (p *parser) callonDocumentBlock893() (interface{}, error) { +func (p *parser) callonListElementContinuationElement181() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock893() + return p.cur.onListElementContinuationElement181(stack["separator"]) } -func (c *current) onDocumentBlock901(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onListElementContinuationElement175(separator interface{}) (interface{}, error) { + return separator, nil } -func (p *parser) callonDocumentBlock901() (bool, error) { +func (p *parser) callonListElementContinuationElement175() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock901(stack["content"]) + return p.cur.onListElementContinuationElement175(stack["separator"]) } -func (c *current) onDocumentBlock800(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onListElementContinuationElement187() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonDocumentBlock800() (interface{}, error) { +func (p *parser) callonListElementContinuationElement187() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock800(stack["content"]) + return p.cur.onListElementContinuationElement187() } -func (c *current) onDocumentBlock795(content interface{}) (interface{}, error) { - - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) - +func (c *current) onListElementContinuationElement190() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDocumentBlock795() (interface{}, error) { +func (p *parser) callonListElementContinuationElement190() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock795(stack["content"]) + return p.cur.onListElementContinuationElement190() } -func (c *current) onDocumentBlock914() (interface{}, error) { +func (c *current) onListElementContinuationElement204() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlock914() (interface{}, error) { +func (p *parser) callonListElementContinuationElement204() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock914() + return p.cur.onListElementContinuationElement204() } -func (c *current) onDocumentBlock923() (interface{}, error) { +func (c *current) onListElementContinuationElement207() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlock923() (interface{}, error) { +func (p *parser) callonListElementContinuationElement207() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock923() + return p.cur.onListElementContinuationElement207() } -func (c *current) onDocumentBlock906(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onListElementContinuationElement198() (interface{}, error) { + return types.NewBlankLine() + } -func (p *parser) callonDocumentBlock906() (interface{}, error) { +func (p *parser) callonListElementContinuationElement198() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock906(stack["content"]) + return p.cur.onListElementContinuationElement198() } -func (c *current) onDocumentBlock944() (interface{}, error) { +func (c *current) onListElementContinuationElement225() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlock944() (interface{}, error) { +func (p *parser) callonListElementContinuationElement225() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock944() + return p.cur.onListElementContinuationElement225() } -func (c *current) onDocumentBlock956() (interface{}, error) { +func (c *current) onListElementContinuationElement228() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlock956() (interface{}, error) { +func (p *parser) callonListElementContinuationElement228() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock956() + return p.cur.onListElementContinuationElement228() } -func (c *current) onDocumentBlock968() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement219() (interface{}, error) { + return types.NewBlankLine() + } -func (p *parser) callonDocumentBlock968() (interface{}, error) { +func (p *parser) callonListElementContinuationElement219() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock968() + return p.cur.onListElementContinuationElement219() } -func (c *current) onDocumentBlock980() (interface{}, error) { +func (c *current) onListElementContinuationElement239() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlock980() (interface{}, error) { +func (p *parser) callonListElementContinuationElement239() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock980() + return p.cur.onListElementContinuationElement239() } -func (c *current) onDocumentBlock992() (interface{}, error) { +func (c *current) onListElementContinuationElement241() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDocumentBlock992() (interface{}, error) { +func (p *parser) callonListElementContinuationElement241() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock992() + return p.cur.onListElementContinuationElement241() } -func (c *current) onDocumentBlock1004() (interface{}, error) { +func (c *current) onListElementContinuationElement250() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonDocumentBlock1004() (interface{}, error) { +func (p *parser) callonListElementContinuationElement250() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock1004() + return p.cur.onListElementContinuationElement250() } -func (c *current) onDocumentBlock1016() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement257() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + } -func (p *parser) callonDocumentBlock1016() (interface{}, error) { +func (p *parser) callonListElementContinuationElement257() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock1016() + return p.cur.onListElementContinuationElement257() } -func (c *current) onDocumentBlock1024() (interface{}, error) { +func (c *current) onListElementContinuationElement260(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil - return string(c.text), nil } -func (p *parser) callonDocumentBlock1024() (interface{}, error) { +func (p *parser) callonListElementContinuationElement260() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock1024() + return p.cur.onListElementContinuationElement260(stack["depth"]) } -func (c *current) onDocumentBlock1032(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil +func (c *current) onListElementContinuationElement254(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewOrderedListElementPrefix(types.Arabic) + case 2: + return types.NewOrderedListElementPrefix(types.LowerAlpha) + case 3: + return types.NewOrderedListElementPrefix(types.LowerRoman) + case 4: + return types.NewOrderedListElementPrefix(types.UpperAlpha) + default: + return types.NewOrderedListElementPrefix(types.UpperRoman) } - return true, nil } -func (p *parser) callonDocumentBlock1032() (bool, error) { +func (p *parser) callonListElementContinuationElement254() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock1032(stack["content"]) + return p.cur.onListElementContinuationElement254(stack["depth"]) } -func (c *current) onDocumentBlock931(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onListElementContinuationElement261() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) } -func (p *parser) callonDocumentBlock931() (interface{}, error) { +func (p *parser) callonListElementContinuationElement261() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock931(stack["content"]) + return p.cur.onListElementContinuationElement261() } -func (c *current) onDocumentBlock902(lines interface{}) (interface{}, error) { - - return types.NewParagraph(lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onListElementContinuationElement266() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) } -func (p *parser) callonDocumentBlock902() (interface{}, error) { +func (p *parser) callonListElementContinuationElement266() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock902(stack["lines"]) + return p.cur.onListElementContinuationElement266() } -func (c *current) onDocumentBlock1033() (interface{}, error) { - // for standalone attributes at the end of the doc - return types.NewStandaloneAttributes(c.globalStore.getAttributes()) // will be discarded anyways +func (c *current) onListElementContinuationElement270() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) } -func (p *parser) callonDocumentBlock1033() (interface{}, error) { +func (p *parser) callonListElementContinuationElement270() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock1033() + return p.cur.onListElementContinuationElement270() } -func (c *current) onDocumentBlock1(attributes, block interface{}) (interface{}, error) { - c.globalStore.discardAttributes() - return block, nil +func (c *current) onListElementContinuationElement274() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) } -func (p *parser) callonDocumentBlock1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement274() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock1(stack["attributes"], stack["block"]) + return p.cur.onListElementContinuationElement274() } -func (c *current) onBlockAttributes16() (interface{}, error) { - // spaces, commas and dots are allowed in this syntax - return types.NewStringElement(string(c.text)) +func (c *current) onListElementContinuationElement279() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) } -func (p *parser) callonBlockAttributes16() (interface{}, error) { +func (p *parser) callonListElementContinuationElement279() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes16() + return p.cur.onListElementContinuationElement279() } -func (c *current) onBlockAttributes23() (interface{}, error) { +func (c *current) onListElementContinuationElement284(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonBlockAttributes23() (interface{}, error) { +func (p *parser) callonListElementContinuationElement284() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes23() + return p.cur.onListElementContinuationElement284(stack["prefix"]) } -func (c *current) onBlockAttributes19(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuationElement247(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonBlockAttributes19() (interface{}, error) { +func (p *parser) callonListElementContinuationElement247() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes19(stack["ref"]) + return p.cur.onListElementContinuationElement247(stack["prefix"]) } -func (c *current) onBlockAttributes31() (interface{}, error) { +func (c *current) onListElementContinuationElement291() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonBlockAttributes31() (interface{}, error) { +func (p *parser) callonListElementContinuationElement291() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes31() + return p.cur.onListElementContinuationElement291() } -func (c *current) onBlockAttributes27(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onListElementContinuationElement298() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + } -func (p *parser) callonBlockAttributes27() (interface{}, error) { +func (p *parser) callonListElementContinuationElement298() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes27(stack["name"]) + return p.cur.onListElementContinuationElement298() } -func (c *current) onBlockAttributes37() (interface{}, error) { +func (c *current) onListElementContinuationElement301(depth interface{}) (bool, error) { - return types.NewStringElement(string(c.text)) + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil } -func (p *parser) callonBlockAttributes37() (interface{}, error) { +func (p *parser) callonListElementContinuationElement301() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes37() + return p.cur.onListElementContinuationElement301(stack["depth"]) } -func (c *current) onBlockAttributes12(elements interface{}) (interface{}, error) { - return types.Reduce(elements, strings.TrimSpace), nil +func (c *current) onListElementContinuationElement295(depth interface{}) (interface{}, error) { + switch depth.(int) { + case 1: + return types.NewUnorderedListElementPrefix(types.OneAsterisk) + case 2: + return types.NewUnorderedListElementPrefix(types.TwoAsterisks) + case 3: + return types.NewUnorderedListElementPrefix(types.ThreeAsterisks) + case 4: + return types.NewUnorderedListElementPrefix(types.FourAsterisks) + default: + return types.NewUnorderedListElementPrefix(types.FiveAsterisks) + } } -func (p *parser) callonBlockAttributes12() (interface{}, error) { +func (p *parser) callonListElementContinuationElement295() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes12(stack["elements"]) + return p.cur.onListElementContinuationElement295(stack["depth"]) } -func (c *current) onBlockAttributes8(id interface{}) (interface{}, error) { - return types.NewIDAttribute(id) +func (c *current) onListElementContinuationElement303() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) } -func (p *parser) callonBlockAttributes8() (interface{}, error) { +func (p *parser) callonListElementContinuationElement303() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes8(stack["id"]) + return p.cur.onListElementContinuationElement303() } -func (c *current) onBlockAttributes43() (interface{}, error) { +func (c *current) onListElementContinuationElement305(prefix interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonBlockAttributes43() (interface{}, error) { +func (p *parser) callonListElementContinuationElement305() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes43() + return p.cur.onListElementContinuationElement305(stack["prefix"]) } -func (c *current) onBlockAttributes5(anchor interface{}) (interface{}, error) { - return anchor, nil - +func (c *current) onListElementContinuationElement288(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonBlockAttributes5() (interface{}, error) { +func (p *parser) callonListElementContinuationElement288() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes5(stack["anchor"]) + return p.cur.onListElementContinuationElement288(stack["prefix"]) } -func (c *current) onBlockAttributes62() (interface{}, error) { - return types.NewStringElement(string(c.text)) - +func (c *current) onListElementContinuationElement313() (interface{}, error) { + return strconv.Atoi(string(c.text)) } -func (p *parser) callonBlockAttributes62() (interface{}, error) { +func (p *parser) callonListElementContinuationElement313() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes62() + return p.cur.onListElementContinuationElement313() } -func (c *current) onBlockAttributes69() (interface{}, error) { +func (c *current) onListElementContinuationElement317(ref interface{}) (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonBlockAttributes69() (interface{}, error) { +func (p *parser) callonListElementContinuationElement317() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes69() + return p.cur.onListElementContinuationElement317(stack["ref"]) } -func (c *current) onBlockAttributes65(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuationElement309(ref interface{}) (interface{}, error) { + return ref, nil + } -func (p *parser) callonBlockAttributes65() (interface{}, error) { +func (p *parser) callonListElementContinuationElement309() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes65(stack["ref"]) + return p.cur.onListElementContinuationElement309(stack["ref"]) } -func (c *current) onBlockAttributes77() (interface{}, error) { +func (c *current) onListElementContinuationElement329() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonBlockAttributes77() (interface{}, error) { +func (p *parser) callonListElementContinuationElement329() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes77() + return p.cur.onListElementContinuationElement329() } -func (c *current) onBlockAttributes73(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onListElementContinuationElement332(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil + } -func (p *parser) callonBlockAttributes73() (interface{}, error) { +func (p *parser) callonListElementContinuationElement332() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes73(stack["name"]) + return p.cur.onListElementContinuationElement332(stack["separator"]) } -func (c *current) onBlockAttributes83() (interface{}, error) { +func (c *current) onListElementContinuationElement326(separator interface{}) (interface{}, error) { + return separator, nil - return types.NewStringElement(string(c.text)) +} +func (p *parser) callonListElementContinuationElement326() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElementContinuationElement326(stack["separator"]) +} + +func (c *current) onListElementContinuationElement335() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonBlockAttributes83() (interface{}, error) { +func (p *parser) callonListElementContinuationElement335() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes83() + return p.cur.onListElementContinuationElement335() } -func (c *current) onBlockAttributes55(elements interface{}) (interface{}, error) { - return types.Reduce(elements, strings.TrimSpace), nil +func (c *current) onListElementContinuationElement322() (interface{}, error) { + return types.NewRawLine(string(c.text)) } -func (p *parser) callonBlockAttributes55() (interface{}, error) { +func (p *parser) callonListElementContinuationElement322() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes55(stack["elements"]) + return p.cur.onListElementContinuationElement322() } -func (c *current) onBlockAttributes51(title interface{}) (interface{}, error) { - return types.NewTitleAttribute(title) +func (c *current) onListElementContinuationElement346() (interface{}, error) { + + return string(c.text), nil } -func (p *parser) callonBlockAttributes51() (interface{}, error) { +func (p *parser) callonListElementContinuationElement346() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes51(stack["title"]) + return p.cur.onListElementContinuationElement346() } -func (c *current) onBlockAttributes88() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement349(separator interface{}) (bool, error) { + + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil + } -func (p *parser) callonBlockAttributes88() (interface{}, error) { +func (p *parser) callonListElementContinuationElement349() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes88() + return p.cur.onListElementContinuationElement349(stack["separator"]) } -func (c *current) onBlockAttributes48(title interface{}) (interface{}, error) { - return title, nil +func (c *current) onListElementContinuationElement343(separator interface{}) (interface{}, error) { + return separator, nil } -func (p *parser) callonBlockAttributes48() (interface{}, error) { +func (p *parser) callonListElementContinuationElement343() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes48(stack["title"]) + return p.cur.onListElementContinuationElement343(stack["separator"]) } -func (c *current) onBlockAttributes100() (interface{}, error) { +func (c *current) onListElementContinuationElement360() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonBlockAttributes100() (interface{}, error) { +func (p *parser) callonListElementContinuationElement360() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes100() + return p.cur.onListElementContinuationElement360() } -func (c *current) onBlockAttributes93(attributes interface{}) (interface{}, error) { - return attributes, nil - +func (c *current) onListElementContinuationElement363() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonBlockAttributes93() (interface{}, error) { +func (p *parser) callonListElementContinuationElement363() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes93(stack["attributes"]) + return p.cur.onListElementContinuationElement363() } -func (c *current) onBlockAttributes1(attributes interface{}) (interface{}, error) { - return types.NewAttributes(attributes.([]interface{})...) +func (c *current) onListElementContinuationElement373() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonBlockAttributes1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement373() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes1(stack["attributes"]) + return p.cur.onListElementContinuationElement373() } -func (c *current) onInlineAttributes1(attributes interface{}) (interface{}, error) { - return types.NewAttributes(attributes.([]interface{})...) - +func (c *current) onListElementContinuationElement376() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonInlineAttributes1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement376() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineAttributes1(stack["attributes"]) + return p.cur.onListElementContinuationElement376() } -func (c *current) onLongHandAttributes1(firstPositionalAttributes, otherAttributes interface{}) (interface{}, error) { - attributes := []interface{}{} - if firstPositionalAttributes != nil { - attributes = append(attributes, firstPositionalAttributes.([]interface{})...) - } - attributes = append(attributes, otherAttributes.([]interface{})...) - return types.NewAttributes(attributes...) +func (c *current) onListElementContinuationElement386() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonLongHandAttributes1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement386() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLongHandAttributes1(stack["firstPositionalAttributes"], stack["otherAttributes"]) + return p.cur.onListElementContinuationElement386() } -func (c *current) onFirstPositionalAttributes18() (interface{}, error) { +func (c *current) onListElementContinuationElement389() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonFirstPositionalAttributes18() (interface{}, error) { +func (p *parser) callonListElementContinuationElement389() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFirstPositionalAttributes18() + return p.cur.onListElementContinuationElement389() } -func (c *current) onFirstPositionalAttributes20(main, extras interface{}) (bool, error) { - // make sure there was a match - return main != nil || len(extras.([]interface{})) > 0, nil +func (c *current) onListElementContinuationElement399() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonFirstPositionalAttributes20() (bool, error) { +func (p *parser) callonListElementContinuationElement399() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFirstPositionalAttributes20(stack["main"], stack["extras"]) + return p.cur.onListElementContinuationElement399() } -func (c *current) onFirstPositionalAttributes1(main, extras interface{}) (interface{}, error) { - attrs := []interface{}{} - if main != nil { - attrs = append(attrs, main) - } - attrs = append(attrs, extras.([]interface{})...) - return attrs, nil - +func (c *current) onListElementContinuationElement402() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonFirstPositionalAttributes1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement402() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFirstPositionalAttributes1(stack["main"], stack["extras"]) + return p.cur.onListElementContinuationElement402() } -func (c *current) onShortHandIDAttribute1(id interface{}) (interface{}, error) { - return types.NewIDAttribute(id) +func (c *current) onListElementContinuationElement412() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonShortHandIDAttribute1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement412() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandIDAttribute1(stack["id"]) + return p.cur.onListElementContinuationElement412() } -func (c *current) onShortHandAttribute1(value interface{}) (interface{}, error) { - return types.NewPositionalAttribute(value) +func (c *current) onListElementContinuationElement415() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonShortHandAttribute1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement415() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttribute1(stack["value"]) + return p.cur.onListElementContinuationElement415() } -func (c *current) onShortHandDotRoleAttribute1(role interface{}) (interface{}, error) { - return types.NewRoleAttribute(role) +func (c *current) onListElementContinuationElement425() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonShortHandDotRoleAttribute1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement425() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandDotRoleAttribute1(stack["role"]) + return p.cur.onListElementContinuationElement425() } -func (c *current) onShortHandOptionAttribute1(option interface{}) (interface{}, error) { - return types.NewOptionAttribute(option) +func (c *current) onListElementContinuationElement428() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonShortHandOptionAttribute1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement428() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandOptionAttribute1(stack["option"]) + return p.cur.onListElementContinuationElement428() } -func (c *current) onShortHandAttributeValue9() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onListElementContinuationElement438() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonShortHandAttributeValue9() (interface{}, error) { +func (p *parser) callonListElementContinuationElement438() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue9() + return p.cur.onListElementContinuationElement438() } -func (c *current) onShortHandAttributeValue17() (interface{}, error) { +func (c *current) onListElementContinuationElement441() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonShortHandAttributeValue17() (interface{}, error) { +func (p *parser) callonListElementContinuationElement441() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue17() + return p.cur.onListElementContinuationElement441() } -func (c *current) onShortHandAttributeValue13(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuationElement451() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonShortHandAttributeValue13() (interface{}, error) { +func (p *parser) callonListElementContinuationElement451() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue13(stack["ref"]) + return p.cur.onListElementContinuationElement451() } -func (c *current) onShortHandAttributeValue25() (interface{}, error) { +func (c *current) onListElementContinuationElement454() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonShortHandAttributeValue25() (interface{}, error) { +func (p *parser) callonListElementContinuationElement454() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue25() + return p.cur.onListElementContinuationElement454() } -func (c *current) onShortHandAttributeValue21(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onListElementContinuationElement351(delimiter interface{}) (interface{}, error) { + return delimiter, nil + } -func (p *parser) callonShortHandAttributeValue21() (interface{}, error) { +func (p *parser) callonListElementContinuationElement351() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue21(stack["name"]) + return p.cur.onListElementContinuationElement351(stack["delimiter"]) } -func (c *current) onShortHandAttributeValue31() (interface{}, error) { +func (c *current) onListElementContinuationElement462() (interface{}, error) { + return strings.TrimSpace(string(c.text)), nil - return types.NewStringElement(string(c.text)) +} +func (p *parser) callonListElementContinuationElement462() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElementContinuationElement462() } -func (p *parser) callonShortHandAttributeValue31() (interface{}, error) { +func (c *current) onListElementContinuationElement466() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElementContinuationElement466() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue31() + return p.cur.onListElementContinuationElement466() } -func (c *current) onShortHandAttributeValue4(elements interface{}) (interface{}, error) { - return types.Reduce(elements, strings.TrimSpace), nil +func (c *current) onListElementContinuationElement216(content interface{}) (interface{}, error) { + // do not retain the EOL chars + return types.NewRawLine(content.(string)) } -func (p *parser) callonShortHandAttributeValue4() (interface{}, error) { +func (p *parser) callonListElementContinuationElement216() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue4(stack["elements"]) + return p.cur.onListElementContinuationElement216(stack["content"]) } -func (c *current) onPositionalAttribute13() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement184(content interface{}) (interface{}, error) { + if content == nil { + return nil, nil + } + return types.NewParagraph(content) + } -func (p *parser) callonPositionalAttribute13() (interface{}, error) { +func (p *parser) callonListElementContinuationElement184() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPositionalAttribute13() + return p.cur.onListElementContinuationElement184(stack["content"]) } -func (c *current) onPositionalAttribute2(value interface{}) (interface{}, error) { - // TODO: see if we can just use `((",")? / &"]")` instead (ie, no need to check for Space*) - return types.NewPositionalAttribute(value) +func (c *current) onListElementContinuationElement475() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil } -func (p *parser) callonPositionalAttribute2() (interface{}, error) { +func (p *parser) callonListElementContinuationElement475() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPositionalAttribute2(stack["value"]) + return p.cur.onListElementContinuationElement475() } -func (c *current) onPositionalAttribute24() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement479() (interface{}, error) { + return types.NewRawLine(string(c.text)) + } -func (p *parser) callonPositionalAttribute24() (interface{}, error) { +func (p *parser) callonListElementContinuationElement479() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPositionalAttribute24() + return p.cur.onListElementContinuationElement479() } -func (c *current) onPositionalAttribute32() (interface{}, error) { +func (c *current) onListElementContinuationElement483() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonPositionalAttribute32() (interface{}, error) { +func (p *parser) callonListElementContinuationElement483() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPositionalAttribute32() + return p.cur.onListElementContinuationElement483() } -func (c *current) onPositionalAttribute36(value interface{}) (bool, error) { - // here we can't rely on `c.text` if the content is empty - // (in which case, `c.text` contains the char sequence of the previous - // rule that matched) - v := types.Merge(value) - return len(v) > 0, nil +func (c *current) onListElementContinuationElement473(content interface{}) (interface{}, error) { + return types.NewParagraph(content) } -func (p *parser) callonPositionalAttribute36() (bool, error) { +func (p *parser) callonListElementContinuationElement473() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPositionalAttribute36(stack["value"]) + return p.cur.onListElementContinuationElement473(stack["content"]) } -func (c *current) onPositionalAttribute17(value interface{}) (interface{}, error) { - - return types.NewPositionalAttribute(nil) +func (c *current) onListElementContinuationElement150(term, separator, description interface{}) (interface{}, error) { + return types.NewLabeledListElement(len(separator.(string))-1, term, description) } -func (p *parser) callonPositionalAttribute17() (interface{}, error) { +func (p *parser) callonListElementContinuationElement150() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPositionalAttribute17(stack["value"]) + return p.cur.onListElementContinuationElement150(stack["term"], stack["separator"], stack["description"]) } -func (c *current) onNamedAttribute9() (interface{}, error) { +func (c *current) onListElementContinuationElement501() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonNamedAttribute9() (interface{}, error) { +func (p *parser) callonListElementContinuationElement501() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttribute9() + return p.cur.onListElementContinuationElement501() } -func (c *current) onNamedAttribute16() (interface{}, error) { +func (c *current) onListElementContinuationElement504() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonNamedAttribute16() (interface{}, error) { +func (p *parser) callonListElementContinuationElement504() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttribute16() + return p.cur.onListElementContinuationElement504() } -func (c *current) onNamedAttribute4() (interface{}, error) { - return strings.TrimSpace(string(c.text)), nil +func (c *current) onListElementContinuationElement495() (interface{}, error) { + return types.NewBlankLine() + } -func (p *parser) callonNamedAttribute4() (interface{}, error) { +func (p *parser) callonListElementContinuationElement495() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttribute4() + return p.cur.onListElementContinuationElement495() } -func (c *current) onNamedAttribute22() (interface{}, error) { +func (c *current) onListElementContinuationElement515() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonNamedAttribute22() (interface{}, error) { +func (p *parser) callonListElementContinuationElement515() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttribute22() + return p.cur.onListElementContinuationElement515() } -func (c *current) onNamedAttribute32() (interface{}, error) { +func (c *current) onListElementContinuationElement525() (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonNamedAttribute32() (interface{}, error) { +func (p *parser) callonListElementContinuationElement525() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttribute32() + return p.cur.onListElementContinuationElement525() } -func (c *current) onNamedAttribute1(key, value interface{}) (interface{}, error) { - // TODO: include `,` or expect `]` - return types.NewNamedAttribute(key.(string), value) +func (c *current) onListElementContinuationElement534() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonNamedAttribute1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement534() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttribute1(stack["key"], stack["value"]) + return p.cur.onListElementContinuationElement534() } -func (c *current) onAttributeValue14() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement543() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonAttributeValue14() (interface{}, error) { +func (p *parser) callonListElementContinuationElement543() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeValue14() + return p.cur.onListElementContinuationElement543() } -func (c *current) onAttributeValue1(value interface{}) (interface{}, error) { - return value, nil +func (c *current) onListElementContinuationElement548() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonAttributeValue1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement548() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeValue1(stack["value"]) + return p.cur.onListElementContinuationElement548() } -func (c *current) onSingleQuotedAttributeValue8() (interface{}, error) { - // = and , signs are allowed within ' quotes - return types.NewStringElement(string(c.text)) +func (c *current) onListElementContinuationElement555() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSingleQuotedAttributeValue8() (interface{}, error) { +func (p *parser) callonListElementContinuationElement555() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue8() + return p.cur.onListElementContinuationElement555() } -func (c *current) onSingleQuotedAttributeValue15() (interface{}, error) { +func (c *current) onListElementContinuationElement567() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSingleQuotedAttributeValue15() (interface{}, error) { +func (p *parser) callonListElementContinuationElement567() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue15() + return p.cur.onListElementContinuationElement567() } -func (c *current) onSingleQuotedAttributeValue11(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuationElement569() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonSingleQuotedAttributeValue11() (interface{}, error) { +func (p *parser) callonListElementContinuationElement569() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue11(stack["ref"]) + return p.cur.onListElementContinuationElement569() } -func (c *current) onSingleQuotedAttributeValue23() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement562(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonSingleQuotedAttributeValue23() (interface{}, error) { +func (p *parser) callonListElementContinuationElement562() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue23() + return p.cur.onListElementContinuationElement562(stack["start"]) } -func (c *current) onSingleQuotedAttributeValue19(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onListElementContinuationElement551(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSingleQuotedAttributeValue19() (interface{}, error) { +func (p *parser) callonListElementContinuationElement551() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue19(stack["name"]) + return p.cur.onListElementContinuationElement551(stack["name"], stack["start"]) } -func (c *current) onSingleQuotedAttributeValue29() (interface{}, error) { +func (c *current) onListElementContinuationElement577() (interface{}, error) { + return string(c.text), nil - return types.NewStringElement(`'`) // escaped quote +} +func (p *parser) callonListElementContinuationElement577() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElementContinuationElement577() } -func (p *parser) callonSingleQuotedAttributeValue29() (interface{}, error) { +func (c *current) onListElementContinuationElement589() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElementContinuationElement589() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue29() + return p.cur.onListElementContinuationElement589() } -func (c *current) onSingleQuotedAttributeValue32() (interface{}, error) { +func (c *current) onListElementContinuationElement591() (interface{}, error) { - return types.NewStringElement(string(c.text)) + return strconv.Atoi(string(c.text)) } -func (p *parser) callonSingleQuotedAttributeValue32() (interface{}, error) { +func (p *parser) callonListElementContinuationElement591() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue32() + return p.cur.onListElementContinuationElement591() } -func (c *current) onSingleQuotedAttributeValue1(elements interface{}) (interface{}, error) { - return types.Reduce(elements), nil +func (c *current) onListElementContinuationElement584(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonSingleQuotedAttributeValue1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement584() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue1(stack["elements"]) + return p.cur.onListElementContinuationElement584(stack["start"]) } -func (c *current) onDoubleQuotedAttributeValue8() (interface{}, error) { - // = and , signs are allowed within " quotes - return types.NewStringElement(string(c.text)) - +func (c *current) onListElementContinuationElement573(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonDoubleQuotedAttributeValue8() (interface{}, error) { +func (p *parser) callonListElementContinuationElement573() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue8() + return p.cur.onListElementContinuationElement573(stack["name"], stack["start"]) } -func (c *current) onDoubleQuotedAttributeValue15() (interface{}, error) { +func (c *current) onListElementContinuationElement599() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDoubleQuotedAttributeValue15() (interface{}, error) { +func (p *parser) callonListElementContinuationElement599() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue15() + return p.cur.onListElementContinuationElement599() } -func (c *current) onDoubleQuotedAttributeValue11(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuationElement595(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonDoubleQuotedAttributeValue11() (interface{}, error) { +func (p *parser) callonListElementContinuationElement595() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue11(stack["ref"]) + return p.cur.onListElementContinuationElement595(stack["name"]) } -func (c *current) onDoubleQuotedAttributeValue23() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement546(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonDoubleQuotedAttributeValue23() (interface{}, error) { +func (p *parser) callonListElementContinuationElement546() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue23() + return p.cur.onListElementContinuationElement546(stack["element"]) } -func (c *current) onDoubleQuotedAttributeValue19(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onListElementContinuationElement605() (interface{}, error) { + // standalone '{' + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonDoubleQuotedAttributeValue19() (interface{}, error) { +func (p *parser) callonListElementContinuationElement605() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue19(stack["name"]) + return p.cur.onListElementContinuationElement605() } -func (c *current) onDoubleQuotedAttributeValue29() (interface{}, error) { +func (c *current) onListElementContinuationElement530(element interface{}) (interface{}, error) { - return types.NewStringElement(`"`) // escaped quote + return element, nil } -func (p *parser) callonDoubleQuotedAttributeValue29() (interface{}, error) { +func (p *parser) callonListElementContinuationElement530() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue29() + return p.cur.onListElementContinuationElement530(stack["element"]) } -func (c *current) onDoubleQuotedAttributeValue32() (interface{}, error) { +func (c *current) onListElementContinuationElement523(elements interface{}) (interface{}, error) { + return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil - return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElementContinuationElement523() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElementContinuationElement523(stack["elements"]) +} +func (c *current) onListElementContinuationElement608() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDoubleQuotedAttributeValue32() (interface{}, error) { +func (p *parser) callonListElementContinuationElement608() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue32() + return p.cur.onListElementContinuationElement608() } -func (c *current) onDoubleQuotedAttributeValue1(elements interface{}) (interface{}, error) { - return types.Reduce(elements), nil +func (c *current) onListElementContinuationElement511(name, value interface{}) (interface{}, error) { + d := types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) + return d, nil } -func (p *parser) callonDoubleQuotedAttributeValue1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement511() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue1(stack["elements"]) + return p.cur.onListElementContinuationElement511(stack["name"], stack["value"]) } -func (c *current) onUnquotedAttributeValue6() (interface{}, error) { +func (c *current) onListElementContinuationElement619() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonUnquotedAttributeValue6() (interface{}, error) { +func (p *parser) callonListElementContinuationElement619() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue6() + return p.cur.onListElementContinuationElement619() } -func (c *current) onUnquotedAttributeValue12() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onListElementContinuationElement626() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonUnquotedAttributeValue12() (interface{}, error) { +func (p *parser) callonListElementContinuationElement626() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue12() + return p.cur.onListElementContinuationElement626() } -func (c *current) onUnquotedAttributeValue19() (interface{}, error) { +func (c *current) onListElementContinuationElement629() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonUnquotedAttributeValue19() (interface{}, error) { +func (p *parser) callonListElementContinuationElement629() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue19() + return p.cur.onListElementContinuationElement629() } -func (c *current) onUnquotedAttributeValue15(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuationElement615(name interface{}) (interface{}, error) { + return types.NewAttributeReset(name.(string)) } -func (p *parser) callonUnquotedAttributeValue15() (interface{}, error) { +func (p *parser) callonListElementContinuationElement615() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue15(stack["ref"]) + return p.cur.onListElementContinuationElement615(stack["name"]) } -func (c *current) onUnquotedAttributeValue27() (interface{}, error) { +func (c *current) onListElementContinuationElement640() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonUnquotedAttributeValue27() (interface{}, error) { +func (p *parser) callonListElementContinuationElement640() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue27() + return p.cur.onListElementContinuationElement640() } -func (c *current) onUnquotedAttributeValue23(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onListElementContinuationElement647() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonUnquotedAttributeValue23() (interface{}, error) { +func (p *parser) callonListElementContinuationElement647() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue23(stack["name"]) + return p.cur.onListElementContinuationElement647() } -func (c *current) onUnquotedAttributeValue33() (interface{}, error) { +func (c *current) onListElementContinuationElement650() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} - return types.NewStringElement(string(c.text)) +func (p *parser) callonListElementContinuationElement650() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElementContinuationElement650() +} +func (c *current) onListElementContinuationElement636(name interface{}) (interface{}, error) { + return types.NewAttributeReset(name.(string)) } -func (p *parser) callonUnquotedAttributeValue33() (interface{}, error) { +func (p *parser) callonListElementContinuationElement636() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue33() + return p.cur.onListElementContinuationElement636(stack["name"]) } -func (c *current) onUnquotedAttributeValue35(elements interface{}) (bool, error) { - // empty string is not a valid value - return types.Reduce(elements, strings.TrimSpace) != "", nil +func (c *current) onListElementContinuationElement658() (interface{}, error) { + // TODO: Space* before EOF + return types.NewThematicBreak() } -func (p *parser) callonUnquotedAttributeValue35() (bool, error) { +func (p *parser) callonListElementContinuationElement658() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue35(stack["elements"]) + return p.cur.onListElementContinuationElement658() } -func (c *current) onUnquotedAttributeValue1(elements interface{}) (interface{}, error) { - return types.Reduce(elements, strings.TrimSpace), nil +func (c *current) onListElementContinuationElement675() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonUnquotedAttributeValue1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement675() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue1(stack["elements"]) + return p.cur.onListElementContinuationElement675() } -func (c *current) onUserMacroBlock4() (interface{}, error) { +func (c *current) onListElementContinuationElement678() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonUserMacroBlock4() (interface{}, error) { +func (p *parser) callonListElementContinuationElement678() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUserMacroBlock4() + return p.cur.onListElementContinuationElement678() } -func (c *current) onUserMacroBlock7(name interface{}) (bool, error) { - // skip if no macro was registered under the given name - return c.globalStore.hasUserMacro(name.(string)), nil +func (c *current) onListElementContinuationElement695() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonUserMacroBlock7() (bool, error) { +func (p *parser) callonListElementContinuationElement695() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUserMacroBlock7(stack["name"]) + return p.cur.onListElementContinuationElement695() } -func (c *current) onUserMacroBlock10() (interface{}, error) { +func (c *current) onListElementContinuationElement701() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonUserMacroBlock10() (interface{}, error) { +func (p *parser) callonListElementContinuationElement701() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUserMacroBlock10() + return p.cur.onListElementContinuationElement701() } -func (c *current) onUserMacroBlock1(name, value, inlineAttributes interface{}) (interface{}, error) { - return types.NewUserMacroBlock(name.(string), value.(string), inlineAttributes, string(c.text)) +func (c *current) onListElementContinuationElement699(content interface{}) (interface{}, error) { + return types.NewRawContent(content.(string)) } -func (p *parser) callonUserMacroBlock1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement699() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUserMacroBlock1(stack["name"], stack["value"], stack["inlineAttributes"]) + return p.cur.onListElementContinuationElement699(stack["content"]) } -func (c *current) onInlineUserMacro4() (interface{}, error) { +func (c *current) onListElementContinuationElement691(content interface{}) (interface{}, error) { + return types.NewTableCell(content.(types.RawContent)) + +} + +func (p *parser) callonListElementContinuationElement691() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElementContinuationElement691(stack["content"]) +} + +func (c *current) onListElementContinuationElement705() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonInlineUserMacro4() (interface{}, error) { +func (p *parser) callonListElementContinuationElement705() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineUserMacro4() + return p.cur.onListElementContinuationElement705() } -func (c *current) onInlineUserMacro7(name interface{}) (bool, error) { - // skip if no macro was registered under the given name - return c.globalStore.hasUserMacro(name.(string)), nil +func (c *current) onListElementContinuationElement719() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonInlineUserMacro7() (bool, error) { +func (p *parser) callonListElementContinuationElement719() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineUserMacro7(stack["name"]) + return p.cur.onListElementContinuationElement719() } -func (c *current) onInlineUserMacro10() (interface{}, error) { +func (c *current) onListElementContinuationElement722() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonInlineUserMacro10() (interface{}, error) { +func (p *parser) callonListElementContinuationElement722() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineUserMacro10() + return p.cur.onListElementContinuationElement722() } -func (c *current) onInlineUserMacro1(name, value, inlineAttributes interface{}) (interface{}, error) { - return types.NewInlineUserMacro(name.(string), value.(string), inlineAttributes, string(c.text)) +func (c *current) onListElementContinuationElement713() (interface{}, error) { + return types.NewBlankLine() } -func (p *parser) callonInlineUserMacro1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement713() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineUserMacro1(stack["name"], stack["value"], stack["inlineAttributes"]) + return p.cur.onListElementContinuationElement713() } -func (c *current) onFileInclusion12() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" - return types.NewStringElement(string(c.text)) +func (c *current) onListElementContinuationElement687(cells interface{}) (interface{}, error) { + return types.NewTableRow(cells.([]interface{})) + } -func (p *parser) callonFileInclusion12() (interface{}, error) { +func (p *parser) callonListElementContinuationElement687() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion12() + return p.cur.onListElementContinuationElement687(stack["cells"]) } -func (c *current) onFileInclusion19() (interface{}, error) { +func (c *current) onListElementContinuationElement739() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonFileInclusion19() (interface{}, error) { +func (p *parser) callonListElementContinuationElement739() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion19() + return p.cur.onListElementContinuationElement739() } -func (c *current) onFileInclusion15(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuationElement742() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonFileInclusion15() (interface{}, error) { +func (p *parser) callonListElementContinuationElement742() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion15(stack["ref"]) + return p.cur.onListElementContinuationElement742() } -func (c *current) onFileInclusion8(path interface{}) (interface{}, error) { - return types.NewLocation("", path.([]interface{})) +func (c *current) onListElementContinuationElement763() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonFileInclusion8() (interface{}, error) { +func (p *parser) callonListElementContinuationElement763() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion8(stack["path"]) + return p.cur.onListElementContinuationElement763() } -func (c *current) onFileInclusion4(path, inlineAttributes interface{}) (interface{}, error) { +func (c *current) onListElementContinuationElement766() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} - return types.NewFileInclusion(path.(types.Location), inlineAttributes.(types.Attributes), string(c.text)) +func (p *parser) callonListElementContinuationElement766() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElementContinuationElement766() +} + +func (c *current) onListElementContinuationElement782() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonFileInclusion4() (interface{}, error) { +func (p *parser) callonListElementContinuationElement782() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion4(stack["path"], stack["inlineAttributes"]) + return p.cur.onListElementContinuationElement782() } -func (c *current) onFileInclusion28() (interface{}, error) { +func (c *current) onListElementContinuationElement785() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonFileInclusion28() (interface{}, error) { +func (p *parser) callonListElementContinuationElement785() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion28() + return p.cur.onListElementContinuationElement785() } -func (c *current) onFileInclusion1(incl interface{}) (interface{}, error) { - return incl.(types.FileInclusion), nil +func (c *current) onListElementContinuationElement776() (interface{}, error) { + return types.NewBlankLine() } -func (p *parser) callonFileInclusion1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement776() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion1(stack["incl"]) + return p.cur.onListElementContinuationElement776() } -func (c *current) onLineRanges17() (interface{}, error) { +func (c *current) onListElementContinuationElement794() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonLineRanges17() (interface{}, error) { +func (p *parser) callonListElementContinuationElement794() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges17() + return p.cur.onListElementContinuationElement794() } -func (c *current) onLineRanges12() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement800() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonLineRanges12() (interface{}, error) { +func (p *parser) callonListElementContinuationElement800() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges12() + return p.cur.onListElementContinuationElement800() } -func (c *current) onLineRanges26() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement798(content interface{}) (interface{}, error) { + return types.NewRawContent(content.(string)) + } -func (p *parser) callonLineRanges26() (interface{}, error) { +func (p *parser) callonListElementContinuationElement798() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges26() + return p.cur.onListElementContinuationElement798(stack["content"]) } -func (c *current) onLineRanges21() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement756(content interface{}) (interface{}, error) { + return types.NewTableCell(content.(types.RawContent)) + } -func (p *parser) callonLineRanges21() (interface{}, error) { +func (p *parser) callonListElementContinuationElement756() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges21() + return p.cur.onListElementContinuationElement756(stack["content"]) } -func (c *current) onLineRanges9(start, end interface{}) (interface{}, error) { - // eg: lines=12..14 - return types.NewLineRange(start.(int), end.(int)) +func (c *current) onListElementContinuationElement804() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} + +func (p *parser) callonListElementContinuationElement804() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElementContinuationElement804() +} + +func (c *current) onListElementContinuationElement753(cell interface{}) (interface{}, error) { + return cell, nil + } -func (p *parser) callonLineRanges9() (interface{}, error) { +func (p *parser) callonListElementContinuationElement753() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges9(stack["start"], stack["end"]) + return p.cur.onListElementContinuationElement753(stack["cell"]) } -func (c *current) onLineRanges35() (interface{}, error) { +func (c *current) onListElementContinuationElement819() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonLineRanges35() (interface{}, error) { +func (p *parser) callonListElementContinuationElement819() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges35() + return p.cur.onListElementContinuationElement819() } -func (c *current) onLineRanges30() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement822() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonLineRanges30() (interface{}, error) { +func (p *parser) callonListElementContinuationElement822() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges30() + return p.cur.onListElementContinuationElement822() } -func (c *current) onLineRanges28(singleline interface{}) (interface{}, error) { - // eg: lines=12 - return types.NewLineRange(singleline.(int), singleline.(int)) +func (c *current) onListElementContinuationElement813() (interface{}, error) { + return types.NewBlankLine() + } -func (p *parser) callonLineRanges28() (interface{}, error) { +func (p *parser) callonListElementContinuationElement813() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges28(stack["singleline"]) + return p.cur.onListElementContinuationElement813() } -func (c *current) onLineRanges52() (interface{}, error) { +func (c *current) onListElementContinuationElement834() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonLineRanges52() (interface{}, error) { +func (p *parser) callonListElementContinuationElement834() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges52() + return p.cur.onListElementContinuationElement834() } -func (c *current) onLineRanges47() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement837() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonLineRanges47() (interface{}, error) { +func (p *parser) callonListElementContinuationElement837() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges47() + return p.cur.onListElementContinuationElement837() } -func (c *current) onLineRanges61() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement732(cells interface{}) (interface{}, error) { + return types.NewTableRow(cells.([]interface{})) + } -func (p *parser) callonLineRanges61() (interface{}, error) { +func (p *parser) callonListElementContinuationElement732() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges61() + return p.cur.onListElementContinuationElement732(stack["cells"]) } -func (c *current) onLineRanges56() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement853() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonLineRanges56() (interface{}, error) { +func (p *parser) callonListElementContinuationElement853() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges56() + return p.cur.onListElementContinuationElement853() } -func (c *current) onLineRanges44(start, end interface{}) (interface{}, error) { - // eg: lines=12..14 - return types.NewLineRange(start.(int), end.(int)) +func (c *current) onListElementContinuationElement856() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonLineRanges44() (interface{}, error) { +func (p *parser) callonListElementContinuationElement856() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges44(stack["start"], stack["end"]) + return p.cur.onListElementContinuationElement856() } -func (c *current) onLineRanges70() (interface{}, error) { +func (c *current) onListElementContinuationElement874() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonLineRanges70() (interface{}, error) { +func (p *parser) callonListElementContinuationElement874() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges70() + return p.cur.onListElementContinuationElement874() } -func (c *current) onLineRanges65() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement877() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonLineRanges65() (interface{}, error) { +func (p *parser) callonListElementContinuationElement877() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges65() + return p.cur.onListElementContinuationElement877() } -func (c *current) onLineRanges63(singleline interface{}) (interface{}, error) { - // eg: lines=12 - return types.NewLineRange(singleline.(int), singleline.(int)) +func (c *current) onListElementContinuationElement893() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonLineRanges63() (interface{}, error) { +func (p *parser) callonListElementContinuationElement893() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges63(stack["singleline"]) + return p.cur.onListElementContinuationElement893() } -func (c *current) onLineRanges39(other interface{}) (interface{}, error) { - return other, nil - +func (c *current) onListElementContinuationElement896() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonLineRanges39() (interface{}, error) { +func (p *parser) callonListElementContinuationElement896() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges39(stack["other"]) + return p.cur.onListElementContinuationElement896() } -func (c *current) onLineRanges5(first, others interface{}) (interface{}, error) { - return append([]interface{}{first}, others.([]interface{})...), nil +func (c *current) onListElementContinuationElement887() (interface{}, error) { + return types.NewBlankLine() } -func (p *parser) callonLineRanges5() (interface{}, error) { +func (p *parser) callonListElementContinuationElement887() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges5(stack["first"], stack["others"]) + return p.cur.onListElementContinuationElement887() } -func (c *current) onLineRanges80() (interface{}, error) { +func (c *current) onListElementContinuationElement905() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonLineRanges80() (interface{}, error) { +func (p *parser) callonListElementContinuationElement905() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges80() + return p.cur.onListElementContinuationElement905() } -func (c *current) onLineRanges75() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement911() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonLineRanges75() (interface{}, error) { +func (p *parser) callonListElementContinuationElement911() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges75() + return p.cur.onListElementContinuationElement911() } -func (c *current) onLineRanges89() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement909(content interface{}) (interface{}, error) { + return types.NewRawContent(content.(string)) + } -func (p *parser) callonLineRanges89() (interface{}, error) { +func (p *parser) callonListElementContinuationElement909() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges89() + return p.cur.onListElementContinuationElement909(stack["content"]) } -func (c *current) onLineRanges84() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement867(content interface{}) (interface{}, error) { + return types.NewTableCell(content.(types.RawContent)) + } -func (p *parser) callonLineRanges84() (interface{}, error) { +func (p *parser) callonListElementContinuationElement867() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges84() + return p.cur.onListElementContinuationElement867(stack["content"]) } -func (c *current) onLineRanges72(start, end interface{}) (interface{}, error) { - // eg: lines=12..14 - return types.NewLineRange(start.(int), end.(int)) +func (c *current) onListElementContinuationElement915() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonLineRanges72() (interface{}, error) { +func (p *parser) callonListElementContinuationElement915() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges72(stack["start"], stack["end"]) + return p.cur.onListElementContinuationElement915() } -func (c *current) onLineRanges98() (interface{}, error) { +func (c *current) onListElementContinuationElement929() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonLineRanges98() (interface{}, error) { +func (p *parser) callonListElementContinuationElement929() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges98() + return p.cur.onListElementContinuationElement929() } -func (c *current) onLineRanges93() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement932() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonLineRanges93() (interface{}, error) { +func (p *parser) callonListElementContinuationElement932() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges93() + return p.cur.onListElementContinuationElement932() } -func (c *current) onLineRanges91(singleline interface{}) (interface{}, error) { - // eg: lines=12 - return types.NewLineRange(singleline.(int), singleline.(int)) +func (c *current) onListElementContinuationElement923() (interface{}, error) { + return types.NewBlankLine() + } -func (p *parser) callonLineRanges91() (interface{}, error) { +func (p *parser) callonListElementContinuationElement923() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges91(stack["singleline"]) + return p.cur.onListElementContinuationElement923() } -func (c *current) onLineRanges1(value interface{}) (interface{}, error) { - // must make sure that the whole content is parsed - return value, nil +func (c *current) onListElementContinuationElement846(cells interface{}) (interface{}, error) { + return types.NewTableRow(cells.([]interface{})) + } -func (p *parser) callonLineRanges1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement846() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges1(stack["value"]) + return p.cur.onListElementContinuationElement846(stack["cells"]) } -func (c *current) onTagRanges11() (interface{}, error) { +func (c *current) onListElementContinuationElement943() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonTagRanges11() (interface{}, error) { +func (p *parser) callonListElementContinuationElement943() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges11() + return p.cur.onListElementContinuationElement943() } -func (c *current) onTagRanges17() (interface{}, error) { +func (c *current) onListElementContinuationElement946() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil - } -func (p *parser) callonTagRanges17() (interface{}, error) { +func (p *parser) callonListElementContinuationElement946() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges17() + return p.cur.onListElementContinuationElement946() } -func (c *current) onTagRanges20(stars interface{}) (bool, error) { - - // use a predicate to make sure that only `*` and `**` are allowed - return len(stars.(string)) <= 2, nil +func (c *current) onListElementContinuationElement671(header, rows interface{}) (interface{}, error) { + return types.NewTable(header, rows.([]interface{})) } -func (p *parser) callonTagRanges20() (bool, error) { +func (p *parser) callonListElementContinuationElement671() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges20(stack["stars"]) + return p.cur.onListElementContinuationElement671(stack["header"], stack["rows"]) } -func (c *current) onTagRanges14(stars interface{}) (interface{}, error) { - return stars, nil +func (c *current) onListElementContinuationElement961() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonTagRanges14() (interface{}, error) { +func (p *parser) callonListElementContinuationElement961() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges14(stack["stars"]) + return p.cur.onListElementContinuationElement961() } -func (c *current) onTagRanges8(tag interface{}) (interface{}, error) { - return types.NewTagRange(tag.(string), true) +func (c *current) onListElementContinuationElement965() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonTagRanges8() (interface{}, error) { +func (p *parser) callonListElementContinuationElement965() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges8(stack["tag"]) + return p.cur.onListElementContinuationElement965() } -func (c *current) onTagRanges26() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement955(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + } -func (p *parser) callonTagRanges26() (interface{}, error) { +func (p *parser) callonListElementContinuationElement955() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges26() + return p.cur.onListElementContinuationElement955(stack["content"]) } -func (c *current) onTagRanges32() (interface{}, error) { - return string(c.text), nil - +func (c *current) onListElementContinuationElement976() (interface{}, error) { + return types.Tip, nil } -func (p *parser) callonTagRanges32() (interface{}, error) { +func (p *parser) callonListElementContinuationElement976() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges32() + return p.cur.onListElementContinuationElement976() } -func (c *current) onTagRanges35(stars interface{}) (bool, error) { - - // use a predicate to make sure that only `*` and `**` are allowed - return len(stars.(string)) <= 2, nil - +func (c *current) onListElementContinuationElement978() (interface{}, error) { + return types.Note, nil } -func (p *parser) callonTagRanges35() (bool, error) { +func (p *parser) callonListElementContinuationElement978() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges35(stack["stars"]) + return p.cur.onListElementContinuationElement978() } -func (c *current) onTagRanges29(stars interface{}) (interface{}, error) { - return stars, nil +func (c *current) onListElementContinuationElement980() (interface{}, error) { + return types.Important, nil } -func (p *parser) callonTagRanges29() (interface{}, error) { +func (p *parser) callonListElementContinuationElement980() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges29(stack["stars"]) + return p.cur.onListElementContinuationElement980() } -func (c *current) onTagRanges21(tag interface{}) (interface{}, error) { - return types.NewTagRange(tag.(string), false) +func (c *current) onListElementContinuationElement982() (interface{}, error) { + return types.Warning, nil } -func (p *parser) callonTagRanges21() (interface{}, error) { +func (p *parser) callonListElementContinuationElement982() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges21(stack["tag"]) + return p.cur.onListElementContinuationElement982() } -func (c *current) onTagRanges46() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement984() (interface{}, error) { + return types.Caution, nil } -func (p *parser) callonTagRanges46() (interface{}, error) { +func (p *parser) callonListElementContinuationElement984() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges46() + return p.cur.onListElementContinuationElement984() } -func (c *current) onTagRanges52() (interface{}, error) { +func (c *current) onListElementContinuationElement991() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonTagRanges52() (interface{}, error) { +func (p *parser) callonListElementContinuationElement991() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges52() + return p.cur.onListElementContinuationElement991() } -func (c *current) onTagRanges55(stars interface{}) (bool, error) { - - // use a predicate to make sure that only `*` and `**` are allowed - return len(stars.(string)) <= 2, nil +func (c *current) onListElementContinuationElement994(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil } -func (p *parser) callonTagRanges55() (bool, error) { +func (p *parser) callonListElementContinuationElement994() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges55(stack["stars"]) + return p.cur.onListElementContinuationElement994(stack["content"]) } -func (c *current) onTagRanges49(stars interface{}) (interface{}, error) { - return stars, nil +func (c *current) onListElementContinuationElement996() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonTagRanges49() (interface{}, error) { +func (p *parser) callonListElementContinuationElement996() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges49(stack["stars"]) + return p.cur.onListElementContinuationElement996() } -func (c *current) onTagRanges43(tag interface{}) (interface{}, error) { - return types.NewTagRange(tag.(string), true) +func (c *current) onListElementContinuationElement988(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + } -func (p *parser) callonTagRanges43() (interface{}, error) { +func (p *parser) callonListElementContinuationElement988() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges43(stack["tag"]) + return p.cur.onListElementContinuationElement988(stack["content"]) } -func (c *current) onTagRanges61() (interface{}, error) { +func (c *current) onListElementContinuationElement1011() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonTagRanges61() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1011() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges61() + return p.cur.onListElementContinuationElement1011() } -func (c *current) onTagRanges67() (interface{}, error) { +func (c *current) onListElementContinuationElement1013() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil - } -func (p *parser) callonTagRanges67() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1013() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges67() + return p.cur.onListElementContinuationElement1013() } -func (c *current) onTagRanges70(stars interface{}) (bool, error) { - - // use a predicate to make sure that only `*` and `**` are allowed - return len(stars.(string)) <= 2, nil +func (c *current) onListElementContinuationElement1026() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonTagRanges70() (bool, error) { +func (p *parser) callonListElementContinuationElement1026() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges70(stack["stars"]) + return p.cur.onListElementContinuationElement1026() } -func (c *current) onTagRanges64(stars interface{}) (interface{}, error) { - return stars, nil +func (c *current) onListElementContinuationElement1030() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonTagRanges64() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1030() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges64(stack["stars"]) + return p.cur.onListElementContinuationElement1030() } -func (c *current) onTagRanges56(tag interface{}) (interface{}, error) { - return types.NewTagRange(tag.(string), false) +func (c *current) onListElementContinuationElement1020(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + } -func (p *parser) callonTagRanges56() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1020() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges56(stack["tag"]) + return p.cur.onListElementContinuationElement1020(stack["content"]) } -func (c *current) onTagRanges38(other interface{}) (interface{}, error) { - return other, nil +func (c *current) onListElementContinuationElement1040() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonTagRanges38() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1040() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges38(stack["other"]) + return p.cur.onListElementContinuationElement1040() } -func (c *current) onTagRanges4(first, others interface{}) (interface{}, error) { - return append([]interface{}{first}, others.([]interface{})...), nil +func (c *current) onListElementContinuationElement1043(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil } -func (p *parser) callonTagRanges4() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1043() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges4(stack["first"], stack["others"]) + return p.cur.onListElementContinuationElement1043(stack["content"]) } -func (c *current) onTagRanges1(value interface{}) (interface{}, error) { - // must make sure that the whole content is parsed - return value, nil +func (c *current) onListElementContinuationElement1045() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonTagRanges1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1045() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges1(stack["value"]) + return p.cur.onListElementContinuationElement1045() } -func (c *current) onIncludedFileLine11() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement1037(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + } -func (p *parser) callonIncludedFileLine11() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1037() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine11() + return p.cur.onListElementContinuationElement1037(stack["content"]) } -func (c *current) onIncludedFileLine10() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement1005(line interface{}) (interface{}, error) { + return line, nil + } -func (p *parser) callonIncludedFileLine10() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1005() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine10() + return p.cur.onListElementContinuationElement1005(stack["line"]) } -func (c *current) onIncludedFileLine6(tag interface{}) (interface{}, error) { - return types.NewIncludedFileStartTag(tag.(string)) +func (c *current) onListElementContinuationElement972(kind, firstLine, otherLines interface{}) (interface{}, error) { + + return types.NewAdmonitionParagraph(kind.(string), append([]interface{}{firstLine}, otherLines.([]interface{})...)) + } -func (p *parser) callonIncludedFileLine6() (interface{}, error) { +func (p *parser) callonListElementContinuationElement972() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine6(stack["tag"]) + return p.cur.onListElementContinuationElement972(stack["kind"], stack["firstLine"], stack["otherLines"]) } -func (c *current) onIncludedFileLine20() (interface{}, error) { +func (c *current) onListElementContinuationElement1060() (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonIncludedFileLine20() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1060() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine20() + return p.cur.onListElementContinuationElement1060() } -func (c *current) onIncludedFileLine19() (interface{}, error) { +func (c *current) onListElementContinuationElement1058() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonIncludedFileLine19() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1058() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine19() + return p.cur.onListElementContinuationElement1058() } -func (c *current) onIncludedFileLine15(tag interface{}) (interface{}, error) { - return types.NewIncludedFileEndTag(tag.(string)) +func (c *current) onListElementContinuationElement1065(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + } -func (p *parser) callonIncludedFileLine15() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1065() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine15(stack["tag"]) + return p.cur.onListElementContinuationElement1065(stack["content"]) } -func (c *current) onIncludedFileLine24() (interface{}, error) { +func (c *current) onListElementContinuationElement1067() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonIncludedFileLine24() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1067() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine24() + return p.cur.onListElementContinuationElement1067() } -func (c *current) onIncludedFileLine1(content interface{}) (interface{}, error) { - return types.NewIncludedFileLine(content.([]interface{})) +func (c *current) onListElementContinuationElement1055(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + } -func (p *parser) callonIncludedFileLine1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1055() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine1(stack["content"]) + return p.cur.onListElementContinuationElement1055(stack["content"]) } -func (c *current) onListParagraph12() (interface{}, error) { +func (c *current) onListElementContinuationElement1083() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonListParagraph12() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1083() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraph12() + return p.cur.onListElementContinuationElement1083() } -func (c *current) onListParagraph21() (interface{}, error) { +func (c *current) onListElementContinuationElement1087() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonListParagraph21() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1087() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraph21() + return p.cur.onListElementContinuationElement1087() } -func (c *current) onListParagraph4(content interface{}) (interface{}, error) { +func (c *current) onListElementContinuationElement1077(content interface{}) (interface{}, error) { return types.NewSingleLineComment(content.(string)) + } -func (p *parser) callonListParagraph4() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1077() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraph4(stack["content"]) + return p.cur.onListElementContinuationElement1077(stack["content"]) } -func (c *current) onListParagraph2(comment interface{}) (interface{}, error) { - return comment, nil +func (c *current) onListElementContinuationElement1097() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonListParagraph2() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1097() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraph2(stack["comment"]) + return p.cur.onListElementContinuationElement1097() } -func (c *current) onListParagraph29(lines interface{}) (interface{}, error) { - return types.NewParagraph(lines.([]interface{}), nil) +func (c *current) onListElementContinuationElement1100(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil } -func (p *parser) callonListParagraph29() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1100() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraph29(stack["lines"]) + return p.cur.onListElementContinuationElement1100(stack["content"]) } -func (c *current) onListParagraphLine15() (interface{}, error) { +func (c *current) onListElementContinuationElement1102() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonListParagraphLine15() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1102() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine15() + return p.cur.onListElementContinuationElement1102() } -func (c *current) onListParagraphLine7() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onListElementContinuationElement1094(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + } -func (p *parser) callonListParagraphLine7() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1094() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine7() + return p.cur.onListElementContinuationElement1094(stack["content"]) } -func (c *current) onListParagraphLine31() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement1052(firstLine, otherLines interface{}) (interface{}, error) { + + return types.NewLiteralParagraph(types.LiteralBlockWithSpacesOnFirstLine, append([]interface{}{firstLine}, otherLines.([]interface{})...)) + } -func (p *parser) callonListParagraphLine31() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1052() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine31() + return p.cur.onListElementContinuationElement1052(stack["firstLine"], stack["otherLines"]) } -func (c *current) onListParagraphLine40() (interface{}, error) { +func (c *current) onListElementContinuationElement1112() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonListParagraphLine40() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1112() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine40() + return p.cur.onListElementContinuationElement1112() } -func (c *current) onListParagraphLine23(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onListElementContinuationElement1116() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonListParagraphLine23() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine23(stack["content"]) + return p.cur.onListElementContinuationElement1116() } -func (c *current) onListParagraphLine54() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement1109(content interface{}) (interface{}, error) { + // do not retain the EOL chars + return types.NewParagraph(types.RawLine(content.(string))) + } -func (p *parser) callonListParagraphLine54() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1109() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine54() + return p.cur.onListElementContinuationElement1109(stack["content"]) } -func (c *current) onListParagraphLine61() (interface{}, error) { - - // `.` is 1, etc. - return (len(c.text)), nil +func (c *current) onListElementContinuationElement1(attributes, element interface{}) (interface{}, error) { + if element, ok := element.(types.BlockWithAttributes); ok && attributes != nil { + element.AddAttributes(attributes.(types.Attributes)) + } + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("returning element '%s'\n", spew.Sdump(element)) + // } + return element, nil } -func (p *parser) callonListParagraphLine61() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine61() + return p.cur.onListElementContinuationElement1(stack["attributes"], stack["element"]) } -func (c *current) onListParagraphLine64(depth interface{}) (bool, error) { - - // use a predicate to make sure that only `.` to `.....` are allowed - return depth.(int) <= 5, nil +func (c *current) onCallout3() (bool, error) { + return c.isSubstitutionEnabled(Callouts) } -func (p *parser) callonListParagraphLine64() (bool, error) { +func (p *parser) callonCallout3() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine64(stack["depth"]) + return p.cur.onCallout3() } -func (c *current) onListParagraphLine58(depth interface{}) (interface{}, error) { - switch depth.(int) { - case 1: - return types.NewOrderedListItemPrefix(types.Arabic, 1) - case 2: - return types.NewOrderedListItemPrefix(types.LowerAlpha, 2) - case 3: - return types.NewOrderedListItemPrefix(types.LowerRoman, 3) - case 4: - return types.NewOrderedListItemPrefix(types.UpperAlpha, 4) - default: - return types.NewOrderedListItemPrefix(types.UpperRoman, 5) - } - +func (c *current) onCallout6() (interface{}, error) { + return strconv.Atoi(string(c.text)) } -func (p *parser) callonListParagraphLine58() (interface{}, error) { +func (p *parser) callonCallout6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine58(stack["depth"]) + return p.cur.onCallout6() } -func (c *current) onListParagraphLine65() (interface{}, error) { - // numbering style: "1." - return types.NewOrderedListItemPrefix(types.Arabic, 1) +func (c *current) onCallout11() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonListParagraphLine65() (interface{}, error) { +func (p *parser) callonCallout11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine65() + return p.cur.onCallout11() } -func (c *current) onListParagraphLine70() (interface{}, error) { - // numbering style: "a." - return types.NewOrderedListItemPrefix(types.LowerAlpha, 1) - +func (c *current) onCallout15() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonListParagraphLine70() (interface{}, error) { +func (p *parser) callonCallout15() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine70() + return p.cur.onCallout15() } -func (c *current) onListParagraphLine74() (interface{}, error) { - // numbering style: "A." - return types.NewOrderedListItemPrefix(types.UpperAlpha, 1) +func (c *current) onCallout1(ref interface{}) (interface{}, error) { + return types.NewCallout(ref.(int)) } -func (p *parser) callonListParagraphLine74() (interface{}, error) { +func (p *parser) callonCallout1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine74() + return p.cur.onCallout1(stack["ref"]) } -func (c *current) onListParagraphLine78() (interface{}, error) { - // numbering style: "i)" - return types.NewOrderedListItemPrefix(types.LowerRoman, 1) +func (c *current) onQuotedText2(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) } -func (p *parser) callonListParagraphLine78() (interface{}, error) { +func (p *parser) callonQuotedText2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine78() + return p.cur.onQuotedText2(stack["attributes"], stack["text"]) } -func (c *current) onListParagraphLine83() (interface{}, error) { - // numbering style: "I)" - return types.NewOrderedListItemPrefix(types.UpperRoman, 1) +func (c *current) onEscapedQuotedText1(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonListParagraphLine83() (interface{}, error) { +func (p *parser) callonEscapedQuotedText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine83() + return p.cur.onEscapedQuotedText1(stack["element"]) } -func (c *current) onListParagraphLine91() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldText1(elements interface{}) (interface{}, error) { + return types.NewQuotedText(types.DoubleQuoteBold, elements.([]interface{})) + } -func (p *parser) callonListParagraphLine91() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine91() + return p.cur.onDoubleQuoteBoldText1(stack["elements"]) } -func (c *current) onListParagraphLine49(prefix interface{}) (interface{}, error) { - return prefix, nil +func (c *current) onDoubleQuoteBoldTextElement13() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonListParagraphLine49() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine49(stack["prefix"]) + return p.cur.onDoubleQuoteBoldTextElement13() } -func (c *current) onListParagraphLine99() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement7() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonListParagraphLine99() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine99() + return p.cur.onDoubleQuoteBoldTextElement7() } -func (c *current) onListParagraphLine106() (interface{}, error) { - - // `*` is 1, etc. - return (len(c.text)), nil +func (c *current) onDoubleQuoteBoldTextElement16() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil } -func (p *parser) callonListParagraphLine106() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine106() + return p.cur.onDoubleQuoteBoldTextElement16() } -func (c *current) onListParagraphLine109(depth interface{}) (bool, error) { - - // use a predicate to make sure that only `*` to `*****` are allowed - return depth.(int) <= 5, nil - +func (c *current) onDoubleQuoteBoldTextElement20() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonListParagraphLine109() (bool, error) { +func (p *parser) callonDoubleQuoteBoldTextElement20() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine109(stack["depth"]) + return p.cur.onDoubleQuoteBoldTextElement20() } -func (c *current) onListParagraphLine103(depth interface{}) (interface{}, error) { - switch depth.(int) { - case 1: - return types.NewUnorderedListItemPrefix(types.OneAsterisk, 1) - case 2: - return types.NewUnorderedListItemPrefix(types.TwoAsterisks, 2) - case 3: - return types.NewUnorderedListItemPrefix(types.ThreeAsterisks, 3) - case 4: - return types.NewUnorderedListItemPrefix(types.FourAsterisks, 4) - default: - return types.NewUnorderedListItemPrefix(types.FiveAsterisks, 5) - } - +func (c *current) onDoubleQuoteBoldTextElement26() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonListParagraphLine103() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine103(stack["depth"]) + return p.cur.onDoubleQuoteBoldTextElement26() } -func (c *current) onListParagraphLine111() (interface{}, error) { - return types.NewUnorderedListItemPrefix(types.Dash, 1) +func (c *current) onDoubleQuoteBoldTextElement33() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonListParagraphLine111() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement33() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine111() + return p.cur.onDoubleQuoteBoldTextElement33() } -func (c *current) onListParagraphLine116() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement40() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonListParagraphLine116() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement40() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine116() + return p.cur.onDoubleQuoteBoldTextElement40() } -func (c *current) onListParagraphLine94(prefix interface{}) (interface{}, error) { - return prefix, nil +func (c *current) onDoubleQuoteBoldTextElement52() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonListParagraphLine94() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement52() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine94(stack["prefix"]) + return p.cur.onDoubleQuoteBoldTextElement52() } -func (c *current) onListParagraphLine123() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement54() (interface{}, error) { + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonListParagraphLine123() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine123() + return p.cur.onDoubleQuoteBoldTextElement54() } -func (c *current) onListParagraphLine130() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement47(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonListParagraphLine130() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement47() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine130() + return p.cur.onDoubleQuoteBoldTextElement47(stack["start"]) } -func (c *current) onListParagraphLine119(ref interface{}) (interface{}, error) { - return ref, nil +func (c *current) onDoubleQuoteBoldTextElement36(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonListParagraphLine119() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement36() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine119(stack["ref"]) + return p.cur.onDoubleQuoteBoldTextElement36(stack["name"], stack["start"]) } -func (c *current) onListParagraphLine138() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement62() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonListParagraphLine138() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement62() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine138() + return p.cur.onDoubleQuoteBoldTextElement62() } -func (c *current) onListParagraphLine156() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement74() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonListParagraphLine156() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement74() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine156() + return p.cur.onDoubleQuoteBoldTextElement74() } -func (c *current) onListParagraphLine168() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement76() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonListParagraphLine168() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement76() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine168() + return p.cur.onDoubleQuoteBoldTextElement76() } -func (c *current) onListParagraphLine180() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement69(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonListParagraphLine180() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement69() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine180() + return p.cur.onDoubleQuoteBoldTextElement69(stack["start"]) } -func (c *current) onListParagraphLine192() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement58(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonListParagraphLine192() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement58() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine192() + return p.cur.onDoubleQuoteBoldTextElement58(stack["name"], stack["start"]) } -func (c *current) onListParagraphLine204() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement84() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonListParagraphLine204() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement84() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine204() + return p.cur.onDoubleQuoteBoldTextElement84() } -func (c *current) onListParagraphLine216() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement80(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonListParagraphLine216() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine216() + return p.cur.onDoubleQuoteBoldTextElement80(stack["name"]) } -func (c *current) onListParagraphLine228() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement31(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonListParagraphLine228() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement31() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine228() + return p.cur.onDoubleQuoteBoldTextElement31(stack["element"]) } -func (c *current) onListParagraphLine239() (interface{}, error) { - return types.NewStringElement(strings.TrimSpace(string(c.text))) +func (c *current) onDoubleQuoteBoldTextElement92() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonListParagraphLine239() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement92() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine239() + return p.cur.onDoubleQuoteBoldTextElement92() } -func (c *current) onListParagraphLine237(content interface{}) (interface{}, error) { - return types.NewInlineElements(content) +func (c *current) onDoubleQuoteBoldTextElement101() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonListParagraphLine237() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement101() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine237(stack["content"]) + return p.cur.onDoubleQuoteBoldTextElement101() } -func (c *current) onListParagraphLine251() (interface{}, error) { - +func (c *current) onDoubleQuoteBoldTextElement105() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil } -func (p *parser) callonListParagraphLine251() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement105() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine251() + return p.cur.onDoubleQuoteBoldTextElement105() } -func (c *current) onListParagraphLine254(content, separator interface{}) (bool, error) { - - // use a predicate to make sure that only `::` to `::::` are allowed - return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil +func (c *current) onDoubleQuoteBoldTextElement111() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) } -func (p *parser) callonListParagraphLine254() (bool, error) { +func (p *parser) callonDoubleQuoteBoldTextElement111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine254(stack["content"], stack["separator"]) + return p.cur.onDoubleQuoteBoldTextElement111() } -func (c *current) onListParagraphLine259() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement118() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonListParagraphLine259() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement118() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine259() + return p.cur.onDoubleQuoteBoldTextElement118() } -func (c *current) onListParagraphLine248(content, separator interface{}) (interface{}, error) { - return separator, nil +func (c *current) onDoubleQuoteBoldTextElement125() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonListParagraphLine248() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement125() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine248(stack["content"], stack["separator"]) + return p.cur.onDoubleQuoteBoldTextElement125() } -func (c *current) onListParagraphLine273() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement137() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonListParagraphLine273() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine273() + return p.cur.onDoubleQuoteBoldTextElement137() } -func (c *current) onListParagraphLine268(elements interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement139() (interface{}, error) { - return types.NewInlineElements(elements.([]interface{})) + return strconv.Atoi(string(c.text)) } -func (p *parser) callonListParagraphLine268() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement139() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine268(stack["elements"]) + return p.cur.onDoubleQuoteBoldTextElement139() } -func (c *current) onListParagraphLine1(line interface{}) (interface{}, error) { - - return line, nil +func (c *current) onDoubleQuoteBoldTextElement132(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonListParagraphLine1() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement132() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine1(stack["line"]) + return p.cur.onDoubleQuoteBoldTextElement132(stack["start"]) } -func (c *current) onContinuedListItemElement7() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement121(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonContinuedListItemElement7() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement121() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemElement7() + return p.cur.onDoubleQuoteBoldTextElement121(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemElement1(element interface{}) (interface{}, error) { - return types.NewContinuedListItemElement(element) // offset is negative +func (c *current) onDoubleQuoteBoldTextElement147() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonContinuedListItemElement1() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement147() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemElement1(stack["element"]) + return p.cur.onDoubleQuoteBoldTextElement147() } -func (c *current) onContinuedListItemContent17() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement159() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent17() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement159() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent17() + return p.cur.onDoubleQuoteBoldTextElement159() } -func (c *current) onContinuedListItemContent26() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement161() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonContinuedListItemContent26() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement161() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent26() + return p.cur.onDoubleQuoteBoldTextElement161() } -func (c *current) onContinuedListItemContent9(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onDoubleQuoteBoldTextElement154(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonContinuedListItemContent9() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement154() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent9(stack["content"]) + return p.cur.onDoubleQuoteBoldTextElement154(stack["start"]) } -func (c *current) onContinuedListItemContent36() (interface{}, error) { - return types.NewThematicBreak() +func (c *current) onDoubleQuoteBoldTextElement143(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonContinuedListItemContent36() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement143() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent36() + return p.cur.onDoubleQuoteBoldTextElement143(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemContent61() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement169() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent61() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement169() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent61() + return p.cur.onDoubleQuoteBoldTextElement169() } -func (c *current) onContinuedListItemContent53() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onDoubleQuoteBoldTextElement165(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonContinuedListItemContent53() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent53() + return p.cur.onDoubleQuoteBoldTextElement165(stack["name"]) } -func (c *current) onContinuedListItemContent70() (bool, error) { - attrs := c.globalStore.getAttributes() - return types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Literal), nil +func (c *current) onDoubleQuoteBoldTextElement116(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonContinuedListItemContent70() (bool, error) { +func (p *parser) callonDoubleQuoteBoldTextElement116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent70() + return p.cur.onDoubleQuoteBoldTextElement116(stack["element"]) } -func (c *current) onContinuedListItemContent84() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement175() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonContinuedListItemContent84() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement175() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent84() + return p.cur.onDoubleQuoteBoldTextElement175() } -func (c *current) onContinuedListItemContent76() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onDoubleQuoteBoldTextElement97(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonContinuedListItemContent76() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent76() + return p.cur.onDoubleQuoteBoldTextElement97(stack["id"], stack["label"]) } -func (c *current) onContinuedListItemContent92() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onDoubleQuoteBoldTextElement182() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent92() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement182() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent92() + return p.cur.onDoubleQuoteBoldTextElement182() } -func (c *current) onContinuedListItemContent73(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onDoubleQuoteBoldTextElement178(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonContinuedListItemContent73() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent73(stack["content"]) + return p.cur.onDoubleQuoteBoldTextElement178(stack["id"]) } -func (c *current) onContinuedListItemContent68(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithAttribute, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onDoubleQuoteBoldTextElement95() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonContinuedListItemContent68() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement95() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent68(stack["lines"]) + return p.cur.onDoubleQuoteBoldTextElement95() } -func (c *current) onContinuedListItemContent113() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement186() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonContinuedListItemContent113() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent113() + return p.cur.onDoubleQuoteBoldTextElement186() } -func (c *current) onContinuedListItemContent108() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onDoubleQuoteBoldTextElement90(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonContinuedListItemContent108() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement90() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent108() + return p.cur.onDoubleQuoteBoldTextElement90(stack["element"]) } -func (c *current) onContinuedListItemContent105(line interface{}) (interface{}, error) { - // do not include the trailing 'EOL' on the first line - return line, nil +func (c *current) onDoubleQuoteBoldTextElement188() (interface{}, error) { + return types.NewStringElement("\u2019") + } -func (p *parser) callonContinuedListItemContent105() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement188() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent105(stack["line"]) + return p.cur.onDoubleQuoteBoldTextElement188() } -func (c *current) onContinuedListItemContent135() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement190() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonContinuedListItemContent135() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement190() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent135() + return p.cur.onDoubleQuoteBoldTextElement190() } -func (c *current) onContinuedListItemContent127() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onDoubleQuoteBoldTextElement192() (interface{}, error) { + return types.NewStringElement("\u2122") + } -func (p *parser) callonContinuedListItemContent127() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement192() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent127() + return p.cur.onDoubleQuoteBoldTextElement192() } -func (c *current) onContinuedListItemContent143() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onDoubleQuoteBoldTextElement194() (interface{}, error) { + return types.NewStringElement("\u00ae") + } -func (p *parser) callonContinuedListItemContent143() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement194() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent143() + return p.cur.onDoubleQuoteBoldTextElement194() } -func (c *current) onContinuedListItemContent124(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onDoubleQuoteBoldTextElement196() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonContinuedListItemContent124() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement196() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent124(stack["content"]) + return p.cur.onDoubleQuoteBoldTextElement196() } -func (c *current) onContinuedListItemContent102(firstLine, otherLines interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement198() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil } -func (p *parser) callonContinuedListItemContent102() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement198() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent102(stack["firstLine"], stack["otherLines"]) + return p.cur.onDoubleQuoteBoldTextElement198() } -func (c *current) onContinuedListItemContent100(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithSpacesOnFirstLine, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onDoubleQuoteBoldTextElement211() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonContinuedListItemContent100() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement211() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent100(stack["lines"]) + return p.cur.onDoubleQuoteBoldTextElement211() } -func (c *current) onContinuedListItemContent157() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement207(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonContinuedListItemContent157() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement207() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent157() + return p.cur.onDoubleQuoteBoldTextElement207(stack["ref"]) } -func (c *current) onContinuedListItemContent169() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onDoubleQuoteBoldTextElement219() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonContinuedListItemContent169() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement219() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent169() + return p.cur.onDoubleQuoteBoldTextElement219() } -func (c *current) onContinuedListItemContent166(line interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement216() (interface{}, error) { + // or a bold delimiter when immediately followed by an alphanum (ie, in the middle of some text) + return types.NewStringElement(string(c.text)) - return line, nil // do not include the trailing 'EOL' } -func (p *parser) callonContinuedListItemContent166() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement216() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent166(stack["line"]) + return p.cur.onDoubleQuoteBoldTextElement216() } -func (c *current) onContinuedListItemContent163(lines interface{}) (interface{}, error) { - return lines.([]interface{}), nil +func (c *current) onDoubleQuoteBoldTextElement1(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonContinuedListItemContent163() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent163(stack["lines"]) + return p.cur.onDoubleQuoteBoldTextElement1(stack["element"]) } -func (c *current) onContinuedListItemContent186() (interface{}, error) { - return string(c.text), nil +func (c *current) onQuotedTextInDoubleQuoteBoldText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -func (p *parser) callonContinuedListItemContent186() (interface{}, error) { +func (p *parser) callonQuotedTextInDoubleQuoteBoldText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent186() + return p.cur.onQuotedTextInDoubleQuoteBoldText1(stack["attributes"], stack["text"]) } -func (c *current) onContinuedListItemContent151(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithDelimiter, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuoteBoldText1(elements interface{}) (interface{}, error) { + return types.NewQuotedText(types.SingleQuoteBold, elements.([]interface{})) + } -func (p *parser) callonContinuedListItemContent151() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent151(stack["lines"]) + return p.cur.onSingleQuoteBoldText1(stack["elements"]) } -func (c *current) onContinuedListItemContent199() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElements7() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent199() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElements7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent199() + return p.cur.onSingleQuoteBoldTextElements7() } -func (c *current) onContinuedListItemContent212() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElements12(elements interface{}) (bool, error) { + return validateSingleQuoteElements(elements.([]interface{})) // cannot end with spaces + } -func (p *parser) callonContinuedListItemContent212() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElements12() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent212() + return p.cur.onSingleQuoteBoldTextElements12(stack["elements"]) } -func (c *current) onContinuedListItemContent217() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteBoldTextElements1(elements interface{}) (interface{}, error) { + return elements, nil } -func (p *parser) callonContinuedListItemContent217() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElements1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent217() + return p.cur.onSingleQuoteBoldTextElements1(stack["elements"]) } -func (c *current) onContinuedListItemContent224() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement8() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent224() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement8() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent224() + return p.cur.onSingleQuoteBoldTextElement8() } -func (c *current) onContinuedListItemContent236() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement2() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonContinuedListItemContent236() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent236() + return p.cur.onSingleQuoteBoldTextElement2() } -func (c *current) onContinuedListItemContent238() (interface{}, error) { - - return strconv.Atoi(string(c.text)) +func (c *current) onSingleQuoteBoldTextElement11() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil } -func (p *parser) callonContinuedListItemContent238() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent238() + return p.cur.onSingleQuoteBoldTextElement11() } -func (c *current) onContinuedListItemContent231(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onSingleQuoteBoldTextElement15() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil +} +func (p *parser) callonSingleQuoteBoldTextElement15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSingleQuoteBoldTextElement15() +} + +func (c *current) onSingleQuoteBoldTextElement21() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonContinuedListItemContent231() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement21() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent231(stack["start"]) + return p.cur.onSingleQuoteBoldTextElement21() } -func (c *current) onContinuedListItemContent220(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), false, start) +func (c *current) onSingleQuoteBoldTextElement28() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonContinuedListItemContent220() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement28() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent220(stack["name"], stack["start"]) + return p.cur.onSingleQuoteBoldTextElement28() } -func (c *current) onContinuedListItemContent246() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement35() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent246() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent246() + return p.cur.onSingleQuoteBoldTextElement35() } -func (c *current) onContinuedListItemContent258() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement47() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonContinuedListItemContent258() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement47() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent258() + return p.cur.onSingleQuoteBoldTextElement47() } -func (c *current) onContinuedListItemContent260() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement49() (interface{}, error) { return strconv.Atoi(string(c.text)) } -func (p *parser) callonContinuedListItemContent260() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement49() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent260() + return p.cur.onSingleQuoteBoldTextElement49() } -func (c *current) onContinuedListItemContent253(start interface{}) (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement42(start interface{}) (interface{}, error) { return start, nil } -func (p *parser) callonContinuedListItemContent253() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent253(stack["start"]) + return p.cur.onSingleQuoteBoldTextElement42(stack["start"]) } -func (c *current) onContinuedListItemContent242(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), true, nil) +func (c *current) onSingleQuoteBoldTextElement31(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonContinuedListItemContent242() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement31() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent242(stack["name"], stack["start"]) + return p.cur.onSingleQuoteBoldTextElement31(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemContent268() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement57() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent268() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement57() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent268() + return p.cur.onSingleQuoteBoldTextElement57() } -func (c *current) onContinuedListItemContent264(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onSingleQuoteBoldTextElement69() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent264() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement69() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent264(stack["name"]) + return p.cur.onSingleQuoteBoldTextElement69() } -func (c *current) onContinuedListItemContent274() (interface{}, error) { - // standalone '{' - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteBoldTextElement71() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonContinuedListItemContent274() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement71() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent274() + return p.cur.onSingleQuoteBoldTextElement71() } -func (c *current) onContinuedListItemContent207(elements interface{}) (interface{}, error) { - return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil +func (c *current) onSingleQuoteBoldTextElement64(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonContinuedListItemContent207() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement64() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent207(stack["elements"]) + return p.cur.onSingleQuoteBoldTextElement64(stack["start"]) } -func (c *current) onContinuedListItemContent195(name, value interface{}) (interface{}, error) { - return types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) +func (c *current) onSingleQuoteBoldTextElement53(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonContinuedListItemContent195() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement53() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent195(stack["name"], stack["value"]) + return p.cur.onSingleQuoteBoldTextElement53(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemContent285() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement79() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent285() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement79() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent285() + return p.cur.onSingleQuoteBoldTextElement79() } -func (c *current) onContinuedListItemContent294() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement75(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonContinuedListItemContent294() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement75() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent294() + return p.cur.onSingleQuoteBoldTextElement75(stack["name"]) } -func (c *current) onContinuedListItemContent281(name interface{}) (interface{}, error) { - return types.NewAttributeReset(name.(string)) +func (c *current) onSingleQuoteBoldTextElement26(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonContinuedListItemContent281() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent281(stack["name"]) + return p.cur.onSingleQuoteBoldTextElement26(stack["element"]) } -func (c *current) onContinuedListItemContent305() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement87() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonContinuedListItemContent305() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement87() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent305() + return p.cur.onSingleQuoteBoldTextElement87() } -func (c *current) onContinuedListItemContent314() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement96() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil -} - -func (p *parser) callonContinuedListItemContent314() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onContinuedListItemContent314() -} -func (c *current) onContinuedListItemContent301(name interface{}) (interface{}, error) { - return types.NewAttributeReset(name.(string)) } -func (p *parser) callonContinuedListItemContent301() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement96() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent301(stack["name"]) + return p.cur.onSingleQuoteBoldTextElement96() } -func (c *current) onContinuedListItemContent333() (interface{}, error) { - return types.Tip, nil +func (c *current) onSingleQuoteBoldTextElement100() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent333() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement100() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent333() + return p.cur.onSingleQuoteBoldTextElement100() } -func (c *current) onContinuedListItemContent335() (interface{}, error) { - return types.Note, nil +func (c *current) onSingleQuoteBoldTextElement106() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonContinuedListItemContent335() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement106() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent335() + return p.cur.onSingleQuoteBoldTextElement106() } -func (c *current) onContinuedListItemContent337() (interface{}, error) { - return types.Important, nil +func (c *current) onSingleQuoteBoldTextElement113() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonContinuedListItemContent337() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement113() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent337() + return p.cur.onSingleQuoteBoldTextElement113() } -func (c *current) onContinuedListItemContent339() (interface{}, error) { - return types.Warning, nil +func (c *current) onSingleQuoteBoldTextElement120() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent339() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement120() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent339() + return p.cur.onSingleQuoteBoldTextElement120() } -func (c *current) onContinuedListItemContent341() (interface{}, error) { - return types.Caution, nil +func (c *current) onSingleQuoteBoldTextElement132() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent341() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement132() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent341() + return p.cur.onSingleQuoteBoldTextElement132() } -func (c *current) onContinuedListItemContent355() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement134() (interface{}, error) { - return types.NewStringElement(string(c.text)) + return strconv.Atoi(string(c.text)) } -func (p *parser) callonContinuedListItemContent355() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement134() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent355() + return p.cur.onSingleQuoteBoldTextElement134() } -func (c *current) onContinuedListItemContent364() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteBoldTextElement127(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonContinuedListItemContent364() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement127() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent364() + return p.cur.onSingleQuoteBoldTextElement127(stack["start"]) } -func (c *current) onContinuedListItemContent351(elements interface{}) (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement116(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonContinuedListItemContent351() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent351(stack["elements"]) + return p.cur.onSingleQuoteBoldTextElement116(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemContent348(content interface{}) (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement142() (interface{}, error) { + return string(c.text), nil - return types.NewRawLine(content.(string)) } -func (p *parser) callonContinuedListItemContent348() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement142() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent348(stack["content"]) + return p.cur.onSingleQuoteBoldTextElement142() } -func (c *current) onContinuedListItemContent390() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement154() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent390() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement154() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent390() + return p.cur.onSingleQuoteBoldTextElement154() } -func (c *current) onContinuedListItemContent405() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onSingleQuoteBoldTextElement156() (interface{}, error) { -func (p *parser) callonContinuedListItemContent405() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onContinuedListItemContent405() -} + return strconv.Atoi(string(c.text)) -func (c *current) onContinuedListItemContent414() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonContinuedListItemContent414() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement156() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent414() + return p.cur.onSingleQuoteBoldTextElement156() } -func (c *current) onContinuedListItemContent397(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onSingleQuoteBoldTextElement149(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonContinuedListItemContent397() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement149() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent397(stack["content"]) + return p.cur.onSingleQuoteBoldTextElement149(stack["start"]) } -func (c *current) onContinuedListItemContent435() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement138(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonContinuedListItemContent435() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement138() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent435() + return p.cur.onSingleQuoteBoldTextElement138(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemContent447() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement164() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent447() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement164() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent447() + return p.cur.onSingleQuoteBoldTextElement164() } -func (c *current) onContinuedListItemContent459() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement160(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonContinuedListItemContent459() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement160() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent459() + return p.cur.onSingleQuoteBoldTextElement160(stack["name"]) } -func (c *current) onContinuedListItemContent471() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement111(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonContinuedListItemContent471() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent471() + return p.cur.onSingleQuoteBoldTextElement111(stack["element"]) } -func (c *current) onContinuedListItemContent483() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement170() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonContinuedListItemContent483() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement170() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent483() + return p.cur.onSingleQuoteBoldTextElement170() } -func (c *current) onContinuedListItemContent495() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement92(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonContinuedListItemContent495() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement92() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent495() + return p.cur.onSingleQuoteBoldTextElement92(stack["id"], stack["label"]) } -func (c *current) onContinuedListItemContent507() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement177() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent507() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement177() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent507() + return p.cur.onSingleQuoteBoldTextElement177() } -func (c *current) onContinuedListItemContent515() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement173(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) - return string(c.text), nil } -func (p *parser) callonContinuedListItemContent515() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement173() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent515() + return p.cur.onSingleQuoteBoldTextElement173(stack["id"]) } -func (c *current) onContinuedListItemContent523(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onSingleQuoteBoldTextElement90() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonContinuedListItemContent523() (bool, error) { +func (p *parser) callonSingleQuoteBoldTextElement90() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent523(stack["content"]) + return p.cur.onSingleQuoteBoldTextElement90() } -func (c *current) onContinuedListItemContent422(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onSingleQuoteBoldTextElement181() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonContinuedListItemContent422() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement181() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent422(stack["content"]) + return p.cur.onSingleQuoteBoldTextElement181() } -func (c *current) onContinuedListItemContent382(line interface{}) (interface{}, error) { - return line, nil +func (c *current) onSingleQuoteBoldTextElement85(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonContinuedListItemContent382() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent382(stack["line"]) + return p.cur.onSingleQuoteBoldTextElement85(stack["element"]) } -func (c *current) onContinuedListItemContent345(firstLine, otherLines interface{}) (interface{}, error) { - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil +func (c *current) onSingleQuoteBoldTextElement183() (interface{}, error) { + return types.NewStringElement("\u2019") + } -func (p *parser) callonContinuedListItemContent345() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement183() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent345(stack["firstLine"], stack["otherLines"]) + return p.cur.onSingleQuoteBoldTextElement183() } -func (c *current) onContinuedListItemContent329(t, lines interface{}) (interface{}, error) { - - return types.NewAdmonitionParagraph(lines.([]interface{}), t.(string), c.globalStore.getAttributes()) +func (c *current) onSingleQuoteBoldTextElement185() (interface{}, error) { + return types.NewStringElement("\u00a9") } -func (p *parser) callonContinuedListItemContent329() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement185() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent329(stack["t"], stack["lines"]) + return p.cur.onSingleQuoteBoldTextElement185() } -func (c *current) onContinuedListItemContent536() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteBoldTextElement187() (interface{}, error) { + return types.NewStringElement("\u2122") } -func (p *parser) callonContinuedListItemContent536() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement187() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent536() + return p.cur.onSingleQuoteBoldTextElement187() } -func (c *current) onContinuedListItemContent545() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteBoldTextElement189() (interface{}, error) { + return types.NewStringElement("\u00ae") } -func (p *parser) callonContinuedListItemContent545() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement189() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent545() + return p.cur.onSingleQuoteBoldTextElement189() } -func (c *current) onContinuedListItemContent532(elements interface{}) (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement191() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonContinuedListItemContent532() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement191() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent532(stack["elements"]) + return p.cur.onSingleQuoteBoldTextElement191() } -func (c *current) onContinuedListItemContent529(content interface{}) (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement193() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") - return types.NewRawLine(content.(string)) } -func (p *parser) callonContinuedListItemContent529() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement193() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent529(stack["content"]) + return p.cur.onSingleQuoteBoldTextElement193() } -func (c *current) onContinuedListItemContent571() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement206() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonContinuedListItemContent571() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement206() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent571() + return p.cur.onSingleQuoteBoldTextElement206() } -func (c *current) onContinuedListItemContent586() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement202(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonContinuedListItemContent586() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement202() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent586() + return p.cur.onSingleQuoteBoldTextElement202(stack["ref"]) } -func (c *current) onContinuedListItemContent595() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement214() (interface{}, error) { return string(c.text), nil -} - -func (p *parser) callonContinuedListItemContent595() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onContinuedListItemContent595() -} -func (c *current) onContinuedListItemContent578(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) } -func (p *parser) callonContinuedListItemContent578() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent578(stack["content"]) + return p.cur.onSingleQuoteBoldTextElement214() } -func (c *current) onContinuedListItemContent616() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement211() (interface{}, error) { + // or a bold delimiter when immediately followed by an alphanum (ie, in the middle of some text) + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonContinuedListItemContent616() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement211() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent616() + return p.cur.onSingleQuoteBoldTextElement211() } -func (c *current) onContinuedListItemContent628() (interface{}, error) { - return string(c.text), nil +func (c *current) onQuotedTextInSingleQuoteBoldText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -func (p *parser) callonContinuedListItemContent628() (interface{}, error) { +func (p *parser) callonQuotedTextInSingleQuoteBoldText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent628() + return p.cur.onQuotedTextInSingleQuoteBoldText1(stack["attributes"], stack["text"]) } -func (c *current) onContinuedListItemContent640() (interface{}, error) { +func (c *current) onEscapedBoldText5() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent640() (interface{}, error) { +func (p *parser) callonEscapedBoldText5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent640() + return p.cur.onEscapedBoldText5() } -func (c *current) onContinuedListItemContent652() (interface{}, error) { - return string(c.text), nil +func (c *current) onEscapedBoldText2(backslashes, elements interface{}) (interface{}, error) { + // double punctuation must be evaluated first + return types.NewEscapedQuotedText(backslashes.(string), "**", elements.([]interface{})) + } -func (p *parser) callonContinuedListItemContent652() (interface{}, error) { +func (p *parser) callonEscapedBoldText2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent652() + return p.cur.onEscapedBoldText2(stack["backslashes"], stack["elements"]) } -func (c *current) onContinuedListItemContent664() (interface{}, error) { +func (c *current) onEscapedBoldText17() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent664() (interface{}, error) { +func (p *parser) callonEscapedBoldText17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent664() + return p.cur.onEscapedBoldText17() } -func (c *current) onContinuedListItemContent676() (interface{}, error) { - return string(c.text), nil +func (c *current) onEscapedBoldText14(backslashes, elements interface{}) (interface{}, error) { + // unbalanced `**` vs `*` punctuation + result := append([]interface{}{"*"}, elements.([]interface{})) + return types.NewEscapedQuotedText(backslashes.(string), "*", result) + } -func (p *parser) callonContinuedListItemContent676() (interface{}, error) { +func (p *parser) callonEscapedBoldText14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent676() + return p.cur.onEscapedBoldText14(stack["backslashes"], stack["elements"]) } -func (c *current) onContinuedListItemContent688() (interface{}, error) { +func (c *current) onEscapedBoldText27() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent688() (interface{}, error) { +func (p *parser) callonEscapedBoldText27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent688() + return p.cur.onEscapedBoldText27() } -func (c *current) onContinuedListItemContent696() (interface{}, error) { +func (c *current) onEscapedBoldText24(backslashes, elements interface{}) (interface{}, error) { + // simple punctuation must be evaluated last + return types.NewEscapedQuotedText(backslashes.(string), "*", elements.([]interface{})) - return string(c.text), nil } -func (p *parser) callonContinuedListItemContent696() (interface{}, error) { +func (p *parser) callonEscapedBoldText24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent696() + return p.cur.onEscapedBoldText24(stack["backslashes"], stack["elements"]) } -func (c *current) onContinuedListItemContent704(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onDoubleQuoteItalicText1(elements interface{}) (interface{}, error) { + // double punctuation must be evaluated first + return types.NewQuotedText(types.DoubleQuoteItalic, elements.([]interface{})) } -func (p *parser) callonContinuedListItemContent704() (bool, error) { +func (p *parser) callonDoubleQuoteItalicText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent704(stack["content"]) + return p.cur.onDoubleQuoteItalicText1(stack["elements"]) } -func (c *current) onContinuedListItemContent603(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onDoubleQuoteItalicTextElement13() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonContinuedListItemContent603() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent603(stack["content"]) -} - -func (c *current) onContinuedListItemContent563(line interface{}) (interface{}, error) { - return line, nil + return p.cur.onDoubleQuoteItalicTextElement13() } -func (p *parser) callonContinuedListItemContent563() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onContinuedListItemContent563(stack["line"]) -} +func (c *current) onDoubleQuoteItalicTextElement7() (interface{}, error) { + return types.NewStringElement(string(c.text)) -func (c *current) onContinuedListItemContent526(firstLine, otherLines interface{}) (interface{}, error) { - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil } -func (p *parser) callonContinuedListItemContent526() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent526(stack["firstLine"], stack["otherLines"]) + return p.cur.onDoubleQuoteItalicTextElement7() } -func (c *current) onContinuedListItemContent524(lines interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement16() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil - return types.NewParagraph(lines.([]interface{}), c.globalStore.getAttributes()) } -func (p *parser) callonContinuedListItemContent524() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent524(stack["lines"]) + return p.cur.onDoubleQuoteItalicTextElement16() } -func (c *current) onContinuedListItemContent1(content interface{}) (interface{}, error) { - return content, nil +func (c *current) onDoubleQuoteItalicTextElement20() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonContinuedListItemContent1() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement20() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent1(stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement20() } -func (c *current) onOrderedListItem9() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement26() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonOrderedListItem9() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem9() + return p.cur.onDoubleQuoteItalicTextElement26() } -func (c *current) onOrderedListItem16() (interface{}, error) { - - // `.` is 1, etc. - return (len(c.text)), nil +func (c *current) onDoubleQuoteItalicTextElement33() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonOrderedListItem16() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement33() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem16() + return p.cur.onDoubleQuoteItalicTextElement33() } -func (c *current) onOrderedListItem19(depth interface{}) (bool, error) { - - // use a predicate to make sure that only `.` to `.....` are allowed - return depth.(int) <= 5, nil +func (c *current) onDoubleQuoteItalicTextElement40() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonOrderedListItem19() (bool, error) { +func (p *parser) callonDoubleQuoteItalicTextElement40() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem19(stack["depth"]) + return p.cur.onDoubleQuoteItalicTextElement40() } -func (c *current) onOrderedListItem13(depth interface{}) (interface{}, error) { - switch depth.(int) { - case 1: - return types.NewOrderedListItemPrefix(types.Arabic, 1) - case 2: - return types.NewOrderedListItemPrefix(types.LowerAlpha, 2) - case 3: - return types.NewOrderedListItemPrefix(types.LowerRoman, 3) - case 4: - return types.NewOrderedListItemPrefix(types.UpperAlpha, 4) - default: - return types.NewOrderedListItemPrefix(types.UpperRoman, 5) - } +func (c *current) onDoubleQuoteItalicTextElement52() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonOrderedListItem13() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement52() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem13(stack["depth"]) + return p.cur.onDoubleQuoteItalicTextElement52() } -func (c *current) onOrderedListItem20() (interface{}, error) { - // numbering style: "1." - return types.NewOrderedListItemPrefix(types.Arabic, 1) +func (c *current) onDoubleQuoteItalicTextElement54() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonOrderedListItem20() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem20() + return p.cur.onDoubleQuoteItalicTextElement54() } -func (c *current) onOrderedListItem25() (interface{}, error) { - // numbering style: "a." - return types.NewOrderedListItemPrefix(types.LowerAlpha, 1) +func (c *current) onDoubleQuoteItalicTextElement47(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonOrderedListItem25() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement47() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem25() + return p.cur.onDoubleQuoteItalicTextElement47(stack["start"]) } -func (c *current) onOrderedListItem29() (interface{}, error) { - // numbering style: "A." - return types.NewOrderedListItemPrefix(types.UpperAlpha, 1) - +func (c *current) onDoubleQuoteItalicTextElement36(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonOrderedListItem29() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement36() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem29() + return p.cur.onDoubleQuoteItalicTextElement36(stack["name"], stack["start"]) } -func (c *current) onOrderedListItem33() (interface{}, error) { - // numbering style: "i)" - return types.NewOrderedListItemPrefix(types.LowerRoman, 1) +func (c *current) onDoubleQuoteItalicTextElement62() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonOrderedListItem33() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement62() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem33() + return p.cur.onDoubleQuoteItalicTextElement62() } -func (c *current) onOrderedListItem38() (interface{}, error) { - // numbering style: "I)" - return types.NewOrderedListItemPrefix(types.UpperRoman, 1) +func (c *current) onDoubleQuoteItalicTextElement74() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonOrderedListItem38() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement74() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem38() + return p.cur.onDoubleQuoteItalicTextElement74() } -func (c *current) onOrderedListItem46() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onDoubleQuoteItalicTextElement76() (interface{}, error) { -func (p *parser) callonOrderedListItem46() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onOrderedListItem46() -} + return strconv.Atoi(string(c.text)) -func (c *current) onOrderedListItem4(prefix interface{}) (interface{}, error) { - return prefix, nil } -func (p *parser) callonOrderedListItem4() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement76() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem4(stack["prefix"]) + return p.cur.onDoubleQuoteItalicTextElement76() } -func (c *current) onOrderedListItem1(prefix, content interface{}) (interface{}, error) { - return types.NewOrderedListItem(prefix.(types.OrderedListItemPrefix), content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onDoubleQuoteItalicTextElement69(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonOrderedListItem1() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement69() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem1(stack["prefix"], stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement69(stack["start"]) } -func (c *current) onOrderedListItemContent1(elements interface{}) (interface{}, error) { - return types.NewListItemContent(elements.([]interface{})) +func (c *current) onDoubleQuoteItalicTextElement58(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonOrderedListItemContent1() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement58() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItemContent1(stack["elements"]) + return p.cur.onDoubleQuoteItalicTextElement58(stack["name"], stack["start"]) } -func (c *current) onUnorderedListItem9() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement84() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonUnorderedListItem9() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement84() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem9() + return p.cur.onDoubleQuoteItalicTextElement84() } -func (c *current) onUnorderedListItem16() (interface{}, error) { - - // `*` is 1, etc. - return (len(c.text)), nil +func (c *current) onDoubleQuoteItalicTextElement80(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonUnorderedListItem16() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem16() + return p.cur.onDoubleQuoteItalicTextElement80(stack["name"]) } -func (c *current) onUnorderedListItem19(depth interface{}) (bool, error) { - - // use a predicate to make sure that only `*` to `*****` are allowed - return depth.(int) <= 5, nil +func (c *current) onDoubleQuoteItalicTextElement31(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonUnorderedListItem19() (bool, error) { +func (p *parser) callonDoubleQuoteItalicTextElement31() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem19(stack["depth"]) + return p.cur.onDoubleQuoteItalicTextElement31(stack["element"]) } -func (c *current) onUnorderedListItem13(depth interface{}) (interface{}, error) { - switch depth.(int) { - case 1: - return types.NewUnorderedListItemPrefix(types.OneAsterisk, 1) - case 2: - return types.NewUnorderedListItemPrefix(types.TwoAsterisks, 2) - case 3: - return types.NewUnorderedListItemPrefix(types.ThreeAsterisks, 3) - case 4: - return types.NewUnorderedListItemPrefix(types.FourAsterisks, 4) - default: - return types.NewUnorderedListItemPrefix(types.FiveAsterisks, 5) - } +func (c *current) onDoubleQuoteItalicTextElement92() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonUnorderedListItem13() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement92() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem13(stack["depth"]) + return p.cur.onDoubleQuoteItalicTextElement92() } -func (c *current) onUnorderedListItem21() (interface{}, error) { - return types.NewUnorderedListItemPrefix(types.Dash, 1) +func (c *current) onDoubleQuoteItalicTextElement101() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonUnorderedListItem21() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement101() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem21() + return p.cur.onDoubleQuoteItalicTextElement101() } -func (c *current) onUnorderedListItem26() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement105() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil -} - -func (p *parser) callonUnorderedListItem26() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onUnorderedListItem26() -} -func (c *current) onUnorderedListItem4(prefix interface{}) (interface{}, error) { - return prefix, nil } -func (p *parser) callonUnorderedListItem4() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement105() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem4(stack["prefix"]) + return p.cur.onDoubleQuoteItalicTextElement105() } -func (c *current) onUnorderedListItem36() (interface{}, error) { - return types.Unchecked, nil +func (c *current) onDoubleQuoteItalicTextElement111() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonUnorderedListItem36() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem36() + return p.cur.onDoubleQuoteItalicTextElement111() } -func (c *current) onUnorderedListItem38() (interface{}, error) { - return types.Checked, nil +func (c *current) onDoubleQuoteItalicTextElement118() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonUnorderedListItem38() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement118() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem38() + return p.cur.onDoubleQuoteItalicTextElement118() } -func (c *current) onUnorderedListItem40() (interface{}, error) { - return types.Checked, nil +func (c *current) onDoubleQuoteItalicTextElement125() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonUnorderedListItem40() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement125() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem40() + return p.cur.onDoubleQuoteItalicTextElement125() } -func (c *current) onUnorderedListItem45() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement137() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonUnorderedListItem45() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem45() + return p.cur.onDoubleQuoteItalicTextElement137() } -func (c *current) onUnorderedListItem30(style interface{}) (interface{}, error) { - return style, nil +func (c *current) onDoubleQuoteItalicTextElement139() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonUnorderedListItem30() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement139() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem30(stack["style"]) + return p.cur.onDoubleQuoteItalicTextElement139() } -func (c *current) onUnorderedListItem1(prefix, checkstyle, content interface{}) (interface{}, error) { - return types.NewUnorderedListItem(prefix.(types.UnorderedListItemPrefix), checkstyle, content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onDoubleQuoteItalicTextElement132(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonUnorderedListItem1() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement132() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem1(stack["prefix"], stack["checkstyle"], stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement132(stack["start"]) } -func (c *current) onUnorderedListItemContent1(elements interface{}) (interface{}, error) { - // Another list or a literal paragraph immediately following a list item will be implicitly included in the list item - return types.NewListItemContent(elements.([]interface{})) +func (c *current) onDoubleQuoteItalicTextElement121(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonUnorderedListItemContent1() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement121() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItemContent1(stack["elements"]) + return p.cur.onDoubleQuoteItalicTextElement121(stack["name"], stack["start"]) } -func (c *current) onLabeledListItem6() (interface{}, error) { - return types.NewStringElement(strings.TrimSpace(string(c.text))) +func (c *current) onDoubleQuoteItalicTextElement147() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonLabeledListItem6() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement147() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem6() + return p.cur.onDoubleQuoteItalicTextElement147() } -func (c *current) onLabeledListItem4(content interface{}) (interface{}, error) { - return types.NewInlineElements(content) +func (c *current) onDoubleQuoteItalicTextElement159() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonLabeledListItem4() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement159() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem4(stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement159() } -func (c *current) onLabeledListItem19() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement161() (interface{}, error) { - return string(c.text), nil + return strconv.Atoi(string(c.text)) } -func (p *parser) callonLabeledListItem19() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement161() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem19() + return p.cur.onDoubleQuoteItalicTextElement161() } -func (c *current) onLabeledListItem22(separator interface{}) (bool, error) { - - // use a predicate to make sure that only `::` to `::::` are allowed - return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil +func (c *current) onDoubleQuoteItalicTextElement154(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonLabeledListItem22() (bool, error) { +func (p *parser) callonDoubleQuoteItalicTextElement154() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem22(stack["separator"]) + return p.cur.onDoubleQuoteItalicTextElement154(stack["start"]) } -func (c *current) onLabeledListItem27() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement143(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonLabeledListItem27() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement143() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem27() + return p.cur.onDoubleQuoteItalicTextElement143(stack["name"], stack["start"]) } -func (c *current) onLabeledListItem16(separator interface{}) (interface{}, error) { - return separator, nil +func (c *current) onDoubleQuoteItalicTextElement169() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonLabeledListItem16() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement169() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem16(stack["separator"]) + return p.cur.onDoubleQuoteItalicTextElement169() } -func (c *current) onLabeledListItem1(term, separator, description interface{}) (interface{}, error) { - return types.NewLabeledListItem(len(separator.(string))-1, term.([]interface{}), description, c.globalStore.getAttributes()) +func (c *current) onDoubleQuoteItalicTextElement165(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonLabeledListItem1() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem1(stack["term"], stack["separator"], stack["description"]) + return p.cur.onDoubleQuoteItalicTextElement165(stack["name"]) } -func (c *current) onLabeledListItemTerm1(elements interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement116(element interface{}) (interface{}, error) { + return element, nil - return types.NewInlineElements(elements.([]interface{})) } -func (p *parser) callonLabeledListItemTerm1() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTerm1(stack["elements"]) + return p.cur.onDoubleQuoteItalicTextElement116(stack["element"]) } -func (c *current) onLabeledListItemTermElement4() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement175() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonLabeledListItemTermElement4() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement175() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement4() + return p.cur.onDoubleQuoteItalicTextElement175() } -func (c *current) onLabeledListItemTermElement13() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteItalicTextElement97(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) } -func (p *parser) callonLabeledListItemTermElement13() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement13() + return p.cur.onDoubleQuoteItalicTextElement97(stack["id"], stack["label"]) } -func (c *current) onLabeledListItemTermElement26() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement182() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement26() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement182() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement26() + return p.cur.onDoubleQuoteItalicTextElement182() } -func (c *current) onLabeledListItemTermElement32() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement178(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonLabeledListItemTermElement32() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement32() + return p.cur.onDoubleQuoteItalicTextElement178(stack["id"]) } -func (c *current) onLabeledListItemTermElement22() (interface{}, error) { - return types.NewLineBreak() +func (c *current) onDoubleQuoteItalicTextElement95() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonLabeledListItemTermElement22() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement95() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement22() + return p.cur.onDoubleQuoteItalicTextElement95() } -func (c *current) onLabeledListItemTermElement43() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement186() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonLabeledListItemTermElement43() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement43() + return p.cur.onDoubleQuoteItalicTextElement186() } -func (c *current) onLabeledListItemTermElement54() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement90(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonLabeledListItemTermElement54() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement90() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement54() + return p.cur.onDoubleQuoteItalicTextElement90(stack["element"]) } -func (c *current) onLabeledListItemTermElement50() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement188() (interface{}, error) { + return types.NewStringElement("\u2019") + } -func (p *parser) callonLabeledListItemTermElement50() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement188() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement50() + return p.cur.onDoubleQuoteItalicTextElement188() } -func (c *current) onLabeledListItemTermElement63() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement190() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonLabeledListItemTermElement63() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement190() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement63() + return p.cur.onDoubleQuoteItalicTextElement190() } -func (c *current) onLabeledListItemTermElement69() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement192() (interface{}, error) { + return types.NewStringElement("\u2122") + } -func (p *parser) callonLabeledListItemTermElement69() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement192() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement69() + return p.cur.onDoubleQuoteItalicTextElement192() } -func (c *current) onLabeledListItemTermElement76() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement194() (interface{}, error) { + return types.NewStringElement("\u00ae") + } -func (p *parser) callonLabeledListItemTermElement76() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement194() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement76() + return p.cur.onDoubleQuoteItalicTextElement194() } -func (c *current) onLabeledListItemTermElement72() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement196() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonLabeledListItemTermElement72() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement196() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement72() + return p.cur.onDoubleQuoteItalicTextElement196() } -func (c *current) onLabeledListItemTermElement58(content interface{}) (interface{}, error) { - return content, nil +func (c *current) onDoubleQuoteItalicTextElement198() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonLabeledListItemTermElement58() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement198() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement58(stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement198() } -func (c *current) onLabeledListItemTermElement85() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement211() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonLabeledListItemTermElement85() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement211() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement85() + return p.cur.onDoubleQuoteItalicTextElement211() } -func (c *current) onLabeledListItemTermElement91() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement207(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonLabeledListItemTermElement91() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement207() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement91() + return p.cur.onDoubleQuoteItalicTextElement207(stack["ref"]) } -func (c *current) onLabeledListItemTermElement98() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement219() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement98() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement219() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement98() + return p.cur.onDoubleQuoteItalicTextElement219() } -func (c *current) onLabeledListItemTermElement94() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement216() (interface{}, error) { + // or a italic delimiter when immediately followed by an alphanum (ie, in the middle of some text) + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonLabeledListItemTermElement94() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement216() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement94() + return p.cur.onDoubleQuoteItalicTextElement216() } -func (c *current) onLabeledListItemTermElement80(content interface{}) (interface{}, error) { - return content, nil +func (c *current) onDoubleQuoteItalicTextElement1(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonLabeledListItemTermElement80() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement80(stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement1(stack["element"]) } -func (c *current) onLabeledListItemTermElement46(term1, term2, term3 interface{}) (interface{}, error) { - return types.NewConcealedIndexTerm(term1, term2, term3) +func (c *current) onQuotedTextInDoubleQuoteItalicText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) } -func (p *parser) callonLabeledListItemTermElement46() (interface{}, error) { +func (p *parser) callonQuotedTextInDoubleQuoteItalicText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement46(stack["term1"], stack["term2"], stack["term3"]) + return p.cur.onQuotedTextInDoubleQuoteItalicText1(stack["attributes"], stack["text"]) } -func (c *current) onLabeledListItemTermElement115() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onSingleQuoteItalicText1(elements interface{}) (interface{}, error) { + + return types.NewQuotedText(types.SingleQuoteItalic, elements.([]interface{})) + } -func (p *parser) callonLabeledListItemTermElement115() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement115() + return p.cur.onSingleQuoteItalicText1(stack["elements"]) } -func (c *current) onLabeledListItemTermElement121() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElements7() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement121() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElements7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement121() + return p.cur.onSingleQuoteItalicTextElements7() } -func (c *current) onLabeledListItemTermElement127() (interface{}, error) { - // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteItalicTextElements12(elements interface{}) (bool, error) { + return validateSingleQuoteElements(elements.([]interface{})) // cannot end with spaces } -func (p *parser) callonLabeledListItemTermElement127() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElements12() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement127() + return p.cur.onSingleQuoteItalicTextElements12(stack["elements"]) } -func (c *current) onLabeledListItemTermElement136() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElements1(elements interface{}) (interface{}, error) { + return elements, nil + } -func (p *parser) callonLabeledListItemTermElement136() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElements1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement136() + return p.cur.onSingleQuoteItalicTextElements1(stack["elements"]) } -func (c *current) onLabeledListItemTermElement132(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onSingleQuoteItalicTextElement8() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement132() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement8() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement132(stack["name"]) + return p.cur.onSingleQuoteItalicTextElement8() } -func (c *current) onLabeledListItemTermElement142() (interface{}, error) { - +func (c *current) onSingleQuoteItalicTextElement2() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonLabeledListItemTermElement142() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement142() + return p.cur.onSingleQuoteItalicTextElement2() } -func (c *current) onLabeledListItemTermElement111(id, label interface{}) (interface{}, error) { - return types.NewInternalCrossReference(id, label) +func (c *current) onSingleQuoteItalicTextElement11() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement111() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement111(stack["id"], stack["label"]) + return p.cur.onSingleQuoteItalicTextElement11() } -func (c *current) onLabeledListItemTermElement149() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ +func (c *current) onSingleQuoteItalicTextElement15() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonLabeledListItemTermElement149() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement15() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement149() + return p.cur.onSingleQuoteItalicTextElement15() } -func (c *current) onLabeledListItemTermElement145(id interface{}) (interface{}, error) { - return types.NewInternalCrossReference(id, nil) +func (c *current) onSingleQuoteItalicTextElement21() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonLabeledListItemTermElement145() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement21() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement145(stack["id"]) + return p.cur.onSingleQuoteItalicTextElement21() } -func (c *current) onLabeledListItemTermElement109() (interface{}, error) { - // if we have a InternalCrossReference we just return a StringElement. - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteItalicTextElement28() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonLabeledListItemTermElement109() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement28() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement109() + return p.cur.onSingleQuoteItalicTextElement28() } -func (c *current) onLabeledListItemTermElement153() (interface{}, error) { - return types.NewSpecialCharacter(string(c.text)) +func (c *current) onSingleQuoteItalicTextElement35() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonLabeledListItemTermElement153() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement153() -} - -func (c *current) onLabeledListItemTermElement155() (interface{}, error) { - return types.NewStringElement("\u2019") + return p.cur.onSingleQuoteItalicTextElement35() } -func (p *parser) callonLabeledListItemTermElement155() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onLabeledListItemTermElement155() -} +func (c *current) onSingleQuoteItalicTextElement47() (interface{}, error) { + return string(c.text), nil -func (c *current) onLabeledListItemTermElement157() (interface{}, error) { - return types.NewStringElement("\u00a9") } -func (p *parser) callonLabeledListItemTermElement157() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement47() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement157() + return p.cur.onSingleQuoteItalicTextElement47() } -func (c *current) onLabeledListItemTermElement159() (interface{}, error) { - return types.NewStringElement("\u2122") -} +func (c *current) onSingleQuoteItalicTextElement49() (interface{}, error) { -func (p *parser) callonLabeledListItemTermElement159() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onLabeledListItemTermElement159() -} + return strconv.Atoi(string(c.text)) -func (c *current) onLabeledListItemTermElement161() (interface{}, error) { - return types.NewStringElement("\u00ae") } -func (p *parser) callonLabeledListItemTermElement161() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement49() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement161() + return p.cur.onSingleQuoteItalicTextElement49() } -func (c *current) onLabeledListItemTermElement163() (interface{}, error) { - return types.NewStringElement("\u2026\u200b") +func (c *current) onSingleQuoteItalicTextElement42(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonLabeledListItemTermElement163() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement163() + return p.cur.onSingleQuoteItalicTextElement42(stack["start"]) } -func (c *current) onLabeledListItemTermElement165() (interface{}, error) { - return types.NewStringElement(string(c.text[:1]) + "\u2019") +func (c *current) onSingleQuoteItalicTextElement31(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonLabeledListItemTermElement165() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement31() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement165() + return p.cur.onSingleQuoteItalicTextElement31(stack["name"], stack["start"]) } -func (c *current) onLabeledListItemTermElement175() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement57() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement175() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement57() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement175() + return p.cur.onSingleQuoteItalicTextElement57() } -func (c *current) onLabeledListItemTermElement187() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement69() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonLabeledListItemTermElement187() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement69() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement187() + return p.cur.onSingleQuoteItalicTextElement69() } -func (c *current) onLabeledListItemTermElement189() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement71() (interface{}, error) { return strconv.Atoi(string(c.text)) } -func (p *parser) callonLabeledListItemTermElement189() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement71() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement189() + return p.cur.onSingleQuoteItalicTextElement71() } -func (c *current) onLabeledListItemTermElement182(start interface{}) (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement64(start interface{}) (interface{}, error) { return start, nil } -func (p *parser) callonLabeledListItemTermElement182() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement64() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement182(stack["start"]) + return p.cur.onSingleQuoteItalicTextElement64(stack["start"]) } -func (c *current) onLabeledListItemTermElement171(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), false, start) +func (c *current) onSingleQuoteItalicTextElement53(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonLabeledListItemTermElement171() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement53() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement171(stack["name"], stack["start"]) + return p.cur.onSingleQuoteItalicTextElement53(stack["name"], stack["start"]) } -func (c *current) onLabeledListItemTermElement197() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement79() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement197() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement79() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement197() + return p.cur.onSingleQuoteItalicTextElement79() } -func (c *current) onLabeledListItemTermElement209() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement75(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonLabeledListItemTermElement209() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement75() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement209() + return p.cur.onSingleQuoteItalicTextElement75(stack["name"]) } -func (c *current) onLabeledListItemTermElement211() (interface{}, error) { - - return strconv.Atoi(string(c.text)) +func (c *current) onSingleQuoteItalicTextElement26(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonLabeledListItemTermElement211() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement211() + return p.cur.onSingleQuoteItalicTextElement26(stack["element"]) } -func (c *current) onLabeledListItemTermElement204(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onSingleQuoteItalicTextElement87() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonLabeledListItemTermElement204() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement87() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement204(stack["start"]) + return p.cur.onSingleQuoteItalicTextElement87() } -func (c *current) onLabeledListItemTermElement193(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), true, nil) +func (c *current) onSingleQuoteItalicTextElement96() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement193() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement96() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement193(stack["name"], stack["start"]) + return p.cur.onSingleQuoteItalicTextElement96() } -func (c *current) onLabeledListItemTermElement219() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement100() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil -} -func (p *parser) callonLabeledListItemTermElement219() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onLabeledListItemTermElement219() } -func (c *current) onLabeledListItemTermElement215(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) -} - -func (p *parser) callonLabeledListItemTermElement215() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement100() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement215(stack["name"]) + return p.cur.onSingleQuoteItalicTextElement100() } -func (c *current) onLabeledListItemTermElement225() (interface{}, error) { - +func (c *current) onSingleQuoteItalicTextElement106() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references return types.NewStringElement(string(c.text)) + } -func (p *parser) callonLabeledListItemTermElement225() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement106() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement225() + return p.cur.onSingleQuoteItalicTextElement106() } -func (c *current) onLabeledListItemTermElement1(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onSingleQuoteItalicTextElement113() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonLabeledListItemTermElement1() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement113() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement1(stack["element"]) + return p.cur.onSingleQuoteItalicTextElement113() } -func (c *current) onLabeledListItemDescription1(elements interface{}) (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement120() (interface{}, error) { + return string(c.text), nil - return types.NewListItemContent(elements.([]interface{})) } -func (p *parser) callonLabeledListItemDescription1() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement120() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemDescription1(stack["elements"]) + return p.cur.onSingleQuoteItalicTextElement120() } -func (c *current) onInlineElement4() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteItalicTextElement132() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonInlineElement4() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement132() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement4() + return p.cur.onSingleQuoteItalicTextElement132() } -func (c *current) onInlineElement13() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement134() (interface{}, error) { - return types.NewStringElement(string(c.text)) + return strconv.Atoi(string(c.text)) } -func (p *parser) callonInlineElement13() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement134() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement13() + return p.cur.onSingleQuoteItalicTextElement134() } -func (c *current) onInlineElement22() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteItalicTextElement127(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonInlineElement22() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement127() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement22() + return p.cur.onSingleQuoteItalicTextElement127(stack["start"]) } -func (c *current) onInlineElement35() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement116(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonInlineElement35() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement35() + return p.cur.onSingleQuoteItalicTextElement116(stack["name"], stack["start"]) } -func (c *current) onInlineElement41() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement142() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineElement41() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement142() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement41() + return p.cur.onSingleQuoteItalicTextElement142() } -func (c *current) onInlineElement31() (interface{}, error) { - return types.NewLineBreak() +func (c *current) onSingleQuoteItalicTextElement154() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonInlineElement31() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement154() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement31() + return p.cur.onSingleQuoteItalicTextElement154() } -func (c *current) onInlineElement52() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement156() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonInlineElement52() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement156() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement52() + return p.cur.onSingleQuoteItalicTextElement156() } -func (c *current) onInlineElement76() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement149(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonInlineElement76() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement149() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement76() + return p.cur.onSingleQuoteItalicTextElement149(stack["start"]) } -func (c *current) onInlineElement82() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement138(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonInlineElement82() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement138() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement82() + return p.cur.onSingleQuoteItalicTextElement138(stack["name"], stack["start"]) } -func (c *current) onInlineElement88() (interface{}, error) { - // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteItalicTextElement164() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonInlineElement88() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement164() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement88() + return p.cur.onSingleQuoteItalicTextElement164() } -func (c *current) onInlineElement97() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement160(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonInlineElement97() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement160() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement97() + return p.cur.onSingleQuoteItalicTextElement160(stack["name"]) } -func (c *current) onInlineElement93(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onSingleQuoteItalicTextElement111(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonInlineElement93() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement93(stack["name"]) + return p.cur.onSingleQuoteItalicTextElement111(stack["element"]) } -func (c *current) onInlineElement103() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement170() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlineElement103() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement170() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement103() + return p.cur.onSingleQuoteItalicTextElement170() } -func (c *current) onInlineElement72(id, label interface{}) (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement92(id, label interface{}) (interface{}, error) { return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonInlineElement72() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement92() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement72(stack["id"], stack["label"]) + return p.cur.onSingleQuoteItalicTextElement92(stack["id"], stack["label"]) } -func (c *current) onInlineElement110() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement177() (interface{}, error) { // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonInlineElement110() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement177() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement110() + return p.cur.onSingleQuoteItalicTextElement177() } -func (c *current) onInlineElement106(id interface{}) (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement173(id interface{}) (interface{}, error) { return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonInlineElement106() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement173() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement106(stack["id"]) + return p.cur.onSingleQuoteItalicTextElement173(stack["id"]) } -func (c *current) onInlineElement70() (interface{}, error) { - // if we have a InternalCrossReference we just return a StringElement. +func (c *current) onSingleQuoteItalicTextElement90() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlineElement70() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement90() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement70() + return p.cur.onSingleQuoteItalicTextElement90() } -func (c *current) onInlineElement114() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement181() (interface{}, error) { return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonInlineElement114() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement181() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSingleQuoteItalicTextElement181() +} + +func (c *current) onSingleQuoteItalicTextElement85(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonSingleQuoteItalicTextElement85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement114() + return p.cur.onSingleQuoteItalicTextElement85(stack["element"]) } -func (c *current) onInlineElement116() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement183() (interface{}, error) { return types.NewStringElement("\u2019") + } -func (p *parser) callonInlineElement116() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement183() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement116() + return p.cur.onSingleQuoteItalicTextElement183() } -func (c *current) onInlineElement118() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement185() (interface{}, error) { return types.NewStringElement("\u00a9") + } -func (p *parser) callonInlineElement118() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement185() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement118() + return p.cur.onSingleQuoteItalicTextElement185() } -func (c *current) onInlineElement120() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement187() (interface{}, error) { return types.NewStringElement("\u2122") + } -func (p *parser) callonInlineElement120() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement187() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement120() + return p.cur.onSingleQuoteItalicTextElement187() } -func (c *current) onInlineElement122() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement189() (interface{}, error) { return types.NewStringElement("\u00ae") + } -func (p *parser) callonInlineElement122() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement189() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement122() + return p.cur.onSingleQuoteItalicTextElement189() } -func (c *current) onInlineElement124() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement191() (interface{}, error) { return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonInlineElement124() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement191() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement124() + return p.cur.onSingleQuoteItalicTextElement191() } -func (c *current) onInlineElement126() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement193() (interface{}, error) { return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonInlineElement126() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement193() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement126() + return p.cur.onSingleQuoteItalicTextElement193() } -func (c *current) onInlineElement137() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement206() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonInlineElement137() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement206() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement137() + return p.cur.onSingleQuoteItalicTextElement206() } -func (c *current) onInlineElement149() (interface{}, error) { - return string(c.text), nil - +func (c *current) onSingleQuoteItalicTextElement202(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonInlineElement149() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement202() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement149() + return p.cur.onSingleQuoteItalicTextElement202(stack["ref"]) } -func (c *current) onInlineElement151() (interface{}, error) { - - return strconv.Atoi(string(c.text)) +func (c *current) onSingleQuoteItalicTextElement214() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonInlineElement151() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement151() + return p.cur.onSingleQuoteItalicTextElement214() } -func (c *current) onInlineElement144(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onSingleQuoteItalicTextElement211() (interface{}, error) { + // or an italic delimiter when immediately followed by an alphanum (ie, in the middle of some text) + return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlineElement144() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement211() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement144(stack["start"]) + return p.cur.onSingleQuoteItalicTextElement211() } -func (c *current) onInlineElement133(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), false, start) -} +func (c *current) onQuotedTextInSingleQuoteItalicText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) -func (p *parser) callonInlineElement133() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onInlineElement133(stack["name"], stack["start"]) } -func (c *current) onInlineElement159() (interface{}, error) { - return string(c.text), nil -} - -func (p *parser) callonInlineElement159() (interface{}, error) { +func (p *parser) callonQuotedTextInSingleQuoteItalicText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement159() + return p.cur.onQuotedTextInSingleQuoteItalicText1(stack["attributes"], stack["text"]) } -func (c *current) onInlineElement171() (interface{}, error) { +func (c *current) onEscapedItalicText5() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonInlineElement171() (interface{}, error) { +func (p *parser) callonEscapedItalicText5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement171() + return p.cur.onEscapedItalicText5() } -func (c *current) onInlineElement173() (interface{}, error) { - - return strconv.Atoi(string(c.text)) +func (c *current) onEscapedItalicText2(backslashes, elements interface{}) (interface{}, error) { + // double punctuation must be evaluated first + return types.NewEscapedQuotedText(backslashes.(string), "__", elements.([]interface{})) } -func (p *parser) callonInlineElement173() (interface{}, error) { +func (p *parser) callonEscapedItalicText2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement173() + return p.cur.onEscapedItalicText2(stack["backslashes"], stack["elements"]) } -func (c *current) onInlineElement166(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onEscapedItalicText17() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonInlineElement166() (interface{}, error) { +func (p *parser) callonEscapedItalicText17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement166(stack["start"]) + return p.cur.onEscapedItalicText17() } -func (c *current) onInlineElement155(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), true, nil) +func (c *current) onEscapedItalicText14(backslashes, elements interface{}) (interface{}, error) { + // unbalanced `__` vs `_` punctuation + result := append([]interface{}{"_"}, elements.([]interface{})) + return types.NewEscapedQuotedText(backslashes.(string), "_", result) + } -func (p *parser) callonInlineElement155() (interface{}, error) { +func (p *parser) callonEscapedItalicText14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement155(stack["name"], stack["start"]) + return p.cur.onEscapedItalicText14(stack["backslashes"], stack["elements"]) } -func (c *current) onInlineElement181() (interface{}, error) { +func (c *current) onEscapedItalicText27() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineElement181() (interface{}, error) { +func (p *parser) callonEscapedItalicText27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement181() + return p.cur.onEscapedItalicText27() } -func (c *current) onInlineElement177(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onEscapedItalicText24(backslashes, elements interface{}) (interface{}, error) { + // simple punctuation must be evaluated last + return types.NewEscapedQuotedText(backslashes.(string), "_", elements.([]interface{})) + } -func (p *parser) callonInlineElement177() (interface{}, error) { +func (p *parser) callonEscapedItalicText24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement177(stack["name"]) + return p.cur.onEscapedItalicText24(stack["backslashes"], stack["elements"]) } -func (c *current) onInlineElement191() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceText1(elements interface{}) (interface{}, error) { + + return types.NewQuotedText(types.DoubleQuoteMonospace, elements.([]interface{})) + } -func (p *parser) callonInlineElement191() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement191() + return p.cur.onDoubleQuoteMonospaceText1(stack["elements"]) } -func (c *current) onInlineElement198() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement13() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonInlineElement198() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement198() + return p.cur.onDoubleQuoteMonospaceTextElement13() } -func (c *current) onInlineElement187(id interface{}) (interface{}, error) { - // no EOL here since there can be multiple InlineElementID on the same line - return types.NewInlineIDAttribute(id.(string)) +func (c *current) onDoubleQuoteMonospaceTextElement7() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonInlineElement187() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement187(stack["id"]) + return p.cur.onDoubleQuoteMonospaceTextElement7() } -func (c *current) onInlineElement208() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement16() (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonInlineElement208() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement208() + return p.cur.onDoubleQuoteMonospaceTextElement16() } -func (c *current) onInlineElement204() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement20() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonInlineElement204() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement20() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement204() + return p.cur.onDoubleQuoteMonospaceTextElement20() } -func (c *current) onInlineElement217() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement26() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonInlineElement217() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement217() + return p.cur.onDoubleQuoteMonospaceTextElement26() } -func (c *current) onInlineElement223() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement33() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonInlineElement223() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement33() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement223() + return p.cur.onDoubleQuoteMonospaceTextElement33() } -func (c *current) onInlineElement230() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement40() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineElement230() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement40() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement230() + return p.cur.onDoubleQuoteMonospaceTextElement40() } -func (c *current) onInlineElement226() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement52() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineElement226() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement52() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement226() + return p.cur.onDoubleQuoteMonospaceTextElement52() } -func (c *current) onInlineElement212(content interface{}) (interface{}, error) { - return content, nil +func (c *current) onDoubleQuoteMonospaceTextElement54() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonInlineElement212() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement212(stack["content"]) + return p.cur.onDoubleQuoteMonospaceTextElement54() } -func (c *current) onInlineElement239() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement47(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonInlineElement239() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement47() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement239() + return p.cur.onDoubleQuoteMonospaceTextElement47(stack["start"]) } -func (c *current) onInlineElement245() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement36(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonInlineElement245() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement36() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement245() + return p.cur.onDoubleQuoteMonospaceTextElement36(stack["name"], stack["start"]) } -func (c *current) onInlineElement252() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement62() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineElement252() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement62() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement252() + return p.cur.onDoubleQuoteMonospaceTextElement62() } -func (c *current) onInlineElement248() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement74() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineElement248() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement74() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement248() + return p.cur.onDoubleQuoteMonospaceTextElement74() } -func (c *current) onInlineElement234(content interface{}) (interface{}, error) { - return content, nil +func (c *current) onDoubleQuoteMonospaceTextElement76() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonInlineElement234() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement76() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement234(stack["content"]) + return p.cur.onDoubleQuoteMonospaceTextElement76() } -func (c *current) onInlineElement200(term1, term2, term3 interface{}) (interface{}, error) { - return types.NewConcealedIndexTerm(term1, term2, term3) +func (c *current) onDoubleQuoteMonospaceTextElement69(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonInlineElement200() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement69() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement200(stack["term1"], stack["term2"], stack["term3"]) + return p.cur.onDoubleQuoteMonospaceTextElement69(stack["start"]) } -func (c *current) onInlineElement260() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement58(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonInlineElement260() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement58() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement260() + return p.cur.onDoubleQuoteMonospaceTextElement58(stack["name"], stack["start"]) } -func (c *current) onInlineElement256(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onDoubleQuoteMonospaceTextElement84() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonInlineElement256() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement84() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement256(stack["ref"]) + return p.cur.onDoubleQuoteMonospaceTextElement84() } -func (c *current) onInlineElement264() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement80(name interface{}) (interface{}, error) { - return types.NewStringElement(string(c.text)) + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonInlineElement264() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement264() + return p.cur.onDoubleQuoteMonospaceTextElement80(stack["name"]) } -func (c *current) onInlineElement1(element interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement31(element interface{}) (interface{}, error) { return element, nil + } -func (p *parser) callonInlineElement1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement31() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement1(stack["element"]) + return p.cur.onDoubleQuoteMonospaceTextElement31(stack["element"]) } -func (c *current) onQuotedText2(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onDoubleQuoteMonospaceTextElement92() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonQuotedText2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement92() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedText2(stack["attributes"], stack["text"]) + return p.cur.onDoubleQuoteMonospaceTextElement92() } -func (c *current) onDoubleQuoteBoldText1(elements interface{}) (interface{}, error) { - return types.NewQuotedText(types.DoubleQuoteBold, elements.([]interface{})) +func (c *current) onDoubleQuoteMonospaceTextElement101() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonDoubleQuoteBoldText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement101() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldText1(stack["elements"]) + return p.cur.onDoubleQuoteMonospaceTextElement101() } -func (c *current) onDoubleQuoteBoldTextElement7() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMonospaceTextElement105() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonDoubleQuoteBoldTextElement7() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement105() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement7() + return p.cur.onDoubleQuoteMonospaceTextElement105() } -func (c *current) onDoubleQuoteBoldTextElement16() (interface{}, error) { - // allow ` +func (c *current) onDoubleQuoteMonospaceTextElement111() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references return types.NewStringElement(string(c.text)) } -func (p *parser) callonDoubleQuoteBoldTextElement16() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement16() + return p.cur.onDoubleQuoteMonospaceTextElement111() } -func (c *current) onDoubleQuoteBoldTextElement26() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement118() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonDoubleQuoteBoldTextElement26() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement118() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement26() + return p.cur.onDoubleQuoteMonospaceTextElement118() } -func (c *current) onDoubleQuoteBoldTextElement42() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement125() (interface{}, error) { return string(c.text), nil -} - -func (p *parser) callonDoubleQuoteBoldTextElement42() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onDoubleQuoteBoldTextElement42() -} -func (c *current) onDoubleQuoteBoldTextElement38(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonDoubleQuoteBoldTextElement38() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement125() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement38(stack["ref"]) + return p.cur.onDoubleQuoteMonospaceTextElement125() } -func (c *current) onDoubleQuoteBoldTextElement50() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement137() (interface{}, error) { return string(c.text), nil -} - -func (p *parser) callonDoubleQuoteBoldTextElement50() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onDoubleQuoteBoldTextElement50() -} - -func (c *current) onDoubleQuoteBoldTextElement47() (interface{}, error) { - // or a bold delimiter when immediately followed by an alphanum (ie, in the middle of some text) - return types.NewStringElement(string(c.text)) } -func (p *parser) callonDoubleQuoteBoldTextElement47() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement47() + return p.cur.onDoubleQuoteMonospaceTextElement137() } -func (c *current) onDoubleQuoteBoldTextElement1(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onDoubleQuoteMonospaceTextElement139() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonDoubleQuoteBoldTextElement1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement139() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement1(stack["element"]) + return p.cur.onDoubleQuoteMonospaceTextElement139() } -func (c *current) onQuotedTextInDoubleQuoteBoldText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onDoubleQuoteMonospaceTextElement132(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonQuotedTextInDoubleQuoteBoldText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement132() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInDoubleQuoteBoldText1(stack["attributes"], stack["text"]) + return p.cur.onDoubleQuoteMonospaceTextElement132(stack["start"]) } -func (c *current) onSingleQuoteBoldText2(elements interface{}) (interface{}, error) { - // single punctuation cannot be followed by a character (needs '**' to emphazise a portion of a word) - return types.NewQuotedText(types.SingleQuoteBold, elements.([]interface{})) - +func (c *current) onDoubleQuoteMonospaceTextElement121(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSingleQuoteBoldText2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement121() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldText2(stack["elements"]) + return p.cur.onDoubleQuoteMonospaceTextElement121(stack["name"], stack["start"]) } -func (c *current) onSingleQuoteBoldText13(elements interface{}) (interface{}, error) { - // unbalanced `**` vs `*` punctuation. - return types.NewQuotedText(types.SingleQuoteBold, elements.([]interface{})) // include the second heading `*` as a regular StringElement in the bold content +func (c *current) onDoubleQuoteMonospaceTextElement147() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSingleQuoteBoldText13() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement147() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldText13(stack["elements"]) + return p.cur.onDoubleQuoteMonospaceTextElement147() } -func (c *current) onSingleQuoteBoldTextElements5() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement159() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSingleQuoteBoldTextElements5() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement159() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElements5() + return p.cur.onDoubleQuoteMonospaceTextElement159() } -func (c *current) onSingleQuoteBoldTextElement2() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement161() (interface{}, error) { - return types.NewStringElement(string(c.text)) + return strconv.Atoi(string(c.text)) } -func (p *parser) callonSingleQuoteBoldTextElement2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement161() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement2() + return p.cur.onDoubleQuoteMonospaceTextElement161() } -func (c *current) onSingleQuoteBoldTextElement11() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMonospaceTextElement154(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonSingleQuoteBoldTextElement11() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement154() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement11() + return p.cur.onDoubleQuoteMonospaceTextElement154(stack["start"]) } -func (c *current) onSingleQuoteBoldTextElement33() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement143(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonSingleQuoteBoldTextElement33() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement143() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement33() + return p.cur.onDoubleQuoteMonospaceTextElement143(stack["name"], stack["start"]) } -func (c *current) onSingleQuoteBoldTextElement45() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement169() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSingleQuoteBoldTextElement45() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement169() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement45() + return p.cur.onDoubleQuoteMonospaceTextElement169() } -func (c *current) onSingleQuoteBoldTextElement41(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onDoubleQuoteMonospaceTextElement165(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSingleQuoteBoldTextElement41() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement41(stack["ref"]) + return p.cur.onDoubleQuoteMonospaceTextElement165(stack["name"]) } -func (c *current) onSingleQuoteBoldTextElement53() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement116(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonSingleQuoteBoldTextElement53() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement53() + return p.cur.onDoubleQuoteMonospaceTextElement116(stack["element"]) } -func (c *current) onSingleQuoteBoldTextElement50() (interface{}, error) { - // or a bold delimiter when immediately followed by an alphanum (ie, in the middle of some text) +func (c *current) onDoubleQuoteMonospaceTextElement175() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSingleQuoteBoldTextElement50() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement175() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement50() + return p.cur.onDoubleQuoteMonospaceTextElement175() } -func (c *current) onQuotedTextInSingleQuoteBoldText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onDoubleQuoteMonospaceTextElement97(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) } -func (p *parser) callonQuotedTextInSingleQuoteBoldText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInSingleQuoteBoldText1(stack["attributes"], stack["text"]) + return p.cur.onDoubleQuoteMonospaceTextElement97(stack["id"], stack["label"]) } -func (c *current) onEscapedBoldText5() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement182() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonEscapedBoldText5() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement182() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedBoldText5() + return p.cur.onDoubleQuoteMonospaceTextElement182() } -func (c *current) onEscapedBoldText2(backslashes, elements interface{}) (interface{}, error) { - // double punctuation must be evaluated first - return types.NewEscapedQuotedText(backslashes.(string), "**", elements.([]interface{})) +func (c *current) onDoubleQuoteMonospaceTextElement178(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) } -func (p *parser) callonEscapedBoldText2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedBoldText2(stack["backslashes"], stack["elements"]) + return p.cur.onDoubleQuoteMonospaceTextElement178(stack["id"]) } -func (c *current) onEscapedBoldText17() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement95() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonEscapedBoldText17() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement95() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedBoldText17() + return p.cur.onDoubleQuoteMonospaceTextElement95() } -func (c *current) onEscapedBoldText14(backslashes, elements interface{}) (interface{}, error) { - // unbalanced `**` vs `*` punctuation - result := append([]interface{}{"*"}, elements.([]interface{})) - return types.NewEscapedQuotedText(backslashes.(string), "*", result) +func (c *current) onDoubleQuoteMonospaceTextElement186() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonEscapedBoldText14() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedBoldText14(stack["backslashes"], stack["elements"]) + return p.cur.onDoubleQuoteMonospaceTextElement186() } -func (c *current) onEscapedBoldText27() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement90(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonEscapedBoldText27() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement90() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedBoldText27() + return p.cur.onDoubleQuoteMonospaceTextElement90(stack["element"]) } -func (c *current) onEscapedBoldText24(backslashes, elements interface{}) (interface{}, error) { - // simple punctuation must be evaluated last - return types.NewEscapedQuotedText(backslashes.(string), "*", elements.([]interface{})) +func (c *current) onDoubleQuoteMonospaceTextElement188() (interface{}, error) { + return types.NewStringElement("\u2019") + } -func (p *parser) callonEscapedBoldText24() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement188() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedBoldText24(stack["backslashes"], stack["elements"]) + return p.cur.onDoubleQuoteMonospaceTextElement188() } -func (c *current) onDoubleQuoteItalicText1(elements interface{}) (interface{}, error) { - // double punctuation must be evaluated first - return types.NewQuotedText(types.DoubleQuoteItalic, elements.([]interface{})) +func (c *current) onDoubleQuoteMonospaceTextElement190() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonDoubleQuoteItalicText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement190() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicText1(stack["elements"]) + return p.cur.onDoubleQuoteMonospaceTextElement190() } -func (c *current) onDoubleQuoteItalicTextElement7() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement192() (interface{}, error) { + return types.NewStringElement("\u2122") - return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDoubleQuoteMonospaceTextElement192() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDoubleQuoteMonospaceTextElement192() +} + +func (c *current) onDoubleQuoteMonospaceTextElement194() (interface{}, error) { + return types.NewStringElement("\u00ae") } -func (p *parser) callonDoubleQuoteItalicTextElement7() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement194() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement7() + return p.cur.onDoubleQuoteMonospaceTextElement194() } -func (c *current) onDoubleQuoteItalicTextElement16() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMonospaceTextElement196() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") } -func (p *parser) callonDoubleQuoteItalicTextElement16() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement196() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement16() + return p.cur.onDoubleQuoteMonospaceTextElement196() } -func (c *current) onDoubleQuoteItalicTextElement26() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement198() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonDoubleQuoteItalicTextElement26() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement198() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement26() + return p.cur.onDoubleQuoteMonospaceTextElement198() } -func (c *current) onDoubleQuoteItalicTextElement42() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement212() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonDoubleQuoteItalicTextElement42() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement212() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement42() + return p.cur.onDoubleQuoteMonospaceTextElement212() } -func (c *current) onDoubleQuoteItalicTextElement38(ref interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement208(ref interface{}) (interface{}, error) { return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonDoubleQuoteItalicTextElement38() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement208() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement38(stack["ref"]) + return p.cur.onDoubleQuoteMonospaceTextElement208(stack["ref"]) } -func (c *current) onDoubleQuoteItalicTextElement50() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement220() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDoubleQuoteItalicTextElement50() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement220() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement50() + return p.cur.onDoubleQuoteMonospaceTextElement220() } -func (c *current) onDoubleQuoteItalicTextElement47() (interface{}, error) { - // or a italic delimiter when immediately followed by an alphanum (ie, in the middle of some text) +func (c *current) onDoubleQuoteMonospaceTextElement217() (interface{}, error) { + // ` or a monospace delimiter when immediately followed by an alphanum (ie, in the middle of some text) return types.NewStringElement(string(c.text)) } -func (p *parser) callonDoubleQuoteItalicTextElement47() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement217() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement47() + return p.cur.onDoubleQuoteMonospaceTextElement217() } -func (c *current) onDoubleQuoteItalicTextElement1(element interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement1(element interface{}) (interface{}, error) { return element, nil } -func (p *parser) callonDoubleQuoteItalicTextElement1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement1(stack["element"]) + return p.cur.onDoubleQuoteMonospaceTextElement1(stack["element"]) } -func (c *current) onQuotedTextInDoubleQuoteItalicText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onQuotedTextInDoubleQuoteMonospaceText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) } -func (p *parser) callonQuotedTextInDoubleQuoteItalicText1() (interface{}, error) { +func (p *parser) callonQuotedTextInDoubleQuoteMonospaceText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInDoubleQuoteItalicText1(stack["attributes"], stack["text"]) + return p.cur.onQuotedTextInDoubleQuoteMonospaceText1(stack["attributes"], stack["text"]) } -func (c *current) onSingleQuoteItalicText2(elements interface{}) (interface{}, error) { - // single punctuation cannot be followed by a character (needs '__' to emphazise a portion of a word) - return types.NewQuotedText(types.SingleQuoteItalic, elements.([]interface{})) +func (c *current) onSingleQuoteMonospaceText1(elements interface{}) (interface{}, error) { + + return types.NewQuotedText(types.SingleQuoteMonospace, elements.([]interface{})) } -func (p *parser) callonSingleQuoteItalicText2() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicText2(stack["elements"]) + return p.cur.onSingleQuoteMonospaceText1(stack["elements"]) } -func (c *current) onSingleQuoteItalicText10(elements interface{}) (interface{}, error) { - // unbalanced `__` vs `_` punctuation. - return types.NewQuotedText(types.SingleQuoteItalic, elements.([]interface{})) // include the second heading `_` as a regular StringElement in the italic content +func (c *current) onSingleQuoteMonospaceTextElements7() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonSingleQuoteItalicText10() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElements7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicText10(stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElements7() } -func (c *current) onSingleQuoteItalicTextElements5() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElements12(elements interface{}) (bool, error) { + return validateSingleQuoteElements(elements.([]interface{})) // cannot end with spaces + } -func (p *parser) callonSingleQuoteItalicTextElements5() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElements12() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElements5() + return p.cur.onSingleQuoteMonospaceTextElements12(stack["elements"]) } -func (c *current) onSingleQuoteItalicTextElement2() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMonospaceTextElements1(elements interface{}) (interface{}, error) { + return elements, nil } -func (p *parser) callonSingleQuoteItalicTextElement2() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElements1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement2() + return p.cur.onSingleQuoteMonospaceTextElements1(stack["elements"]) } -func (c *current) onSingleQuoteItalicTextElement11() (interface{}, error) { - // allow ` +func (c *current) onSingleQuoteMonospaceTextElement2() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonSingleQuoteItalicTextElement11() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement11() + return p.cur.onSingleQuoteMonospaceTextElement2() } -func (c *current) onSingleQuoteItalicTextElement33() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement11() (interface{}, error) { + // allow ` + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSingleQuoteItalicTextElement33() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement33() + return p.cur.onSingleQuoteMonospaceTextElement11() } -func (c *current) onSingleQuoteItalicTextElement45() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement20() (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil -} -func (p *parser) callonSingleQuoteItalicTextElement45() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSingleQuoteItalicTextElement45() } -func (c *current) onSingleQuoteItalicTextElement41(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) -} - -func (p *parser) callonSingleQuoteItalicTextElement41() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement20() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement41(stack["ref"]) + return p.cur.onSingleQuoteMonospaceTextElement20() } -func (c *current) onSingleQuoteItalicTextElement53() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement24() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonSingleQuoteItalicTextElement53() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement53() + return p.cur.onSingleQuoteMonospaceTextElement24() } -func (c *current) onSingleQuoteItalicTextElement50() (interface{}, error) { - // or an italic delimiter when immediately followed by an alphanum (ie, in the middle of some text) - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMonospaceTextElement30() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonSingleQuoteItalicTextElement50() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement30() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement50() + return p.cur.onSingleQuoteMonospaceTextElement30() } -func (c *current) onQuotedTextInSingleQuoteItalicText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onSingleQuoteMonospaceTextElement37() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonQuotedTextInSingleQuoteItalicText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement37() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInSingleQuoteItalicText1(stack["attributes"], stack["text"]) + return p.cur.onSingleQuoteMonospaceTextElement37() } -func (c *current) onEscapedItalicText5() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement44() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonEscapedItalicText5() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement44() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedItalicText5() + return p.cur.onSingleQuoteMonospaceTextElement44() } -func (c *current) onEscapedItalicText2(backslashes, elements interface{}) (interface{}, error) { - // double punctuation must be evaluated first - return types.NewEscapedQuotedText(backslashes.(string), "__", elements.([]interface{})) +func (c *current) onSingleQuoteMonospaceTextElement56() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonEscapedItalicText2() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedItalicText2(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement56() } -func (c *current) onEscapedItalicText17() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement58() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonEscapedItalicText17() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement58() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedItalicText17() + return p.cur.onSingleQuoteMonospaceTextElement58() } -func (c *current) onEscapedItalicText14(backslashes, elements interface{}) (interface{}, error) { - // unbalanced `__` vs `_` punctuation - result := append([]interface{}{"_"}, elements.([]interface{})) - return types.NewEscapedQuotedText(backslashes.(string), "_", result) +func (c *current) onSingleQuoteMonospaceTextElement51(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonEscapedItalicText14() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement51() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedItalicText14(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement51(stack["start"]) } -func (c *current) onEscapedItalicText27() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement40(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonEscapedItalicText27() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement40() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedItalicText27() + return p.cur.onSingleQuoteMonospaceTextElement40(stack["name"], stack["start"]) } -func (c *current) onEscapedItalicText24(backslashes, elements interface{}) (interface{}, error) { - // simple punctuation must be evaluated last - return types.NewEscapedQuotedText(backslashes.(string), "_", elements.([]interface{})) +func (c *current) onSingleQuoteMonospaceTextElement66() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonEscapedItalicText24() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement66() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedItalicText24(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement66() } -func (c *current) onDoubleQuoteMonospaceText1(elements interface{}) (interface{}, error) { - // double punctuation must be evaluated first - return types.NewQuotedText(types.DoubleQuoteMonospace, elements.([]interface{})) +func (c *current) onSingleQuoteMonospaceTextElement78() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDoubleQuoteMonospaceText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement78() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceText1(stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement78() } -func (c *current) onDoubleQuoteMonospaceTextElement7() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement80() (interface{}, error) { - return types.NewStringElement(string(c.text)) + return strconv.Atoi(string(c.text)) } -func (p *parser) callonDoubleQuoteMonospaceTextElement7() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement7() + return p.cur.onSingleQuoteMonospaceTextElement80() } -func (c *current) onDoubleQuoteMonospaceTextElement16() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMonospaceTextElement73(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonDoubleQuoteMonospaceTextElement16() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement73() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement16() + return p.cur.onSingleQuoteMonospaceTextElement73(stack["start"]) } -func (c *current) onDoubleQuoteMonospaceTextElement26() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement62(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonDoubleQuoteMonospaceTextElement26() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement62() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement26() + return p.cur.onSingleQuoteMonospaceTextElement62(stack["name"], stack["start"]) } -func (c *current) onDoubleQuoteMonospaceTextElement43() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement88() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDoubleQuoteMonospaceTextElement43() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement88() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement43() + return p.cur.onSingleQuoteMonospaceTextElement88() } -func (c *current) onDoubleQuoteMonospaceTextElement39(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMonospaceTextElement84(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonDoubleQuoteMonospaceTextElement39() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement84() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement39(stack["ref"]) + return p.cur.onSingleQuoteMonospaceTextElement84(stack["name"]) } -func (c *current) onDoubleQuoteMonospaceTextElement51() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement35(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonDoubleQuoteMonospaceTextElement51() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement51() + return p.cur.onSingleQuoteMonospaceTextElement35(stack["element"]) } -func (c *current) onDoubleQuoteMonospaceTextElement48() (interface{}, error) { - // ` or a monospace delimiter when immediately followed by an alphanum (ie, in the middle of some text) - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMonospaceTextElement96() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonDoubleQuoteMonospaceTextElement48() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement96() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement48() + return p.cur.onSingleQuoteMonospaceTextElement96() } -func (c *current) onDoubleQuoteMonospaceTextElement1(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onSingleQuoteMonospaceTextElement105() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonDoubleQuoteMonospaceTextElement1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement105() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement1(stack["element"]) + return p.cur.onSingleQuoteMonospaceTextElement105() } -func (c *current) onQuotedTextInDoubleQuoteMonospaceText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onSingleQuoteMonospaceTextElement109() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonQuotedTextInDoubleQuoteMonospaceText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement109() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInDoubleQuoteMonospaceText1(stack["attributes"], stack["text"]) + return p.cur.onSingleQuoteMonospaceTextElement109() } -func (c *current) onSingleQuoteMonospaceText2(elements interface{}) (interface{}, error) { - // single punctuation cannot be followed by a character (needs "``" to emphazise a portion of a word) - return types.NewQuotedText(types.SingleQuoteMonospace, elements.([]interface{})) +func (c *current) onSingleQuoteMonospaceTextElement115() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSingleQuoteMonospaceText2() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement115() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceText2(stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement115() } -func (c *current) onSingleQuoteMonospaceText10(elements interface{}) (interface{}, error) { - // unbalanced "``" vs "`" punctuation. - return types.NewQuotedText(types.SingleQuoteMonospace, elements.([]interface{})) // include the second heading "`" as a regular StringElement in the monospace content +func (c *current) onSingleQuoteMonospaceTextElement122() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonSingleQuoteMonospaceText10() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement122() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceText10(stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement122() } -func (c *current) onSingleQuoteMonospaceTextElements5() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement129() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSingleQuoteMonospaceTextElements5() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement129() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElements5() + return p.cur.onSingleQuoteMonospaceTextElement129() } -func (c *current) onSingleQuoteMonospaceTextElement2() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMonospaceTextElement141() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSingleQuoteMonospaceTextElement2() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement141() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement2() + return p.cur.onSingleQuoteMonospaceTextElement141() } -func (c *current) onSingleQuoteMonospaceTextElement11() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMonospaceTextElement143() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonSingleQuoteMonospaceTextElement11() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement143() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement11() + return p.cur.onSingleQuoteMonospaceTextElement143() } -func (c *current) onSingleQuoteMonospaceTextElement33() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement136(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonSingleQuoteMonospaceTextElement33() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement136() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement33() + return p.cur.onSingleQuoteMonospaceTextElement136(stack["start"]) } -func (c *current) onSingleQuoteMonospaceTextElement46() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement125(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSingleQuoteMonospaceTextElement46() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement125() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement46() + return p.cur.onSingleQuoteMonospaceTextElement125(stack["name"], stack["start"]) } -func (c *current) onSingleQuoteMonospaceTextElement42(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMonospaceTextElement151() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSingleQuoteMonospaceTextElement42() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement151() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement42(stack["ref"]) + return p.cur.onSingleQuoteMonospaceTextElement151() } -func (c *current) onSingleQuoteMonospaceTextElement55() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement163() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSingleQuoteMonospaceTextElement55() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement163() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement55() + return p.cur.onSingleQuoteMonospaceTextElement163() } -func (c *current) onSingleQuoteMonospaceTextElement50() (interface{}, error) { - // or an monospace delimiter when immediately followed by an alphanum (ie, in the middle of some text) - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMonospaceTextElement165() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonSingleQuoteMonospaceTextElement50() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement50() + return p.cur.onSingleQuoteMonospaceTextElement165() } -func (c *current) onQuotedTextInSingleQuoteMonospaceText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onSingleQuoteMonospaceTextElement158(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonQuotedTextInSingleQuoteMonospaceText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement158() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInSingleQuoteMonospaceText1(stack["attributes"], stack["text"]) + return p.cur.onSingleQuoteMonospaceTextElement158(stack["start"]) } -func (c *current) onEscapedMonospaceText5() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement147(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonEscapedMonospaceText5() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement147() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMonospaceText5() + return p.cur.onSingleQuoteMonospaceTextElement147(stack["name"], stack["start"]) } -func (c *current) onEscapedMonospaceText2(backslashes, elements interface{}) (interface{}, error) { - // double punctuation must be evaluated first - return types.NewEscapedQuotedText(backslashes.(string), "``", elements.([]interface{})) +func (c *current) onSingleQuoteMonospaceTextElement173() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonEscapedMonospaceText2() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement173() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMonospaceText2(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement173() } -func (c *current) onEscapedMonospaceText17() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement169(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonEscapedMonospaceText17() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement169() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMonospaceText17() + return p.cur.onSingleQuoteMonospaceTextElement169(stack["name"]) } -func (c *current) onEscapedMonospaceText14(backslashes, elements interface{}) (interface{}, error) { - // unbalanced "``" vs "`" punctuation - result := append([]interface{}{"`"}, elements.([]interface{})) - return types.NewEscapedQuotedText(backslashes.(string), "`", result) +func (c *current) onSingleQuoteMonospaceTextElement120(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonEscapedMonospaceText14() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement120() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMonospaceText14(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement120(stack["element"]) } -func (c *current) onEscapedMonospaceText27() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onSingleQuoteMonospaceTextElement179() (interface{}, error) { -func (p *parser) callonEscapedMonospaceText27() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onEscapedMonospaceText27() -} + return types.NewStringElement(string(c.text)) -func (c *current) onEscapedMonospaceText24(backslashes, elements interface{}) (interface{}, error) { - // simple punctuation must be evaluated last - return types.NewEscapedQuotedText(backslashes.(string), "`", elements.([]interface{})) } -func (p *parser) callonEscapedMonospaceText24() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement179() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMonospaceText24(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement179() } -func (c *current) onSingleQuotedString1(elements interface{}) (interface{}, error) { - return types.NewQuotedString(types.SingleQuote, elements.([]interface{})) +func (c *current) onSingleQuoteMonospaceTextElement101(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonSingleQuotedString1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement101() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedString1(stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement101(stack["id"], stack["label"]) } -func (c *current) onSingleQuotedStringElements1(elements interface{}) (interface{}, error) { - return types.NewInlineElements(elements) +func (c *current) onSingleQuoteMonospaceTextElement186() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonSingleQuotedStringElements1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElements1(stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement186() } -func (c *current) onSingleQuotedStringElement9() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement182(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonSingleQuotedStringElement9() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement182() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement9() + return p.cur.onSingleQuoteMonospaceTextElement182(stack["id"]) } -func (c *current) onSingleQuotedStringElement15() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement99() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSingleQuotedStringElement15() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement15() + return p.cur.onSingleQuoteMonospaceTextElement99() } -func (c *current) onSingleQuotedStringElement5() (interface{}, error) { - return types.NewLineBreak() +func (c *current) onSingleQuoteMonospaceTextElement190() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonSingleQuotedStringElement5() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement190() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement5() + return p.cur.onSingleQuoteMonospaceTextElement190() } -func (c *current) onSingleQuotedStringElement29() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement94(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonSingleQuotedStringElement29() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement94() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement29() + return p.cur.onSingleQuoteMonospaceTextElement94(stack["element"]) } -func (c *current) onSingleQuotedStringElement39() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement192() (interface{}, error) { return types.NewStringElement("\u2019") + } -func (p *parser) callonSingleQuotedStringElement39() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement192() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement39() + return p.cur.onSingleQuoteMonospaceTextElement192() } -func (c *current) onSingleQuotedStringElement41() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement194() (interface{}, error) { return types.NewStringElement("\u00a9") + } -func (p *parser) callonSingleQuotedStringElement41() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement194() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement41() + return p.cur.onSingleQuoteMonospaceTextElement194() } -func (c *current) onSingleQuotedStringElement43() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement196() (interface{}, error) { return types.NewStringElement("\u2122") + } -func (p *parser) callonSingleQuotedStringElement43() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement196() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement43() + return p.cur.onSingleQuoteMonospaceTextElement196() } -func (c *current) onSingleQuotedStringElement45() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement198() (interface{}, error) { return types.NewStringElement("\u00ae") + } -func (p *parser) callonSingleQuotedStringElement45() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement198() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement45() + return p.cur.onSingleQuoteMonospaceTextElement198() } -func (c *current) onSingleQuotedStringElement47() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement200() (interface{}, error) { return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonSingleQuotedStringElement47() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement200() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement47() + return p.cur.onSingleQuoteMonospaceTextElement200() } -func (c *current) onSingleQuotedStringElement49() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement202() (interface{}, error) { return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonSingleQuotedStringElement49() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement202() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement49() + return p.cur.onSingleQuoteMonospaceTextElement202() } -func (c *current) onSingleQuotedStringElement33(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onSingleQuoteMonospaceTextElement216() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSingleQuotedStringElement33() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement216() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement33(stack["element"]) + return p.cur.onSingleQuoteMonospaceTextElement216() } -func (c *current) onSingleQuotedStringElement58() (interface{}, error) { - // ' - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMonospaceTextElement212(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonSingleQuotedStringElement58() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement212() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement58() + return p.cur.onSingleQuoteMonospaceTextElement212(stack["ref"]) } -func (c *current) onSingleQuotedStringElement1(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onSingleQuoteMonospaceTextElement225() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSingleQuotedStringElement1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement225() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement1(stack["element"]) + return p.cur.onSingleQuoteMonospaceTextElement225() } -func (c *current) onQuotedTextInSingleQuotedString10(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onSingleQuoteMonospaceTextElement220() (interface{}, error) { + // or an monospace delimiter when immediately followed by an alphanum (ie, in the middle of some text) + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuotedTextInSingleQuotedString10() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement220() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInSingleQuotedString10(stack["element"]) + return p.cur.onSingleQuoteMonospaceTextElement220() } -func (c *current) onQuotedTextInSingleQuotedString1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onQuotedTextInSingleQuoteMonospaceText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) } -func (p *parser) callonQuotedTextInSingleQuotedString1() (interface{}, error) { +func (p *parser) callonQuotedTextInSingleQuoteMonospaceText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInSingleQuotedString1(stack["attributes"], stack["text"]) + return p.cur.onQuotedTextInSingleQuoteMonospaceText1(stack["attributes"], stack["text"]) } -func (c *current) onDoubleQuotedString1(elements interface{}) (interface{}, error) { - return types.NewQuotedString(types.DoubleQuote, elements.([]interface{})) +func (c *current) onEscapedMonospaceText5() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDoubleQuotedString1() (interface{}, error) { +func (p *parser) callonEscapedMonospaceText5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedString1(stack["elements"]) + return p.cur.onEscapedMonospaceText5() } -func (c *current) onDoubleQuotedStringElements1(elements interface{}) (interface{}, error) { - return types.NewInlineElements(elements) +func (c *current) onEscapedMonospaceText2(backslashes, elements interface{}) (interface{}, error) { + // double punctuation must be evaluated first + return types.NewEscapedQuotedText(backslashes.(string), "``", elements.([]interface{})) + } -func (p *parser) callonDoubleQuotedStringElements1() (interface{}, error) { +func (p *parser) callonEscapedMonospaceText2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElements1(stack["elements"]) + return p.cur.onEscapedMonospaceText2(stack["backslashes"], stack["elements"]) } -func (c *current) onDoubleQuotedStringElement9() (interface{}, error) { +func (c *current) onEscapedMonospaceText17() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDoubleQuotedStringElement9() (interface{}, error) { +func (p *parser) callonEscapedMonospaceText17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElement9() + return p.cur.onEscapedMonospaceText17() } -func (c *current) onDoubleQuotedStringElement15() (interface{}, error) { - return string(c.text), nil +func (c *current) onEscapedMonospaceText14(backslashes, elements interface{}) (interface{}, error) { + // unbalanced "``" vs "`" punctuation + result := append([]interface{}{"`"}, elements.([]interface{})) + return types.NewEscapedQuotedText(backslashes.(string), "`", result) + } -func (p *parser) callonDoubleQuotedStringElement15() (interface{}, error) { +func (p *parser) callonEscapedMonospaceText14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElement15() + return p.cur.onEscapedMonospaceText14(stack["backslashes"], stack["elements"]) } -func (c *current) onDoubleQuotedStringElement5() (interface{}, error) { - return types.NewLineBreak() +func (c *current) onEscapedMonospaceText27() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDoubleQuotedStringElement5() (interface{}, error) { +func (p *parser) callonEscapedMonospaceText27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElement5() + return p.cur.onEscapedMonospaceText27() } -func (c *current) onDoubleQuotedStringElement29() (interface{}, error) { - return string(c.text), nil +func (c *current) onEscapedMonospaceText24(backslashes, elements interface{}) (interface{}, error) { + // simple punctuation must be evaluated last + return types.NewEscapedQuotedText(backslashes.(string), "`", elements.([]interface{})) + } -func (p *parser) callonDoubleQuotedStringElement29() (interface{}, error) { +func (p *parser) callonEscapedMonospaceText24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElement29() + return p.cur.onEscapedMonospaceText24(stack["backslashes"], stack["elements"]) } -func (c *current) onDoubleQuotedStringElement35() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedText1(elements interface{}) (interface{}, error) { + + return types.NewQuotedText(types.DoubleQuoteMarked, elements.([]interface{})) + } -func (p *parser) callonDoubleQuotedStringElement35() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElement35() + return p.cur.onDoubleQuoteMarkedText1(stack["elements"]) } -func (c *current) onDoubleQuotedStringElement1(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onDoubleQuoteMarkedTextElement13() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonDoubleQuotedStringElement1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElement1(stack["element"]) + return p.cur.onDoubleQuoteMarkedTextElement13() } -func (c *current) onQuotedTextInDoubleQuotedString10(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onDoubleQuoteMarkedTextElement7() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuotedTextInDoubleQuotedString10() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInDoubleQuotedString10(stack["element"]) + return p.cur.onDoubleQuoteMarkedTextElement7() } -func (c *current) onQuotedTextInDoubleQuotedString1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onDoubleQuoteMarkedTextElement16() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil } -func (p *parser) callonQuotedTextInDoubleQuotedString1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInDoubleQuotedString1(stack["attributes"], stack["text"]) + return p.cur.onDoubleQuoteMarkedTextElement16() } -func (c *current) onDoubleQuoteMarkedText1(elements interface{}) (interface{}, error) { - // double punctuation must be evaluated first - return types.NewQuotedText(types.DoubleQuoteMarked, elements.([]interface{})) +func (c *current) onDoubleQuoteMarkedTextElement20() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDoubleQuoteMarkedText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement20() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedText1(stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement20() } -func (c *current) onDoubleQuoteMarkedTextElements9() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement26() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDoubleQuoteMarkedTextElements9() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElements9() + return p.cur.onDoubleQuoteMarkedTextElement26() } -func (c *current) onDoubleQuoteMarkedTextElement2() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedTextElement33() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonDoubleQuoteMarkedTextElement2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement33() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElement2() + return p.cur.onDoubleQuoteMarkedTextElement33() } -func (c *current) onDoubleQuoteMarkedTextElement11() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedTextElement40() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDoubleQuoteMarkedTextElement11() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement40() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElement11() + return p.cur.onDoubleQuoteMarkedTextElement40() } -func (c *current) onDoubleQuoteMarkedTextElement34() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement52() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDoubleQuoteMarkedTextElement34() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement52() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElement34() + return p.cur.onDoubleQuoteMarkedTextElement52() } -func (c *current) onDoubleQuoteMarkedTextElement30(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onDoubleQuoteMarkedTextElement54() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonDoubleQuoteMarkedTextElement30() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElement30(stack["ref"]) + return p.cur.onDoubleQuoteMarkedTextElement54() } -func (c *current) onDoubleQuoteMarkedTextElement42() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement47(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonDoubleQuoteMarkedTextElement42() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement47() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElement42() + return p.cur.onDoubleQuoteMarkedTextElement47(stack["start"]) } -func (c *current) onDoubleQuoteMarkedTextElement39() (interface{}, error) { - // or a marked delimiter when immediately followed by an alphanum (ie, in the middle of some text) - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedTextElement36(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonDoubleQuoteMarkedTextElement39() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement36() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElement39() + return p.cur.onDoubleQuoteMarkedTextElement36(stack["name"], stack["start"]) } -func (c *current) onNonDoubleQuoteMarkedText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onDoubleQuoteMarkedTextElement62() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonNonDoubleQuoteMarkedText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement62() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNonDoubleQuoteMarkedText1(stack["attributes"], stack["text"]) + return p.cur.onDoubleQuoteMarkedTextElement62() } -func (c *current) onSingleQuoteMarkedText2(elements interface{}) (interface{}, error) { - // single punctuation cannot be followed by a character (needs '##' to emphazise a portion of a word) - return types.NewQuotedText(types.SingleQuoteMarked, elements.([]interface{})) +func (c *current) onDoubleQuoteMarkedTextElement74() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSingleQuoteMarkedText2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement74() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedText2(stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement74() } -func (c *current) onSingleQuoteMarkedText10(elements interface{}) (interface{}, error) { - // unbalanced `##` vs `#` punctuation. - return types.NewQuotedText(types.SingleQuoteMarked, elements.([]interface{})) // include the second heading `_` as a regular StringElement in the italic content +func (c *current) onDoubleQuoteMarkedTextElement76() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonSingleQuoteMarkedText10() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement76() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedText10(stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement76() } -func (c *current) onSingleQuoteMarkedTextElements5() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement69(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonSingleQuoteMarkedTextElements5() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement69() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElements5() + return p.cur.onDoubleQuoteMarkedTextElement69(stack["start"]) } -func (c *current) onSingleQuoteMarkedTextElement2() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement58(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} - return types.NewStringElement(string(c.text)) +func (p *parser) callonDoubleQuoteMarkedTextElement58() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDoubleQuoteMarkedTextElement58(stack["name"], stack["start"]) +} + +func (c *current) onDoubleQuoteMarkedTextElement84() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSingleQuoteMarkedTextElement2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement84() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement2() + return p.cur.onDoubleQuoteMarkedTextElement84() } -func (c *current) onSingleQuoteMarkedTextElement11() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedTextElement80(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSingleQuoteMarkedTextElement11() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement11() + return p.cur.onDoubleQuoteMarkedTextElement80(stack["name"]) } -func (c *current) onSingleQuoteMarkedTextElement33() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement31(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonSingleQuoteMarkedTextElement33() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement31() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement33() + return p.cur.onDoubleQuoteMarkedTextElement31(stack["element"]) } -func (c *current) onSingleQuoteMarkedTextElement45() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement92() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonSingleQuoteMarkedTextElement45() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement92() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement45() + return p.cur.onDoubleQuoteMarkedTextElement92() } -func (c *current) onSingleQuoteMarkedTextElement41(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onDoubleQuoteMarkedTextElement101() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonSingleQuoteMarkedTextElement41() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement101() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement41(stack["ref"]) + return p.cur.onDoubleQuoteMarkedTextElement101() } -func (c *current) onSingleQuoteMarkedTextElement53() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement105() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonSingleQuoteMarkedTextElement53() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement105() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement53() + return p.cur.onDoubleQuoteMarkedTextElement105() } -func (c *current) onSingleQuoteMarkedTextElement50() (interface{}, error) { - // or a mark delimiter when immediately followed by an alphanum (ie, in the middle of some text) +func (c *current) onDoubleQuoteMarkedTextElement111() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSingleQuoteMarkedTextElement50() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement50() + return p.cur.onDoubleQuoteMarkedTextElement111() } -func (c *current) onNonSingleQuoteMarkedText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onDoubleQuoteMarkedTextElement118() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonNonSingleQuoteMarkedText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement118() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNonSingleQuoteMarkedText1(stack["attributes"], stack["text"]) + return p.cur.onDoubleQuoteMarkedTextElement118() } -func (c *current) onEscapedMarkedText5() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement125() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonEscapedMarkedText5() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement125() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMarkedText5() + return p.cur.onDoubleQuoteMarkedTextElement125() } -func (c *current) onEscapedMarkedText2(backslashes, elements interface{}) (interface{}, error) { - // double punctuation must be evaluated first - return types.NewEscapedQuotedText(backslashes.(string), "##", elements.([]interface{})) +func (c *current) onDoubleQuoteMarkedTextElement137() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonEscapedMarkedText2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMarkedText2(stack["backslashes"], stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement137() } -func (c *current) onEscapedMarkedText17() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement139() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonEscapedMarkedText17() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement139() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMarkedText17() + return p.cur.onDoubleQuoteMarkedTextElement139() } -func (c *current) onEscapedMarkedText14(backslashes, elements interface{}) (interface{}, error) { - // unbalanced `##` vs `#` punctuation - result := append([]interface{}{"#"}, elements.([]interface{})) - return types.NewEscapedQuotedText(backslashes.(string), "#", result) +func (c *current) onDoubleQuoteMarkedTextElement132(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonEscapedMarkedText14() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement132() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMarkedText14(stack["backslashes"], stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement132(stack["start"]) } -func (c *current) onEscapedMarkedText27() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement121(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonEscapedMarkedText27() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement121() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMarkedText27() + return p.cur.onDoubleQuoteMarkedTextElement121(stack["name"], stack["start"]) } -func (c *current) onEscapedMarkedText24(backslashes, elements interface{}) (interface{}, error) { - // simple punctuation must be evaluated last - return types.NewEscapedQuotedText(backslashes.(string), "#", elements.([]interface{})) +func (c *current) onDoubleQuoteMarkedTextElement147() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonEscapedMarkedText24() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement147() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMarkedText24(stack["backslashes"], stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement147() } -func (c *current) onSubscriptText1(element interface{}) (interface{}, error) { - // wraps a single word - return types.NewQuotedText(types.SingleQuoteSubscript, element) +func (c *current) onDoubleQuoteMarkedTextElement159() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSubscriptText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement159() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSubscriptText1(stack["element"]) + return p.cur.onDoubleQuoteMarkedTextElement159() } -func (c *current) onSubscriptTextElement3() (interface{}, error) { - // anything except spaces, EOL or '~' - return c.text, nil +func (c *current) onDoubleQuoteMarkedTextElement161() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonSubscriptTextElement3() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement161() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSubscriptTextElement3() + return p.cur.onDoubleQuoteMarkedTextElement161() } -func (c *current) onEscapedSubscriptText4() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement154(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonEscapedSubscriptText4() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement154() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedSubscriptText4() + return p.cur.onDoubleQuoteMarkedTextElement154(stack["start"]) } -func (c *current) onEscapedSubscriptText1(backslashes, element interface{}) (interface{}, error) { - // simple punctuation must be evaluated last - return types.NewEscapedQuotedText(backslashes.(string), "~", element) +func (c *current) onDoubleQuoteMarkedTextElement143(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonEscapedSubscriptText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement143() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedSubscriptText1(stack["backslashes"], stack["element"]) + return p.cur.onDoubleQuoteMarkedTextElement143(stack["name"], stack["start"]) } -func (c *current) onSuperscriptText1(element interface{}) (interface{}, error) { - // wraps a single word - return types.NewQuotedText(types.SingleQuoteSuperscript, element) +func (c *current) onDoubleQuoteMarkedTextElement169() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSuperscriptText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement169() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSuperscriptText1(stack["element"]) + return p.cur.onDoubleQuoteMarkedTextElement169() } -func (c *current) onSuperscriptTextElement3() (interface{}, error) { - // anything except spaces, EOL or '^' - return c.text, nil +func (c *current) onDoubleQuoteMarkedTextElement165(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSuperscriptTextElement3() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSuperscriptTextElement3() + return p.cur.onDoubleQuoteMarkedTextElement165(stack["name"]) } -func (c *current) onEscapedSuperscriptText4() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement116(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonEscapedSuperscriptText4() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedSuperscriptText4() + return p.cur.onDoubleQuoteMarkedTextElement116(stack["element"]) } -func (c *current) onEscapedSuperscriptText1(backslashes, element interface{}) (interface{}, error) { - // simple punctuation must be evaluated last - return types.NewEscapedQuotedText(backslashes.(string), "^", element) +func (c *current) onDoubleQuoteMarkedTextElement175() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonEscapedSuperscriptText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement175() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedSuperscriptText1(stack["backslashes"], stack["element"]) + return p.cur.onDoubleQuoteMarkedTextElement175() } -func (c *current) onInlinePassthrough7() (interface{}, error) { - // spaces and newlines are also allowed in the first or last position of the content and elsewhere too - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedTextElement97(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonInlinePassthrough7() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough7() + return p.cur.onDoubleQuoteMarkedTextElement97(stack["id"], stack["label"]) } -func (c *current) onInlinePassthrough19() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement182() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonInlinePassthrough19() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement182() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough19() + return p.cur.onDoubleQuoteMarkedTextElement182() } -func (c *current) onInlinePassthrough13() (interface{}, error) { - // a single character - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedTextElement178(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonInlinePassthrough13() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough13() + return p.cur.onDoubleQuoteMarkedTextElement178(stack["id"]) } -func (c *current) onInlinePassthrough2(content interface{}) (interface{}, error) { - return types.NewInlinePassthrough(types.TriplePlusPassthrough, []interface{}{content}) +func (c *current) onDoubleQuoteMarkedTextElement95() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonInlinePassthrough2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement95() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough2(stack["content"]) + return p.cur.onDoubleQuoteMarkedTextElement95() } -func (c *current) onInlinePassthrough43() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement186() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonInlinePassthrough43() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough43() + return p.cur.onDoubleQuoteMarkedTextElement186() } -func (c *current) onInlinePassthrough57() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement90(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonInlinePassthrough57() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement90() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough57() + return p.cur.onDoubleQuoteMarkedTextElement90(stack["element"]) } -func (c *current) onInlinePassthrough36() (interface{}, error) { - // no space in the first or last position of the content, but allowed elsewhere - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedTextElement188() (interface{}, error) { + return types.NewStringElement("\u2019") + } -func (p *parser) callonInlinePassthrough36() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement188() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough36() + return p.cur.onDoubleQuoteMarkedTextElement188() } -func (c *current) onInlinePassthrough72() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement190() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonInlinePassthrough72() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement190() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough72() + return p.cur.onDoubleQuoteMarkedTextElement190() } -func (c *current) onInlinePassthrough67() (interface{}, error) { - // a single character - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedTextElement192() (interface{}, error) { + return types.NewStringElement("\u2122") + } -func (p *parser) callonInlinePassthrough67() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement192() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough67() + return p.cur.onDoubleQuoteMarkedTextElement192() } -func (c *current) onInlinePassthrough31(content interface{}) (interface{}, error) { - return types.NewInlinePassthrough(types.SinglePlusPassthrough, []interface{}{content}) +func (c *current) onDoubleQuoteMarkedTextElement194() (interface{}, error) { + return types.NewStringElement("\u00ae") + } -func (p *parser) callonInlinePassthrough31() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement194() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough31(stack["content"]) + return p.cur.onDoubleQuoteMarkedTextElement194() } -func (c *current) onPassthroughMacro7() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedTextElement196() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonPassthroughMacro7() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement196() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPassthroughMacro7() + return p.cur.onDoubleQuoteMarkedTextElement196() } -func (c *current) onPassthroughMacro2(content interface{}) (interface{}, error) { - return types.NewInlinePassthrough(types.PassthroughMacro, []interface{}{content}) +func (c *current) onDoubleQuoteMarkedTextElement198() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonPassthroughMacro2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement198() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPassthroughMacro2(stack["content"]) + return p.cur.onDoubleQuoteMarkedTextElement198() } -func (c *current) onPassthroughMacro17() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedTextElement211() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonPassthroughMacro17() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement211() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPassthroughMacro17() + return p.cur.onDoubleQuoteMarkedTextElement211() } -func (c *current) onPassthroughMacro10(content interface{}) (interface{}, error) { - return types.NewInlinePassthrough(types.PassthroughMacro, content.([]interface{})) +func (c *current) onDoubleQuoteMarkedTextElement207(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonPassthroughMacro10() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement207() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPassthroughMacro10(stack["content"]) + return p.cur.onDoubleQuoteMarkedTextElement207(stack["ref"]) } -func (c *current) onCrossReference6() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ +func (c *current) onDoubleQuoteMarkedTextElement219() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonCrossReference6() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement219() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference6() + return p.cur.onDoubleQuoteMarkedTextElement219() } -func (c *current) onCrossReference12() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement216() (interface{}, error) { + // or a marked delimiter when immediately followed by an alphanum (ie, in the middle of some text) + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonCrossReference12() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement216() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference12() + return p.cur.onDoubleQuoteMarkedTextElement216() } -func (c *current) onCrossReference18() (interface{}, error) { - // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedTextElement1(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonCrossReference18() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference18() + return p.cur.onDoubleQuoteMarkedTextElement1(stack["element"]) } -func (c *current) onCrossReference27() (interface{}, error) { - return string(c.text), nil +func (c *current) onQuotedTextInDoubleMarkedBoldText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -func (p *parser) callonCrossReference27() (interface{}, error) { +func (p *parser) callonQuotedTextInDoubleMarkedBoldText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference27() + return p.cur.onQuotedTextInDoubleMarkedBoldText1(stack["attributes"], stack["text"]) } -func (c *current) onCrossReference23(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onSingleQuoteMarkedText1(elements interface{}) (interface{}, error) { + + return types.NewQuotedText(types.SingleQuoteMarked, elements.([]interface{})) + } -func (p *parser) callonCrossReference23() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference23(stack["name"]) + return p.cur.onSingleQuoteMarkedText1(stack["elements"]) } -func (c *current) onCrossReference33() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElements7() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonCrossReference33() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElements7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference33() + return p.cur.onSingleQuoteMarkedTextElements7() } -func (c *current) onCrossReference2(id, label interface{}) (interface{}, error) { - return types.NewInternalCrossReference(id, label) +func (c *current) onSingleQuoteMarkedTextElements12(elements interface{}) (bool, error) { + return validateSingleQuoteElements(elements.([]interface{})) // cannot end with spaces + } -func (p *parser) callonCrossReference2() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElements12() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference2(stack["id"], stack["label"]) + return p.cur.onSingleQuoteMarkedTextElements12(stack["elements"]) } -func (c *current) onCrossReference40() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElements1(elements interface{}) (interface{}, error) { + return elements, nil + } -func (p *parser) callonCrossReference40() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElements1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference40() + return p.cur.onSingleQuoteMarkedTextElements1(stack["elements"]) } -func (c *current) onCrossReference36(id interface{}) (interface{}, error) { - return types.NewInternalCrossReference(id, nil) +func (c *current) onSingleQuoteMarkedTextElement8() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonCrossReference36() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement8() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference36(stack["id"]) + return p.cur.onSingleQuoteMarkedTextElement8() } -func (c *current) onExternalCrossReference9() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" +func (c *current) onSingleQuoteMarkedTextElement2() (interface{}, error) { return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExternalCrossReference9() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalCrossReference9() + return p.cur.onSingleQuoteMarkedTextElement2() } -func (c *current) onExternalCrossReference16() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement11() (interface{}, error) { + log.Debug("matched multiple spaces") return string(c.text), nil + } -func (p *parser) callonExternalCrossReference16() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalCrossReference16() + return p.cur.onSingleQuoteMarkedTextElement11() } -func (c *current) onExternalCrossReference12(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMarkedTextElement15() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonExternalCrossReference12() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement15() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalCrossReference12(stack["ref"]) + return p.cur.onSingleQuoteMarkedTextElement15() } -func (c *current) onExternalCrossReference5(path interface{}) (interface{}, error) { - return types.NewLocation("", path.([]interface{})) +func (c *current) onSingleQuoteMarkedTextElement21() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonExternalCrossReference5() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement21() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalCrossReference5(stack["path"]) + return p.cur.onSingleQuoteMarkedTextElement21() } -func (c *current) onExternalCrossReference1(url, inlineAttributes interface{}) (interface{}, error) { - return types.NewExternalCrossReference(url.(types.Location), inlineAttributes.(types.Attributes)) +func (c *current) onSingleQuoteMarkedTextElement28() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonExternalCrossReference1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement28() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalCrossReference1(stack["url"], stack["inlineAttributes"]) + return p.cur.onSingleQuoteMarkedTextElement28() } -func (c *current) onRelativeLink18() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElement35() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonRelativeLink18() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRelativeLink18() + return p.cur.onSingleQuoteMarkedTextElement35() } -func (c *current) onRelativeLink25() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement47() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonRelativeLink25() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement47() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRelativeLink25() + return p.cur.onSingleQuoteMarkedTextElement47() } -func (c *current) onRelativeLink21(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMarkedTextElement49() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonRelativeLink21() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement49() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRelativeLink21(stack["ref"]) + return p.cur.onSingleQuoteMarkedTextElement49() } -func (c *current) onRelativeLink5(scheme, path interface{}) (interface{}, error) { - return types.NewLocation(scheme, path.([]interface{})) +func (c *current) onSingleQuoteMarkedTextElement42(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonRelativeLink5() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRelativeLink5(stack["scheme"], stack["path"]) + return p.cur.onSingleQuoteMarkedTextElement42(stack["start"]) } -func (c *current) onRelativeLink1(url, inlineAttributes interface{}) (interface{}, error) { - return types.NewInlineLink(url.(types.Location), inlineAttributes.(types.Attributes)) +func (c *current) onSingleQuoteMarkedTextElement31(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonRelativeLink1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement31() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRelativeLink1(stack["url"], stack["inlineAttributes"]) + return p.cur.onSingleQuoteMarkedTextElement31(stack["name"], stack["start"]) } -func (c *current) onExternalLink16() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElement57() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonExternalLink16() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement57() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalLink16() + return p.cur.onSingleQuoteMarkedTextElement57() } -func (c *current) onExternalLink23() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement69() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExternalLink23() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement69() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalLink23() + return p.cur.onSingleQuoteMarkedTextElement69() } -func (c *current) onExternalLink19(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMarkedTextElement71() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonExternalLink19() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement71() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalLink19(stack["ref"]) + return p.cur.onSingleQuoteMarkedTextElement71() } -func (c *current) onExternalLink4(scheme, path interface{}) (interface{}, error) { - return types.NewLocation(scheme, path.([]interface{})) +func (c *current) onSingleQuoteMarkedTextElement64(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExternalLink4() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement64() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalLink4(stack["scheme"], stack["path"]) + return p.cur.onSingleQuoteMarkedTextElement64(stack["start"]) } -func (c *current) onExternalLink1(url, inlineAttributes interface{}) (interface{}, error) { - return types.NewInlineLink(url.(types.Location), inlineAttributes) +func (c *current) onSingleQuoteMarkedTextElement53(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonExternalLink1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement53() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalLink1(stack["url"], stack["inlineAttributes"]) + return p.cur.onSingleQuoteMarkedTextElement53(stack["name"], stack["start"]) } -func (c *current) onImageBlock3() (bool, error) { - // AttrPositional1 must not be set - return types.HasNotAttribute(c.globalStore.getAttributes(), types.AttrPositional1), nil +func (c *current) onSingleQuoteMarkedTextElement79() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonImageBlock3() (bool, error) { +func (p *parser) callonSingleQuoteMarkedTextElement79() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock3() + return p.cur.onSingleQuoteMarkedTextElement79() } -func (c *current) onImageBlock19() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElement75(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonImageBlock19() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement75() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock19() + return p.cur.onSingleQuoteMarkedTextElement75(stack["name"]) } -func (c *current) onImageBlock26() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement26(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonImageBlock26() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock26() + return p.cur.onSingleQuoteMarkedTextElement26(stack["element"]) } -func (c *current) onImageBlock22(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMarkedTextElement87() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonImageBlock22() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement87() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock22(stack["ref"]) + return p.cur.onSingleQuoteMarkedTextElement87() } -func (c *current) onImageBlock6(scheme, path interface{}) (interface{}, error) { - return types.NewLocation(scheme, path.([]interface{})) +func (c *current) onSingleQuoteMarkedTextElement96() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonImageBlock6() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement96() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock6(stack["scheme"], stack["path"]) + return p.cur.onSingleQuoteMarkedTextElement96() } -func (c *current) onImageBlock35() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement100() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonImageBlock35() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement100() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock35() + return p.cur.onSingleQuoteMarkedTextElement100() } -func (c *current) onImageBlock1(path, inlineAttributes interface{}) (interface{}, error) { - // 'imagesdir' attribute is added after applying the attribute substitutions on the image location - return types.NewImageBlock(path.(types.Location), inlineAttributes.(types.Attributes), c.globalStore.getAttributes()) +func (c *current) onSingleQuoteMarkedTextElement106() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonImageBlock1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement106() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock1(stack["path"], stack["inlineAttributes"]) + return p.cur.onSingleQuoteMarkedTextElement106() } -func (c *current) onInlineImage20() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElement113() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonInlineImage20() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement113() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineImage20() + return p.cur.onSingleQuoteMarkedTextElement113() } -func (c *current) onInlineImage27() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement120() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineImage27() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement120() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineImage27() + return p.cur.onSingleQuoteMarkedTextElement120() } -func (c *current) onInlineImage23(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMarkedTextElement132() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonInlineImage23() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement132() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineImage23(stack["ref"]) + return p.cur.onSingleQuoteMarkedTextElement132() } -func (c *current) onInlineImage7(scheme, path interface{}) (interface{}, error) { - return types.NewLocation(scheme, path.([]interface{})) -} +func (c *current) onSingleQuoteMarkedTextElement134() (interface{}, error) { -func (p *parser) callonInlineImage7() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onInlineImage7(stack["scheme"], stack["path"]) -} + return strconv.Atoi(string(c.text)) -func (c *current) onInlineImage1(path, inlineAttributes interface{}) (interface{}, error) { - return types.NewInlineImage(path.(types.Location), inlineAttributes.(types.Attributes), c.globalStore["imagesdir"]) } -func (p *parser) callonInlineImage1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement134() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineImage1(stack["path"], stack["inlineAttributes"]) + return p.cur.onSingleQuoteMarkedTextElement134() } -func (c *current) onInlineIcon5() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement127(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonInlineIcon5() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement127() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineIcon5() + return p.cur.onSingleQuoteMarkedTextElement127(stack["start"]) } -func (c *current) onInlineIcon1(icon, attributes interface{}) (interface{}, error) { - return types.NewIcon(icon.(string), attributes) +func (c *current) onSingleQuoteMarkedTextElement116(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonInlineIcon1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineIcon1(stack["icon"], stack["attributes"]) + return p.cur.onSingleQuoteMarkedTextElement116(stack["name"], stack["start"]) } -func (c *current) onInlineFootnote2(content interface{}) (interface{}, error) { - return types.NewFootnote("", content.([]interface{})) +func (c *current) onSingleQuoteMarkedTextElement142() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonInlineFootnote2() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement142() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineFootnote2(stack["content"]) + return p.cur.onSingleQuoteMarkedTextElement142() } -func (c *current) onInlineFootnote12() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement154() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineFootnote12() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement154() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineFootnote12() + return p.cur.onSingleQuoteMarkedTextElement154() } -func (c *current) onInlineFootnote8(ref, content interface{}) (interface{}, error) { - return types.NewFootnote(ref.(string), content) +func (c *current) onSingleQuoteMarkedTextElement156() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonInlineFootnote8() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement156() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineFootnote8(stack["ref"], stack["content"]) + return p.cur.onSingleQuoteMarkedTextElement156() } -func (c *current) onFootnoteContent1(elements interface{}) (interface{}, error) { - // footnote content may span multiple lines - return types.NewInlineElements(elements.([]interface{})) +func (c *current) onSingleQuoteMarkedTextElement149(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonFootnoteContent1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement149() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFootnoteContent1(stack["elements"]) + return p.cur.onSingleQuoteMarkedTextElement149(stack["start"]) } -func (c *current) onCallout5() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElement138(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonCallout5() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement138() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCallout5() + return p.cur.onSingleQuoteMarkedTextElement138(stack["name"], stack["start"]) } -func (c *current) onCallout12() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement164() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonCallout12() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement164() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCallout12() + return p.cur.onSingleQuoteMarkedTextElement164() } -func (c *current) onCallout1(ref interface{}) (interface{}, error) { - return types.NewCallout(ref.(int)) +func (c *current) onSingleQuoteMarkedTextElement160(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonCallout1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement160() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCallout1(stack["ref"]) + return p.cur.onSingleQuoteMarkedTextElement160(stack["name"]) } -func (c *current) onCalloutListItem8() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElement111(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonCalloutListItem8() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutListItem8() + return p.cur.onSingleQuoteMarkedTextElement111(stack["element"]) } -func (c *current) onCalloutListItem15() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement170() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonCalloutListItem15() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement170() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutListItem15() + return p.cur.onSingleQuoteMarkedTextElement170() } -func (c *current) onCalloutListItem4(ref interface{}) (interface{}, error) { - return ref, nil +func (c *current) onSingleQuoteMarkedTextElement92(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonCalloutListItem4() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement92() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutListItem4(stack["ref"]) + return p.cur.onSingleQuoteMarkedTextElement92(stack["id"], stack["label"]) } -func (c *current) onCalloutListItem1(ref, description interface{}) (interface{}, error) { - return types.NewCalloutListItem(ref.(int), description.([]interface{})) +func (c *current) onSingleQuoteMarkedTextElement177() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonCalloutListItem1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement177() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutListItem1(stack["ref"], stack["description"]) + return p.cur.onSingleQuoteMarkedTextElement177() } -func (c *current) onDelimitedBlock13() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement173(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonDelimitedBlock13() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement173() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock13() + return p.cur.onSingleQuoteMarkedTextElement173(stack["id"]) } -func (c *current) onDelimitedBlock31() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement90() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonDelimitedBlock31() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement90() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock31() + return p.cur.onSingleQuoteMarkedTextElement90() } -func (c *current) onDelimitedBlock47() (interface{}, error) { - - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement181() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonDelimitedBlock47() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement181() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock47() + return p.cur.onSingleQuoteMarkedTextElement181() } -func (c *current) onDelimitedBlock41(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onSingleQuoteMarkedTextElement85(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonDelimitedBlock41() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock41(stack["content"]) + return p.cur.onSingleQuoteMarkedTextElement85(stack["element"]) } -func (c *current) onDelimitedBlock22(line interface{}) (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement183() (interface{}, error) { + return types.NewStringElement("\u2019") - return line, nil } -func (p *parser) callonDelimitedBlock22() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement183() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock22(stack["line"]) + return p.cur.onSingleQuoteMarkedTextElement183() } -func (c *current) onDelimitedBlock61() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement185() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonDelimitedBlock61() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement185() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock61() + return p.cur.onSingleQuoteMarkedTextElement185() } -func (c *current) onDelimitedBlock7(content interface{}) (interface{}, error) { - return types.NewFencedBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuoteMarkedTextElement187() (interface{}, error) { + return types.NewStringElement("\u2122") + } -func (p *parser) callonDelimitedBlock7() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement187() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock7(stack["content"]) + return p.cur.onSingleQuoteMarkedTextElement187() } -func (c *current) onDelimitedBlock76() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement189() (interface{}, error) { + return types.NewStringElement("\u00ae") + } -func (p *parser) callonDelimitedBlock76() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement189() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock76() + return p.cur.onSingleQuoteMarkedTextElement189() } -func (c *current) onDelimitedBlock94() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement191() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonDelimitedBlock94() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement191() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock94() + return p.cur.onSingleQuoteMarkedTextElement191() } -func (c *current) onDelimitedBlock110() (interface{}, error) { - - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement193() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") } -func (p *parser) callonDelimitedBlock110() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement193() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock110() + return p.cur.onSingleQuoteMarkedTextElement193() } -func (c *current) onDelimitedBlock104(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) - +func (c *current) onSingleQuoteMarkedTextElement206() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDelimitedBlock104() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement206() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock104(stack["content"]) + return p.cur.onSingleQuoteMarkedTextElement206() } -func (c *current) onDelimitedBlock85(line interface{}) (interface{}, error) { - - return line, nil +func (c *current) onSingleQuoteMarkedTextElement202(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonDelimitedBlock85() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement202() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock85(stack["line"]) + return p.cur.onSingleQuoteMarkedTextElement202(stack["ref"]) } -func (c *current) onDelimitedBlock124() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement214() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDelimitedBlock124() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock124() + return p.cur.onSingleQuoteMarkedTextElement214() } -func (c *current) onDelimitedBlock70(content interface{}) (interface{}, error) { - return types.NewListingBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuoteMarkedTextElement211() (interface{}, error) { + // or a mark delimiter when immediately followed by an alphanum (ie, in the middle of some text) + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonDelimitedBlock70() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement211() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock70(stack["content"]) + return p.cur.onSingleQuoteMarkedTextElement211() } -func (c *current) onDelimitedBlock136() (bool, error) { - // AttrPositional1 must be equal to `verse` - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Verse), nil +func (c *current) onQuotedTextInSingleQuoteMarkedText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) } -func (p *parser) callonDelimitedBlock136() (bool, error) { +func (p *parser) callonQuotedTextInSingleQuoteMarkedText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock136() + return p.cur.onQuotedTextInSingleQuoteMarkedText1(stack["attributes"], stack["text"]) } -func (c *current) onDelimitedBlock141() (interface{}, error) { +func (c *current) onEscapedMarkedText5() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDelimitedBlock141() (interface{}, error) { +func (p *parser) callonEscapedMarkedText5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock141() + return p.cur.onEscapedMarkedText5() } -func (c *current) onDelimitedBlock159() (interface{}, error) { - return string(c.text), nil +func (c *current) onEscapedMarkedText2(backslashes, elements interface{}) (interface{}, error) { + // double punctuation must be evaluated first + return types.NewEscapedQuotedText(backslashes.(string), "##", elements.([]interface{})) + } -func (p *parser) callonDelimitedBlock159() (interface{}, error) { +func (p *parser) callonEscapedMarkedText2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock159() + return p.cur.onEscapedMarkedText2(stack["backslashes"], stack["elements"]) } -func (c *current) onDelimitedBlock175() (interface{}, error) { - +func (c *current) onEscapedMarkedText17() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonDelimitedBlock175() (interface{}, error) { +func (p *parser) callonEscapedMarkedText17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock175() + return p.cur.onEscapedMarkedText17() } -func (c *current) onDelimitedBlock169(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onEscapedMarkedText14(backslashes, elements interface{}) (interface{}, error) { + // unbalanced `##` vs `#` punctuation + result := append([]interface{}{"#"}, elements.([]interface{})) + return types.NewEscapedQuotedText(backslashes.(string), "#", result) } -func (p *parser) callonDelimitedBlock169() (interface{}, error) { +func (p *parser) callonEscapedMarkedText14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock169(stack["content"]) + return p.cur.onEscapedMarkedText14(stack["backslashes"], stack["elements"]) } -func (c *current) onDelimitedBlock150(line interface{}) (interface{}, error) { +func (c *current) onEscapedMarkedText27() (interface{}, error) { + return string(c.text), nil - return line, nil } -func (p *parser) callonDelimitedBlock150() (interface{}, error) { +func (p *parser) callonEscapedMarkedText27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock150(stack["line"]) + return p.cur.onEscapedMarkedText27() } -func (c *current) onDelimitedBlock189() (interface{}, error) { - return string(c.text), nil +func (c *current) onEscapedMarkedText24(backslashes, elements interface{}) (interface{}, error) { + // simple punctuation must be evaluated last + return types.NewEscapedQuotedText(backslashes.(string), "#", elements.([]interface{})) + } -func (p *parser) callonDelimitedBlock189() (interface{}, error) { +func (p *parser) callonEscapedMarkedText24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock189() + return p.cur.onEscapedMarkedText24(stack["backslashes"], stack["elements"]) } -func (c *current) onDelimitedBlock134(content interface{}) (interface{}, error) { - return types.NewVerseBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSubscriptText1(element interface{}) (interface{}, error) { + // wraps a single word + return types.NewQuotedText(types.SingleQuoteSubscript, element) } -func (p *parser) callonDelimitedBlock134() (interface{}, error) { +func (p *parser) callonSubscriptText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock134(stack["content"]) + return p.cur.onSubscriptText1(stack["element"]) } -func (c *current) onDelimitedBlock206() (interface{}, error) { - return string(c.text), nil +func (c *current) onSubscriptTextElement3() (interface{}, error) { + // anything except spaces, EOL or '~' + return c.text, nil + } -func (p *parser) callonDelimitedBlock206() (interface{}, error) { +func (p *parser) callonSubscriptTextElement3() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock206() + return p.cur.onSubscriptTextElement3() } -func (c *current) onDelimitedBlock224() (interface{}, error) { +func (c *current) onEscapedSubscriptText4() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDelimitedBlock224() (interface{}, error) { +func (p *parser) callonEscapedSubscriptText4() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock224() + return p.cur.onEscapedSubscriptText4() } -func (c *current) onDelimitedBlock240() (interface{}, error) { - - return string(c.text), nil +func (c *current) onEscapedSubscriptText1(backslashes, element interface{}) (interface{}, error) { + // simple punctuation must be evaluated last + return types.NewEscapedQuotedText(backslashes.(string), "~", element) } -func (p *parser) callonDelimitedBlock240() (interface{}, error) { +func (p *parser) callonEscapedSubscriptText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock240() + return p.cur.onEscapedSubscriptText1(stack["backslashes"], stack["element"]) } -func (c *current) onDelimitedBlock234(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onSuperscriptText1(element interface{}) (interface{}, error) { + // wraps a single word + return types.NewQuotedText(types.SingleQuoteSuperscript, element) } -func (p *parser) callonDelimitedBlock234() (interface{}, error) { +func (p *parser) callonSuperscriptText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock234(stack["content"]) + return p.cur.onSuperscriptText1(stack["element"]) } -func (c *current) onDelimitedBlock215(line interface{}) (interface{}, error) { +func (c *current) onSuperscriptTextElement3() (interface{}, error) { + // anything except spaces, EOL or '^' + return c.text, nil - return line, nil } -func (p *parser) callonDelimitedBlock215() (interface{}, error) { +func (p *parser) callonSuperscriptTextElement3() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock215(stack["line"]) + return p.cur.onSuperscriptTextElement3() } -func (c *current) onDelimitedBlock254() (interface{}, error) { +func (c *current) onEscapedSuperscriptText4() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDelimitedBlock254() (interface{}, error) { +func (p *parser) callonEscapedSuperscriptText4() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock254() + return p.cur.onEscapedSuperscriptText4() } -func (c *current) onDelimitedBlock200(content interface{}) (interface{}, error) { - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onEscapedSuperscriptText1(backslashes, element interface{}) (interface{}, error) { + // simple punctuation must be evaluated last + return types.NewEscapedQuotedText(backslashes.(string), "^", element) + } -func (p *parser) callonDelimitedBlock200() (interface{}, error) { +func (p *parser) callonEscapedSuperscriptText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock200(stack["content"]) + return p.cur.onEscapedSuperscriptText1(stack["backslashes"], stack["element"]) } -func (c *current) onDelimitedBlock269() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedString1(elements interface{}) (interface{}, error) { + return types.NewQuotedString(types.SingleQuote, elements.([]interface{})) + } -func (p *parser) callonDelimitedBlock269() (interface{}, error) { +func (p *parser) callonSingleQuotedString1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock269() + return p.cur.onSingleQuotedString1(stack["elements"]) } -func (c *current) onDelimitedBlock287() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElements1(elements interface{}) (interface{}, error) { + c.resetSpaceSuffixTracking() + return types.NewInlineElements(elements) + } -func (p *parser) callonDelimitedBlock287() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElements1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock287() + return p.cur.onSingleQuotedStringElements1(stack["elements"]) } -func (c *current) onDelimitedBlock303() (interface{}, error) { - +func (c *current) onSingleQuotedStringElement13() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil } -func (p *parser) callonDelimitedBlock303() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock303() + return p.cur.onSingleQuotedStringElement13() } -func (c *current) onDelimitedBlock297(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onSingleQuotedStringElement7() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDelimitedBlock297() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock297(stack["content"]) + return p.cur.onSingleQuotedStringElement7() } -func (c *current) onDelimitedBlock278(line interface{}) (interface{}, error) { +func (c *current) onSingleQuotedStringElement17() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil - return line, nil } -func (p *parser) callonDelimitedBlock278() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock278(stack["line"]) + return p.cur.onSingleQuotedStringElement17() } -func (c *current) onDelimitedBlock317() (interface{}, error) { +func (c *current) onSingleQuotedStringElement22() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonDelimitedBlock317() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock317() + return p.cur.onSingleQuotedStringElement22() } -func (c *current) onDelimitedBlock263(content interface{}) (interface{}, error) { - return types.NewCommentBlock(content.([]interface{}), nil) +func (c *current) onSingleQuotedStringElement28() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonDelimitedBlock263() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement28() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock263(stack["content"]) + return p.cur.onSingleQuotedStringElement28() } -func (c *current) onDelimitedBlock1(block interface{}) (interface{}, error) { - return block, nil +func (c *current) onSingleQuotedStringElement35() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonDelimitedBlock1() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement35() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock1(stack["block"]) + return p.cur.onSingleQuotedStringElement35() } -func (c *current) onExampleBlock7() (interface{}, error) { +func (c *current) onSingleQuotedStringElement42() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlock7() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlock7() + return p.cur.onSingleQuotedStringElement42() } -func (c *current) onExampleBlock22() (interface{}, error) { +func (c *current) onSingleQuotedStringElement54() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlock22() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlock22() + return p.cur.onSingleQuotedStringElement54() } -func (c *current) onExampleBlock1(blocks interface{}) (interface{}, error) { - return types.NewExampleBlock(blocks.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuotedStringElement56() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonExampleBlock1() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlock1(stack["blocks"]) + return p.cur.onSingleQuotedStringElement56() } -func (c *current) onExampleBlockRawContent13() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement49(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent13() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement49() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent13() + return p.cur.onSingleQuotedStringElement49(stack["start"]) } -func (c *current) onExampleBlockRawContent25(attributes interface{}) error { - c.globalStore.pushAttributes(attributes) - return nil - +func (c *current) onSingleQuotedStringElement38(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonExampleBlockRawContent25() error { +func (p *parser) callonSingleQuotedStringElement38() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent25(stack["attributes"]) + return p.cur.onSingleQuotedStringElement38(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent31() (bool, error) { - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Literal), nil +func (c *current) onSingleQuotedStringElement64() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent31() (bool, error) { +func (p *parser) callonSingleQuotedStringElement64() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent31() + return p.cur.onSingleQuotedStringElement64() } -func (c *current) onExampleBlockRawContent40() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuotedStringElement76() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent40() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement76() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent40() + return p.cur.onSingleQuotedStringElement76() } -func (c *current) onExampleBlockRawContent49() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuotedStringElement78() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonExampleBlockRawContent49() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement78() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent49() + return p.cur.onSingleQuotedStringElement78() } -func (c *current) onExampleBlockRawContent36(elements interface{}) (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement71(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent36() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement71() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent36(stack["elements"]) + return p.cur.onSingleQuotedStringElement71(stack["start"]) } -func (c *current) onExampleBlockRawContent33(content interface{}) (interface{}, error) { - - return types.NewRawLine(content.(string)) +func (c *current) onSingleQuotedStringElement60(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonExampleBlockRawContent33() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement60() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent33(stack["content"]) + return p.cur.onSingleQuotedStringElement60(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent76() (interface{}, error) { +func (c *current) onSingleQuotedStringElement86() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent76() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement86() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent76() + return p.cur.onSingleQuotedStringElement86() } -func (c *current) onExampleBlockRawContent85() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement82(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonExampleBlockRawContent85() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement82() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent85() + return p.cur.onSingleQuotedStringElement82(stack["name"]) } -func (c *current) onExampleBlockRawContent68(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onSingleQuotedStringElement33(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonExampleBlockRawContent68() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement33() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent68(stack["content"]) + return p.cur.onSingleQuotedStringElement33(stack["element"]) } -func (c *current) onExampleBlockRawContent106() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement94() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonExampleBlockRawContent106() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement94() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent106() + return p.cur.onSingleQuotedStringElement94() } -func (c *current) onExampleBlockRawContent118() (interface{}, error) { +func (c *current) onSingleQuotedStringElement103() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent118() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement103() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent118() + return p.cur.onSingleQuotedStringElement103() } -func (c *current) onExampleBlockRawContent130() (interface{}, error) { +func (c *current) onSingleQuotedStringElement107() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent130() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement107() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent130() + return p.cur.onSingleQuotedStringElement107() } -func (c *current) onExampleBlockRawContent142() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement113() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent142() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement113() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent142() + return p.cur.onSingleQuotedStringElement113() } -func (c *current) onExampleBlockRawContent154() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement120() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonExampleBlockRawContent154() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement120() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent154() + return p.cur.onSingleQuotedStringElement120() } -func (c *current) onExampleBlockRawContent166() (interface{}, error) { +func (c *current) onSingleQuotedStringElement127() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent166() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement127() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent166() + return p.cur.onSingleQuotedStringElement127() } -func (c *current) onExampleBlockRawContent178() (interface{}, error) { +func (c *current) onSingleQuotedStringElement139() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent178() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement139() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent178() + return p.cur.onSingleQuotedStringElement139() } -func (c *current) onExampleBlockRawContent186() (interface{}, error) { +func (c *current) onSingleQuotedStringElement141() (interface{}, error) { + + return strconv.Atoi(string(c.text)) - return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent186() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement141() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent186() + return p.cur.onSingleQuotedStringElement141() } -func (c *current) onExampleBlockRawContent194(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onSingleQuotedStringElement134(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonExampleBlockRawContent194() (bool, error) { +func (p *parser) callonSingleQuotedStringElement134() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent194(stack["content"]) + return p.cur.onSingleQuotedStringElement134(stack["start"]) } -func (c *current) onExampleBlockRawContent93(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) - +func (c *current) onSingleQuotedStringElement123(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonExampleBlockRawContent93() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement123() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent93(stack["content"]) + return p.cur.onSingleQuotedStringElement123(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent29(firstLine, otherLines interface{}) (interface{}, error) { - - return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...), c.globalStore.getAttributes()) +func (c *current) onSingleQuotedStringElement149() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent29() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement149() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent29(stack["firstLine"], stack["otherLines"]) + return p.cur.onSingleQuotedStringElement149() } -func (c *current) onExampleBlockRawContent203() (interface{}, error) { +func (c *current) onSingleQuotedStringElement161() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent203() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement161() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent203() + return p.cur.onSingleQuotedStringElement161() } -func (c *current) onExampleBlockRawContent195() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onSingleQuotedStringElement163() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent195() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement163() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent195() + return p.cur.onSingleQuotedStringElement163() } -func (c *current) onExampleBlockRawContent211() (interface{}, error) { - return types.NewThematicBreak() +func (c *current) onSingleQuotedStringElement156(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent211() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement156() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent211() + return p.cur.onSingleQuotedStringElement156(stack["start"]) } -func (c *current) onExampleBlockRawContent234() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement145(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonExampleBlockRawContent234() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement145() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent234() + return p.cur.onSingleQuotedStringElement145(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent252() (interface{}, error) { +func (c *current) onSingleQuotedStringElement171() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent252() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement171() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent252() + return p.cur.onSingleQuotedStringElement171() } -func (c *current) onExampleBlockRawContent268() (interface{}, error) { - - return string(c.text), nil +func (c *current) onSingleQuotedStringElement167(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonExampleBlockRawContent268() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement167() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent268() + return p.cur.onSingleQuotedStringElement167(stack["name"]) } -func (c *current) onExampleBlockRawContent262(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onSingleQuotedStringElement118(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonExampleBlockRawContent262() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement118() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent262(stack["content"]) + return p.cur.onSingleQuotedStringElement118(stack["element"]) } -func (c *current) onExampleBlockRawContent243(line interface{}) (interface{}, error) { +func (c *current) onSingleQuotedStringElement177() (interface{}, error) { + + return types.NewStringElement(string(c.text)) - return line, nil } -func (p *parser) callonExampleBlockRawContent243() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement177() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent243(stack["line"]) + return p.cur.onSingleQuotedStringElement177() } -func (c *current) onExampleBlockRawContent282() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement99(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonExampleBlockRawContent282() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent282() + return p.cur.onSingleQuotedStringElement99(stack["id"], stack["label"]) } -func (c *current) onExampleBlockRawContent228(content interface{}) (interface{}, error) { - return types.NewFencedBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuotedStringElement184() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent228() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement184() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent228(stack["content"]) + return p.cur.onSingleQuotedStringElement184() } -func (c *current) onExampleBlockRawContent297() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement180(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonExampleBlockRawContent297() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement180() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent297() + return p.cur.onSingleQuotedStringElement180(stack["id"]) } -func (c *current) onExampleBlockRawContent315() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement97() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent315() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent315() + return p.cur.onSingleQuotedStringElement97() } -func (c *current) onExampleBlockRawContent331() (interface{}, error) { - - return string(c.text), nil +func (c *current) onSingleQuotedStringElement188() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonExampleBlockRawContent331() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement188() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent331() + return p.cur.onSingleQuotedStringElement188() } -func (c *current) onExampleBlockRawContent325(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onSingleQuotedStringElement92(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonExampleBlockRawContent325() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement92() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent325(stack["content"]) + return p.cur.onSingleQuotedStringElement92(stack["element"]) } -func (c *current) onExampleBlockRawContent306(line interface{}) (interface{}, error) { +func (c *current) onSingleQuotedStringElement194() (bool, error) { + + return c.isPreceededBySpace(), nil - return line, nil } -func (p *parser) callonExampleBlockRawContent306() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement194() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent306(stack["line"]) + return p.cur.onSingleQuotedStringElement194() } -func (c *current) onExampleBlockRawContent345() (interface{}, error) { +func (c *current) onSingleQuotedStringElement197() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent345() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement197() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent345() + return p.cur.onSingleQuotedStringElement197() } -func (c *current) onExampleBlockRawContent291(content interface{}) (interface{}, error) { - return types.NewListingBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuotedStringElement201() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent291() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement201() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent291(stack["content"]) + return p.cur.onSingleQuotedStringElement201() } -func (c *current) onExampleBlockRawContent356() (bool, error) { - // AttrPositional1 must be equal to `verse` - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Verse), nil +func (c *current) onSingleQuotedStringElement192() (interface{}, error) { + return types.NewLineBreak() } -func (p *parser) callonExampleBlockRawContent356() (bool, error) { +func (p *parser) callonSingleQuotedStringElement192() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent356() + return p.cur.onSingleQuotedStringElement192() } -func (c *current) onExampleBlockRawContent361() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement210() (interface{}, error) { + return types.NewStringElement("\u2019") + } -func (p *parser) callonExampleBlockRawContent361() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement210() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent361() + return p.cur.onSingleQuotedStringElement210() } -func (c *current) onExampleBlockRawContent379() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement212() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonExampleBlockRawContent379() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement212() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent379() + return p.cur.onSingleQuotedStringElement212() } -func (c *current) onExampleBlockRawContent395() (interface{}, error) { - - return string(c.text), nil +func (c *current) onSingleQuotedStringElement214() (interface{}, error) { + return types.NewStringElement("\u2122") } -func (p *parser) callonExampleBlockRawContent395() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent395() + return p.cur.onSingleQuotedStringElement214() } -func (c *current) onExampleBlockRawContent389(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onSingleQuotedStringElement216() (interface{}, error) { + return types.NewStringElement("\u00ae") } -func (p *parser) callonExampleBlockRawContent389() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement216() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent389(stack["content"]) + return p.cur.onSingleQuotedStringElement216() } -func (c *current) onExampleBlockRawContent370(line interface{}) (interface{}, error) { +func (c *current) onSingleQuotedStringElement218() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") - return line, nil } -func (p *parser) callonExampleBlockRawContent370() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement218() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent370(stack["line"]) + return p.cur.onSingleQuotedStringElement218() } -func (c *current) onExampleBlockRawContent409() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement220() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonExampleBlockRawContent409() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement220() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent409() + return p.cur.onSingleQuotedStringElement220() } -func (c *current) onExampleBlockRawContent354(content interface{}) (interface{}, error) { - return types.NewVerseBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuotedStringElement229() (interface{}, error) { + // ' + return types.NewStringElement(string(c.text)) } -func (p *parser) callonExampleBlockRawContent354() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement229() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent354(stack["content"]) + return p.cur.onSingleQuotedStringElement229() } -func (c *current) onExampleBlockRawContent428() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement1(element interface{}) (interface{}, error) { + c.trackSpaceSuffix(element) + return element, nil + } -func (p *parser) callonExampleBlockRawContent428() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent428() + return p.cur.onSingleQuotedStringElement1(stack["element"]) } -func (c *current) onExampleBlockRawContent437() (interface{}, error) { - return string(c.text), nil +func (c *current) onQuotedTextInSingleQuotedString10(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonExampleBlockRawContent437() (interface{}, error) { +func (p *parser) callonQuotedTextInSingleQuotedString10() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent437() + return p.cur.onQuotedTextInSingleQuotedString10(stack["element"]) } -func (c *current) onExampleBlockRawContent420(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onQuotedTextInSingleQuotedString1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -func (p *parser) callonExampleBlockRawContent420() (interface{}, error) { +func (p *parser) callonQuotedTextInSingleQuotedString1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent420(stack["content"]) + return p.cur.onQuotedTextInSingleQuotedString1(stack["attributes"], stack["text"]) } -func (c *current) onExampleBlockRawContent451() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedString1(elements interface{}) (interface{}, error) { + return types.NewQuotedString(types.DoubleQuote, elements.([]interface{})) + } -func (p *parser) callonExampleBlockRawContent451() (interface{}, error) { +func (p *parser) callonDoubleQuotedString1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent451() + return p.cur.onDoubleQuotedString1(stack["elements"]) } -func (c *current) onExampleBlockRawContent469() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElements1(elements interface{}) (interface{}, error) { + c.resetSpaceSuffixTracking() + return types.NewInlineElements(elements) + } -func (p *parser) callonExampleBlockRawContent469() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElements1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent469() + return p.cur.onDoubleQuotedStringElements1(stack["elements"]) } -func (c *current) onExampleBlockRawContent485() (interface{}, error) { - +func (c *current) onDoubleQuotedStringElement13() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent485() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent485() + return p.cur.onDoubleQuotedStringElement13() } -func (c *current) onExampleBlockRawContent479(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onDoubleQuotedStringElement7() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonExampleBlockRawContent479() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent479(stack["content"]) + return p.cur.onDoubleQuotedStringElement7() } -func (c *current) onExampleBlockRawContent460(line interface{}) (interface{}, error) { +func (c *current) onDoubleQuotedStringElement17() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil - return line, nil } -func (p *parser) callonExampleBlockRawContent460() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent460(stack["line"]) + return p.cur.onDoubleQuotedStringElement17() } -func (c *current) onExampleBlockRawContent499() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement22() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent499() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent499() + return p.cur.onDoubleQuotedStringElement22() } -func (c *current) onExampleBlockRawContent445(content interface{}) (interface{}, error) { - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onDoubleQuotedStringElement28() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent445() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement28() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent445(stack["content"]) + return p.cur.onDoubleQuotedStringElement28() } -func (c *current) onExampleBlockRawContent515() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement36() (bool, error) { + + return c.isPreceededBySpace(), nil + } -func (p *parser) callonExampleBlockRawContent515() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement36() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent515() + return p.cur.onDoubleQuotedStringElement36() } -func (c *current) onExampleBlockRawContent533() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement39() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent533() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement39() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent533() + return p.cur.onDoubleQuotedStringElement39() } -func (c *current) onExampleBlockRawContent549() (interface{}, error) { - +func (c *current) onDoubleQuotedStringElement43() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil - } -func (p *parser) callonExampleBlockRawContent549() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement43() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent549() + return p.cur.onDoubleQuotedStringElement43() } -func (c *current) onExampleBlockRawContent543(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onDoubleQuotedStringElement34() (interface{}, error) { + return types.NewLineBreak() } -func (p *parser) callonExampleBlockRawContent543() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement34() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent543(stack["content"]) + return p.cur.onDoubleQuotedStringElement34() } -func (c *current) onExampleBlockRawContent524(line interface{}) (interface{}, error) { +func (c *current) onDoubleQuotedStringElement54() (bool, error) { + return c.isSubstitutionEnabled(Attributes) - return line, nil } -func (p *parser) callonExampleBlockRawContent524() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement54() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent524(stack["line"]) + return p.cur.onDoubleQuotedStringElement54() } -func (c *current) onExampleBlockRawContent563() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement61() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent563() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement61() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent563() + return p.cur.onDoubleQuotedStringElement61() } -func (c *current) onExampleBlockRawContent509(content interface{}) (interface{}, error) { - return types.NewCommentBlock(content.([]interface{}), nil) +func (c *current) onDoubleQuotedStringElement73() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent509() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement73() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent509(stack["content"]) + return p.cur.onDoubleQuotedStringElement73() } -func (c *current) onExampleBlockRawContent574() (bool, error) { - attrs := c.globalStore.getAttributes() - return types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Literal), nil +func (c *current) onDoubleQuotedStringElement75() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonExampleBlockRawContent574() (bool, error) { +func (p *parser) callonDoubleQuotedStringElement75() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent574() + return p.cur.onDoubleQuotedStringElement75() } -func (c *current) onExampleBlockRawContent588() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement68(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent588() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement68() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent588() + return p.cur.onDoubleQuotedStringElement68(stack["start"]) } -func (c *current) onExampleBlockRawContent580() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onDoubleQuotedStringElement57(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonExampleBlockRawContent580() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement57() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent580() + return p.cur.onDoubleQuotedStringElement57(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent596() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onDoubleQuotedStringElement83() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent596() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement83() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent596() + return p.cur.onDoubleQuotedStringElement83() } -func (c *current) onExampleBlockRawContent577(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onDoubleQuotedStringElement95() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent577() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement95() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent577(stack["content"]) + return p.cur.onDoubleQuotedStringElement95() } -func (c *current) onExampleBlockRawContent572(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithAttribute, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onDoubleQuotedStringElement97() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonExampleBlockRawContent572() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent572(stack["lines"]) + return p.cur.onDoubleQuotedStringElement97() } -func (c *current) onExampleBlockRawContent617() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement90(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent617() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement90() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent617() + return p.cur.onDoubleQuotedStringElement90(stack["start"]) } -func (c *current) onExampleBlockRawContent612() (interface{}, error) { - return types.NewRawLine(string(c.text)) - +func (c *current) onDoubleQuotedStringElement79(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonExampleBlockRawContent612() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement79() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent612() + return p.cur.onDoubleQuotedStringElement79(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent609(line interface{}) (interface{}, error) { - // do not include the trailing 'EOL' on the first line - return line, nil +func (c *current) onDoubleQuotedStringElement105() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent609() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement105() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent609(stack["line"]) + return p.cur.onDoubleQuotedStringElement105() } -func (c *current) onExampleBlockRawContent639() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement101(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonExampleBlockRawContent639() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement101() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent639() + return p.cur.onDoubleQuotedStringElement101(stack["name"]) } -func (c *current) onExampleBlockRawContent631() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onDoubleQuotedStringElement52(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonExampleBlockRawContent631() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement52() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent631() + return p.cur.onDoubleQuotedStringElement52(stack["element"]) } -func (c *current) onExampleBlockRawContent647() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onDoubleQuotedStringElement113() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonExampleBlockRawContent647() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement113() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent647() + return p.cur.onDoubleQuotedStringElement113() } -func (c *current) onExampleBlockRawContent628(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onDoubleQuotedStringElement122() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent628() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement122() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent628(stack["content"]) + return p.cur.onDoubleQuotedStringElement122() } -func (c *current) onExampleBlockRawContent606(firstLine, otherLines interface{}) (interface{}, error) { +func (c *current) onDoubleQuotedStringElement126() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil } -func (p *parser) callonExampleBlockRawContent606() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement126() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent606(stack["firstLine"], stack["otherLines"]) + return p.cur.onDoubleQuotedStringElement126() } -func (c *current) onExampleBlockRawContent604(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithSpacesOnFirstLine, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onDoubleQuotedStringElement132() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent604() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement132() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent604(stack["lines"]) + return p.cur.onDoubleQuotedStringElement132() } -func (c *current) onExampleBlockRawContent661() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement139() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonExampleBlockRawContent661() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement139() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent661() + return p.cur.onDoubleQuotedStringElement139() } -func (c *current) onExampleBlockRawContent673() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onDoubleQuotedStringElement146() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent673() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement146() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent673() + return p.cur.onDoubleQuotedStringElement146() } -func (c *current) onExampleBlockRawContent670(line interface{}) (interface{}, error) { +func (c *current) onDoubleQuotedStringElement158() (interface{}, error) { + return string(c.text), nil - return line, nil // do not include the trailing 'EOL' } -func (p *parser) callonExampleBlockRawContent670() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement158() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent670(stack["line"]) + return p.cur.onDoubleQuotedStringElement158() } -func (c *current) onExampleBlockRawContent667(lines interface{}) (interface{}, error) { - return lines.([]interface{}), nil +func (c *current) onDoubleQuotedStringElement160() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent667() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement160() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent667(stack["lines"]) + return p.cur.onDoubleQuotedStringElement160() } -func (c *current) onExampleBlockRawContent690() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement153(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent690() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement153() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent690() + return p.cur.onDoubleQuotedStringElement153(stack["start"]) } -func (c *current) onExampleBlockRawContent655(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithDelimiter, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onDoubleQuotedStringElement142(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonExampleBlockRawContent655() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement142() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent655(stack["lines"]) + return p.cur.onDoubleQuotedStringElement142(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent703() (interface{}, error) { - return types.Tip, nil +func (c *current) onDoubleQuotedStringElement168() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent703() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement168() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent703() + return p.cur.onDoubleQuotedStringElement168() } -func (c *current) onExampleBlockRawContent705() (interface{}, error) { - return types.Note, nil +func (c *current) onDoubleQuotedStringElement180() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent705() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement180() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent705() + return p.cur.onDoubleQuotedStringElement180() } -func (c *current) onExampleBlockRawContent707() (interface{}, error) { - return types.Important, nil +func (c *current) onDoubleQuotedStringElement182() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent707() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement182() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent707() + return p.cur.onDoubleQuotedStringElement182() } -func (c *current) onExampleBlockRawContent709() (interface{}, error) { - return types.Warning, nil +func (c *current) onDoubleQuotedStringElement175(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent709() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement175() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent709() + return p.cur.onDoubleQuotedStringElement175(stack["start"]) } -func (c *current) onExampleBlockRawContent711() (interface{}, error) { - return types.Caution, nil +func (c *current) onDoubleQuotedStringElement164(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonExampleBlockRawContent711() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement164() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent711() + return p.cur.onDoubleQuotedStringElement164(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent725() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement190() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent725() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement190() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent725() + return p.cur.onDoubleQuotedStringElement190() } -func (c *current) onExampleBlockRawContent734() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement186(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonExampleBlockRawContent734() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent734() + return p.cur.onDoubleQuotedStringElement186(stack["name"]) } -func (c *current) onExampleBlockRawContent717(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onDoubleQuotedStringElement137(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonExampleBlockRawContent717() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent717(stack["content"]) + return p.cur.onDoubleQuotedStringElement137(stack["element"]) } -func (c *current) onExampleBlockRawContent755() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement196() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent755() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement196() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent755() + return p.cur.onDoubleQuotedStringElement196() } -func (c *current) onExampleBlockRawContent767() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement118(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonExampleBlockRawContent767() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement118() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent767() + return p.cur.onDoubleQuotedStringElement118(stack["id"], stack["label"]) } -func (c *current) onExampleBlockRawContent779() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement203() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent779() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement203() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent779() + return p.cur.onDoubleQuotedStringElement203() } -func (c *current) onExampleBlockRawContent791() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement199(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonExampleBlockRawContent791() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement199() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent791() + return p.cur.onDoubleQuotedStringElement199(stack["id"]) } -func (c *current) onExampleBlockRawContent803() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement116() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent803() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent803() + return p.cur.onDoubleQuotedStringElement116() } -func (c *current) onExampleBlockRawContent815() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement207() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent815() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement207() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent815() + return p.cur.onDoubleQuotedStringElement207() } -func (c *current) onExampleBlockRawContent827() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement111(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonExampleBlockRawContent827() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent827() + return p.cur.onDoubleQuotedStringElement111(stack["element"]) } -func (c *current) onExampleBlockRawContent835() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement212() (interface{}, error) { + return types.NewStringElement(string(c.text)) - return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent835() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement212() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent835() + return p.cur.onDoubleQuotedStringElement212() } -func (c *current) onExampleBlockRawContent843(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onDoubleQuotedStringElement1(element interface{}) (interface{}, error) { + c.trackSpaceSuffix(element) + return element, nil } -func (p *parser) callonExampleBlockRawContent843() (bool, error) { +func (p *parser) callonDoubleQuotedStringElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent843(stack["content"]) + return p.cur.onDoubleQuotedStringElement1(stack["element"]) } -func (c *current) onExampleBlockRawContent742(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) - +func (c *current) onQuotedTextInDoubleQuotedString10(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonExampleBlockRawContent742() (interface{}, error) { +func (p *parser) callonQuotedTextInDoubleQuotedString10() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent742(stack["content"]) + return p.cur.onQuotedTextInDoubleQuotedString10(stack["element"]) } -func (c *current) onExampleBlockRawContent699(t, lines interface{}) (interface{}, error) { - - return types.NewAdmonitionParagraph(lines.([]interface{}), t.(string), c.globalStore.getAttributes()) +func (c *current) onQuotedTextInDoubleQuotedString1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) } -func (p *parser) callonExampleBlockRawContent699() (interface{}, error) { +func (p *parser) callonQuotedTextInDoubleQuotedString1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent699(stack["t"], stack["lines"]) + return p.cur.onQuotedTextInDoubleQuotedString1(stack["attributes"], stack["text"]) } -func (c *current) onExampleBlockRawContent860() (interface{}, error) { +func (c *current) onAttributesGroup6() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent860() (interface{}, error) { +func (p *parser) callonAttributesGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent860() + return p.cur.onAttributesGroup6() } -func (c *current) onExampleBlockRawContent852() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onAttributesGroup9() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent852() (interface{}, error) { +func (p *parser) callonAttributesGroup9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent852() + return p.cur.onAttributesGroup9() } -func (c *current) onExampleBlockRawContent876() (interface{}, error) { - - return string(c.text), nil +func (c *current) onAttributesGroup13() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonExampleBlockRawContent876() (interface{}, error) { +func (p *parser) callonAttributesGroup13() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent876() + return p.cur.onAttributesGroup13() } -func (c *current) onExampleBlockRawContent870(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onAttributesGroup22() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent870() (interface{}, error) { +func (p *parser) callonAttributesGroup22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent870(stack["content"]) + return p.cur.onAttributesGroup22() } -func (c *current) onExampleBlockRawContent849(content interface{}) (interface{}, error) { +func (c *current) onAttributesGroup26() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil - return content, nil } -func (p *parser) callonExampleBlockRawContent849() (interface{}, error) { +func (p *parser) callonAttributesGroup26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent849(stack["content"]) + return p.cur.onAttributesGroup26() } -func (c *current) onExampleBlockRawContent844(content interface{}) (interface{}, error) { - return types.NewMarkdownQuoteBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onAttributesGroup32() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) } -func (p *parser) callonExampleBlockRawContent844() (interface{}, error) { +func (p *parser) callonAttributesGroup32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent844(stack["content"]) + return p.cur.onAttributesGroup32() } -func (c *current) onExampleBlockRawContent886() (bool, error) { - // verify that one of the attributes is `kind:passthrough` - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Passthrough), nil +func (c *current) onAttributesGroup39() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonExampleBlockRawContent886() (bool, error) { +func (p *parser) callonAttributesGroup39() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent886() + return p.cur.onAttributesGroup39() } -func (c *current) onExampleBlockRawContent902() (interface{}, error) { +func (c *current) onAttributesGroup46() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent902() (interface{}, error) { +func (p *parser) callonAttributesGroup46() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent902() + return p.cur.onAttributesGroup46() } -func (c *current) onExampleBlockRawContent914() (interface{}, error) { +func (c *current) onAttributesGroup58() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent914() (interface{}, error) { +func (p *parser) callonAttributesGroup58() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent914() + return p.cur.onAttributesGroup58() } -func (c *current) onExampleBlockRawContent926() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup60() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent926() (interface{}, error) { +func (p *parser) callonAttributesGroup60() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent926() + return p.cur.onAttributesGroup60() } -func (c *current) onExampleBlockRawContent938() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup53(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent938() (interface{}, error) { +func (p *parser) callonAttributesGroup53() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent938() + return p.cur.onAttributesGroup53(stack["start"]) } -func (c *current) onExampleBlockRawContent950() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup42(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonExampleBlockRawContent950() (interface{}, error) { +func (p *parser) callonAttributesGroup42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent950() + return p.cur.onAttributesGroup42(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent962() (interface{}, error) { +func (c *current) onAttributesGroup68() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent962() (interface{}, error) { +func (p *parser) callonAttributesGroup68() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent962() + return p.cur.onAttributesGroup68() } -func (c *current) onExampleBlockRawContent974() (interface{}, error) { +func (c *current) onAttributesGroup80() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent974() (interface{}, error) { +func (p *parser) callonAttributesGroup80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent974() + return p.cur.onAttributesGroup80() } -func (c *current) onExampleBlockRawContent982() (interface{}, error) { +func (c *current) onAttributesGroup82() (interface{}, error) { + + return strconv.Atoi(string(c.text)) - return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent982() (interface{}, error) { +func (p *parser) callonAttributesGroup82() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent982() + return p.cur.onAttributesGroup82() } -func (c *current) onExampleBlockRawContent990(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onAttributesGroup75(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonExampleBlockRawContent990() (bool, error) { +func (p *parser) callonAttributesGroup75() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent990(stack["content"]) + return p.cur.onAttributesGroup75(stack["start"]) } -func (c *current) onExampleBlockRawContent889(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) - +func (c *current) onAttributesGroup64(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonExampleBlockRawContent889() (interface{}, error) { +func (p *parser) callonAttributesGroup64() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent889(stack["content"]) + return p.cur.onAttributesGroup64(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent884(content interface{}) (interface{}, error) { - - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onAttributesGroup90() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent884() (interface{}, error) { +func (p *parser) callonAttributesGroup90() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent884(stack["content"]) + return p.cur.onAttributesGroup90() } -func (c *current) onExampleBlockRawContent1003() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup86(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonExampleBlockRawContent1003() (interface{}, error) { +func (p *parser) callonAttributesGroup86() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1003() + return p.cur.onAttributesGroup86(stack["name"]) } -func (c *current) onExampleBlockRawContent1012() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup37(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonExampleBlockRawContent1012() (interface{}, error) { +func (p *parser) callonAttributesGroup37() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1012() + return p.cur.onAttributesGroup37(stack["element"]) } -func (c *current) onExampleBlockRawContent995(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onAttributesGroup96() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent995() (interface{}, error) { +func (p *parser) callonAttributesGroup96() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent995(stack["content"]) + return p.cur.onAttributesGroup96() } -func (c *current) onExampleBlockRawContent1033() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup18(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonExampleBlockRawContent1033() (interface{}, error) { +func (p *parser) callonAttributesGroup18() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1033() + return p.cur.onAttributesGroup18(stack["id"], stack["label"]) } -func (c *current) onExampleBlockRawContent1045() (interface{}, error) { +func (c *current) onAttributesGroup103() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent1045() (interface{}, error) { +func (p *parser) callonAttributesGroup103() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1045() + return p.cur.onAttributesGroup103() } -func (c *current) onExampleBlockRawContent1057() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup99(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonExampleBlockRawContent1057() (interface{}, error) { +func (p *parser) callonAttributesGroup99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1057() + return p.cur.onAttributesGroup99(stack["id"]) } -func (c *current) onExampleBlockRawContent1069() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup16() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent1069() (interface{}, error) { +func (p *parser) callonAttributesGroup16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1069() + return p.cur.onAttributesGroup16() } -func (c *current) onExampleBlockRawContent1081() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup107() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent1081() (interface{}, error) { +func (p *parser) callonAttributesGroup107() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1081() + return p.cur.onAttributesGroup107() } -func (c *current) onExampleBlockRawContent1093() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup11(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonExampleBlockRawContent1093() (interface{}, error) { +func (p *parser) callonAttributesGroup11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1093() + return p.cur.onAttributesGroup11(stack["element"]) } -func (c *current) onExampleBlockRawContent1105() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup113() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonExampleBlockRawContent1105() (interface{}, error) { +func (p *parser) callonAttributesGroup113() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1105() + return p.cur.onAttributesGroup113() } -func (c *current) onExampleBlockRawContent1113() (interface{}, error) { - +func (c *current) onAttributesGroup120() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent1113() (interface{}, error) { +func (p *parser) callonAttributesGroup120() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1113() + return p.cur.onAttributesGroup120() } -func (c *current) onExampleBlockRawContent1121(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onAttributesGroup132() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent1121() (bool, error) { +func (p *parser) callonAttributesGroup132() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1121(stack["content"]) + return p.cur.onAttributesGroup132() } -func (c *current) onExampleBlockRawContent1020(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onAttributesGroup134() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonExampleBlockRawContent1020() (interface{}, error) { +func (p *parser) callonAttributesGroup134() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1020(stack["content"]) + return p.cur.onAttributesGroup134() } -func (c *current) onExampleBlockRawContent991(lines interface{}) (interface{}, error) { - - return types.NewParagraph(lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onAttributesGroup127(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonExampleBlockRawContent991() (interface{}, error) { +func (p *parser) callonAttributesGroup127() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent991(stack["lines"]) + return p.cur.onAttributesGroup127(stack["start"]) } -func (c *current) onExampleBlockRawContent1128() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup116(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonExampleBlockRawContent1128() (interface{}, error) { +func (p *parser) callonAttributesGroup116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1128() + return p.cur.onAttributesGroup116(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent1122() (interface{}, error) { - // for standalone attributes at the end of the delomited block - return types.NewStandaloneAttributes(c.globalStore.getAttributes()) // will be discarded anyways +func (c *current) onAttributesGroup142() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent1122() (interface{}, error) { +func (p *parser) callonAttributesGroup142() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1122() + return p.cur.onAttributesGroup142() } -func (c *current) onExampleBlockRawContent4(attributes, element interface{}) (interface{}, error) { - c.globalStore.discardAttributes() - return element, nil +func (c *current) onAttributesGroup154() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent4() (interface{}, error) { +func (p *parser) callonAttributesGroup154() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent4(stack["attributes"], stack["element"]) + return p.cur.onAttributesGroup154() } -func (c *current) onExampleBlockRawContent1(elements interface{}) (interface{}, error) { - return elements, nil +func (c *current) onAttributesGroup156() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonExampleBlockRawContent1() (interface{}, error) { +func (p *parser) callonAttributesGroup156() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1(stack["elements"]) + return p.cur.onAttributesGroup156() } -func (c *current) onQuoteBlock3() (bool, error) { - // AttrPositional1 may be missing or must be equal to `quote` - attrs := c.globalStore.getAttributes() - if types.HasNotAttribute(attrs, types.AttrPositional1) || - types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Quote) { - return true, nil - } - return false, nil +func (c *current) onAttributesGroup149(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonQuoteBlock3() (bool, error) { +func (p *parser) callonAttributesGroup149() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlock3() + return p.cur.onAttributesGroup149(stack["start"]) } -func (c *current) onQuoteBlock8() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup138(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonQuoteBlock8() (interface{}, error) { +func (p *parser) callonAttributesGroup138() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlock8() + return p.cur.onAttributesGroup138(stack["name"], stack["start"]) } -func (c *current) onQuoteBlock23() (interface{}, error) { +func (c *current) onAttributesGroup164() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlock23() (interface{}, error) { +func (p *parser) callonAttributesGroup164() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlock23() + return p.cur.onAttributesGroup164() } -func (c *current) onQuoteBlock1(content interface{}) (interface{}, error) { - return types.NewQuoteBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onAttributesGroup160(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonQuoteBlock1() (interface{}, error) { +func (p *parser) callonAttributesGroup160() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlock1(stack["content"]) + return p.cur.onAttributesGroup160(stack["name"]) } -func (c *current) onQuoteBlockRawContent13() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup111(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent13() (interface{}, error) { +func (p *parser) callonAttributesGroup111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent13() + return p.cur.onAttributesGroup111(stack["element"]) } -func (c *current) onQuoteBlockRawContent25(attributes interface{}) error { - c.globalStore.pushAttributes(attributes) - return nil - +func (c *current) onAttributesGroup174() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent25() error { +func (p *parser) callonAttributesGroup174() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent25(stack["attributes"]) + return p.cur.onAttributesGroup174() } -func (c *current) onQuoteBlockRawContent31() (bool, error) { - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Literal), nil - +func (c *current) onAttributesGroup170(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonQuoteBlockRawContent31() (bool, error) { +func (p *parser) callonAttributesGroup170() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent31() + return p.cur.onAttributesGroup170(stack["ref"]) } -func (c *current) onQuoteBlockRawContent40() (interface{}, error) { +func (c *current) onAttributesGroup178() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent40() (interface{}, error) { +func (p *parser) callonAttributesGroup178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent40() + return p.cur.onAttributesGroup178() } -func (c *current) onQuoteBlockRawContent49() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onAttributesGroup1(elements interface{}) (interface{}, error) { + + return types.NewInlineElements(elements) } -func (p *parser) callonQuoteBlockRawContent49() (interface{}, error) { +func (p *parser) callonAttributesGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent49() + return p.cur.onAttributesGroup1(stack["elements"]) } -func (c *current) onQuoteBlockRawContent36(elements interface{}) (interface{}, error) { +func (c *current) onElementAttributesGroup11() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent36() (interface{}, error) { +func (p *parser) callonElementAttributesGroup11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent36(stack["elements"]) + return p.cur.onElementAttributesGroup11() } -func (c *current) onQuoteBlockRawContent33(content interface{}) (interface{}, error) { - - return types.NewRawLine(content.(string)) +func (c *current) onElementAttributesGroup16() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent33() (interface{}, error) { +func (p *parser) callonElementAttributesGroup16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent33(stack["content"]) + return p.cur.onElementAttributesGroup16() } -func (c *current) onQuoteBlockRawContent76() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup6() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent76() (interface{}, error) { +func (p *parser) callonElementAttributesGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent76() + return p.cur.onElementAttributesGroup6() } -func (c *current) onQuoteBlockRawContent85() (interface{}, error) { +func (c *current) onElementAttributesGroup23() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent85() (interface{}, error) { +func (p *parser) callonElementAttributesGroup23() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent85() + return p.cur.onElementAttributesGroup23() } -func (c *current) onQuoteBlockRawContent68(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onElementAttributesGroup27() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonQuoteBlockRawContent68() (interface{}, error) { +func (p *parser) callonElementAttributesGroup27() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent68(stack["content"]) + return p.cur.onElementAttributesGroup27() } -func (c *current) onQuoteBlockRawContent106() (interface{}, error) { +func (c *current) onElementAttributesGroup34() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent106() (interface{}, error) { +func (p *parser) callonElementAttributesGroup34() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent106() + return p.cur.onElementAttributesGroup34() } -func (c *current) onQuoteBlockRawContent118() (interface{}, error) { +func (c *current) onElementAttributesGroup46() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent118() (interface{}, error) { +func (p *parser) callonElementAttributesGroup46() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent118() + return p.cur.onElementAttributesGroup46() } -func (c *current) onQuoteBlockRawContent130() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup48() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent130() (interface{}, error) { +func (p *parser) callonElementAttributesGroup48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent130() + return p.cur.onElementAttributesGroup48() } -func (c *current) onQuoteBlockRawContent142() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup41(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonQuoteBlockRawContent142() (interface{}, error) { +func (p *parser) callonElementAttributesGroup41() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent142() + return p.cur.onElementAttributesGroup41(stack["start"]) } -func (c *current) onQuoteBlockRawContent154() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup30(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonQuoteBlockRawContent154() (interface{}, error) { +func (p *parser) callonElementAttributesGroup30() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent154() + return p.cur.onElementAttributesGroup30(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent166() (interface{}, error) { +func (c *current) onElementAttributesGroup56() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent166() (interface{}, error) { +func (p *parser) callonElementAttributesGroup56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent166() + return p.cur.onElementAttributesGroup56() } -func (c *current) onQuoteBlockRawContent178() (interface{}, error) { +func (c *current) onElementAttributesGroup68() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent178() (interface{}, error) { +func (p *parser) callonElementAttributesGroup68() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent178() + return p.cur.onElementAttributesGroup68() } -func (c *current) onQuoteBlockRawContent186() (interface{}, error) { +func (c *current) onElementAttributesGroup70() (interface{}, error) { + + return strconv.Atoi(string(c.text)) - return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent186() (interface{}, error) { +func (p *parser) callonElementAttributesGroup70() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent186() + return p.cur.onElementAttributesGroup70() } -func (c *current) onQuoteBlockRawContent194(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onElementAttributesGroup63(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonQuoteBlockRawContent194() (bool, error) { +func (p *parser) callonElementAttributesGroup63() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent194(stack["content"]) + return p.cur.onElementAttributesGroup63(stack["start"]) } -func (c *current) onQuoteBlockRawContent93(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) - +func (c *current) onElementAttributesGroup52(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonQuoteBlockRawContent93() (interface{}, error) { +func (p *parser) callonElementAttributesGroup52() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent93(stack["content"]) + return p.cur.onElementAttributesGroup52(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent29(firstLine, otherLines interface{}) (interface{}, error) { - - return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...), c.globalStore.getAttributes()) +func (c *current) onElementAttributesGroup78() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent29() (interface{}, error) { +func (p *parser) callonElementAttributesGroup78() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent29(stack["firstLine"], stack["otherLines"]) + return p.cur.onElementAttributesGroup78() } -func (c *current) onQuoteBlockRawContent203() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup74(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonQuoteBlockRawContent203() (interface{}, error) { +func (p *parser) callonElementAttributesGroup74() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent203() + return p.cur.onElementAttributesGroup74(stack["name"]) } -func (c *current) onQuoteBlockRawContent195() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onElementAttributesGroup25(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent195() (interface{}, error) { +func (p *parser) callonElementAttributesGroup25() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent195() + return p.cur.onElementAttributesGroup25(stack["element"]) } -func (c *current) onQuoteBlockRawContent211() (interface{}, error) { - return types.NewThematicBreak() +func (c *current) onElementAttributesGroup87() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonQuoteBlockRawContent211() (interface{}, error) { +func (p *parser) callonElementAttributesGroup87() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent211() + return p.cur.onElementAttributesGroup87() } -func (c *current) onQuoteBlockRawContent234() (interface{}, error) { +func (c *current) onElementAttributesGroup96() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent234() (interface{}, error) { +func (p *parser) callonElementAttributesGroup96() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent234() + return p.cur.onElementAttributesGroup96() } -func (c *current) onQuoteBlockRawContent252() (interface{}, error) { +func (c *current) onElementAttributesGroup100() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent252() (interface{}, error) { +func (p *parser) callonElementAttributesGroup100() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent252() + return p.cur.onElementAttributesGroup100() } -func (c *current) onQuoteBlockRawContent268() (interface{}, error) { - - return string(c.text), nil +func (c *current) onElementAttributesGroup106() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent268() (interface{}, error) { +func (p *parser) callonElementAttributesGroup106() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent268() + return p.cur.onElementAttributesGroup106() } -func (c *current) onQuoteBlockRawContent262(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onElementAttributesGroup113() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonQuoteBlockRawContent262() (interface{}, error) { +func (p *parser) callonElementAttributesGroup113() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent262(stack["content"]) + return p.cur.onElementAttributesGroup113() } -func (c *current) onQuoteBlockRawContent243(line interface{}) (interface{}, error) { +func (c *current) onElementAttributesGroup120() (interface{}, error) { + return string(c.text), nil - return line, nil } -func (p *parser) callonQuoteBlockRawContent243() (interface{}, error) { +func (p *parser) callonElementAttributesGroup120() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent243(stack["line"]) + return p.cur.onElementAttributesGroup120() } -func (c *current) onQuoteBlockRawContent282() (interface{}, error) { +func (c *current) onElementAttributesGroup132() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent282() (interface{}, error) { +func (p *parser) callonElementAttributesGroup132() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent282() + return p.cur.onElementAttributesGroup132() } -func (c *current) onQuoteBlockRawContent228(content interface{}) (interface{}, error) { - return types.NewFencedBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onElementAttributesGroup134() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent228() (interface{}, error) { +func (p *parser) callonElementAttributesGroup134() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent228(stack["content"]) + return p.cur.onElementAttributesGroup134() } -func (c *current) onQuoteBlockRawContent297() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup127(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonQuoteBlockRawContent297() (interface{}, error) { +func (p *parser) callonElementAttributesGroup127() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent297() + return p.cur.onElementAttributesGroup127(stack["start"]) } -func (c *current) onQuoteBlockRawContent315() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup116(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonQuoteBlockRawContent315() (interface{}, error) { +func (p *parser) callonElementAttributesGroup116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent315() + return p.cur.onElementAttributesGroup116(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent331() (interface{}, error) { - +func (c *current) onElementAttributesGroup142() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent331() (interface{}, error) { +func (p *parser) callonElementAttributesGroup142() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent331() + return p.cur.onElementAttributesGroup142() } -func (c *current) onQuoteBlockRawContent325(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onElementAttributesGroup154() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent325() (interface{}, error) { +func (p *parser) callonElementAttributesGroup154() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent325(stack["content"]) + return p.cur.onElementAttributesGroup154() } -func (c *current) onQuoteBlockRawContent306(line interface{}) (interface{}, error) { +func (c *current) onElementAttributesGroup156() (interface{}, error) { - return line, nil -} - -func (p *parser) callonQuoteBlockRawContent306() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onQuoteBlockRawContent306(stack["line"]) -} + return strconv.Atoi(string(c.text)) -func (c *current) onQuoteBlockRawContent345() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent345() (interface{}, error) { +func (p *parser) callonElementAttributesGroup156() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent345() + return p.cur.onElementAttributesGroup156() } -func (c *current) onQuoteBlockRawContent291(content interface{}) (interface{}, error) { - return types.NewListingBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onElementAttributesGroup149(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonQuoteBlockRawContent291() (interface{}, error) { +func (p *parser) callonElementAttributesGroup149() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent291(stack["content"]) + return p.cur.onElementAttributesGroup149(stack["start"]) } -func (c *current) onQuoteBlockRawContent356() (bool, error) { - // AttrPositional1 must be equal to `verse` - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Verse), nil - +func (c *current) onElementAttributesGroup138(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonQuoteBlockRawContent356() (bool, error) { +func (p *parser) callonElementAttributesGroup138() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent356() + return p.cur.onElementAttributesGroup138(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent361() (interface{}, error) { +func (c *current) onElementAttributesGroup164() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent361() (interface{}, error) { +func (p *parser) callonElementAttributesGroup164() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent361() + return p.cur.onElementAttributesGroup164() } -func (c *current) onQuoteBlockRawContent379() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup160(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonQuoteBlockRawContent379() (interface{}, error) { +func (p *parser) callonElementAttributesGroup160() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent379() + return p.cur.onElementAttributesGroup160(stack["name"]) } -func (c *current) onQuoteBlockRawContent395() (interface{}, error) { - - return string(c.text), nil +func (c *current) onElementAttributesGroup111(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonQuoteBlockRawContent395() (interface{}, error) { +func (p *parser) callonElementAttributesGroup111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent395() + return p.cur.onElementAttributesGroup111(stack["element"]) } -func (c *current) onQuoteBlockRawContent389(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onElementAttributesGroup170() (interface{}, error) { + + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent389() (interface{}, error) { +func (p *parser) callonElementAttributesGroup170() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent389(stack["content"]) + return p.cur.onElementAttributesGroup170() } -func (c *current) onQuoteBlockRawContent370(line interface{}) (interface{}, error) { +func (c *current) onElementAttributesGroup92(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) - return line, nil } -func (p *parser) callonQuoteBlockRawContent370() (interface{}, error) { +func (p *parser) callonElementAttributesGroup92() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent370(stack["line"]) + return p.cur.onElementAttributesGroup92(stack["id"], stack["label"]) } -func (c *current) onQuoteBlockRawContent409() (interface{}, error) { +func (c *current) onElementAttributesGroup177() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent409() (interface{}, error) { +func (p *parser) callonElementAttributesGroup177() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent409() + return p.cur.onElementAttributesGroup177() } -func (c *current) onQuoteBlockRawContent354(content interface{}) (interface{}, error) { - return types.NewVerseBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onElementAttributesGroup173(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) } -func (p *parser) callonQuoteBlockRawContent354() (interface{}, error) { +func (p *parser) callonElementAttributesGroup173() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent354(stack["content"]) + return p.cur.onElementAttributesGroup173(stack["id"]) } -func (c *current) onQuoteBlockRawContent428() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup90() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent428() (interface{}, error) { +func (p *parser) callonElementAttributesGroup90() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent428() + return p.cur.onElementAttributesGroup90() } -func (c *current) onQuoteBlockRawContent437() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup181() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent437() (interface{}, error) { +func (p *parser) callonElementAttributesGroup181() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent437() + return p.cur.onElementAttributesGroup181() } -func (c *current) onQuoteBlockRawContent420(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onElementAttributesGroup85(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent420() (interface{}, error) { +func (p *parser) callonElementAttributesGroup85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent420(stack["content"]) + return p.cur.onElementAttributesGroup85(stack["element"]) } -func (c *current) onQuoteBlockRawContent451() (interface{}, error) { +func (c *current) onElementAttributesGroup187() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent451() (interface{}, error) { +func (p *parser) callonElementAttributesGroup187() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent451() + return p.cur.onElementAttributesGroup187() } -func (c *current) onQuoteBlockRawContent469() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup183(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonQuoteBlockRawContent469() (interface{}, error) { +func (p *parser) callonElementAttributesGroup183() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent469() + return p.cur.onElementAttributesGroup183(stack["ref"]) } -func (c *current) onQuoteBlockRawContent485() (interface{}, error) { +func (c *current) onElementAttributesGroup191() (interface{}, error) { - return string(c.text), nil + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent485() (interface{}, error) { +func (p *parser) callonElementAttributesGroup191() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent485() + return p.cur.onElementAttributesGroup191() } -func (c *current) onQuoteBlockRawContent479(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onElementAttributesGroup1(elements interface{}) (interface{}, error) { + + return types.NewInlineElements(elements) } -func (p *parser) callonQuoteBlockRawContent479() (interface{}, error) { +func (p *parser) callonElementAttributesGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent479(stack["content"]) + return p.cur.onElementAttributesGroup1(stack["elements"]) } -func (c *current) onQuoteBlockRawContent460(line interface{}) (interface{}, error) { +func (c *current) onHeaderGroup1(elements interface{}) (interface{}, error) { + + return types.NewInlineElements(elements) - return line, nil } -func (p *parser) callonQuoteBlockRawContent460() (interface{}, error) { +func (p *parser) callonHeaderGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent460(stack["line"]) + return p.cur.onHeaderGroup1(stack["elements"]) } -func (c *current) onQuoteBlockRawContent499() (interface{}, error) { +func (c *current) onHeaderGroupElement13() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent499() (interface{}, error) { +func (p *parser) callonHeaderGroupElement13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent499() + return p.cur.onHeaderGroupElement13() } -func (c *current) onQuoteBlockRawContent445(content interface{}) (interface{}, error) { - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onHeaderGroupElement18() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent445() (interface{}, error) { +func (p *parser) callonHeaderGroupElement18() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent445(stack["content"]) + return p.cur.onHeaderGroupElement18() } -func (c *current) onQuoteBlockRawContent515() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement8() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent515() (interface{}, error) { +func (p *parser) callonHeaderGroupElement8() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent515() + return p.cur.onHeaderGroupElement8() } -func (c *current) onQuoteBlockRawContent533() (interface{}, error) { +func (c *current) onHeaderGroupElement25() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent533() (interface{}, error) { +func (p *parser) callonHeaderGroupElement25() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent533() + return p.cur.onHeaderGroupElement25() } -func (c *current) onQuoteBlockRawContent549() (interface{}, error) { - - return string(c.text), nil +func (c *current) onHeaderGroupElement30() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonQuoteBlockRawContent549() (interface{}, error) { +func (p *parser) callonHeaderGroupElement30() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent549() + return p.cur.onHeaderGroupElement30() } -func (c *current) onQuoteBlockRawContent543(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onHeaderGroupElement39() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent543() (interface{}, error) { +func (p *parser) callonHeaderGroupElement39() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent543(stack["content"]) + return p.cur.onHeaderGroupElement39() } -func (c *current) onQuoteBlockRawContent524(line interface{}) (interface{}, error) { +func (c *current) onHeaderGroupElement43() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil - return line, nil } -func (p *parser) callonQuoteBlockRawContent524() (interface{}, error) { +func (p *parser) callonHeaderGroupElement43() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent524(stack["line"]) + return p.cur.onHeaderGroupElement43() } -func (c *current) onQuoteBlockRawContent563() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement49() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent563() (interface{}, error) { +func (p *parser) callonHeaderGroupElement49() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent563() + return p.cur.onHeaderGroupElement49() } -func (c *current) onQuoteBlockRawContent509(content interface{}) (interface{}, error) { - return types.NewCommentBlock(content.([]interface{}), nil) +func (c *current) onHeaderGroupElement56() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonQuoteBlockRawContent509() (interface{}, error) { +func (p *parser) callonHeaderGroupElement56() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent509(stack["content"]) + return p.cur.onHeaderGroupElement56() } -func (c *current) onQuoteBlockRawContent574() (bool, error) { - attrs := c.globalStore.getAttributes() - return types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Literal), nil +func (c *current) onHeaderGroupElement63() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent574() (bool, error) { +func (p *parser) callonHeaderGroupElement63() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent574() + return p.cur.onHeaderGroupElement63() } -func (c *current) onQuoteBlockRawContent588() (interface{}, error) { +func (c *current) onHeaderGroupElement75() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent588() (interface{}, error) { +func (p *parser) callonHeaderGroupElement75() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent588() + return p.cur.onHeaderGroupElement75() } -func (c *current) onQuoteBlockRawContent580() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onHeaderGroupElement77() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent580() (interface{}, error) { +func (p *parser) callonHeaderGroupElement77() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent580() + return p.cur.onHeaderGroupElement77() } -func (c *current) onQuoteBlockRawContent596() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onHeaderGroupElement70(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonQuoteBlockRawContent596() (interface{}, error) { +func (p *parser) callonHeaderGroupElement70() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent596() + return p.cur.onHeaderGroupElement70(stack["start"]) } -func (c *current) onQuoteBlockRawContent577(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onHeaderGroupElement59(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonQuoteBlockRawContent577() (interface{}, error) { +func (p *parser) callonHeaderGroupElement59() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent577(stack["content"]) + return p.cur.onHeaderGroupElement59(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent572(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithAttribute, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onHeaderGroupElement85() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent572() (interface{}, error) { +func (p *parser) callonHeaderGroupElement85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent572(stack["lines"]) + return p.cur.onHeaderGroupElement85() } -func (c *current) onQuoteBlockRawContent617() (interface{}, error) { +func (c *current) onHeaderGroupElement97() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent617() (interface{}, error) { +func (p *parser) callonHeaderGroupElement97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent617() + return p.cur.onHeaderGroupElement97() } -func (c *current) onQuoteBlockRawContent612() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onHeaderGroupElement99() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent612() (interface{}, error) { +func (p *parser) callonHeaderGroupElement99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent612() + return p.cur.onHeaderGroupElement99() } -func (c *current) onQuoteBlockRawContent609(line interface{}) (interface{}, error) { - // do not include the trailing 'EOL' on the first line - return line, nil +func (c *current) onHeaderGroupElement92(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonQuoteBlockRawContent609() (interface{}, error) { +func (p *parser) callonHeaderGroupElement92() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent609(stack["line"]) + return p.cur.onHeaderGroupElement92(stack["start"]) } -func (c *current) onQuoteBlockRawContent639() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement81(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonQuoteBlockRawContent639() (interface{}, error) { +func (p *parser) callonHeaderGroupElement81() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent639() + return p.cur.onHeaderGroupElement81(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent631() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onHeaderGroupElement107() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent631() (interface{}, error) { +func (p *parser) callonHeaderGroupElement107() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent631() + return p.cur.onHeaderGroupElement107() } -func (c *current) onQuoteBlockRawContent647() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onHeaderGroupElement103(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonQuoteBlockRawContent647() (interface{}, error) { +func (p *parser) callonHeaderGroupElement103() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent647() + return p.cur.onHeaderGroupElement103(stack["name"]) } -func (c *current) onQuoteBlockRawContent628(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onHeaderGroupElement54(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent628() (interface{}, error) { +func (p *parser) callonHeaderGroupElement54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent628(stack["content"]) + return p.cur.onHeaderGroupElement54(stack["element"]) } -func (c *current) onQuoteBlockRawContent606(firstLine, otherLines interface{}) (interface{}, error) { +func (c *current) onHeaderGroupElement113() (interface{}, error) { + + return types.NewStringElement(string(c.text)) - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil } -func (p *parser) callonQuoteBlockRawContent606() (interface{}, error) { +func (p *parser) callonHeaderGroupElement113() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent606(stack["firstLine"], stack["otherLines"]) + return p.cur.onHeaderGroupElement113() } -func (c *current) onQuoteBlockRawContent604(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithSpacesOnFirstLine, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onHeaderGroupElement35(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonQuoteBlockRawContent604() (interface{}, error) { +func (p *parser) callonHeaderGroupElement35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent604(stack["lines"]) + return p.cur.onHeaderGroupElement35(stack["id"], stack["label"]) } -func (c *current) onQuoteBlockRawContent661() (interface{}, error) { +func (c *current) onHeaderGroupElement120() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent661() (interface{}, error) { +func (p *parser) callonHeaderGroupElement120() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent661() + return p.cur.onHeaderGroupElement120() } -func (c *current) onQuoteBlockRawContent673() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onHeaderGroupElement116(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) } -func (p *parser) callonQuoteBlockRawContent673() (interface{}, error) { +func (p *parser) callonHeaderGroupElement116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent673() + return p.cur.onHeaderGroupElement116(stack["id"]) } -func (c *current) onQuoteBlockRawContent670(line interface{}) (interface{}, error) { +func (c *current) onHeaderGroupElement33() (interface{}, error) { + return types.NewStringElement(string(c.text)) - return line, nil // do not include the trailing 'EOL' } -func (p *parser) callonQuoteBlockRawContent670() (interface{}, error) { +func (p *parser) callonHeaderGroupElement33() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent670(stack["line"]) + return p.cur.onHeaderGroupElement33() } -func (c *current) onQuoteBlockRawContent667(lines interface{}) (interface{}, error) { - return lines.([]interface{}), nil +func (c *current) onHeaderGroupElement124() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent667() (interface{}, error) { +func (p *parser) callonHeaderGroupElement124() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent667(stack["lines"]) + return p.cur.onHeaderGroupElement124() } -func (c *current) onQuoteBlockRawContent690() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement28(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent690() (interface{}, error) { +func (p *parser) callonHeaderGroupElement28() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent690() + return p.cur.onHeaderGroupElement28(stack["element"]) } -func (c *current) onQuoteBlockRawContent655(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithDelimiter, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onHeaderGroupElement131() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonQuoteBlockRawContent655() (interface{}, error) { +func (p *parser) callonHeaderGroupElement131() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent655(stack["lines"]) + return p.cur.onHeaderGroupElement131() } -func (c *current) onQuoteBlockRawContent703() (interface{}, error) { - return types.Tip, nil +func (c *current) onHeaderGroupElement138() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent703() (interface{}, error) { +func (p *parser) callonHeaderGroupElement138() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent703() + return p.cur.onHeaderGroupElement138() } -func (c *current) onQuoteBlockRawContent705() (interface{}, error) { - return types.Note, nil +func (c *current) onHeaderGroupElement150() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent705() (interface{}, error) { +func (p *parser) callonHeaderGroupElement150() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent705() + return p.cur.onHeaderGroupElement150() } -func (c *current) onQuoteBlockRawContent707() (interface{}, error) { - return types.Important, nil +func (c *current) onHeaderGroupElement152() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent707() (interface{}, error) { +func (p *parser) callonHeaderGroupElement152() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent707() + return p.cur.onHeaderGroupElement152() } -func (c *current) onQuoteBlockRawContent709() (interface{}, error) { - return types.Warning, nil +func (c *current) onHeaderGroupElement145(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonQuoteBlockRawContent709() (interface{}, error) { +func (p *parser) callonHeaderGroupElement145() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent709() + return p.cur.onHeaderGroupElement145(stack["start"]) } -func (c *current) onQuoteBlockRawContent711() (interface{}, error) { - return types.Caution, nil +func (c *current) onHeaderGroupElement134(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonQuoteBlockRawContent711() (interface{}, error) { +func (p *parser) callonHeaderGroupElement134() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent711() + return p.cur.onHeaderGroupElement134(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent725() (interface{}, error) { +func (c *current) onHeaderGroupElement160() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent725() (interface{}, error) { +func (p *parser) callonHeaderGroupElement160() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent725() + return p.cur.onHeaderGroupElement160() } -func (c *current) onQuoteBlockRawContent734() (interface{}, error) { +func (c *current) onHeaderGroupElement172() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent734() (interface{}, error) { +func (p *parser) callonHeaderGroupElement172() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent734() + return p.cur.onHeaderGroupElement172() } -func (c *current) onQuoteBlockRawContent717(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onHeaderGroupElement174() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent717() (interface{}, error) { +func (p *parser) callonHeaderGroupElement174() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent717(stack["content"]) + return p.cur.onHeaderGroupElement174() } -func (c *current) onQuoteBlockRawContent755() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement167(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonQuoteBlockRawContent755() (interface{}, error) { +func (p *parser) callonHeaderGroupElement167() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent755() + return p.cur.onHeaderGroupElement167(stack["start"]) } -func (c *current) onQuoteBlockRawContent767() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement156(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonQuoteBlockRawContent767() (interface{}, error) { +func (p *parser) callonHeaderGroupElement156() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent767() + return p.cur.onHeaderGroupElement156(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent779() (interface{}, error) { +func (c *current) onHeaderGroupElement182() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent779() (interface{}, error) { +func (p *parser) callonHeaderGroupElement182() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent779() + return p.cur.onHeaderGroupElement182() } -func (c *current) onQuoteBlockRawContent791() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement178(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonQuoteBlockRawContent791() (interface{}, error) { +func (p *parser) callonHeaderGroupElement178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent791() + return p.cur.onHeaderGroupElement178(stack["name"]) } -func (c *current) onQuoteBlockRawContent803() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement129(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent803() (interface{}, error) { +func (p *parser) callonHeaderGroupElement129() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent803() + return p.cur.onHeaderGroupElement129(stack["element"]) } -func (c *current) onQuoteBlockRawContent815() (interface{}, error) { +func (c *current) onHeaderGroupElement192() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent815() (interface{}, error) { +func (p *parser) callonHeaderGroupElement192() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent815() + return p.cur.onHeaderGroupElement192() } -func (c *current) onQuoteBlockRawContent827() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement188(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonQuoteBlockRawContent827() (interface{}, error) { +func (p *parser) callonHeaderGroupElement188() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent827() + return p.cur.onHeaderGroupElement188(stack["ref"]) } -func (c *current) onQuoteBlockRawContent835() (interface{}, error) { +func (c *current) onHeaderGroupElement198() (bool, error) { + return c.isSubstitutionEnabled(Replacements) - return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent835() (interface{}, error) { +func (p *parser) callonHeaderGroupElement198() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent835() + return p.cur.onHeaderGroupElement198() } -func (c *current) onQuoteBlockRawContent843(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onHeaderGroupElement201() (interface{}, error) { + return types.NewStringElement("\u2019") } -func (p *parser) callonQuoteBlockRawContent843() (bool, error) { +func (p *parser) callonHeaderGroupElement201() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent843(stack["content"]) + return p.cur.onHeaderGroupElement201() } -func (c *current) onQuoteBlockRawContent742(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onHeaderGroupElement203() (interface{}, error) { + return types.NewStringElement("\u00a9") } -func (p *parser) callonQuoteBlockRawContent742() (interface{}, error) { +func (p *parser) callonHeaderGroupElement203() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent742(stack["content"]) + return p.cur.onHeaderGroupElement203() } -func (c *current) onQuoteBlockRawContent699(t, lines interface{}) (interface{}, error) { - - return types.NewAdmonitionParagraph(lines.([]interface{}), t.(string), c.globalStore.getAttributes()) +func (c *current) onHeaderGroupElement205() (interface{}, error) { + return types.NewStringElement("\u2122") } -func (p *parser) callonQuoteBlockRawContent699() (interface{}, error) { +func (p *parser) callonHeaderGroupElement205() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent699(stack["t"], stack["lines"]) + return p.cur.onHeaderGroupElement205() } -func (c *current) onQuoteBlockRawContent860() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement207() (interface{}, error) { + return types.NewStringElement("\u00ae") + } -func (p *parser) callonQuoteBlockRawContent860() (interface{}, error) { +func (p *parser) callonHeaderGroupElement207() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent860() + return p.cur.onHeaderGroupElement207() } -func (c *current) onQuoteBlockRawContent852() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onHeaderGroupElement209() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonQuoteBlockRawContent852() (interface{}, error) { +func (p *parser) callonHeaderGroupElement209() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent852() + return p.cur.onHeaderGroupElement209() } -func (c *current) onQuoteBlockRawContent876() (interface{}, error) { - - return string(c.text), nil +func (c *current) onHeaderGroupElement211() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") } -func (p *parser) callonQuoteBlockRawContent876() (interface{}, error) { +func (p *parser) callonHeaderGroupElement211() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent876() + return p.cur.onHeaderGroupElement211() } -func (c *current) onQuoteBlockRawContent870(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onHeaderGroupElement196(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonQuoteBlockRawContent870() (interface{}, error) { +func (p *parser) callonHeaderGroupElement196() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent870(stack["content"]) + return p.cur.onHeaderGroupElement196(stack["element"]) } -func (c *current) onQuoteBlockRawContent849(content interface{}) (interface{}, error) { +func (c *current) onHeaderGroupElement225() (interface{}, error) { + // spaces, commas and dots are allowed in this syntax + return types.NewStringElement(string(c.text)) - return content, nil } -func (p *parser) callonQuoteBlockRawContent849() (interface{}, error) { +func (p *parser) callonHeaderGroupElement225() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent849(stack["content"]) + return p.cur.onHeaderGroupElement225() } -func (c *current) onQuoteBlockRawContent844(content interface{}) (interface{}, error) { - return types.NewMarkdownQuoteBlock(content.([]interface{}), c.globalStore.getAttributes()) - +func (c *current) onHeaderGroupElement232() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent844() (interface{}, error) { +func (p *parser) callonHeaderGroupElement232() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent844(stack["content"]) + return p.cur.onHeaderGroupElement232() } -func (c *current) onQuoteBlockRawContent886() (bool, error) { - // verify that one of the attributes is `kind:passthrough` - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Passthrough), nil - +func (c *current) onHeaderGroupElement228(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonQuoteBlockRawContent886() (bool, error) { +func (p *parser) callonHeaderGroupElement228() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent886() + return p.cur.onHeaderGroupElement228(stack["ref"]) } -func (c *current) onQuoteBlockRawContent902() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement238() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonQuoteBlockRawContent902() (interface{}, error) { +func (p *parser) callonHeaderGroupElement238() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent902() + return p.cur.onHeaderGroupElement238() } -func (c *current) onQuoteBlockRawContent914() (interface{}, error) { +func (c *current) onHeaderGroupElement245() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent914() (interface{}, error) { +func (p *parser) callonHeaderGroupElement245() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent914() + return p.cur.onHeaderGroupElement245() } -func (c *current) onQuoteBlockRawContent926() (interface{}, error) { +func (c *current) onHeaderGroupElement257() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent926() (interface{}, error) { +func (p *parser) callonHeaderGroupElement257() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent926() + return p.cur.onHeaderGroupElement257() } -func (c *current) onQuoteBlockRawContent938() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement259() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent938() (interface{}, error) { +func (p *parser) callonHeaderGroupElement259() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent938() + return p.cur.onHeaderGroupElement259() } -func (c *current) onQuoteBlockRawContent950() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement252(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonQuoteBlockRawContent950() (interface{}, error) { +func (p *parser) callonHeaderGroupElement252() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent950() + return p.cur.onHeaderGroupElement252(stack["start"]) } -func (c *current) onQuoteBlockRawContent962() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement241(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonQuoteBlockRawContent962() (interface{}, error) { +func (p *parser) callonHeaderGroupElement241() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent962() + return p.cur.onHeaderGroupElement241(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent974() (interface{}, error) { +func (c *current) onHeaderGroupElement267() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent974() (interface{}, error) { +func (p *parser) callonHeaderGroupElement267() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent974() + return p.cur.onHeaderGroupElement267() } -func (c *current) onQuoteBlockRawContent982() (interface{}, error) { - +func (c *current) onHeaderGroupElement279() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent982() (interface{}, error) { +func (p *parser) callonHeaderGroupElement279() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent982() + return p.cur.onHeaderGroupElement279() } -func (c *current) onQuoteBlockRawContent990(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onHeaderGroupElement281() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent990() (bool, error) { +func (p *parser) callonHeaderGroupElement281() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent990(stack["content"]) + return p.cur.onHeaderGroupElement281() } -func (c *current) onQuoteBlockRawContent889(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onHeaderGroupElement274(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonQuoteBlockRawContent889() (interface{}, error) { +func (p *parser) callonHeaderGroupElement274() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent889(stack["content"]) + return p.cur.onHeaderGroupElement274(stack["start"]) } -func (c *current) onQuoteBlockRawContent884(content interface{}) (interface{}, error) { - - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) - +func (c *current) onHeaderGroupElement263(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonQuoteBlockRawContent884() (interface{}, error) { +func (p *parser) callonHeaderGroupElement263() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent884(stack["content"]) + return p.cur.onHeaderGroupElement263(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent1003() (interface{}, error) { +func (c *current) onHeaderGroupElement289() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent1003() (interface{}, error) { +func (p *parser) callonHeaderGroupElement289() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1003() + return p.cur.onHeaderGroupElement289() } -func (c *current) onQuoteBlockRawContent1012() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement285(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonQuoteBlockRawContent1012() (interface{}, error) { +func (p *parser) callonHeaderGroupElement285() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1012() + return p.cur.onHeaderGroupElement285(stack["name"]) } -func (c *current) onQuoteBlockRawContent995(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onHeaderGroupElement236(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent995() (interface{}, error) { +func (p *parser) callonHeaderGroupElement236() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent995(stack["content"]) + return p.cur.onHeaderGroupElement236(stack["element"]) } -func (c *current) onQuoteBlockRawContent1033() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement295() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent1033() (interface{}, error) { +func (p *parser) callonHeaderGroupElement295() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1033() + return p.cur.onHeaderGroupElement295() } -func (c *current) onQuoteBlockRawContent1045() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement221(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + } -func (p *parser) callonQuoteBlockRawContent1045() (interface{}, error) { +func (p *parser) callonHeaderGroupElement221() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1045() + return p.cur.onHeaderGroupElement221(stack["elements"]) } -func (c *current) onQuoteBlockRawContent1057() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement217(id interface{}) (interface{}, error) { + return types.NewIDAttribute(id) + } -func (p *parser) callonQuoteBlockRawContent1057() (interface{}, error) { +func (p *parser) callonHeaderGroupElement217() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1057() + return p.cur.onHeaderGroupElement217(stack["id"]) } -func (c *current) onQuoteBlockRawContent1069() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement299() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent1069() (interface{}, error) { +func (p *parser) callonHeaderGroupElement299() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1069() + return p.cur.onHeaderGroupElement299() } -func (c *current) onQuoteBlockRawContent1081() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement1(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent1081() (interface{}, error) { +func (p *parser) callonHeaderGroupElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1081() + return p.cur.onHeaderGroupElement1(stack["element"]) } -func (c *current) onQuoteBlockRawContent1093() (interface{}, error) { +func (c *current) onMacrosGroup11() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent1093() (interface{}, error) { +func (p *parser) callonMacrosGroup11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1093() + return p.cur.onMacrosGroup11() } -func (c *current) onQuoteBlockRawContent1105() (interface{}, error) { +func (c *current) onMacrosGroup16() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent1105() (interface{}, error) { +func (p *parser) callonMacrosGroup16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1105() + return p.cur.onMacrosGroup16() } -func (c *current) onQuoteBlockRawContent1113() (interface{}, error) { +func (c *current) onMacrosGroup6() (interface{}, error) { + return types.NewStringElement(string(c.text)) - return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent1113() (interface{}, error) { +func (p *parser) callonMacrosGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1113() + return p.cur.onMacrosGroup6() } -func (c *current) onQuoteBlockRawContent1121(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil - +func (c *current) onMacrosGroup28() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent1121() (bool, error) { +func (p *parser) callonMacrosGroup28() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1121(stack["content"]) + return p.cur.onMacrosGroup28() } -func (c *current) onQuoteBlockRawContent1020(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) - +func (c *current) onMacrosGroup24(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonQuoteBlockRawContent1020() (interface{}, error) { +func (p *parser) callonMacrosGroup24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1020(stack["content"]) + return p.cur.onMacrosGroup24(stack["ref"]) } -func (c *current) onQuoteBlockRawContent991(lines interface{}) (interface{}, error) { +func (c *current) onMacrosGroup32() (interface{}, error) { - return types.NewParagraph(lines.([]interface{}), c.globalStore.getAttributes()) + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent991() (interface{}, error) { +func (p *parser) callonMacrosGroup32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent991(stack["lines"]) + return p.cur.onMacrosGroup32() } -func (c *current) onQuoteBlockRawContent1129() (interface{}, error) { - return string(c.text), nil +func (c *current) onMacrosGroup1(elements interface{}) (interface{}, error) { + + return types.NewInlineElements(elements) + } -func (p *parser) callonQuoteBlockRawContent1129() (interface{}, error) { +func (p *parser) callonMacrosGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1129() + return p.cur.onMacrosGroup1(stack["elements"]) } -func (c *current) onQuoteBlockRawContent1122() (interface{}, error) { - // for standalone attributes at the end of the delomited block - return types.NewStandaloneAttributes(c.globalStore.getAttributes()) // will be discarded anyways +func (c *current) onNoneGroup18() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent1122() (interface{}, error) { +func (p *parser) callonNoneGroup18() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1122() + return p.cur.onNoneGroup18() } -func (c *current) onQuoteBlockRawContent4(attributes, element interface{}) (interface{}, error) { - c.globalStore.discardAttributes() - return element, nil - +func (c *current) onNoneGroup23() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent4() (interface{}, error) { +func (p *parser) callonNoneGroup23() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent4(stack["attributes"], stack["element"]) + return p.cur.onNoneGroup23() } -func (c *current) onQuoteBlockRawContent1(elements interface{}) (interface{}, error) { - return elements, nil +func (c *current) onNoneGroup13() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent1() (interface{}, error) { +func (p *parser) callonNoneGroup13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1(stack["elements"]) + return p.cur.onNoneGroup13() } -func (c *current) onSidebarBlock7() (interface{}, error) { +func (c *current) onNoneGroup34() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonSidebarBlock7() (interface{}, error) { +func (p *parser) callonNoneGroup34() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlock7() + return p.cur.onNoneGroup34() } -func (c *current) onSidebarBlock22() (interface{}, error) { - return string(c.text), nil +func (c *current) onNoneGroup30(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonSidebarBlock22() (interface{}, error) { +func (p *parser) callonNoneGroup30() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlock22() + return p.cur.onNoneGroup30(stack["ref"]) } -func (c *current) onSidebarBlock1(content interface{}) (interface{}, error) { - return types.NewSidebarBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onNoneGroup38() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlock1() (interface{}, error) { +func (p *parser) callonNoneGroup38() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlock1(stack["content"]) + return p.cur.onNoneGroup38() } -func (c *current) onSidebarBlockRawContent13() (interface{}, error) { - return string(c.text), nil +func (c *current) onNoneGroup5(element interface{}) (interface{}, error) { + + return element, nil + } -func (p *parser) callonSidebarBlockRawContent13() (interface{}, error) { +func (p *parser) callonNoneGroup5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent13() + return p.cur.onNoneGroup5(stack["element"]) } -func (c *current) onSidebarBlockRawContent25(attributes interface{}) error { - c.globalStore.pushAttributes(attributes) - return nil +func (c *current) onNoneGroup1(elements interface{}) (interface{}, error) { + + return types.NewInlineElements(elements) } -func (p *parser) callonSidebarBlockRawContent25() error { +func (p *parser) callonNoneGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent25(stack["attributes"]) + return p.cur.onNoneGroup1(stack["elements"]) } -func (c *current) onSidebarBlockRawContent31() (bool, error) { - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Literal), nil +func (c *current) onNormalGroup1(elements interface{}) (interface{}, error) { + + c.resetSpaceSuffixTracking() + return types.NewInlineElements(elements) } -func (p *parser) callonSidebarBlockRawContent31() (bool, error) { +func (p *parser) callonNormalGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent31() + return p.cur.onNormalGroup1(stack["elements"]) } -func (c *current) onSidebarBlockRawContent40() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onNormalGroupElement13() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent40() (interface{}, error) { +func (p *parser) callonNormalGroupElement13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent40() + return p.cur.onNormalGroupElement13() } -func (c *current) onSidebarBlockRawContent49() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) - +func (c *current) onNormalGroupElement18() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent49() (interface{}, error) { +func (p *parser) callonNormalGroupElement18() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent49() + return p.cur.onNormalGroupElement18() } -func (c *current) onSidebarBlockRawContent36(elements interface{}) (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement8() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent36() (interface{}, error) { +func (p *parser) callonNormalGroupElement8() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent36(stack["elements"]) + return p.cur.onNormalGroupElement8() } -func (c *current) onSidebarBlockRawContent33(content interface{}) (interface{}, error) { +func (c *current) onNormalGroupElement25() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil - return types.NewRawLine(content.(string)) } -func (p *parser) callonSidebarBlockRawContent33() (interface{}, error) { +func (p *parser) callonNormalGroupElement25() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent33(stack["content"]) + return p.cur.onNormalGroupElement25() } -func (c *current) onSidebarBlockRawContent76() (interface{}, error) { +func (c *current) onNormalGroupElement27() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent76() (interface{}, error) { +func (p *parser) callonNormalGroupElement27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent76() + return p.cur.onNormalGroupElement27() } -func (c *current) onSidebarBlockRawContent85() (interface{}, error) { +func (c *current) onNormalGroupElement36() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent85() (interface{}, error) { +func (p *parser) callonNormalGroupElement36() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent85() + return p.cur.onNormalGroupElement36() } -func (c *current) onSidebarBlockRawContent68(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onNormalGroupElement32(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonSidebarBlockRawContent68() (interface{}, error) { +func (p *parser) callonNormalGroupElement32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent68(stack["content"]) + return p.cur.onNormalGroupElement32(stack["ref"]) } -func (c *current) onSidebarBlockRawContent106() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement42() (bool, error) { + + return c.isPreceededBySpace(), nil + } -func (p *parser) callonSidebarBlockRawContent106() (interface{}, error) { +func (p *parser) callonNormalGroupElement42() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent106() + return p.cur.onNormalGroupElement42() } -func (c *current) onSidebarBlockRawContent118() (interface{}, error) { +func (c *current) onNormalGroupElement45() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent118() (interface{}, error) { +func (p *parser) callonNormalGroupElement45() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent118() + return p.cur.onNormalGroupElement45() } -func (c *current) onSidebarBlockRawContent130() (interface{}, error) { +func (c *current) onNormalGroupElement49() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent130() (interface{}, error) { +func (p *parser) callonNormalGroupElement49() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent130() + return p.cur.onNormalGroupElement49() } -func (c *current) onSidebarBlockRawContent142() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement40() (interface{}, error) { + return types.NewLineBreak() + } -func (p *parser) callonSidebarBlockRawContent142() (interface{}, error) { +func (p *parser) callonNormalGroupElement40() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent142() + return p.cur.onNormalGroupElement40() } -func (c *current) onSidebarBlockRawContent154() (interface{}, error) { +func (c *current) onNormalGroupElement61() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent154() (interface{}, error) { +func (p *parser) callonNormalGroupElement61() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent154() + return p.cur.onNormalGroupElement61() } -func (c *current) onSidebarBlockRawContent166() (interface{}, error) { +func (c *current) onNormalGroupElement63() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent166() (interface{}, error) { +func (p *parser) callonNormalGroupElement63() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent166() + return p.cur.onNormalGroupElement63() } -func (c *current) onSidebarBlockRawContent178() (interface{}, error) { +func (c *current) onNormalGroupElement56() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent178() (interface{}, error) { +func (p *parser) callonNormalGroupElement56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent178() + return p.cur.onNormalGroupElement56() } -func (c *current) onSidebarBlockRawContent186() (interface{}, error) { +func (c *current) onNormalGroupElement75() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) - return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent186() (interface{}, error) { +func (p *parser) callonNormalGroupElement75() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent186() + return p.cur.onNormalGroupElement75() } -func (c *current) onSidebarBlockRawContent194(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onNormalGroupElement84() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent194() (bool, error) { +func (p *parser) callonNormalGroupElement84() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent194(stack["content"]) + return p.cur.onNormalGroupElement84() } -func (c *current) onSidebarBlockRawContent93(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onNormalGroupElement88() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent93() (interface{}, error) { +func (p *parser) callonNormalGroupElement88() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent93(stack["content"]) + return p.cur.onNormalGroupElement88() } -func (c *current) onSidebarBlockRawContent29(firstLine, otherLines interface{}) (interface{}, error) { - - return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...), c.globalStore.getAttributes()) - -} - -func (p *parser) callonSidebarBlockRawContent29() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent29(stack["firstLine"], stack["otherLines"]) -} +func (c *current) onNormalGroupElement94() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) -func (c *current) onSidebarBlockRawContent203() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent203() (interface{}, error) { +func (p *parser) callonNormalGroupElement94() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent203() + return p.cur.onNormalGroupElement94() } -func (c *current) onSidebarBlockRawContent195() (interface{}, error) { - return types.NewBlankLine() -} +func (c *current) onNormalGroupElement101() (bool, error) { + return c.isSubstitutionEnabled(Attributes) -func (p *parser) callonSidebarBlockRawContent195() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent195() -} - -func (c *current) onSidebarBlockRawContent211() (interface{}, error) { - return types.NewThematicBreak() } -func (p *parser) callonSidebarBlockRawContent211() (interface{}, error) { +func (p *parser) callonNormalGroupElement101() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent211() + return p.cur.onNormalGroupElement101() } -func (c *current) onSidebarBlockRawContent234() (interface{}, error) { +func (c *current) onNormalGroupElement108() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent234() (interface{}, error) { +func (p *parser) callonNormalGroupElement108() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent234() + return p.cur.onNormalGroupElement108() } -func (c *current) onSidebarBlockRawContent252() (interface{}, error) { +func (c *current) onNormalGroupElement120() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent252() (interface{}, error) { +func (p *parser) callonNormalGroupElement120() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent252() + return p.cur.onNormalGroupElement120() } -func (c *current) onSidebarBlockRawContent268() (interface{}, error) { +func (c *current) onNormalGroupElement122() (interface{}, error) { - return string(c.text), nil + return strconv.Atoi(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent268() (interface{}, error) { +func (p *parser) callonNormalGroupElement122() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent268() + return p.cur.onNormalGroupElement122() } -func (c *current) onSidebarBlockRawContent262(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onNormalGroupElement115(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonSidebarBlockRawContent262() (interface{}, error) { +func (p *parser) callonNormalGroupElement115() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent262(stack["content"]) + return p.cur.onNormalGroupElement115(stack["start"]) } -func (c *current) onSidebarBlockRawContent243(line interface{}) (interface{}, error) { - - return line, nil +func (c *current) onNormalGroupElement104(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSidebarBlockRawContent243() (interface{}, error) { +func (p *parser) callonNormalGroupElement104() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent243(stack["line"]) + return p.cur.onNormalGroupElement104(stack["name"], stack["start"]) } -func (c *current) onSidebarBlockRawContent282() (interface{}, error) { +func (c *current) onNormalGroupElement130() (interface{}, error) { return string(c.text), nil -} - -func (p *parser) callonSidebarBlockRawContent282() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent282() -} -func (c *current) onSidebarBlockRawContent228(content interface{}) (interface{}, error) { - return types.NewFencedBlock(content.([]interface{}), c.globalStore.getAttributes()) } -func (p *parser) callonSidebarBlockRawContent228() (interface{}, error) { +func (p *parser) callonNormalGroupElement130() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent228(stack["content"]) + return p.cur.onNormalGroupElement130() } -func (c *current) onSidebarBlockRawContent297() (interface{}, error) { +func (c *current) onNormalGroupElement142() (interface{}, error) { return string(c.text), nil -} -func (p *parser) callonSidebarBlockRawContent297() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent297() -} - -func (c *current) onSidebarBlockRawContent315() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent315() (interface{}, error) { +func (p *parser) callonNormalGroupElement142() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent315() + return p.cur.onNormalGroupElement142() } -func (c *current) onSidebarBlockRawContent331() (interface{}, error) { +func (c *current) onNormalGroupElement144() (interface{}, error) { - return string(c.text), nil + return strconv.Atoi(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent331() (interface{}, error) { +func (p *parser) callonNormalGroupElement144() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent331() + return p.cur.onNormalGroupElement144() } -func (c *current) onSidebarBlockRawContent325(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onNormalGroupElement137(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonSidebarBlockRawContent325() (interface{}, error) { +func (p *parser) callonNormalGroupElement137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent325(stack["content"]) + return p.cur.onNormalGroupElement137(stack["start"]) } -func (c *current) onSidebarBlockRawContent306(line interface{}) (interface{}, error) { - - return line, nil +func (c *current) onNormalGroupElement126(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonSidebarBlockRawContent306() (interface{}, error) { +func (p *parser) callonNormalGroupElement126() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent306(stack["line"]) + return p.cur.onNormalGroupElement126(stack["name"], stack["start"]) } -func (c *current) onSidebarBlockRawContent345() (interface{}, error) { +func (c *current) onNormalGroupElement152() (interface{}, error) { return string(c.text), nil -} -func (p *parser) callonSidebarBlockRawContent345() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent345() } -func (c *current) onSidebarBlockRawContent291(content interface{}) (interface{}, error) { - return types.NewListingBlock(content.([]interface{}), c.globalStore.getAttributes()) -} - -func (p *parser) callonSidebarBlockRawContent291() (interface{}, error) { +func (p *parser) callonNormalGroupElement152() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent291(stack["content"]) + return p.cur.onNormalGroupElement152() } -func (c *current) onSidebarBlockRawContent356() (bool, error) { - // AttrPositional1 must be equal to `verse` - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Verse), nil +func (c *current) onNormalGroupElement148(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSidebarBlockRawContent356() (bool, error) { +func (p *parser) callonNormalGroupElement148() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent356() + return p.cur.onNormalGroupElement148(stack["name"]) } -func (c *current) onSidebarBlockRawContent361() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onNormalGroupElement99(element interface{}) (interface{}, error) { + return element, nil -func (p *parser) callonSidebarBlockRawContent361() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent361() } -func (c *current) onSidebarBlockRawContent379() (interface{}, error) { - return string(c.text), nil -} - -func (p *parser) callonSidebarBlockRawContent379() (interface{}, error) { +func (p *parser) callonNormalGroupElement99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent379() + return p.cur.onNormalGroupElement99(stack["element"]) } -func (c *current) onSidebarBlockRawContent395() (interface{}, error) { +func (c *current) onNormalGroupElement158() (interface{}, error) { - return string(c.text), nil + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent395() (interface{}, error) { +func (p *parser) callonNormalGroupElement158() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent395() + return p.cur.onNormalGroupElement158() } -func (c *current) onSidebarBlockRawContent389(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onNormalGroupElement80(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) } -func (p *parser) callonSidebarBlockRawContent389() (interface{}, error) { +func (p *parser) callonNormalGroupElement80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent389(stack["content"]) + return p.cur.onNormalGroupElement80(stack["id"], stack["label"]) } -func (c *current) onSidebarBlockRawContent370(line interface{}) (interface{}, error) { +func (c *current) onNormalGroupElement165() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil - return line, nil } -func (p *parser) callonSidebarBlockRawContent370() (interface{}, error) { +func (p *parser) callonNormalGroupElement165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent370(stack["line"]) + return p.cur.onNormalGroupElement165() } -func (c *current) onSidebarBlockRawContent409() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement161(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonSidebarBlockRawContent409() (interface{}, error) { +func (p *parser) callonNormalGroupElement161() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent409() + return p.cur.onNormalGroupElement161(stack["id"]) } -func (c *current) onSidebarBlockRawContent354(content interface{}) (interface{}, error) { - return types.NewVerseBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onNormalGroupElement78() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent354() (interface{}, error) { +func (p *parser) callonNormalGroupElement78() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent354(stack["content"]) + return p.cur.onNormalGroupElement78() } -func (c *current) onSidebarBlockRawContent428() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement169() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent428() (interface{}, error) { +func (p *parser) callonNormalGroupElement169() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent428() + return p.cur.onNormalGroupElement169() } -func (c *current) onSidebarBlockRawContent437() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement73(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonSidebarBlockRawContent437() (interface{}, error) { +func (p *parser) callonNormalGroupElement73() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent437() + return p.cur.onNormalGroupElement73(stack["element"]) } -func (c *current) onSidebarBlockRawContent420(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onNormalGroupElement173() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonSidebarBlockRawContent420() (interface{}, error) { +func (p *parser) callonNormalGroupElement173() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent420(stack["content"]) + return p.cur.onNormalGroupElement173() } -func (c *current) onSidebarBlockRawContent451() (interface{}, error) { +func (c *current) onNormalGroupElement180() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent451() (interface{}, error) { +func (p *parser) callonNormalGroupElement180() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent451() + return p.cur.onNormalGroupElement180() } -func (c *current) onSidebarBlockRawContent469() (interface{}, error) { +func (c *current) onNormalGroupElement192() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent469() (interface{}, error) { +func (p *parser) callonNormalGroupElement192() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent469() + return p.cur.onNormalGroupElement192() } -func (c *current) onSidebarBlockRawContent485() (interface{}, error) { +func (c *current) onNormalGroupElement194() (interface{}, error) { - return string(c.text), nil + return strconv.Atoi(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent485() (interface{}, error) { +func (p *parser) callonNormalGroupElement194() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent485() + return p.cur.onNormalGroupElement194() } -func (c *current) onSidebarBlockRawContent479(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onNormalGroupElement187(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonSidebarBlockRawContent479() (interface{}, error) { +func (p *parser) callonNormalGroupElement187() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent479(stack["content"]) + return p.cur.onNormalGroupElement187(stack["start"]) } -func (c *current) onSidebarBlockRawContent460(line interface{}) (interface{}, error) { - - return line, nil +func (c *current) onNormalGroupElement176(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSidebarBlockRawContent460() (interface{}, error) { +func (p *parser) callonNormalGroupElement176() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent460(stack["line"]) + return p.cur.onNormalGroupElement176(stack["name"], stack["start"]) } -func (c *current) onSidebarBlockRawContent499() (interface{}, error) { +func (c *current) onNormalGroupElement202() (interface{}, error) { return string(c.text), nil -} - -func (p *parser) callonSidebarBlockRawContent499() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent499() -} -func (c *current) onSidebarBlockRawContent445(content interface{}) (interface{}, error) { - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) } -func (p *parser) callonSidebarBlockRawContent445() (interface{}, error) { +func (p *parser) callonNormalGroupElement202() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent445(stack["content"]) + return p.cur.onNormalGroupElement202() } -func (c *current) onSidebarBlockRawContent515() (interface{}, error) { +func (c *current) onNormalGroupElement214() (interface{}, error) { return string(c.text), nil -} - -func (p *parser) callonSidebarBlockRawContent515() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent515() -} -func (c *current) onSidebarBlockRawContent533() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent533() (interface{}, error) { +func (p *parser) callonNormalGroupElement214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent533() + return p.cur.onNormalGroupElement214() } -func (c *current) onSidebarBlockRawContent549() (interface{}, error) { +func (c *current) onNormalGroupElement216() (interface{}, error) { - return string(c.text), nil + return strconv.Atoi(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent549() (interface{}, error) { +func (p *parser) callonNormalGroupElement216() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent549() + return p.cur.onNormalGroupElement216() } -func (c *current) onSidebarBlockRawContent543(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onNormalGroupElement209(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonSidebarBlockRawContent543() (interface{}, error) { +func (p *parser) callonNormalGroupElement209() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent543(stack["content"]) + return p.cur.onNormalGroupElement209(stack["start"]) } -func (c *current) onSidebarBlockRawContent524(line interface{}) (interface{}, error) { - - return line, nil +func (c *current) onNormalGroupElement198(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonSidebarBlockRawContent524() (interface{}, error) { +func (p *parser) callonNormalGroupElement198() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent524(stack["line"]) + return p.cur.onNormalGroupElement198(stack["name"], stack["start"]) } -func (c *current) onSidebarBlockRawContent563() (interface{}, error) { +func (c *current) onNormalGroupElement224() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent563() (interface{}, error) { +func (p *parser) callonNormalGroupElement224() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent563() + return p.cur.onNormalGroupElement224() } -func (c *current) onSidebarBlockRawContent509(content interface{}) (interface{}, error) { - return types.NewCommentBlock(content.([]interface{}), nil) +func (c *current) onNormalGroupElement220(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSidebarBlockRawContent509() (interface{}, error) { +func (p *parser) callonNormalGroupElement220() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent509(stack["content"]) + return p.cur.onNormalGroupElement220(stack["name"]) } -func (c *current) onSidebarBlockRawContent574() (bool, error) { - attrs := c.globalStore.getAttributes() - return types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Literal), nil +func (c *current) onNormalGroupElement171(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonSidebarBlockRawContent574() (bool, error) { +func (p *parser) callonNormalGroupElement171() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent574() + return p.cur.onNormalGroupElement171(stack["element"]) } -func (c *current) onSidebarBlockRawContent588() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement230() (interface{}, error) { + return types.NewStringElement("\u2019") + } -func (p *parser) callonSidebarBlockRawContent588() (interface{}, error) { +func (p *parser) callonNormalGroupElement230() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent588() + return p.cur.onNormalGroupElement230() } -func (c *current) onSidebarBlockRawContent580() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onNormalGroupElement232() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonSidebarBlockRawContent580() (interface{}, error) { +func (p *parser) callonNormalGroupElement232() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent580() + return p.cur.onNormalGroupElement232() } -func (c *current) onSidebarBlockRawContent596() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onNormalGroupElement234() (interface{}, error) { + return types.NewStringElement("\u2122") + } -func (p *parser) callonSidebarBlockRawContent596() (interface{}, error) { +func (p *parser) callonNormalGroupElement234() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent596() + return p.cur.onNormalGroupElement234() } -func (c *current) onSidebarBlockRawContent577(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onNormalGroupElement236() (interface{}, error) { + return types.NewStringElement("\u00ae") + } -func (p *parser) callonSidebarBlockRawContent577() (interface{}, error) { +func (p *parser) callonNormalGroupElement236() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent577(stack["content"]) + return p.cur.onNormalGroupElement236() } -func (c *current) onSidebarBlockRawContent572(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithAttribute, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onNormalGroupElement238() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") } -func (p *parser) callonSidebarBlockRawContent572() (interface{}, error) { +func (p *parser) callonNormalGroupElement238() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent572(stack["lines"]) + return p.cur.onNormalGroupElement238() } -func (c *current) onSidebarBlockRawContent617() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement240() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonSidebarBlockRawContent617() (interface{}, error) { +func (p *parser) callonNormalGroupElement240() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent617() + return p.cur.onNormalGroupElement240() } -func (c *current) onSidebarBlockRawContent612() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onNormalGroupElement246() (interface{}, error) { + + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent612() (interface{}, error) { +func (p *parser) callonNormalGroupElement246() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent612() + return p.cur.onNormalGroupElement246() } -func (c *current) onSidebarBlockRawContent609(line interface{}) (interface{}, error) { - // do not include the trailing 'EOL' on the first line - return line, nil +func (c *current) onNormalGroupElement1(element interface{}) (interface{}, error) { + c.trackSpaceSuffix(element) + return element, nil + } -func (p *parser) callonSidebarBlockRawContent609() (interface{}, error) { +func (p *parser) callonNormalGroupElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent609(stack["line"]) + return p.cur.onNormalGroupElement1(stack["element"]) } -func (c *current) onSidebarBlockRawContent639() (interface{}, error) { +func (c *current) onPostReplacementsGroup17() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil -} -func (p *parser) callonSidebarBlockRawContent639() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent639() } -func (c *current) onSidebarBlockRawContent631() (interface{}, error) { - return types.NewBlankLine() -} - -func (p *parser) callonSidebarBlockRawContent631() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent631() + return p.cur.onPostReplacementsGroup17() } -func (c *current) onSidebarBlockRawContent647() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onPostReplacementsGroup22() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent647() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent647() + return p.cur.onPostReplacementsGroup22() } -func (c *current) onSidebarBlockRawContent628(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onPostReplacementsGroup12() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent628() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup12() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent628(stack["content"]) + return p.cur.onPostReplacementsGroup12() } -func (c *current) onSidebarBlockRawContent606(firstLine, otherLines interface{}) (interface{}, error) { +func (c *current) onPostReplacementsGroup29() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil } -func (p *parser) callonSidebarBlockRawContent606() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup29() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent606(stack["firstLine"], stack["otherLines"]) + return p.cur.onPostReplacementsGroup29() } -func (c *current) onSidebarBlockRawContent604(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithSpacesOnFirstLine, lines.([]interface{}), c.globalStore.getAttributes()) -} +func (c *current) onPostReplacementsGroup33() (bool, error) { -func (p *parser) callonSidebarBlockRawContent604() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent604(stack["lines"]) -} + return c.isPreceededBySpace(), nil -func (c *current) onSidebarBlockRawContent661() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent661() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup33() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent661() + return p.cur.onPostReplacementsGroup33() } -func (c *current) onSidebarBlockRawContent673() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onPostReplacementsGroup36() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent673() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup36() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent673() + return p.cur.onPostReplacementsGroup36() } -func (c *current) onSidebarBlockRawContent670(line interface{}) (interface{}, error) { - - return line, nil // do not include the trailing 'EOL' +func (c *current) onPostReplacementsGroup40() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent670() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup40() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent670(stack["line"]) + return p.cur.onPostReplacementsGroup40() } -func (c *current) onSidebarBlockRawContent667(lines interface{}) (interface{}, error) { - return lines.([]interface{}), nil +func (c *current) onPostReplacementsGroup31() (interface{}, error) { + return types.NewLineBreak() + } -func (p *parser) callonSidebarBlockRawContent667() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup31() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent667(stack["lines"]) + return p.cur.onPostReplacementsGroup31() } -func (c *current) onSidebarBlockRawContent690() (interface{}, error) { +func (c *current) onPostReplacementsGroup47() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent690() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup47() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent690() + return p.cur.onPostReplacementsGroup47() } -func (c *current) onSidebarBlockRawContent655(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithDelimiter, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onPostReplacementsGroup56() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent655() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent655(stack["lines"]) + return p.cur.onPostReplacementsGroup56() } -func (c *current) onSidebarBlockRawContent703() (interface{}, error) { - return types.Tip, nil +func (c *current) onPostReplacementsGroup52(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonSidebarBlockRawContent703() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup52() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent703() + return p.cur.onPostReplacementsGroup52(stack["ref"]) } -func (c *current) onSidebarBlockRawContent705() (interface{}, error) { - return types.Note, nil -} +func (c *current) onPostReplacementsGroup60() (interface{}, error) { -func (p *parser) callonSidebarBlockRawContent705() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent705() -} + return types.NewStringElement(string(c.text)) -func (c *current) onSidebarBlockRawContent707() (interface{}, error) { - return types.Important, nil } -func (p *parser) callonSidebarBlockRawContent707() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup60() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent707() + return p.cur.onPostReplacementsGroup60() } -func (c *current) onSidebarBlockRawContent709() (interface{}, error) { - return types.Warning, nil +func (c *current) onPostReplacementsGroup5(element interface{}) (interface{}, error) { + c.trackSpaceSuffix(element) + return element, nil + } -func (p *parser) callonSidebarBlockRawContent709() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent709() + return p.cur.onPostReplacementsGroup5(stack["element"]) } -func (c *current) onSidebarBlockRawContent711() (interface{}, error) { - return types.Caution, nil +func (c *current) onPostReplacementsGroup1(elements interface{}) (interface{}, error) { + c.resetSpaceSuffixTracking() + return types.NewInlineElements(elements) + } -func (p *parser) callonSidebarBlockRawContent711() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent711() + return p.cur.onPostReplacementsGroup1(stack["elements"]) } -func (c *current) onSidebarBlockRawContent725() (interface{}, error) { +func (c *current) onQuotesGroup11() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent725() (interface{}, error) { +func (p *parser) callonQuotesGroup11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent725() + return p.cur.onQuotesGroup11() } -func (c *current) onSidebarBlockRawContent734() (interface{}, error) { +func (c *current) onQuotesGroup16() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent734() (interface{}, error) { +func (p *parser) callonQuotesGroup16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent734() + return p.cur.onQuotesGroup16() } -func (c *current) onSidebarBlockRawContent717(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onQuotesGroup6() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent717() (interface{}, error) { +func (p *parser) callonQuotesGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent717(stack["content"]) + return p.cur.onQuotesGroup6() } -func (c *current) onSidebarBlockRawContent755() (interface{}, error) { +func (c *current) onQuotesGroup28() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent755() (interface{}, error) { +func (p *parser) callonQuotesGroup28() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent755() + return p.cur.onQuotesGroup28() } -func (c *current) onSidebarBlockRawContent767() (interface{}, error) { - return string(c.text), nil +func (c *current) onQuotesGroup24(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonSidebarBlockRawContent767() (interface{}, error) { +func (p *parser) callonQuotesGroup24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent767() + return p.cur.onQuotesGroup24(stack["ref"]) } -func (c *current) onSidebarBlockRawContent779() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onQuotesGroup32() (interface{}, error) { -func (p *parser) callonSidebarBlockRawContent779() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent779() -} + return types.NewStringElement(string(c.text)) -func (c *current) onSidebarBlockRawContent791() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent791() (interface{}, error) { +func (p *parser) callonQuotesGroup32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent791() + return p.cur.onQuotesGroup32() } -func (c *current) onSidebarBlockRawContent803() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onQuotesGroup1(elements interface{}) (interface{}, error) { -func (p *parser) callonSidebarBlockRawContent803() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent803() -} + return types.NewInlineElements(elements) -func (c *current) onSidebarBlockRawContent815() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent815() (interface{}, error) { +func (p *parser) callonQuotesGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent815() + return p.cur.onQuotesGroup1(stack["elements"]) } -func (c *current) onSidebarBlockRawContent827() (interface{}, error) { +func (c *current) onReplacementsGroup11() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent827() (interface{}, error) { +func (p *parser) callonReplacementsGroup11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent827() + return p.cur.onReplacementsGroup11() } -func (c *current) onSidebarBlockRawContent835() (interface{}, error) { - +func (c *current) onReplacementsGroup16() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent835() (interface{}, error) { +func (p *parser) callonReplacementsGroup16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent835() + return p.cur.onReplacementsGroup16() } -func (c *current) onSidebarBlockRawContent843(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onReplacementsGroup6() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent843() (bool, error) { +func (p *parser) callonReplacementsGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent843(stack["content"]) + return p.cur.onReplacementsGroup6() } -func (c *current) onSidebarBlockRawContent742(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onReplacementsGroup25() (bool, error) { + return c.isSubstitutionEnabled(Replacements) } -func (p *parser) callonSidebarBlockRawContent742() (interface{}, error) { +func (p *parser) callonReplacementsGroup25() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent742(stack["content"]) + return p.cur.onReplacementsGroup25() } -func (c *current) onSidebarBlockRawContent699(t, lines interface{}) (interface{}, error) { - - return types.NewAdmonitionParagraph(lines.([]interface{}), t.(string), c.globalStore.getAttributes()) +func (c *current) onReplacementsGroup28() (interface{}, error) { + return types.NewStringElement("\u2019") } -func (p *parser) callonSidebarBlockRawContent699() (interface{}, error) { +func (p *parser) callonReplacementsGroup28() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent699(stack["t"], stack["lines"]) + return p.cur.onReplacementsGroup28() } -func (c *current) onSidebarBlockRawContent860() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onReplacementsGroup30() (interface{}, error) { + return types.NewStringElement("\u00a9") -func (p *parser) callonSidebarBlockRawContent860() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent860() } -func (c *current) onSidebarBlockRawContent852() (interface{}, error) { - return types.NewBlankLine() -} - -func (p *parser) callonSidebarBlockRawContent852() (interface{}, error) { +func (p *parser) callonReplacementsGroup30() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent852() + return p.cur.onReplacementsGroup30() } -func (c *current) onSidebarBlockRawContent876() (interface{}, error) { - - return string(c.text), nil +func (c *current) onReplacementsGroup32() (interface{}, error) { + return types.NewStringElement("\u2122") } -func (p *parser) callonSidebarBlockRawContent876() (interface{}, error) { +func (p *parser) callonReplacementsGroup32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent876() + return p.cur.onReplacementsGroup32() } -func (c *current) onSidebarBlockRawContent870(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onReplacementsGroup34() (interface{}, error) { + return types.NewStringElement("\u00ae") } -func (p *parser) callonSidebarBlockRawContent870() (interface{}, error) { +func (p *parser) callonReplacementsGroup34() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent870(stack["content"]) + return p.cur.onReplacementsGroup34() } -func (c *current) onSidebarBlockRawContent849(content interface{}) (interface{}, error) { +func (c *current) onReplacementsGroup36() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") - return content, nil } -func (p *parser) callonSidebarBlockRawContent849() (interface{}, error) { +func (p *parser) callonReplacementsGroup36() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent849(stack["content"]) + return p.cur.onReplacementsGroup36() } -func (c *current) onSidebarBlockRawContent844(content interface{}) (interface{}, error) { - return types.NewMarkdownQuoteBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onReplacementsGroup38() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") } -func (p *parser) callonSidebarBlockRawContent844() (interface{}, error) { +func (p *parser) callonReplacementsGroup38() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent844(stack["content"]) + return p.cur.onReplacementsGroup38() } -func (c *current) onSidebarBlockRawContent886() (bool, error) { - // verify that one of the attributes is `kind:passthrough` - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Passthrough), nil +func (c *current) onReplacementsGroup23(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonSidebarBlockRawContent886() (bool, error) { +func (p *parser) callonReplacementsGroup23() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent886() + return p.cur.onReplacementsGroup23(stack["element"]) } -func (c *current) onSidebarBlockRawContent902() (interface{}, error) { +func (c *current) onReplacementsGroup48() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent902() (interface{}, error) { +func (p *parser) callonReplacementsGroup48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent902() + return p.cur.onReplacementsGroup48() } -func (c *current) onSidebarBlockRawContent914() (interface{}, error) { - return string(c.text), nil +func (c *current) onReplacementsGroup44(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonSidebarBlockRawContent914() (interface{}, error) { +func (p *parser) callonReplacementsGroup44() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent914() + return p.cur.onReplacementsGroup44(stack["ref"]) } -func (c *current) onSidebarBlockRawContent926() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onReplacementsGroup52() (interface{}, error) { -func (p *parser) callonSidebarBlockRawContent926() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent926() -} + return types.NewStringElement(string(c.text)) -func (c *current) onSidebarBlockRawContent938() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent938() (interface{}, error) { +func (p *parser) callonReplacementsGroup52() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent938() + return p.cur.onReplacementsGroup52() } -func (c *current) onSidebarBlockRawContent950() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onReplacementsGroup1(elements interface{}) (interface{}, error) { -func (p *parser) callonSidebarBlockRawContent950() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent950() -} + return types.NewInlineElements(elements) -func (c *current) onSidebarBlockRawContent962() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent962() (interface{}, error) { +func (p *parser) callonReplacementsGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent962() + return p.cur.onReplacementsGroup1(stack["elements"]) } -func (c *current) onSidebarBlockRawContent974() (interface{}, error) { +func (c *current) onSpecialCharactersGroup11() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent974() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent974() + return p.cur.onSpecialCharactersGroup11() } -func (c *current) onSidebarBlockRawContent982() (interface{}, error) { - +func (c *current) onSpecialCharactersGroup16() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent982() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent982() + return p.cur.onSpecialCharactersGroup16() } -func (c *current) onSidebarBlockRawContent990(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onSpecialCharactersGroup6() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent990() (bool, error) { +func (p *parser) callonSpecialCharactersGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent990(stack["content"]) + return p.cur.onSpecialCharactersGroup6() } -func (c *current) onSidebarBlockRawContent889(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onSpecialCharactersGroup25() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonSidebarBlockRawContent889() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup25() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent889(stack["content"]) + return p.cur.onSpecialCharactersGroup25() } -func (c *current) onSidebarBlockRawContent884(content interface{}) (interface{}, error) { - - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSpecialCharactersGroup34() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent884() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup34() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent884(stack["content"]) + return p.cur.onSpecialCharactersGroup34() } -func (c *current) onSidebarBlockRawContent1003() (interface{}, error) { +func (c *current) onSpecialCharactersGroup38() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent1003() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup38() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1003() + return p.cur.onSpecialCharactersGroup38() } -func (c *current) onSidebarBlockRawContent1012() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup44() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent1012() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup44() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1012() + return p.cur.onSpecialCharactersGroup44() } -func (c *current) onSidebarBlockRawContent995(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onSpecialCharactersGroup51() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonSidebarBlockRawContent995() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup51() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent995(stack["content"]) + return p.cur.onSpecialCharactersGroup51() } -func (c *current) onSidebarBlockRawContent1033() (interface{}, error) { +func (c *current) onSpecialCharactersGroup58() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent1033() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup58() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1033() + return p.cur.onSpecialCharactersGroup58() } -func (c *current) onSidebarBlockRawContent1045() (interface{}, error) { +func (c *current) onSpecialCharactersGroup70() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent1045() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup70() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1045() + return p.cur.onSpecialCharactersGroup70() } -func (c *current) onSidebarBlockRawContent1057() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onSpecialCharactersGroup72() (interface{}, error) { -func (p *parser) callonSidebarBlockRawContent1057() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSidebarBlockRawContent1057() -} + return strconv.Atoi(string(c.text)) -func (c *current) onSidebarBlockRawContent1069() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent1069() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup72() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1069() + return p.cur.onSpecialCharactersGroup72() } -func (c *current) onSidebarBlockRawContent1081() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup65(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonSidebarBlockRawContent1081() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup65() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1081() + return p.cur.onSpecialCharactersGroup65(stack["start"]) } -func (c *current) onSidebarBlockRawContent1093() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup54(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSidebarBlockRawContent1093() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1093() + return p.cur.onSpecialCharactersGroup54(stack["name"], stack["start"]) } -func (c *current) onSidebarBlockRawContent1105() (interface{}, error) { +func (c *current) onSpecialCharactersGroup80() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent1105() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1105() + return p.cur.onSpecialCharactersGroup80() } -func (c *current) onSidebarBlockRawContent1113() (interface{}, error) { - +func (c *current) onSpecialCharactersGroup92() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent1113() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup92() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1113() + return p.cur.onSpecialCharactersGroup92() } -func (c *current) onSidebarBlockRawContent1121(content interface{}) (bool, error) { - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +func (c *current) onSpecialCharactersGroup94() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent1121() (bool, error) { +func (p *parser) callonSpecialCharactersGroup94() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1121(stack["content"]) + return p.cur.onSpecialCharactersGroup94() } -func (c *current) onSidebarBlockRawContent1020(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onSpecialCharactersGroup87(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonSidebarBlockRawContent1020() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup87() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1020(stack["content"]) + return p.cur.onSpecialCharactersGroup87(stack["start"]) } -func (c *current) onSidebarBlockRawContent991(lines interface{}) (interface{}, error) { - - return types.NewParagraph(lines.([]interface{}), c.globalStore.getAttributes()) - +func (c *current) onSpecialCharactersGroup76(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonSidebarBlockRawContent991() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup76() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent991(stack["lines"]) + return p.cur.onSpecialCharactersGroup76(stack["name"], stack["start"]) } -func (c *current) onSidebarBlockRawContent1129() (interface{}, error) { +func (c *current) onSpecialCharactersGroup102() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent1129() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup102() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1129() + return p.cur.onSpecialCharactersGroup102() } -func (c *current) onSidebarBlockRawContent1122() (interface{}, error) { - // for standalone attributes at the end of the delomited block - return types.NewStandaloneAttributes(c.globalStore.getAttributes()) // will be discarded anyways +func (c *current) onSpecialCharactersGroup98(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSidebarBlockRawContent1122() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup98() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1122() + return p.cur.onSpecialCharactersGroup98(stack["name"]) } -func (c *current) onSidebarBlockRawContent4(attributes, element interface{}) (interface{}, error) { - c.globalStore.discardAttributes() +func (c *current) onSpecialCharactersGroup49(element interface{}) (interface{}, error) { return element, nil } -func (p *parser) callonSidebarBlockRawContent4() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup49() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent4(stack["attributes"], stack["element"]) + return p.cur.onSpecialCharactersGroup49(stack["element"]) } -func (c *current) onSidebarBlockRawContent1(elements interface{}) (interface{}, error) { - return elements, nil +func (c *current) onSpecialCharactersGroup108() (interface{}, error) { + + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent1() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup108() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1(stack["elements"]) + return p.cur.onSpecialCharactersGroup108() } -func (c *current) onInlineMacros13() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onSpecialCharactersGroup30(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonInlineMacros13() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup30() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros13() + return p.cur.onSpecialCharactersGroup30(stack["id"], stack["label"]) } -func (c *current) onInlineMacros20() (interface{}, error) { +func (c *current) onSpecialCharactersGroup115() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonInlineMacros20() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup115() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros20() + return p.cur.onSpecialCharactersGroup115() } -func (c *current) onInlineMacros9(id interface{}) (interface{}, error) { - // no EOL here since there can be multiple InlineElementID on the same line - return types.NewInlineIDAttribute(id.(string)) +func (c *current) onSpecialCharactersGroup111(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonInlineMacros9() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros9(stack["id"]) + return p.cur.onSpecialCharactersGroup111(stack["id"]) } -func (c *current) onInlineMacros30() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup28() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonInlineMacros30() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup28() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros30() + return p.cur.onSpecialCharactersGroup28() } -func (c *current) onInlineMacros26() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup119() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonInlineMacros26() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup119() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros26() + return p.cur.onSpecialCharactersGroup119() } -func (c *current) onInlineMacros39() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup23(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonInlineMacros39() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup23() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros39() + return p.cur.onSpecialCharactersGroup23(stack["element"]) } -func (c *current) onInlineMacros45() (interface{}, error) { +func (c *current) onSpecialCharactersGroup125() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonInlineMacros45() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup125() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros45() + return p.cur.onSpecialCharactersGroup125() } -func (c *current) onInlineMacros52() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup121(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonInlineMacros52() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup121() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros52() + return p.cur.onSpecialCharactersGroup121(stack["ref"]) } -func (c *current) onInlineMacros48() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onSpecialCharactersGroup129() (interface{}, error) { -func (p *parser) callonInlineMacros48() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onInlineMacros48() -} + return types.NewStringElement(string(c.text)) -func (c *current) onInlineMacros34(content interface{}) (interface{}, error) { - return content, nil } -func (p *parser) callonInlineMacros34() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup129() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros34(stack["content"]) + return p.cur.onSpecialCharactersGroup129() } -func (c *current) onInlineMacros61() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onSpecialCharactersGroup1(elements interface{}) (interface{}, error) { -func (p *parser) callonInlineMacros61() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onInlineMacros61() -} + return types.NewInlineElements(elements) -func (c *current) onInlineMacros67() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonInlineMacros67() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros67() + return p.cur.onSpecialCharactersGroup1(stack["elements"]) } -func (c *current) onInlineMacros74() (interface{}, error) { +func (c *current) onVerbatimGroup11() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonInlineMacros74() (interface{}, error) { +func (p *parser) callonVerbatimGroup11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros74() + return p.cur.onVerbatimGroup11() } -func (c *current) onInlineMacros70() (interface{}, error) { +func (c *current) onVerbatimGroup16() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonInlineMacros70() (interface{}, error) { +func (p *parser) callonVerbatimGroup16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros70() + return p.cur.onVerbatimGroup16() } -func (c *current) onInlineMacros56(content interface{}) (interface{}, error) { - return content, nil +func (c *current) onVerbatimGroup6() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonInlineMacros56() (interface{}, error) { +func (p *parser) callonVerbatimGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros56(stack["content"]) + return p.cur.onVerbatimGroup6() } -func (c *current) onInlineMacros22(term1, term2, term3 interface{}) (interface{}, error) { - return types.NewConcealedIndexTerm(term1, term2, term3) +func (c *current) onVerbatimGroup26() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonInlineMacros22() (interface{}, error) { +func (p *parser) callonVerbatimGroup26() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros22(stack["term1"], stack["term2"], stack["term3"]) + return p.cur.onVerbatimGroup26() } -func (c *current) onInlinePassthroughSubs5() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup35() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonInlinePassthroughSubs5() (interface{}, error) { +func (p *parser) callonVerbatimGroup35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthroughSubs5() + return p.cur.onVerbatimGroup35() } -func (c *current) onInlinePassthroughSubs14() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup39() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonInlinePassthroughSubs14() (interface{}, error) { +func (p *parser) callonVerbatimGroup39() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthroughSubs14() + return p.cur.onVerbatimGroup39() } -func (c *current) onInlinePassthroughSubs23() (interface{}, error) { - // allow ` +func (c *current) onVerbatimGroup45() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlinePassthroughSubs23() (interface{}, error) { +func (p *parser) callonVerbatimGroup45() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthroughSubs23() + return p.cur.onVerbatimGroup45() } -func (c *current) onInlinePassthroughSubs36() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onVerbatimGroup52() (bool, error) { + return c.isSubstitutionEnabled(Attributes) -func (p *parser) callonInlinePassthroughSubs36() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onInlinePassthroughSubs36() } -func (c *current) onInlinePassthroughSubs32(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) -} - -func (p *parser) callonInlinePassthroughSubs32() (interface{}, error) { +func (p *parser) callonVerbatimGroup52() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthroughSubs32(stack["ref"]) + return p.cur.onVerbatimGroup52() } -func (c *current) onInlinePassthroughSubs43() (interface{}, error) { +func (c *current) onVerbatimGroup59() (interface{}, error) { return string(c.text), nil -} -func (p *parser) callonInlinePassthroughSubs43() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onInlinePassthroughSubs43() } -func (c *current) onInlinePassthroughSubs45() (interface{}, error) { - - return types.NewStringElement(string(c.text)) -} - -func (p *parser) callonInlinePassthroughSubs45() (interface{}, error) { +func (p *parser) callonVerbatimGroup59() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthroughSubs45() + return p.cur.onVerbatimGroup59() } -func (c *current) onSpecialCharacterSubs4() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup71() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSpecialCharacterSubs4() (interface{}, error) { +func (p *parser) callonVerbatimGroup71() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs4() + return p.cur.onVerbatimGroup71() } -func (c *current) onSpecialCharacterSubs13() (interface{}, error) { +func (c *current) onVerbatimGroup73() (interface{}, error) { - return types.NewStringElement(string(c.text)) + return strconv.Atoi(string(c.text)) } -func (p *parser) callonSpecialCharacterSubs13() (interface{}, error) { +func (p *parser) callonVerbatimGroup73() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs13() + return p.cur.onVerbatimGroup73() } -func (c *current) onSpecialCharacterSubs22() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup66(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonSpecialCharacterSubs22() (interface{}, error) { +func (p *parser) callonVerbatimGroup66() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs22() + return p.cur.onVerbatimGroup66(stack["start"]) } -func (c *current) onSpecialCharacterSubs37() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onVerbatimGroup55(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSpecialCharacterSubs37() (interface{}, error) { +func (p *parser) callonVerbatimGroup55() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs37() + return p.cur.onVerbatimGroup55(stack["name"], stack["start"]) } -func (c *current) onSpecialCharacterSubs43() (interface{}, error) { +func (c *current) onVerbatimGroup81() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSpecialCharacterSubs43() (interface{}, error) { +func (p *parser) callonVerbatimGroup81() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs43() + return p.cur.onVerbatimGroup81() } -func (c *current) onSpecialCharacterSubs49() (interface{}, error) { - // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup93() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSpecialCharacterSubs49() (interface{}, error) { +func (p *parser) callonVerbatimGroup93() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs49() + return p.cur.onVerbatimGroup93() } -func (c *current) onSpecialCharacterSubs58() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onVerbatimGroup95() (interface{}, error) { -func (p *parser) callonSpecialCharacterSubs58() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSpecialCharacterSubs58() -} + return strconv.Atoi(string(c.text)) -func (c *current) onSpecialCharacterSubs54(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSpecialCharacterSubs54() (interface{}, error) { +func (p *parser) callonVerbatimGroup95() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs54(stack["name"]) + return p.cur.onVerbatimGroup95() } -func (c *current) onSpecialCharacterSubs64() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup88(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonSpecialCharacterSubs64() (interface{}, error) { +func (p *parser) callonVerbatimGroup88() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs64() + return p.cur.onVerbatimGroup88(stack["start"]) } -func (c *current) onSpecialCharacterSubs33(id, label interface{}) (interface{}, error) { - return types.NewInternalCrossReference(id, label) +func (c *current) onVerbatimGroup77(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonSpecialCharacterSubs33() (interface{}, error) { +func (p *parser) callonVerbatimGroup77() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs33(stack["id"], stack["label"]) + return p.cur.onVerbatimGroup77(stack["name"], stack["start"]) } -func (c *current) onSpecialCharacterSubs71() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ +func (c *current) onVerbatimGroup103() (interface{}, error) { return string(c.text), nil -} -func (p *parser) callonSpecialCharacterSubs71() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSpecialCharacterSubs71() -} - -func (c *current) onSpecialCharacterSubs67(id interface{}) (interface{}, error) { - return types.NewInternalCrossReference(id, nil) } -func (p *parser) callonSpecialCharacterSubs67() (interface{}, error) { +func (p *parser) callonVerbatimGroup103() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs67(stack["id"]) + return p.cur.onVerbatimGroup103() } -func (c *current) onSpecialCharacterSubs31() (interface{}, error) { - // if we have a InternalCrossReference we just return a StringElement. - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup99(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSpecialCharacterSubs31() (interface{}, error) { +func (p *parser) callonVerbatimGroup99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs31() + return p.cur.onVerbatimGroup99(stack["name"]) } -func (c *current) onSpecialCharacterSubs75() (interface{}, error) { - return types.NewSpecialCharacter(string(c.text)) +func (c *current) onVerbatimGroup50(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonSpecialCharacterSubs75() (interface{}, error) { +func (p *parser) callonVerbatimGroup50() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs75() + return p.cur.onVerbatimGroup50(stack["element"]) } -func (c *current) onSpecialCharacterSubs81() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onVerbatimGroup109() (interface{}, error) { -func (p *parser) callonSpecialCharacterSubs81() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSpecialCharacterSubs81() -} + return types.NewStringElement(string(c.text)) -func (c *current) onSpecialCharacterSubs77(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonSpecialCharacterSubs77() (interface{}, error) { +func (p *parser) callonVerbatimGroup109() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs77(stack["ref"]) + return p.cur.onVerbatimGroup109() } -func (c *current) onSpecialCharacterSubs88() (interface{}, error) { - return string(c.text), nil +func (c *current) onVerbatimGroup31(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonSpecialCharacterSubs88() (interface{}, error) { +func (p *parser) callonVerbatimGroup31() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs88() + return p.cur.onVerbatimGroup31(stack["id"], stack["label"]) } -func (c *current) onSpecialCharacterSubs90() (interface{}, error) { +func (c *current) onVerbatimGroup116() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil - return types.NewStringElement(string(c.text)) } -func (p *parser) callonSpecialCharacterSubs90() (interface{}, error) { +func (p *parser) callonVerbatimGroup116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs90() + return p.cur.onVerbatimGroup116() } -func (c *current) onQuotedTextSubs4() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup112(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) } -func (p *parser) callonQuotedTextSubs4() (interface{}, error) { +func (p *parser) callonVerbatimGroup112() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs4() + return p.cur.onVerbatimGroup112(stack["id"]) } -func (c *current) onQuotedTextSubs13() (interface{}, error) { - +func (c *current) onVerbatimGroup29() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuotedTextSubs13() (interface{}, error) { +func (p *parser) callonVerbatimGroup29() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs13() + return p.cur.onVerbatimGroup29() } -func (c *current) onQuotedTextSubs22() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup120() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonQuotedTextSubs22() (interface{}, error) { +func (p *parser) callonVerbatimGroup120() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs22() + return p.cur.onVerbatimGroup120() } -func (c *current) onQuotedTextSubs34() (interface{}, error) { - return string(c.text), nil +func (c *current) onVerbatimGroup24(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuotedTextSubs34() (interface{}, error) { +func (p *parser) callonVerbatimGroup24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs34() + return p.cur.onVerbatimGroup24(stack["element"]) } -func (c *current) onQuotedTextSubs42() (interface{}, error) { +func (c *current) onVerbatimGroup126() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonQuotedTextSubs42() (interface{}, error) { +func (p *parser) callonVerbatimGroup126() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs42() + return p.cur.onVerbatimGroup126() } -func (c *current) onQuotedTextSubs38(ref interface{}) (interface{}, error) { +func (c *current) onVerbatimGroup122(ref interface{}) (interface{}, error) { return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonQuotedTextSubs38() (interface{}, error) { +func (p *parser) callonVerbatimGroup122() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs38(stack["ref"]) + return p.cur.onVerbatimGroup122(stack["ref"]) } -func (c *current) onQuotedTextSubs46() (interface{}, error) { +func (c *current) onVerbatimGroup130() (interface{}, error) { return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuotedTextSubs46() (interface{}, error) { +func (p *parser) callonVerbatimGroup130() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs46() + return p.cur.onVerbatimGroup130() } -func (c *current) onAttributeSubs4() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup1(elements interface{}) (interface{}, error) { + + return types.NewInlineElements(elements) } -func (p *parser) callonAttributeSubs4() (interface{}, error) { +func (p *parser) callonVerbatimGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs4() + return p.cur.onVerbatimGroup1(stack["elements"]) } -func (c *current) onAttributeSubs13() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onInlineMacro3() (bool, error) { + return c.isSubstitutionEnabled(Macros) } -func (p *parser) callonAttributeSubs13() (interface{}, error) { +func (p *parser) callonInlineMacro3() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs13() + return p.cur.onInlineMacro3() } -func (c *current) onAttributeSubs22() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onInlineMacro17() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonAttributeSubs22() (interface{}, error) { +func (p *parser) callonInlineMacro17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs22() + return p.cur.onInlineMacro17() } -func (c *current) onAttributeSubs34() (interface{}, error) { +func (c *current) onInlineMacro22() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonAttributeSubs34() (interface{}, error) { +func (p *parser) callonInlineMacro22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs34() + return p.cur.onInlineMacro22() } -func (c *current) onAttributeSubs40() (interface{}, error) { - return string(c.text), nil +func (c *current) onInlineMacro13(id interface{}) (interface{}, error) { + // no EOL here since there can be multiple InlineElementID on the same line + return types.NewInlineIDAttribute(id.(string)) } -func (p *parser) callonAttributeSubs40() (interface{}, error) { +func (p *parser) callonInlineMacro13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs40() + return p.cur.onInlineMacro13(stack["id"]) } -func (c *current) onAttributeSubs52() (interface{}, error) { +func (c *current) onInlineMacro32() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil } -func (p *parser) callonAttributeSubs52() (interface{}, error) { +func (p *parser) callonInlineMacro32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs52() + return p.cur.onInlineMacro32() } -func (c *current) onAttributeSubs54() (interface{}, error) { - - return strconv.Atoi(string(c.text)) - +func (c *current) onInlineMacro28() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonAttributeSubs54() (interface{}, error) { +func (p *parser) callonInlineMacro28() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs54() + return p.cur.onInlineMacro28() } -func (c *current) onAttributeSubs47(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onInlineMacro39() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonAttributeSubs47() (interface{}, error) { +func (p *parser) callonInlineMacro39() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs47(stack["start"]) + return p.cur.onInlineMacro39() } -func (c *current) onAttributeSubs36(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), false, start) +func (c *current) onInlineMacro43() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonAttributeSubs36() (interface{}, error) { +func (p *parser) callonInlineMacro43() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs36(stack["name"], stack["start"]) + return p.cur.onInlineMacro43() } -func (c *current) onAttributeSubs62() (interface{}, error) { +func (c *current) onInlineMacro50() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonAttributeSubs62() (interface{}, error) { +func (p *parser) callonInlineMacro50() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs62() + return p.cur.onInlineMacro50() } -func (c *current) onAttributeSubs74() (interface{}, error) { +func (c *current) onInlineMacro46() (interface{}, error) { return string(c.text), nil - } -func (p *parser) callonAttributeSubs74() (interface{}, error) { +func (p *parser) callonInlineMacro46() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs74() + return p.cur.onInlineMacro46() } -func (c *current) onAttributeSubs76() (interface{}, error) { - - return strconv.Atoi(string(c.text)) - +func (c *current) onInlineMacro36(content interface{}) (interface{}, error) { + return content, nil } -func (p *parser) callonAttributeSubs76() (interface{}, error) { +func (p *parser) callonInlineMacro36() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs76() + return p.cur.onInlineMacro36(stack["content"]) } -func (c *current) onAttributeSubs69(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onInlineMacro57() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonAttributeSubs69() (interface{}, error) { +func (p *parser) callonInlineMacro57() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs69(stack["start"]) + return p.cur.onInlineMacro57() } -func (c *current) onAttributeSubs58(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), true, nil) +func (c *current) onInlineMacro61() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonAttributeSubs58() (interface{}, error) { +func (p *parser) callonInlineMacro61() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs58(stack["name"], stack["start"]) + return p.cur.onInlineMacro61() } -func (c *current) onAttributeSubs84() (interface{}, error) { +func (c *current) onInlineMacro68() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonAttributeSubs84() (interface{}, error) { +func (p *parser) callonInlineMacro68() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs84() + return p.cur.onInlineMacro68() } -func (c *current) onAttributeSubs80(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onInlineMacro64() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonAttributeSubs80() (interface{}, error) { +func (p *parser) callonInlineMacro64() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs80(stack["name"]) + return p.cur.onInlineMacro64() } -func (c *current) onAttributeSubs94() (interface{}, error) { - return string(c.text), nil +func (c *current) onInlineMacro54(content interface{}) (interface{}, error) { + return content, nil } -func (p *parser) callonAttributeSubs94() (interface{}, error) { +func (p *parser) callonInlineMacro54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs94() + return p.cur.onInlineMacro54(stack["content"]) } -func (c *current) onAttributeSubs90(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onInlineMacro24(term1, term2, term3 interface{}) (interface{}, error) { + return types.NewConcealedIndexTerm(term1, term2, term3) + } -func (p *parser) callonAttributeSubs90() (interface{}, error) { +func (p *parser) callonInlineMacro24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs90(stack["ref"]) + return p.cur.onInlineMacro24(stack["term1"], stack["term2"], stack["term3"]) } -func (c *current) onAttributeSubs98() (interface{}, error) { +func (c *current) onInlineMacro1(element interface{}) (interface{}, error) { + return element, nil - return types.NewStringElement(string(c.text)) } -func (p *parser) callonAttributeSubs98() (interface{}, error) { +func (p *parser) callonInlineMacro1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs98() + return p.cur.onInlineMacro1(stack["element"]) } -func (c *current) onInlineMacroSubs4() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onInlinePassthrough3() (bool, error) { + return c.isSubstitutionEnabled(InlinePassthroughs) } -func (p *parser) callonInlineMacroSubs4() (interface{}, error) { +func (p *parser) callonInlinePassthrough3() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacroSubs4() + return p.cur.onInlinePassthrough3() } -func (c *current) onInlineMacroSubs13() (interface{}, error) { - +func (c *current) onInlinePassthrough11() (interface{}, error) { + // spaces and newlines are also allowed in the first or last position of the content and elsewhere too return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlineMacroSubs13() (interface{}, error) { +func (p *parser) callonInlinePassthrough11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacroSubs13() + return p.cur.onInlinePassthrough11() } -func (c *current) onInlineMacroSubs22() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onInlinePassthrough21() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil } -func (p *parser) callonInlineMacroSubs22() (interface{}, error) { +func (p *parser) callonInlinePassthrough21() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacroSubs22() + return p.cur.onInlinePassthrough21() } -func (c *current) onInlineMacroSubs34() (interface{}, error) { +func (c *current) onInlinePassthrough24() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonInlineMacroSubs34() (interface{}, error) { +func (p *parser) callonInlinePassthrough24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacroSubs34() + return p.cur.onInlinePassthrough24() } -func (c *current) onInlineMacroSubs41() (interface{}, error) { - return string(c.text), nil +func (c *current) onInlinePassthrough17() (interface{}, error) { + // a single character + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonInlineMacroSubs41() (interface{}, error) { +func (p *parser) callonInlinePassthrough17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacroSubs41() + return p.cur.onInlinePassthrough17() } -func (c *current) onInlineMacroSubs37(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onInlinePassthrough6(content interface{}) (interface{}, error) { + return types.NewInlinePassthrough(types.TriplePlusPassthrough, []interface{}{content}) + } -func (p *parser) callonInlineMacroSubs37() (interface{}, error) { +func (p *parser) callonInlinePassthrough6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacroSubs37(stack["ref"]) + return p.cur.onInlinePassthrough6(stack["content"]) } -func (c *current) onInlineMacroSubs45() (interface{}, error) { +func (c *current) onInlinePassthrough45() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil - return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlineMacroSubs45() (interface{}, error) { +func (p *parser) callonInlinePassthrough45() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacroSubs45() + return p.cur.onInlinePassthrough45() } -func (c *current) onMarkdownQuoteMacroSubs1(lines interface{}) (interface{}, error) { - return types.NewParagraph(lines.([]interface{}), nil) +func (c *current) onInlinePassthrough48() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonMarkdownQuoteMacroSubs1() (interface{}, error) { +func (p *parser) callonInlinePassthrough48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteMacroSubs1(stack["lines"]) + return p.cur.onInlinePassthrough48() } -func (c *current) onMarkdownQuoteLine6() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onInlinePassthrough58() (interface{}, error) { + log.Debug("matched multiple spaces") + return string(c.text), nil } -func (p *parser) callonMarkdownQuoteLine6() (interface{}, error) { +func (p *parser) callonInlinePassthrough58() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine6() + return p.cur.onInlinePassthrough58() } -func (c *current) onMarkdownQuoteLine15() (interface{}, error) { - - return types.NewStringElement(string(c.text)) - +func (c *current) onInlinePassthrough65() (interface{}, error) { + // TODO: just use "\n" + return string(c.text), nil } -func (p *parser) callonMarkdownQuoteLine15() (interface{}, error) { +func (p *parser) callonInlinePassthrough65() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine15() + return p.cur.onInlinePassthrough65() } -func (c *current) onMarkdownQuoteLine24() (interface{}, error) { - // allow ` +func (c *current) onInlinePassthrough40() (interface{}, error) { + // no space in the first or last position of the content, but allowed elsewhere return types.NewStringElement(string(c.text)) } -func (p *parser) callonMarkdownQuoteLine24() (interface{}, error) { +func (p *parser) callonInlinePassthrough40() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine24() + return p.cur.onInlinePassthrough40() } -func (c *current) onMarkdownQuoteLine36() (interface{}, error) { +func (c *current) onInlinePassthrough74() (interface{}, error) { + log.Debug("matched single space") return string(c.text), nil + } -func (p *parser) callonMarkdownQuoteLine36() (interface{}, error) { +func (p *parser) callonInlinePassthrough74() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine36() + return p.cur.onInlinePassthrough74() } -func (c *current) onMarkdownQuoteLine43() (interface{}, error) { +func (c *current) onInlinePassthrough77() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonMarkdownQuoteLine43() (interface{}, error) { +func (p *parser) callonInlinePassthrough77() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine43() + return p.cur.onInlinePassthrough77() } -func (c *current) onMarkdownQuoteLine39(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onInlinePassthrough71() (interface{}, error) { + // a single character + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonMarkdownQuoteLine39() (interface{}, error) { +func (p *parser) callonInlinePassthrough71() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine39(stack["ref"]) + return p.cur.onInlinePassthrough71() } -func (c *current) onMarkdownQuoteLine47() (interface{}, error) { +func (c *current) onInlinePassthrough35(content interface{}) (interface{}, error) { + return types.NewInlinePassthrough(types.SinglePlusPassthrough, []interface{}{content}) - return types.NewStringElement(string(c.text)) } -func (p *parser) callonMarkdownQuoteLine47() (interface{}, error) { +func (p *parser) callonInlinePassthrough35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine47() + return p.cur.onInlinePassthrough35(stack["content"]) } -func (c *current) onMarkdownQuoteLine1(elements interface{}) (interface{}, error) { - return types.NewInlineElements(elements.([]interface{})) +func (c *current) onInlinePassthrough1(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonMarkdownQuoteLine1() (interface{}, error) { +func (p *parser) callonInlinePassthrough1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine1(stack["elements"]) + return p.cur.onInlinePassthrough1(stack["element"]) } -func (c *current) onMarkdownQuoteAttribution5() (interface{}, error) { - return string(c.text), nil +func (c *current) onQuote3() (bool, error) { + return c.isSubstitutionEnabled(Quotes) } -func (p *parser) callonMarkdownQuoteAttribution5() (interface{}, error) { +func (p *parser) callonQuote3() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteAttribution5() + return p.cur.onQuote3() } -func (c *current) onMarkdownQuoteAttribution1(author interface{}) (interface{}, error) { - return author, nil +func (c *current) onQuote1(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonMarkdownQuoteAttribution1() (interface{}, error) { +func (p *parser) callonQuote1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteAttribution1(stack["author"]) + return p.cur.onQuote1(stack["element"]) } -func (c *current) onReplacementSubs4() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onTableColumnsAttribute20() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonReplacementSubs4() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute20() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onReplacementSubs4() + return p.cur.onTableColumnsAttribute20() } -func (c *current) onReplacementSubs13() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onTableColumnsAttribute15() (interface{}, error) { + return strconv.Atoi(string(c.text)) } -func (p *parser) callonReplacementSubs13() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute15() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onReplacementSubs13() + return p.cur.onTableColumnsAttribute15() } -func (c *current) onReplacementSubs22() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) - +func (c *current) onTableColumnsAttribute12(n interface{}) (interface{}, error) { + return n, nil } -func (p *parser) callonReplacementSubs22() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute12() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onReplacementSubs22() + return p.cur.onTableColumnsAttribute12(stack["n"]) } -func (c *current) onReplacementSubs34() (interface{}, error) { - return string(c.text), nil +func (c *current) onTableColumnsAttribute26() (interface{}, error) { + return types.HAlignLeft, nil } -func (p *parser) callonReplacementSubs34() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onReplacementSubs34() + return p.cur.onTableColumnsAttribute26() } -func (c *current) onReplacementSubs36() (interface{}, error) { - return types.NewStringElement("\u2019") +func (c *current) onTableColumnsAttribute28() (interface{}, error) { + return types.HAlignRight, nil } -func (p *parser) callonReplacementSubs36() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute28() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onReplacementSubs36() + return p.cur.onTableColumnsAttribute28() } -func (c *current) onReplacementSubs38() (interface{}, error) { - return types.NewStringElement("\u00a9") +func (c *current) onTableColumnsAttribute30() (interface{}, error) { + return types.HAlignCenter, nil } -func (p *parser) callonReplacementSubs38() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute30() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onReplacementSubs38() + return p.cur.onTableColumnsAttribute30() } -func (c *current) onReplacementSubs40() (interface{}, error) { - return types.NewStringElement("\u2122") +func (c *current) onTableColumnsAttribute35() (interface{}, error) { + return types.VAlignTop, nil } -func (p *parser) callonReplacementSubs40() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onReplacementSubs40() + return p.cur.onTableColumnsAttribute35() } -func (c *current) onReplacementSubs42() (interface{}, error) { - return types.NewStringElement("\u00ae") +func (c *current) onTableColumnsAttribute37() (interface{}, error) { + return types.VAlignBottom, nil } -func (p *parser) callonReplacementSubs42() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute37() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onReplacementSubs42() + return p.cur.onTableColumnsAttribute37() } -func (c *current) onReplacementSubs44() (interface{}, error) { - return types.NewStringElement("\u2026\u200b") +func (c *current) onTableColumnsAttribute39() (interface{}, error) { + return types.VAlignMiddle, nil } -func (p *parser) callonReplacementSubs44() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute39() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onReplacementSubs44() + return p.cur.onTableColumnsAttribute39() } -func (c *current) onReplacementSubs46() (interface{}, error) { - return types.NewStringElement(string(c.text[:1]) + "\u2019") +func (c *current) onTableColumnsAttribute49() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonReplacementSubs46() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute49() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onReplacementSubs46() + return p.cur.onTableColumnsAttribute49() } -func (c *current) onReplacementSubs56() (interface{}, error) { - return string(c.text), nil +func (c *current) onTableColumnsAttribute44() (interface{}, error) { + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonReplacementSubs56() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute44() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onReplacementSubs56() + return p.cur.onTableColumnsAttribute44() } -func (c *current) onReplacementSubs52(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onTableColumnsAttribute51() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonReplacementSubs52() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute51() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onReplacementSubs52(stack["ref"]) + return p.cur.onTableColumnsAttribute51() } -func (c *current) onReplacementSubs60() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onTableColumnsAttribute55() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonReplacementSubs60() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute55() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onReplacementSubs60() + return p.cur.onTableColumnsAttribute55() } -func (c *current) onPostReplacementSubs4() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onTableColumnsAttribute60(multiplier, halign, valign, weight, style, comma interface{}) (bool, error) { + // make sure that at least something was set + // (otherwise the parser will run indefinitely) + return multiplier != nil || + halign != nil || + valign != nil || + weight != nil || + style != nil || + comma != nil, nil } -func (p *parser) callonPostReplacementSubs4() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute60() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPostReplacementSubs4() + return p.cur.onTableColumnsAttribute60(stack["multiplier"], stack["halign"], stack["valign"], stack["weight"], stack["style"], stack["comma"]) } -func (c *current) onPostReplacementSubs13() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onTableColumnsAttribute5(multiplier, halign, valign, weight, style, comma interface{}) (interface{}, error) { + return types.NewTableColumn(multiplier, halign, valign, weight, style) } -func (p *parser) callonPostReplacementSubs13() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPostReplacementSubs13() + return p.cur.onTableColumnsAttribute5(stack["multiplier"], stack["halign"], stack["valign"], stack["weight"], stack["style"], stack["comma"]) } -func (c *current) onPostReplacementSubs22() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onTableColumnsAttribute1(cols interface{}) (interface{}, error) { + return cols, nil } -func (p *parser) callonPostReplacementSubs22() (interface{}, error) { +func (p *parser) callonTableColumnsAttribute1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPostReplacementSubs22() + return p.cur.onTableColumnsAttribute1(stack["cols"]) } -func (c *current) onPostReplacementSubs35() (interface{}, error) { +func (c *current) onUserMacroBlock4() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonPostReplacementSubs35() (interface{}, error) { +func (p *parser) callonUserMacroBlock4() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPostReplacementSubs35() + return p.cur.onUserMacroBlock4() } -func (c *current) onPostReplacementSubs31(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onUserMacroBlock7(name interface{}) (bool, error) { + // skip if no macro was registered under the given name + return c.globalStore.hasUserMacro(name.(string)), nil + } -func (p *parser) callonPostReplacementSubs31() (interface{}, error) { +func (p *parser) callonUserMacroBlock7() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPostReplacementSubs31(stack["ref"]) + return p.cur.onUserMacroBlock7(stack["name"]) } -func (c *current) onPostReplacementSubs43() (interface{}, error) { +func (c *current) onUserMacroBlock10() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonPostReplacementSubs43() (interface{}, error) { +func (p *parser) callonUserMacroBlock10() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPostReplacementSubs43() + return p.cur.onUserMacroBlock10() } -func (c *current) onPostReplacementSubs49() (interface{}, error) { +func (c *current) onUserMacroBlock16() (interface{}, error) { + // TODO: just use "\n" return string(c.text), nil } -func (p *parser) callonPostReplacementSubs49() (interface{}, error) { +func (p *parser) callonUserMacroBlock16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPostReplacementSubs49() + return p.cur.onUserMacroBlock16() } -func (c *current) onPostReplacementSubs39() (interface{}, error) { - return types.NewLineBreak() +func (c *current) onUserMacroBlock1(name, value, inlineAttributes interface{}) (interface{}, error) { + return types.NewUserMacroBlock(name.(string), value.(string), inlineAttributes.(types.Attributes), string(c.text)) + } -func (p *parser) callonPostReplacementSubs39() (interface{}, error) { +func (p *parser) callonUserMacroBlock1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPostReplacementSubs39() + return p.cur.onUserMacroBlock1(stack["name"], stack["value"], stack["inlineAttributes"]) } -func (c *current) onPostReplacementSubs60() (interface{}, error) { +func (c *current) onInlineUserMacro4() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonPostReplacementSubs60() (interface{}, error) { +func (p *parser) callonInlineUserMacro4() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPostReplacementSubs60() + return p.cur.onInlineUserMacro4() } -func (c *current) onPostReplacementSubs62() (interface{}, error) { +func (c *current) onInlineUserMacro7(name interface{}) (bool, error) { + // skip if no macro was registered under the given name + return c.globalStore.hasUserMacro(name.(string)), nil - return types.NewStringElement(string(c.text)) } -func (p *parser) callonPostReplacementSubs62() (interface{}, error) { +func (p *parser) callonInlineUserMacro7() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPostReplacementSubs62() + return p.cur.onInlineUserMacro7(stack["name"]) } -func (c *current) onCalloutSubs4() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onInlineUserMacro10() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonCalloutSubs4() (interface{}, error) { +func (p *parser) callonInlineUserMacro10() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutSubs4() + return p.cur.onInlineUserMacro10() } -func (c *current) onCalloutSubs13() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onInlineUserMacro1(name, value, inlineAttributes interface{}) (interface{}, error) { + return types.NewInlineUserMacro(name.(string), value.(string), inlineAttributes.(types.Attributes), string(c.text)) } -func (p *parser) callonCalloutSubs13() (interface{}, error) { +func (p *parser) callonInlineUserMacro1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutSubs13() + return p.cur.onInlineUserMacro1(stack["name"], stack["value"], stack["inlineAttributes"]) } -func (c *current) onCalloutSubs22() (interface{}, error) { - // allow ` +func (c *current) onFileLocation9() (interface{}, error) { + // not supported for now: EOL, space, "{", "[", "]" return types.NewStringElement(string(c.text)) } -func (p *parser) callonCalloutSubs22() (interface{}, error) { +func (p *parser) callonFileLocation9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutSubs22() + return p.cur.onFileLocation9() } -func (c *current) onCalloutSubs35() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation14() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonCalloutSubs35() (interface{}, error) { +func (p *parser) callonFileLocation14() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutSubs35() + return p.cur.onFileLocation14() } -func (c *current) onCalloutSubs31(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onFileLocation21() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonCalloutSubs31() (interface{}, error) { +func (p *parser) callonFileLocation21() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutSubs31(stack["ref"]) + return p.cur.onFileLocation21() } -func (c *current) onCalloutSubs42() (interface{}, error) { +func (c *current) onFileLocation33() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonCalloutSubs42() (interface{}, error) { +func (p *parser) callonFileLocation33() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutSubs42() + return p.cur.onFileLocation33() } -func (c *current) onCalloutSubs45() (interface{}, error) { +func (c *current) onFileLocation35() (interface{}, error) { + + return strconv.Atoi(string(c.text)) - return types.NewStringElement(string(c.text)) } -func (p *parser) callonCalloutSubs45() (interface{}, error) { +func (p *parser) callonFileLocation35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutSubs45() + return p.cur.onFileLocation35() } -func (c *current) onNoneSubs8() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation28(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonNoneSubs8() (interface{}, error) { +func (p *parser) callonFileLocation28() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNoneSubs8() + return p.cur.onFileLocation28(stack["start"]) } -func (c *current) onNoneSubs4(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onFileLocation17(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonNoneSubs4() (interface{}, error) { +func (p *parser) callonFileLocation17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNoneSubs4(stack["ref"]) + return p.cur.onFileLocation17(stack["name"], stack["start"]) } -func (c *current) onNoneSubs12() (interface{}, error) { - // just text, including empty lines - return types.NewStringElement(string(c.text)) +func (c *current) onFileLocation43() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonNoneSubs12() (interface{}, error) { +func (p *parser) callonFileLocation43() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNoneSubs12() + return p.cur.onFileLocation43() } -func (c *current) onTable7() (interface{}, error) { +func (c *current) onFileLocation55() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonTable7() (interface{}, error) { +func (p *parser) callonFileLocation55() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTable7() + return p.cur.onFileLocation55() } -func (c *current) onTable26() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation57() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonTable26() (interface{}, error) { +func (p *parser) callonFileLocation57() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTable26() + return p.cur.onFileLocation57() } -func (c *current) onTable1(header, lines interface{}) (interface{}, error) { - // end delimiter or end of file - return types.NewTable(header, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onFileLocation50(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonTable1() (interface{}, error) { +func (p *parser) callonFileLocation50() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTable1(stack["header"], stack["lines"]) + return p.cur.onFileLocation50(stack["start"]) } -func (c *current) onTableLineHeader9() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation39(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonTableLineHeader9() (interface{}, error) { +func (p *parser) callonFileLocation39() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableLineHeader9() + return p.cur.onFileLocation39(stack["name"], stack["start"]) } -func (c *current) onTableLineHeader32() (interface{}, error) { +func (c *current) onFileLocation65() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonTableLineHeader32() (interface{}, error) { +func (p *parser) callonFileLocation65() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableLineHeader32() + return p.cur.onFileLocation65() } -func (c *current) onTableLineHeader24(cells interface{}) (interface{}, error) { - return types.NewBlankLine() +func (c *current) onFileLocation61(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonTableLineHeader24() (interface{}, error) { +func (p *parser) callonFileLocation61() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableLineHeader24(stack["cells"]) + return p.cur.onFileLocation61(stack["name"]) } -func (c *current) onTableLineHeader1(cells interface{}) (interface{}, error) { - return types.NewTableLine(cells.([]interface{})) +func (c *current) onFileLocation12(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonTableLineHeader1() (interface{}, error) { +func (p *parser) callonFileLocation12() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableLineHeader1(stack["cells"]) + return p.cur.onFileLocation12(stack["element"]) } -func (c *current) onTableLine9() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation73() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonTableLine9() (interface{}, error) { +func (p *parser) callonFileLocation73() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableLine9() + return p.cur.onFileLocation73() } -func (c *current) onTableLine33() (interface{}, error) { +func (c *current) onFileLocation82() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonTableLine33() (interface{}, error) { +func (p *parser) callonFileLocation82() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableLine33() + return p.cur.onFileLocation82() } -func (c *current) onTableLine25() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onFileLocation86() (interface{}, error) { + log.Debug("matched single space") + return string(c.text), nil + } -func (p *parser) callonTableLine25() (interface{}, error) { +func (p *parser) callonFileLocation86() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableLine25() + return p.cur.onFileLocation86() } -func (c *current) onTableLine1(cells interface{}) (interface{}, error) { - return types.NewTableLine(cells.([]interface{})) +func (c *current) onFileLocation92() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonTableLine1() (interface{}, error) { +func (p *parser) callonFileLocation92() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableLine1(stack["cells"]) + return p.cur.onFileLocation92() } -func (c *current) onTableCell7() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation99() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonTableCell7() (interface{}, error) { +func (p *parser) callonFileLocation99() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableCell7() + return p.cur.onFileLocation99() } -func (c *current) onTableCell18() (interface{}, error) { +func (c *current) onFileLocation106() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonTableCell18() (interface{}, error) { +func (p *parser) callonFileLocation106() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableCell18() + return p.cur.onFileLocation106() } -func (c *current) onTableCell29() (interface{}, error) { +func (c *current) onFileLocation118() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonTableCell29() (interface{}, error) { +func (p *parser) callonFileLocation118() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableCell29() + return p.cur.onFileLocation118() } -func (c *current) onTableCell35() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation120() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonTableCell35() (interface{}, error) { +func (p *parser) callonFileLocation120() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableCell35() + return p.cur.onFileLocation120() } -func (c *current) onTableCell1(elements interface{}) (interface{}, error) { - return types.NewInlineElements(elements) +func (c *current) onFileLocation113(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonTableCell1() (interface{}, error) { +func (p *parser) callonFileLocation113() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableCell1(stack["elements"]) + return p.cur.onFileLocation113(stack["start"]) } -func (c *current) onIndexTerm1(term interface{}) (interface{}, error) { - return types.NewIndexTerm(term.([]interface{})) +func (c *current) onFileLocation102(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonIndexTerm1() (interface{}, error) { +func (p *parser) callonFileLocation102() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTerm1(stack["term"]) + return p.cur.onFileLocation102(stack["name"], stack["start"]) } -func (c *current) onIndexTermContent5() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onFileLocation128() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonIndexTermContent5() (interface{}, error) { +func (p *parser) callonFileLocation128() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent5() + return p.cur.onFileLocation128() } -func (c *current) onIndexTermContent14() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onFileLocation140() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonIndexTermContent14() (interface{}, error) { +func (p *parser) callonFileLocation140() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent14() + return p.cur.onFileLocation140() } -func (c *current) onIndexTermContent26() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation142() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonIndexTermContent26() (interface{}, error) { +func (p *parser) callonFileLocation142() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent26() + return p.cur.onFileLocation142() } -func (c *current) onIndexTermContent34() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onFileLocation135(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonIndexTermContent34() (interface{}, error) { +func (p *parser) callonFileLocation135() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent34() + return p.cur.onFileLocation135(stack["start"]) } -func (c *current) onIndexTermContent40() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation124(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonIndexTermContent40() (interface{}, error) { +func (p *parser) callonFileLocation124() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent40() + return p.cur.onFileLocation124(stack["name"], stack["start"]) } -func (c *current) onIndexTermContent46() (interface{}, error) { - // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references - return types.NewStringElement(string(c.text)) +func (c *current) onFileLocation150() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonIndexTermContent46() (interface{}, error) { +func (p *parser) callonFileLocation150() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent46() + return p.cur.onFileLocation150() } -func (c *current) onIndexTermContent55() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation146(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonIndexTermContent55() (interface{}, error) { +func (p *parser) callonFileLocation146() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent55() + return p.cur.onFileLocation146(stack["name"]) } -func (c *current) onIndexTermContent51(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onFileLocation97(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonIndexTermContent51() (interface{}, error) { +func (p *parser) callonFileLocation97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent51(stack["name"]) + return p.cur.onFileLocation97(stack["element"]) } -func (c *current) onIndexTermContent61() (interface{}, error) { +func (c *current) onFileLocation156() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonIndexTermContent61() (interface{}, error) { +func (p *parser) callonFileLocation156() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent61() + return p.cur.onFileLocation156() } -func (c *current) onIndexTermContent30(id, label interface{}) (interface{}, error) { +func (c *current) onFileLocation78(id, label interface{}) (interface{}, error) { return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonIndexTermContent30() (interface{}, error) { +func (p *parser) callonFileLocation78() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent30(stack["id"], stack["label"]) + return p.cur.onFileLocation78(stack["id"], stack["label"]) } -func (c *current) onIndexTermContent68() (interface{}, error) { +func (c *current) onFileLocation163() (interface{}, error) { // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonIndexTermContent68() (interface{}, error) { +func (p *parser) callonFileLocation163() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent68() + return p.cur.onFileLocation163() } -func (c *current) onIndexTermContent64(id interface{}) (interface{}, error) { +func (c *current) onFileLocation159(id interface{}) (interface{}, error) { return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonIndexTermContent64() (interface{}, error) { +func (p *parser) callonFileLocation159() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent64(stack["id"]) + return p.cur.onFileLocation159(stack["id"]) } -func (c *current) onIndexTermContent28() (interface{}, error) { - // if we have a InternalCrossReference we just return a StringElement. +func (c *current) onFileLocation76() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonIndexTermContent28() (interface{}, error) { +func (p *parser) callonFileLocation76() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent28() + return p.cur.onFileLocation76() } -func (c *current) onIndexTermContent72() (interface{}, error) { +func (c *current) onFileLocation167() (interface{}, error) { return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonIndexTermContent72() (interface{}, error) { +func (p *parser) callonFileLocation167() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent72() -} - -func (c *current) onIndexTermContent78() (interface{}, error) { - return string(c.text), nil + return p.cur.onFileLocation167() } -func (p *parser) callonIndexTermContent78() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onIndexTermContent78() -} +func (c *current) onFileLocation71(element interface{}) (interface{}, error) { + return element, nil -func (c *current) onIndexTermContent74(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonIndexTermContent74() (interface{}, error) { +func (p *parser) callonFileLocation71() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent74(stack["ref"]) + return p.cur.onFileLocation71(stack["element"]) } -func (c *current) onIndexTermContent82() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation169() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonIndexTermContent82() (interface{}, error) { +func (p *parser) callonFileLocation169() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent82() + return p.cur.onFileLocation169() } -func (c *current) onIndexTermContent1(elements interface{}) (interface{}, error) { +func (c *current) onFileLocation5(elements interface{}) (interface{}, error) { return types.NewInlineElements(elements.([]interface{})) -} -func (p *parser) callonIndexTermContent1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onIndexTermContent1(stack["elements"]) -} - -func (c *current) onFileLocation5() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" - return types.NewStringElement(string(c.text)) } func (p *parser) callonFileLocation5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileLocation5() + return p.cur.onFileLocation5(stack["elements"]) } -func (c *current) onFileLocation12() (interface{}, error) { +func (c *current) onFileLocation175() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonFileLocation12() (interface{}, error) { +func (p *parser) callonFileLocation175() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileLocation12() + return p.cur.onFileLocation175() } -func (c *current) onFileLocation8(ref interface{}) (interface{}, error) { +func (c *current) onFileLocation171(ref interface{}) (interface{}, error) { return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonFileLocation8() (interface{}, error) { +func (p *parser) callonFileLocation171() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileLocation8(stack["ref"]) + return p.cur.onFileLocation171(stack["ref"]) } func (c *current) onFileLocation1(path interface{}) (interface{}, error) { return types.NewLocation("", path.([]interface{})) + } func (p *parser) callonFileLocation1() (interface{}, error) { diff --git a/pkg/parser/parser.peg b/pkg/parser/parser.peg index 0b3b77f3..eeb5f84e 100644 --- a/pkg/parser/parser.peg +++ b/pkg/parser/parser.peg @@ -3,6 +3,7 @@ package parser import ( "io" + "fmt" "strconv" "strings" "unicode" @@ -14,194 +15,171 @@ import ( } -// ---------------------------------------------------------------- -// RawSource - source with file inclusions or just plain text -// ---------------------------------------------------------------- -RawSource <- lines:(AttributeDeclaration / RawSection / FileInclusion / RawLine)* { - return lines.([]interface{}), nil -} - -// we need to identify section titles to properly handle file inclusions with level offsets -RawSection <- - level:(("=")+ { - // `=` is level 0, etc. - return (len(c.text)-1), nil - }) - &{ - // use a predicate to make sure that only `=` (level 0) to `======` (level 5) are allowed - return level.(int) <= 5, nil - } - Space+ title:(RawSectionTitle) EOL { - return types.NewRawSection(level.(int), title.(string)) -} - -RawSectionTitle <- [^\r\n]* { - return string(c.text), nil -} - -RawLine <- !EOF content:([^\r\n]* { - return string(c.text), nil - }) EOL { // line MAY have content - return types.NewRawLine(content.(string)) - } - -// ---------------------------------------------------------------- -// RawDocument - fully parsed document with raw blocks -// ---------------------------------------------------------------- -RawDocument <- frontmatter:(FrontMatter?) blocks:(DocumentBlocks) EOF { - return types.NewRawDocument(frontmatter, blocks.([]interface{})) -} - -// ------------------------------------------ -// Document blocks -// ------------------------------------------ -DocumentBlocks <- Newline* header:(DocumentHeader?) blocks:(DocumentBlock*) { - if header != nil && blocks != nil { - return append([]interface{}{header}, blocks.([]interface{})...), nil - } else if blocks != nil { - return blocks.([]interface{}), nil - } - return []interface{}{}, nil -} - -DocumentBlock <- +// ------------------------------------------------------------------------------------- +// Document Fragments +// ------------------------------------------------------------------------------------- +DocumentFragment <- !EOF attributes:(BlockAttributes)? - #{ - c.globalStore.pushAttributes(attributes) - return nil - } - block:( - LabeledListItem // must appear before simple paragraph - / SimpleRawParagraph - / BlankLine // must be before LiteralBlock - / Section + element:( + ImageBlock + / UserMacroBlock + / FileInclusion + / ShortcutParagraph + / AttributeDeclaration + / AttributeReset + / DocumentHeader // must appear before Section + / BlankLine // must appear after DocumentHeader + / Section // must appear after delimited block (because of example delimiter) / DelimitedBlock - / ImageBlock - / SingleLineComment + / ThematicBreak // must appear before ListElement :/ + / ListElements / Table - / ThematicBreak - / OrderedListItem - / UnorderedListItem - / CalloutListItem - / ContinuedListItemElement - / LiteralBlock - / AttributeDeclaration - / AttributeReset - / TableOfContentsPlaceHolder - / UserMacroBlock - / RawParagraph - / EOF { // for standalone attributes at the end of the doc - return types.NewStandaloneAttributes(c.globalStore.getAttributes()) // will be discarded anyways - } + / SingleLineComment + / AdmonitionParagraph + / LiteralParagraph + / FrontMatter + / Paragraph // must be the last one... ) { - c.globalStore.discardAttributes() - return block, nil + c.setFrontMatterAllowed(false) // not allowed anymore + c.setDocumentHeaderAllowed(false) // not allowed anymore + + if element, ok := element.(types.BlockWithAttributes); ok && attributes != nil { + element.AddAttributes(attributes.(types.Attributes)) + } + return element, nil } -// ------------------------------------------ -// Front Matter -// ------------------------------------------ -FrontMatter <- YamlFrontMatter - -YamlFrontMatter <- YamlFrontMatterToken content:(YamlFrontMatterContent)? YamlFrontMatterToken { - return types.NewYamlFrontMatter(content.(string)) -} - -YamlFrontMatterToken <- "---" Space* EOL - -YamlFrontMatterContent <- ((!YamlFrontMatterToken .)+)* { - return string(c.text), nil -} - -// ------------------------------------------ -// Document Header and Metadata -// ------------------------------------------ -DocumentHeader <- "=" Space+ title:(TitleElements) id:(InlineElementID*) EOL - (Space* SingleLineComment / CommentBlock)* - authors:(DocumentAuthors?) - (Space* SingleLineComment / CommentBlock)* - revision:(DocumentRevision?) { - return types.NewDocumentHeader(title.([]interface{}), authors, revision) -} - -DocumentAuthors <- DocumentAuthorsInlineForm / DocumentAuthorsAttributeForm - -DocumentAuthorsInlineForm <- Space* !":" authors:(DocumentAuthor+) EOL { - return types.NewDocumentAuthors(authors.([]interface{})) -} - -DocumentAuthorsAttributeForm <- Space* ":author:" author:(DocumentAuthor) EOL { - return []types.DocumentAuthor{author.(types.DocumentAuthor)}, nil -} - -DocumentAuthor <- Space* fullname:(DocumentAuthorName) email:(DocumentAuthorEmail)? Space* ";"? Space* { - return types.NewDocumentAuthor(fullname, email) -} +// DocumentFragment <- +// element:( +// DocumentFragmentWithoutAttributes +// / DocumentFragmentWithAttributes +// ) { +// c.setFrontMatterAllowed(false) // not allowed anymore +// c.setDocumentHeaderAllowed(false) // not allowed anymore +// return element, nil +// } + -// "<" marks the beginning of the author email, and ";" is the authors separator -DocumentAuthorName <- [^<;\r\n]+ { - return string(c.text), nil -} +// DocumentFragmentWithoutAttributes <- +// AttributeDeclaration +// / AttributeReset +// / FileInclusion +// / UserMacroBlock +// / BlankLine +// / ThematicBreak // must appear before ListElement :/ +// / FrontMatter + +// DocumentFragmentWithAttributes <- +// attributes:(BlockAttributes)? +// element:( +// ImageBlock +// / ShortcutParagraph // taking a shortcut here +// / BlankLine +// / DelimitedBlock +// / Section // must appear after delimited block (because of example delimiter) +// / ListElements +// / Table +// / SingleLineComment +// / AdmonitionParagraph +// / LiteralParagraph +// / DocumentHeader +// / Paragraph // must be the last one... +// ) { +// if element, ok := element.(types.BlockWithAttributes); ok && attributes != nil { +// element.AddAttributes(attributes.(types.Attributes)) +// } +// return element, nil +// } + +DocumentFragmentWithinVerbatimBlock <- + elements:( + FileInclusion + / RawLine + )* EOF { + return elements, nil + } -DocumentAuthorEmail <- "<" email:(([^>\r\n]+) { - return string(c.text), nil -}) ">" { - return email, nil -} +RawLine <- + !EOF + content:([^\r\n]* { + return string(c.text), nil + }) + EOL { + return types.NewRawLine(content.(string)) + } -// see http://asciidoctor.org/docs/user-manual/#revision-number-date-and-remark -// Eg: "v1.0, October 2, 2013: First incarnation" -DocumentRevision <- Space* !":" revision:( - (revnumber:(DocumentRevisionNumber) ","? revdate:(DocumentRevisionDate)? ":"? revremark:(DocumentRevisionRemark)? { - return types.NewDocumentRevision(revnumber, revdate, revremark) - }) / (revdate:(DocumentRevisionDate) ":"? revremark:(DocumentRevisionRemark)? { - return types.NewDocumentRevision(nil, revdate, revremark) - })) EOL { - return revision, nil -} -// DocumentRevisionNumber MUST start with a `v` or MAY start with a `v` but MUST end with a `,` -DocumentRevisionNumber <- "v"i Digit [^:,\r\n]+ { - return string(c.text), nil -} / "v"i? Digit [^:,\r\n]+ Space* &"," { - return string(c.text), nil -} +// reads all elements at once (for example, within a delimited block) +DelimitedBlockElements <- + elements:( + ElementPlaceHolder // if there was a fileinclusion + / DocumentFragment + )* + EOF { + return elements, nil + } + +// ------------------------------------------------------------------------------------- +// Document Raw Line (main rule) +// Identify the delimiters for raw blocks +// ------------------------------------------------------------------------------------- -DocumentRevisionDate <- [^:\r\n]+ { - return string(c.text), nil -} +FrontMatterFragmentElement <- + FrontMatterDelimiter + / BlankLine + // if no match, parser will return an error and content will be store in a RawLine -DocumentRevisionRemark <- [^\r\r\n]+ { - return string(c.text), nil +// ------------------------------------------------------------------------------------- +// Admonitions +// ------------------------------------------------------------------------------------- +AdmonitionKind <- "TIP" { + return types.Tip, nil +} / "NOTE" { + return types.Note, nil +} / "IMPORTANT" { + return types.Important, nil +} / "WARNING" { + return types.Warning, nil +} / "CAUTION" { + return types.Caution, nil } -// ------------------------------------------ -// Attributes -// ------------------------------------------ -AttributeDeclaration <- ":" name:(AttributeName) ":" - value:(AttributeDeclarationValue)? EOL { - return types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) -} +// ------------------------------------------------------------------------------------- +// Attribute Declarations and Resets +// ------------------------------------------------------------------------------------- +AttributeDeclaration <- + ":" name:(AttributeName) ":" + value:(AttributeDeclarationValue)? + EOL { + d := types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) + return d, nil + } // AttributeName must be at least one character long, // must begin with a word character (A-Z, a-z, 0-9 or _) and // must only contain word Word and hyphens ("-"). AttributeName <- [\pL0-9_] ([\pL0-9-])* { - return string(c.text), nil -} + return string(c.text), nil + } -AttributeDeclarationValue <- Space+ elements:( - ([^\r\n{]+ { - return types.NewStringElement(string(c.text)) - }) / - AttributeSubstitution / - ("{" { // standalone '{' - return types.NewStringElement(string(c.text)) - }) -)* { - return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil -} +AttributeDeclarationValue <- + Spaces elements:(AttributeDeclarationValueElement)* { + return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil + } + +AttributeDeclarationValueElement <- !EOL + element:( + ([^\r\n{]+ { + return types.NewStringElement(string(c.text)) + }) + / AttributeSubstitution + / ("{" { // standalone '{' + return types.NewStringElement(string(c.text)) + }) + ) { + return element, nil + } AttributeReset <- ":!" name:(AttributeName) ":" Space* EOL { return types.NewAttributeReset(name.(string)) @@ -209,63 +187,38 @@ AttributeReset <- ":!" name:(AttributeName) ":" Space* EOL { return types.NewAttributeReset(name.(string)) } -AttributeSubstitution <- CounterSubstitution / AttrSub - -AttrSub <- "{" name:AttributeName "}" { - return types.NewAttributeSubstitution(name.(string)) -} - -// TODO: simplify the 'start' optional attribute -CounterSubstitution <- CounterSubstitution1 / CounterSubstitution2 // / CounterSubstitutionAlpha / CounterSubstitutionAlpha2 / CounterSubstitutionStart / CounterSubstitutionStart2 - -CounterSubstitution1 <- "{counter:" name:AttributeName start:(CounterStart)? "}" { - return types.NewCounterSubstitution(name.(string), false, start) -} - -CounterSubstitution2 <- "{counter2:" name:AttributeName start:(CounterStart)? "}" { - return types.NewCounterSubstitution(name.(string), true, nil) -} - -CounterStart <- ":" start:([A-Za-z] { - return string(c.text), nil - } / [0-9]+ { - return strconv.Atoi(string(c.text)) - }) { - return start, nil - } - -InlineElementID <- "[[" id:(Id) "]]" Space* { // no EOL here since there can be multiple InlineElementID on the same line - return types.NewInlineIDAttribute(id.(string)) -} - -StandaloneAttributeKey <- !"quote" !"verse" !"literal" key:(NamedAttributeKey) ("," Space*)? { // value is not defined - return types.NewNamedAttribute(key.(string), nil) -} - -// ------------------------------------------ -// Attributes, refactored -// ------------------------------------------ -BlockAttributes <- +// ------------------------------------------------------------------------------------- +// Block and Inline Attributes +// ------------------------------------------------------------------------------------- +BlockAttributes <- attributes:( // shorthand syntax for anchors. Eg: `[[an_id]]` - (anchor:(ShortHandAnchor) Space* Newline { + (anchor:(ShortHandAnchor) Space* EOL { return anchor, nil }) // shorthand syntax for titles. Eg: `.a title` - / (title:(ShortHandTitle) Space* Newline { + / (title:(ShortHandTitle) Space* EOL { return title, nil }) // default syntax - / (attributes:(LongHandAttributes) Space* Newline { + / (attributes:(LongHandAttributes) Space* EOL { return attributes, nil }) )+ { - return types.NewAttributes(attributes.([]interface{})...) + // c.unsetCurrentSubstitution() + return types.MergeAttributes(attributes.([]interface{})...) } InlineAttributes <- "[" - attributes:(PositionalAttribute/NamedAttribute)* + attributes:( + ( + !"]" // quick escape + attribute:(PositionalAttribute / NamedAttribute) + ) { + return attribute, nil + } + )* "]" { return types.NewAttributes(attributes.([]interface{})...) } @@ -277,10 +230,10 @@ ShortHandAnchor <- elements:( ([^=\r\n\uFFFD{\]]+ { // spaces, commas and dots are allowed in this syntax return types.NewStringElement(string(c.text)) - }) / - ElementPlaceHolder / - AttrSub / - ("{" { + }) + / ElementPlaceHolder + / AttributeSubstitution + / ("{" { return types.NewStringElement(string(c.text)) }))+ { return types.Reduce(elements, strings.TrimSpace), nil @@ -296,10 +249,10 @@ ShortHandTitle <- `.` title:( elements:( ([^\r\n\uFFFD{]+ { return types.NewStringElement(string(c.text)) - }) / - ElementPlaceHolder / - AttrSub / - ("{" { + }) + / ElementPlaceHolder + / AttributeSubstitution + / ("{" { return types.NewStringElement(string(c.text)) }))+ { return types.Reduce(elements, strings.TrimSpace), nil @@ -312,7 +265,7 @@ ShortHandTitle <- `.` title:( // positional attributes are optional, and `positional1` can be combined with options and roles ("extras") LongHandAttributes <- "[" !"[" // prevent processing nested attributes at this point (parser will need to move forward by 1 char first) - // !Space // no space allowed on the first character + //!Space // no space allowed on the first character firstPositionalAttributes:(FirstPositionalAttributes)? otherAttributes:(PositionalAttribute / NamedAttribute)* "]" { @@ -320,7 +273,9 @@ LongHandAttributes <- if firstPositionalAttributes != nil { attributes=append(attributes, firstPositionalAttributes.([]interface{})...) } - attributes=append(attributes, otherAttributes.([]interface{})...) + if len(otherAttributes.([]interface{})) > 0 { + attributes=append(attributes, otherAttributes.([]interface{})...) + } return types.NewAttributes(attributes...) } @@ -331,9 +286,13 @@ FirstPositionalAttributes <- ShortHandAttribute )? extras:( - ShortHandIDAttribute - / ShortHandOptionAttribute - / ShortHandDotRoleAttribute + !"," !"]" + extra:( + ShortHandIDAttribute + / ShortHandOptionAttribute + / ShortHandDotRoleAttribute) { + return extra, nil + } )* ("," Space*)? &{ // make sure there was a match @@ -344,50 +303,53 @@ FirstPositionalAttributes <- if main != nil { attrs = append(attrs, main) } - attrs = append(attrs, extras.([]interface{})...) + if len(extras.([]interface{})) > 0 { + attrs = append(attrs, extras.([]interface{})...) + } return attrs, nil } // an `id` must be prefixed with a `#` ShortHandIDAttribute <- "#" id:(ShortHandAttributeValue) { - return types.NewIDAttribute(id) -} + return types.NewIDAttribute(id) + } ShortHandAttribute <- value:(ShortHandAttributeValue) { - return types.NewPositionalAttribute(value) -} + return types.NewPositionalAttribute(value) + } // a `role` must be prefixed with a `.` ShortHandDotRoleAttribute <- "." role:(ShortHandAttributeValue) { - return types.NewRoleAttribute(role) -} + return types.NewRoleAttribute(role) + } // an `option` must be prefixed with a `%` ShortHandOptionAttribute <- "%" option:(ShortHandAttributeValue) { - return types.NewOptionAttribute(option) -} + return types.NewOptionAttribute(option) + } // Shorthand Attribute Value. ShortHandAttributeValue <- - SingleQuotedAttributeValue - / DoubleQuotedAttributeValue + SingleQuotedAttributeRawValue + / DoubleQuotedAttributeRawValue / elements:( - // unquoted shorthand value may include placeholders and substitutions but NOT comma, space, equal sign and dots - // also, cannot be followed by an `=` sign - ([^,=.%# \r\n\uFFFD{\]]+ { - return types.NewStringElement(string(c.text)) - }) / - QuotedText / - ElementPlaceHolder / - AttrSub / - ("{" { - return types.NewStringElement(string(c.text)) - }))+ &[^=] { + // unquoted shorthand value may include placeholders and substitutions but NOT comma, space, equal sign and dots + // also, cannot be followed by an `=` sign + ([^,=.%# \r\n\uFFFD{\]]+ { + return types.NewStringElement(string(c.text)) + }) + / ElementPlaceHolder + // / Quote + / AttributeSubstitution + / ("{" { + return types.NewStringElement(string(c.text)) + }) + )+ &(!(Space* "=")) { return types.Reduce(elements, strings.TrimSpace), nil } PositionalAttribute <- ( - value:(AttributeValue) (("," Space*)? / &"]") { // TODO: see if we can just use `((",")? / &"]")` instead (ie, no need to check for Space*) + value:(AttributeRawValue) (("," Space*)? / &"]") { // TODO: see if we can just use `((",")? / &"]")` instead (ie, no need to check for Space*) return types.NewPositionalAttribute(value) }) / @@ -395,188 +357,685 @@ PositionalAttribute <- ( (value:(Space* (("," Space*) / &"]")) &{ // here we can't rely on `c.text` if the content is empty - // (in which case, `c.text` contains the char sequence of the previous + // (in such a case, `c.text` contains the char sequence of the previous // rule that matched) - v := types.Merge(value) - return len(v) > 0, nil + return !types.AllNilEntries(value.([]interface{})), nil } { return types.NewPositionalAttribute(nil) }) -NamedAttribute <- key:(NamedAttributeKey) "=" Space* value:(AttributeValue) ("," Space*)? { // TODO: include `,` or expect `]` - return types.NewNamedAttribute(key.(string), value) -} +NamedAttribute <- key:(NamedAttributeKey) "=" Space* value:(AttributeRawValue) ("," Space*)? { // TODO: include `,` or expect `]` + return types.NewNamedAttribute(key.(string), value) + } // The spec says attributes have be alphanumeric but does not consider foreign letters. We are more generous. NamedAttributeKey <- !Space [^\r\n=,\]]+ Space* { - return strings.TrimSpace(string(c.text)), nil -} + return strings.TrimSpace(string(c.text)), nil + } -AttributeValue <- +AttributeRawValue <- value:( - SingleQuotedAttributeValue - / DoubleQuotedAttributeValue - / UnquotedAttributeValue + SingleQuotedAttributeRawValue + / DoubleQuotedAttributeRawValue + / UnquotedAttributeRawValue ) &(!(Space* "=")) { return value, nil } -SingleQuotedAttributeValue <- - "'" +SingleQuotedAttributeRawValue <- + "'" !"`" // prevent entering when the value is a quoted string (eg: '`cookie`') + content:(SingleQuotedAttributeRawValueContent) + "'" { + return content, nil + } + +// SingleQuotedAttributeRawValueContent <- +// ([^\r\n'\]])+ { // until ' +// return string(c.text), nil +// } + +SingleQuotedAttributeRawValueContent <- elements:( - QuotedText - / ([^'\r\n\uFFFD\\{]+ { // = and , signs are allowed within ' quotes - return types.NewStringElement(string(c.text)) - }) - / ElementPlaceHolder - / AttrSub + Alphanums + / Space + / AttributeSubstitution / (`\'` { - return types.NewStringElement(`'`) // escaped quote - } - / `{` / `\` { - return types.NewStringElement(string(c.text)) + return types.NewStringElement(`'`) // escaped single quote }) - )+ - "'" { + / ( "'`" / "`'" / `\` { // quoted string delimiters or standalone backslash + return types.NewStringElement(string(c.text)) // keep as-is for now + }) + / ([^\r\n\\'' ]+ { // = and , signs are allowed within '' quoted values + return types.NewStringElement(string(c.text)) + }) + )+ { return types.Reduce(elements), nil } -DoubleQuotedAttributeValue <- - "\"" +DoubleQuotedAttributeRawValue <- + "\"" !"`" // prevent entering when the value is a quoted string (eg: "`cookie`") + content:(DoubleQuotedAttributeRawValueContent) + "\"" &(!(Space* "=")) { + return content, nil + } +// DoubleQuotedAttributeRawValueContent <- +// ([^\r\n"\]])+ { // until " +// return string(c.text), nil +// } + +DoubleQuotedAttributeRawValueContent <- elements:( - QuotedText - / ([^\r\n\uFFFD"\\{]+ { // = and , signs are allowed within " quotes - return types.NewStringElement(string(c.text)) - }) - / ElementPlaceHolder - / AttrSub + Alphanums + / Space + / AttributeSubstitution / (`\"` { - return types.NewStringElement(`"`) // escaped quote - } - / `{` / `\` { - return types.NewStringElement(string(c.text)) + return types.NewStringElement(`"`) // escaped double quote + }) + / ( "\"`" / "`\"" / `\` / "`" { // quoted string delimiters or standalone backslash or standalone backtick + return types.NewStringElement(string(c.text)) // keep as-is for now + }) + / ([^\r\n\\"` ]+ { // = and , signs are allowed within " quoted values + return types.NewStringElement(string(c.text)) }) - )+ - "\"" { + )+ { return types.Reduce(elements), nil } // Unquoted Attribute Value, may include spaces but not on the first position -UnquotedAttributeValue <- - !Space +UnquotedAttributeRawValue <- + // need to support value like `[.myrole1]_a_` in `a link to https://example.com[[.myrole1]_a_]` + // so we need to count the `[` and `]` to balance + !Space // can't start with a space (eg: can't have `[ cookie ]`) elements:( - QuotedText - / ([^,=\r\n\uFFFD{\]]+ { - return types.NewStringElement(string(c.text)) - }) + ("[" UnquotedAttributeRawValue "]") // recursively within brackets / ElementPlaceHolder - / AttrSub - / ("{" { - return types.NewStringElement(string(c.text)) - }) - )+ - &{ - // empty string is not a valid value - return types.Reduce(elements, strings.TrimSpace) != "", nil - } - { + / AttributeSubstitution + / ([^=,\r\n\uFFFD\] ]+ { // not within brackets and stop on space + return string(c.text), nil + }) + / Space + )+ { return types.Reduce(elements, strings.TrimSpace), nil } -// ------------------------------------------ -// Sections -// ------------------------------------------ -Section <- - level:(("=")+ { - // `=` is level 0, etc. - return (len(c.text)-1), nil - }) - &{ - // use a predicate to make sure that only `=` (level 0) to `======` (level 5) are allowed - return level.(int) <= 5, nil - } - Space+ title:(TitleElements) id:(InlineElementID*) EOL { - return types.NewSection(level.(int), title.([]interface{}), id.([]interface{}), c.globalStore.getAttributes()) -} +// UnquotedAttributeRawValue <- +// !Space +// elements:( +// !("]" / ",") // Quick escape +// element:( +// Alphanums +// / Space +// / Quote +// / AttributeSubstitution +// / ElementPlaceHolder +// / ([^,=\r\n\] ]+ { // = and , signs are NOT allowed within unquoted values +// return types.NewStringElement(string(c.text)) +// }) +// ) { +// return element, nil +// } +// )+ +// &{ +// // post-parsing condition to verify that the value is not an empty string +// return types.Reduce(elements, strings.TrimSpace) != "", nil +// } +// { +// return types.Reduce(elements, strings.TrimSpace), nil +// } -TitleElements <- elements:(!Newline !InlineElementID TitleElement)+ { // absorbs heading and trailing spaces - return types.NewInlineElements(elements.([]interface{})) -} +// ------------------------------------------------------------------------------------- +// Attribute Substitution +// ------------------------------------------------------------------------------------- +AttributeSubstitution <- + // check if enabled with the current substitution context + &{ + return c.isSubstitutionEnabled(Attributes) + } + element:(CounterSubstitution / AttributeValueSubstitution) { + return element, nil + } -TitleElement <- element:(Word - / LineBreak // must be before spaces - / Space+ - / ElementPlaceHolder - / AnyChar) { - return element, nil +AttributeValueSubstitution <- "{" name:AttributeName "}" { + return types.NewAttributeSubstitution(name.(string)) } -// ------------------------------------------ -// Table of Contents -// ------------------------------------------ -TableOfContentsPlaceHolder <- "toc::[]" EOL - -// ------------------------------------------ -// User Macro -// ------------------------------------------ -UserMacroBlock <- - name:(UserMacroName) +// TODO: simplify the 'start' optional attribute +CounterSubstitution <- CounterSubstitution1 / CounterSubstitution2 // / CounterSubstitutionAlpha / CounterSubstitutionAlpha2 / CounterSubstitutionStart / CounterSubstitutionStart2 + +CounterSubstitution1 <- "{counter:" name:AttributeName start:(CounterStart)? "}" { + return types.NewCounterSubstitution(name.(string), false, start) +} + +CounterSubstitution2 <- "{counter2:" name:AttributeName start:(CounterStart)? "}" { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +CounterStart <- ":" start:([A-Za-z] { + return string(c.text), nil + } / [0-9]+ { + return strconv.Atoi(string(c.text)) + }) { + return start, nil + } + +// ------------------------------------------------------------------------------------- +// BlankLine +// ------------------------------------------------------------------------------------- +BlankLine <- !EOF Space* EOL { + return types.NewBlankLine() + } + +// ------------------------------------------------------------------------------------- +// Cross References +// ------------------------------------------------------------------------------------- +CrossReference <- InternalCrossReference / ExternalCrossReference + +InternalCrossReference <- "<<" id:(Id) Space* "," label:(CrossReferenceLabel) ">>" { + return types.NewInternalCrossReference(id, label) + } / "<<" id:(Id) ">>" { + return types.NewInternalCrossReference(id, nil) + } + +ExternalCrossReference <- "xref:" url:(FileLocation) inlineAttributes:(InlineAttributes) { + return types.NewExternalCrossReference(url.(*types.Location), inlineAttributes.(types.Attributes)) + } + +CrossReferenceLabel <- ( + ([\pL0-9][^\r\n{<>]+ { // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) + }) + / AttributeSubstitution + / ("{" { + return types.NewStringElement(string(c.text)) + }) + )+ + + +// ------------------------------------------------------------------------------------- +// Delimited Blocks +// ------------------------------------------------------------------------------------- +DelimitedBlock <- + CommentBlock + / ExampleBlock + / FencedBlock + / ListingBlock + / LiteralBlock + / MarkdownQuoteBlock + / PassthroughBlock + / QuoteBlock + / SidebarBlock + +BlockDelimiter <- + !Alphanum // quick escape + delimiter:( + CommentBlockDelimiter + / ExampleBlockDelimiter + / FencedBlockDelimiter + / ListingBlockDelimiter + / LiteralBlockDelimiter + / PassthroughBlockDelimiter + / QuoteBlockDelimiter + / SidebarBlockDelimiter) { + return delimiter, nil + } + + +CommentBlockDelimiter <- "////" Space* EOL + +ExampleBlockDelimiter <- "====" Space* EOL + +FencedBlockDelimiter <- "```" Space* EOL + +ListingBlockDelimiter <- "----" Space* EOL + +LiteralBlockDelimiter <- "...." Space* EOL + +PassthroughBlockDelimiter <- "++++" Space* EOL + +QuoteBlockDelimiter <- "____" Space* EOL + +SidebarBlockDelimiter <- "****" Space* EOL + +DelimitedBlockRawLine <- + !EOF // in case the block is unclosed and at the end of the document + content:([^\r\n]* { // content is NOT mandatory + return string(c.text), nil + }) EOL { + return types.NewRawLine(content.(string)) + } + +// ---------------- +// Comment Blocks +// ---------------- +CommentBlock <- &{ - // skip if no macro was registered under the given name - return c.globalStore.hasUserMacro(name.(string)), nil + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Comment), nil } - "::" - value:(UserMacroValue) - inlineAttributes:(InlineAttributes) { - return types.NewUserMacroBlock(name.(string), value.(string), inlineAttributes, string(c.text)) + CommentBlockStartDelimiter + &{ + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Comment) + return true, nil + } + content:(CommentBlockContent) + CommentBlockEndDelimiter? { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Comment, content.([]interface{})) } -InlineUserMacro <- - name:(UserMacroName) +CommentBlockStartDelimiter <- CommentBlockDelimiter + +CommentBlockEndDelimiter <- CommentBlockDelimiter / EOF + +CommentBlockContent <- + (!CommentBlockEndDelimiter + line:DelimitedBlockRawLine { + return line, nil + })* + +// ---------------------- +// Example Blocks +// ---------------------- +ExampleBlock <- &{ - // skip if no macro was registered under the given name - return c.globalStore.hasUserMacro(name.(string)), nil + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Example), nil } - ":" - value:(UserMacroValue) - inlineAttributes:(InlineAttributes) { - return types.NewInlineUserMacro(name.(string), value.(string), inlineAttributes, string(c.text)) + ExampleBlockStartDelimiter + &{ + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Example) + return true, nil + } + content:(ExampleBlockContent) + ExampleBlockEndDelimiter { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Example, content.([]interface{})) } -UserMacroName <- ([\pL0-9_-]+) { +ExampleBlockStartDelimiter <- ExampleBlockDelimiter + +ExampleBlockEndDelimiter <- ExampleBlockDelimiter / EOF + +ExampleBlockContent <- + (!ExampleBlockEndDelimiter + line:(FileInclusion/DelimitedBlockRawLine) { + return line, nil + })* + +// ---------------------- +// Fenced Blocks +// ---------------------- +FencedBlock <- + &{ + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Fenced), nil + } + FencedBlockStartDelimiter + &{ + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Fenced) + return true, nil + } + content:(FencedBlockContent) + FencedBlockEndDelimiter { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Fenced, content.([]interface{})) + } + +FencedBlockStartDelimiter <- FencedBlockDelimiter + +FencedBlockEndDelimiter <- FencedBlockDelimiter / EOF + +FencedBlockContent <- + (!FencedBlockEndDelimiter + line:(FileInclusion/DelimitedBlockRawLine) { + return line, nil + })* + +// ---------------------- +// Listing Blocks +// ---------------------- +ListingBlock <- + &{ + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Listing), nil + } + ListingBlockStartDelimiter + &{ + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Listing) + return true, nil + } + content:(ListingBlockContent) + ListingBlockEndDelimiter { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Listing, content.([]interface{})) + } + +ListingBlockStartDelimiter <- ListingBlockDelimiter + +ListingBlockEndDelimiter <- ListingBlockDelimiter / EOF + +ListingBlockContent <- + (!ListingBlockEndDelimiter + line:(FileInclusion/DelimitedBlockRawLine) { + return line, nil + })* + +// ---------------------- +// Literal Blocks +// ---------------------- +LiteralBlock <- + LiteralBlockStartDelimiter + &{ + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Literal), nil + } + content:(LiteralBlockContent) + &{ + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Literal) + return true, nil + } + LiteralBlockEndDelimiter? { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Literal, content.([]interface{})) + } + +LiteralBlockStartDelimiter <- LiteralBlockDelimiter + +LiteralBlockEndDelimiter <- LiteralBlockDelimiter / EOF + +LiteralBlockContent <- + (!LiteralBlockEndDelimiter + line:(FileInclusion/DelimitedBlockRawLine) { + return line, nil + })* + +// ---------------------- +// Markdown Quote Blocks +// ---------------------- +MarkdownQuoteBlock <- + firstLine:(MarkdownQuoteRawLine) + otherLines:(MarkdownQuoteRawLine / ParagraphRawLine)* + { + return types.NewDelimitedBlock(types.MarkdownQuote, append([]interface{}{firstLine}, otherLines.([]interface{})...)) + } + +MarkdownQuoteRawLine <- + !BlankLine + "> " + content:(([^\r\n]+) { + return string(c.text), nil + }) EOL { + return types.NewRawLine(content.(string)) + } + +MarkdownQuoteAttribution <- + "-- " author:(([^\r\n]+) { + return string(c.text), nil + }) EOL { + return author, nil + } + +// ---------------------- +// Passthrough Blocks +// ---------------------- +PassthroughBlock <- + &{ + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Passthrough), nil + } + PassthroughBlockStartDelimiter + &{ + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Passthrough) + return true, nil + } + content:(PassthroughBlockContent) + PassthroughBlockEndDelimiter? { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Passthrough, content.([]interface{})) + } + +PassthroughBlockStartDelimiter <- PassthroughBlockDelimiter + +PassthroughBlockEndDelimiter <- PassthroughBlockDelimiter / EOF + +PassthroughBlockContent <- + (!PassthroughBlockEndDelimiter + line:(FileInclusion/DelimitedBlockRawLine) { + return line, nil + })* + +// ---------------------- +// Quote Blocks +// ---------------------- +QuoteBlock <- + &{ + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Quote), nil + } + QuoteBlockStartDelimiter + &{ + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Quote) + return true, nil + } + content:(QuoteBlockContent) + QuoteBlockEndDelimiter { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Quote, content.([]interface{})) + } + +QuoteBlockStartDelimiter <- QuoteBlockDelimiter + +QuoteBlockEndDelimiter <- QuoteBlockDelimiter / EOF + +QuoteBlockContent <- + (!QuoteBlockEndDelimiter + line:(FileInclusion/DelimitedBlockRawLine) { + return line, nil + })* + +// ---------------------- +// Sidebar Blocks +// ---------------------- +SidebarBlock <- + &{ + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Sidebar), nil + } + SidebarBlockStartDelimiter + &{ + // only accept if the delimiter matches the current delimited block or if no kind is registered yet + c.setWithinDelimitedBlockOfKind(types.Sidebar) + return true, nil + } + content:(SidebarBlockContent) + SidebarBlockEndDelimiter { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Sidebar, content.([]interface{})) + } + +SidebarBlockStartDelimiter <- SidebarBlockDelimiter + +SidebarBlockEndDelimiter <- SidebarBlockDelimiter / EOF + +SidebarBlockContent <- + (!SidebarBlockEndDelimiter + line:(FileInclusion/DelimitedBlockRawLine) { + return line, nil + })* + +// ------------------------------------------------------------------------------------- +// Document Header and Metadata +// ------------------------------------------------------------------------------------- +DocumentHeader <- + &{ + return c.isDocumentHeaderAllowed(), nil + } + BlankLine* // ignored in the returned element + title:DocumentTitle + info:DocumentInformation? + extraAttrs:(AttributeDeclaration / AttributeReset)* // we need to collect extra attrs to process substitution on the title + { + c.setFrontMatterAllowed(false) // not allowed anymore + c.setDocumentHeaderAllowed(false) // not allowed anymore + return types.NewDocumentHeader(title.([]interface{}), info, extraAttrs.([]interface{})) + } + // { + // return append([]interface{}{header}, attrs.([]interface{})...), nil + // } + + +DocumentTitle <- + "=" Spaces title:(RawSectionTitle) EOL { + return title, nil + } + +DocumentInformation <- + !BlankLine + (SingleLineComment / CommentBlock)* // ignored in the returned element + authors:(DocumentAuthors) + (SingleLineComment / CommentBlock)* // ignored in the returned element + revision:(DocumentRevision)? { + return types.NewDocumentInformation(authors.(types.DocumentAuthors), revision) + } + +DocumentAuthors <- Space* authors:(DocumentAuthorsInlineForm / DocumentAuthorsAttributeForm) EOL { + return authors, nil +} + +DocumentAuthorsInlineForm <- !":" authors:(DocumentAuthor+) { + return types.NewDocumentAuthors(authors.([]interface{})...) +} + +DocumentAuthorsAttributeForm <- ":author:" Space* author:(DocumentAuthor) { + return types.NewDocumentAuthors(author) +} + +DocumentAuthor <- + fullName:(DocumentAuthorFullName)? email:(DocumentAuthorEmail)? Space* ";"? Space* + &{ + // at least 1 of [fullName, email] must be defined + return fullName != nil || email != nil, nil + } + { + return types.NewDocumentAuthor(fullName, email) + } + +// "<" marks the beginning of the author email, and ";" is the authors separator +DocumentAuthorFullName <- + part1:([^<;\r\n ]+ { // no space allowed + return string(c.text), nil + }) + Space* + part2:([^<;\r\n ]+ { // no space allowed + return string(c.text), nil + })? + Space* + part3:([^<;\r\n]+ { // spaces allowed + return string(c.text), nil + })? + Space* { + return types.NewDocumentAuthorFullName(part1.(string), part2, part3) + } + + +DocumentAuthorEmail <- + !EOF + "<" + email:(([^>\r\n]+) { + return string(c.text), nil + }) + ">" { + return email, nil + } + +// see http://asciidoctor.org/docs/user-manual/#revision-number-date-and-remark +// Eg: "v1.0, October 2, 2013: First incarnation" +DocumentRevision <- Space* !":" revision:( + (revnumber:(DocumentRevisionNumber) ","? revdate:(DocumentRevisionDate)? ":"? revremark:(DocumentRevisionRemark)? { + return types.NewDocumentRevision(revnumber, revdate, revremark) + }) / (revdate:(DocumentRevisionDate) ":"? revremark:(DocumentRevisionRemark)? { + return types.NewDocumentRevision(nil, revdate, revremark) + })) EOL { + return revision, nil +} + +// DocumentRevisionNumber MUST start with a `v` or MAY start with a `v` but MUST end with a `,` +DocumentRevisionNumber <- "v"i Digit [^:,\r\n]+ { + return string(c.text), nil +} / "v"i? Digit [^:,\r\n]+ Space* &"," { return string(c.text), nil } -UserMacroValue <- [^:[ \r\n]* { +DocumentRevisionDate <- [^:\r\n]+ { + return string(c.text), nil +} + +DocumentRevisionRemark <- [^\r\r\n]+ { return string(c.text), nil } -// ------------------------------------------ +// ------------------------------------------------------------------------------------- +// ElementPlaceHolder +// ------------------------------------------------------------------------------------- +ElementPlaceHolderDelimiter <- "\uFFFD" + +ElementPlaceHolder <- ElementPlaceHolderDelimiter ref:([0-9]+ { return string(c.text), nil }) ElementPlaceHolderDelimiter { + return types.NewElementPlaceHolder(ref.(string)) +} + +// ----------------------------------------------------------------------------------------------------------------------- +// Explicit line breaks +// ----------------------------------------------------------------------------------------------------------------------- +LineBreak <- + &{ + return c.isPreceededBySpace(), nil + } + "+" Space* &(EOL) { + return types.NewLineBreak() + } + +// ------------------------------------------------------------------------------------- // File inclusions -// ------------------------------------------ +// ------------------------------------------------------------------------------------- FileInclusion <- + &{ + // skip if disabled + return c.isRuleEnabled(FileInclusion) + } + #{ + // force/enable attribute substitution + // log.Debug("entering FileInclusion rule") + return c.setCurrentSubstitution("attributes") + } incl:( "include::" path:(FileLocation) inlineAttributes:(InlineAttributes) { - return types.NewFileInclusion(path.(types.Location), inlineAttributes.(types.Attributes), string(c.text)) + return types.NewFileInclusion(path.(*types.Location), inlineAttributes.(types.Attributes), string(c.text)) } ) Space* EOL { - return incl.(types.FileInclusion), nil + return incl.(*types.FileInclusion), nil } FileIncludeAttributes <- LongHandAttributes // extra entrypoint LineRanges <- value:(MultipleLineRanges - / MultiLineRange - / SingleLineRange - ) EOF { // must make sure that the whole content is parsed - return value, nil -} + / MultiLineRange + / SingleLineRange + ) EOF { // must make sure that the whole content is parsed + return value, nil + } MultipleLineRanges <- first:(MultiLineRange / SingleLineRange) others:( @@ -588,17 +1047,17 @@ MultipleLineRanges <- first:(MultiLineRange / SingleLineRange) } MultiLineRange <- start:(Number) ".." end:(Number) { // eg: lines=12..14 - return types.NewLineRange(start.(int), end.(int)) -} + return types.NewLineRange(start.(int), end.(int)) + } SingleLineRange <- singleline:(Number) { // eg: lines=12 - return types.NewLineRange(singleline.(int), singleline.(int)) -} + return types.NewLineRange(singleline.(int), singleline.(int)) + } // extra entrypoint TagRanges <- value:(MultipleTagRanges) EOF { // must make sure that the whole content is parsed - return value, nil -} + return value, nil + } MultipleTagRanges <- first:(TagRange) others:( @@ -610,10 +1069,10 @@ MultipleTagRanges <- first:(TagRange) } TagRange <- tag:(Alphanums / TagWildcard) { - return types.NewTagRange(tag.(string), true) -} / "!" tag:(Alphanums / TagWildcard) { - return types.NewTagRange(tag.(string), false) -} + return types.NewTagRange(tag.(string), true) + } / "!" tag:(Alphanums / TagWildcard) { + return types.NewTagRange(tag.(string), false) + } TagWildcard <- stars:(("*")+ { return string(c.text), nil @@ -622,82 +1081,363 @@ TagWildcard <- stars:(("*")+ { // use a predicate to make sure that only `*` and `**` are allowed return len(stars.(string)) <= 2, nil } { - return stars, nil -} + return stars, nil + } -// ------------------------------------------ -// Tag macros in lines of files to include -// ------------------------------------------ IncludedFileLine <- content:(IncludedFileStartTag / IncludedFileEndTag / . {return string(c.text), nil})* EOL { - return types.NewIncludedFileLine(content.([]interface{})) -} + return types.NewIncludedFileLine(content.([]interface{})) + } IncludedFileStartTag <- "tag::" tag:(Alphanums {return string(c.text), nil}) "[]" { - return types.NewIncludedFileStartTag(tag.(string)) -} + return types.NewIncludedFileStartTag(tag.(string)) + } IncludedFileEndTag <- "end::" tag:(Alphanums {return string(c.text), nil}) "[]" { - return types.NewIncludedFileEndTag(tag.(string)) + return types.NewIncludedFileEndTag(tag.(string)) + } + +// ------------------------------------------------------------------------------------- +// Front Matter +// ------------------------------------------------------------------------------------- +FrontMatter <- + &{ + return c.isFrontMatterAllowed(), nil + } + frontmatter:(YamlFrontMatter) + { + c.setFrontMatterAllowed(false) // not allowed anymore + return frontmatter, nil + } + +YamlFrontMatter <- YamlFrontMatterDelimiter content:(YamlFrontMatterContent)? YamlFrontMatterDelimiter { + return types.NewYamlFrontMatter(content.(string)) } -// ------------------------------------------ -// Lists -// ------------------------------------------ -ListParagraph <- comment:(SingleLineComment) { - return comment, nil - } / lines:(ListParagraphLine)+ { - return types.NewParagraph(lines.([]interface{}), nil) - } +YamlFrontMatterDelimiter <- "---" Space* EOL -ListParagraphLine <- !EOF - !BlankLine - !SingleLineComment - !OrderedListItemPrefix - !UnorderedListItemPrefix - !CalloutListItemPrefix - !ListItemContinuation - !BlockAttributes - !BlockDelimiter - !LabeledListItemPrefix - line:(Space* elements:(InlineElement)+ { - return types.NewInlineElements(elements.([]interface{})) - }) EOL { - return line, nil +YamlFrontMatterContent <- ((!YamlFrontMatterDelimiter .)+)* { + return string(c.text), nil +} + +FrontMatterFragment <- FrontMatterDelimiter / BlankLine / FrontMatterLine + +FrontMatterDelimiter <- "---" Space* EOF + +FrontMatterLine <- (.)* { + return types.NewRawLine(string(c.text)) +} + +// ------------------------------------------------------------------------------------- +// Inline Elements +// ------------------------------------------------------------------------------------- +InlineElements <- + elements:(comment:(SingleLineComment) { + return types.NewInlineElements([]interface{}{comment}) + } / elements:(InlineElement)+ EOL { + return types.NewInlineElements(elements.([]interface{})) + }) { + c.resetSpaceSuffixTracking() + return elements, nil } -ListItemContinuation <- "+" Space* Newline // there should be something after, so `EOL` is not valid here -ContinuedListItemElement <- ListItemContinuation element:ContinuedListItemContent { - return types.NewContinuedListItemElement(element) // offset is negative +// TODO: group as below and enable based on substitution context. +// Also, add Callouts + +// "specialcharacters", +// "quotes", +// "attributes", +// "replacements", +// "macros", +// "post_replacements", +InlineElement <- + element:( + InlineWord // more permissive than the 'Word' rule + / Spaces + / LineBreak + / !EOL ( + SpecialCharacter + / Quote + / AttributeSubstitution + / InlineMacro + / Symbol + / ElementPlaceHolder // TODO: needed? + // if anything above did not match... + / AnyChar)) { + c.trackSpaceSuffix(element) + return element, nil } -ContinuedListItemContent <- !EOF - content:(DelimitedBlock - / SingleLineComment - / Table - / ImageBlock - / ThematicBreak - / OrderedListItem - / UnorderedListItem - / LabeledListItem - / BlankLine // must be before LiteralBlock - / LiteralBlock - / AttributeDeclaration - / AttributeReset - / TableOfContentsPlaceHolder - / UserMacroBlock - / ContinuedRawParagraph) { - return content, nil +// ------------------------------------------------------------------------------------- +// InlineElement ID +// ------------------------------------------------------------------------------------- +InlineElementID <- "[[" id:(Id) "]]" Space* { // no EOL here since there can be multiple InlineElementID on the same line + return types.NewInlineIDAttribute(id.(string)) +} + +// ------------------------------------------------------------------------------------- +// Index Terms +// ------------------------------------------------------------------------------------- +IndexTerm <- "((" term:(IndexTermContent) "))" { + return types.NewIndexTerm(term.([]interface{})) +} + +IndexTermContent <- elements:(Word / QuotedString / QuotedText / Space / SpecialCharacter / ElementPlaceHolder / (!"))" .) { + return string(c.text), nil +})+ { + return types.NewInlineElements(elements.([]interface{})) +} + +ConcealedIndexTerm <- "(((" term1:(ConcealedIndexTermContent) + term2:(Space* "," Space* content:(ConcealedIndexTermContent) { return content, nil })? + term3:(Space* "," Space* content:(ConcealedIndexTermContent) { return content, nil })? + ")))" { + return types.NewConcealedIndexTerm(term1, term2, term3) + } + +ConcealedIndexTermContent <- (Alphanum / Space)+ { + return string(c.text), nil } -// ------------------------------------------ -// Ordered List Items -// ------------------------------------------ -OrderedListItem <- prefix:(OrderedListItemPrefix) content:(OrderedListItemContent) { - return types.NewOrderedListItem(prefix.(types.OrderedListItemPrefix), content.([]interface{}), c.globalStore.getAttributes()) +// ------------------------------------------------------------------------------------- +// Images +// ------------------------------------------------------------------------------------- +ImageBlock <- + &{ + // AttrPositional1 must not be set + return types.HasNotAttribute(c.globalStore.getAttributes(), types.AttrPositional1), nil + } + "image::" path:(Location) inlineAttributes:(InlineAttributes) Space* EOL { + // c.unsetCurrentSubstitution() + // 'imagesdir' attribute is added after applying the attribute substitutions on the image location + return types.NewImageBlock(path.(*types.Location), inlineAttributes.(types.Attributes), c.globalStore.getAttributes()) + } + +InlineImage <- "image:" !":" path:(Location) inlineAttributes:(InlineAttributes) { + return types.NewInlineImage(path.(*types.Location), inlineAttributes.(types.Attributes), c.globalStore["imagesdir"]) + } + +// ------------------------------------------------------------------------------------------------------------------------------- +// Inline Icons +// ------------------------------------------------------------------------------------------------------------------------------- +InlineIcon <- "icon:" icon:([\pL0-9_-]+ { return string(c.text), nil }) attributes:(InlineAttributes) { + return types.NewIcon(icon.(string), attributes) + } + +// ------------------------------------------------------------------------------------------------------------------------------- +// Inline Foot Notes +// ------------------------------------------------------------------------------------------------------------------------------- +InlineFootnote <- "footnote:[" content:(FootnoteContent) "]" { + return types.NewFootnote("", content) + } / "footnote:" ref:(FootnoteRef) "[" content:(FootnoteContent)? "]" { // TODO: use only this rule with `ref:(FootnoteRef)?` + return types.NewFootnote(ref.(string), content) + } + +FootnoteRef <- Alphanums + +FootnoteContent <- elements:(!"]" InlineElement)+ { // footnote content may span multiple lines + return types.NewInlineElements(elements.([]interface{})) + } + +// ------------------------------------------------------------------------------------- +// Passthrough +// ------------------------------------------------------------------------------------- + +SinglePlusPassthroughPrefix <- "+" + +SinglePlusPassthrough <- SinglePlusPassthroughPrefix content:(SinglePlusPassthroughContent) SinglePlusPassthroughPrefix !Alphanum { + return types.NewInlinePassthrough(types.SinglePlusPassthrough, []interface{}{content}) + } + +SinglePlusPassthroughContent <- ((!SinglePlusPassthroughPrefix !Space !Newline .) (!(Spaces SinglePlusPassthroughPrefix) !SinglePlusPassthroughPrefix !Newline .)* { // no space in the first or last position of the content, but allowed elsewhere + return types.NewStringElement(string(c.text)) + }) / ((!Space !Newline !SinglePlusPassthroughPrefix .) { // a single character + return types.NewStringElement(string(c.text)) + }) + +TriplePlusPassthroughPrefix <- "+++" + +TriplePlusPassthrough <- TriplePlusPassthroughPrefix content:(TriplePlusPassthroughContent) TriplePlusPassthroughPrefix !Alphanum { + return types.NewInlinePassthrough(types.TriplePlusPassthrough, []interface{}{content}) + } + +TriplePlusPassthroughContent <- ((!TriplePlusPassthroughPrefix .)* { // spaces and newlines are also allowed in the first or last position of the content and elsewhere too + return types.NewStringElement(string(c.text)) + }) / ((!Space !Newline !TriplePlusPassthroughPrefix .)? { // a single character + return types.NewStringElement(string(c.text)) + }) + +PassthroughMacro <- "pass:[" content:(PassthroughMacroCharacter)* "]" { + return types.NewInlinePassthrough(types.PassthroughMacro, []interface{}{content}) + } / "pass:q[" content:(QuotedText / PassthroughMacroCharacter)* "]" { + return types.NewInlinePassthrough(types.PassthroughMacro, content.([]interface{})) + } + +PassthroughMacroCharacter <- [^\]] { + return types.NewStringElement(string(c.text)) + } + +// ------------------------------------------------------------------------------------- +// Links +// ------------------------------------------------------------------------------------- +Link <- RelativeLink / ExternalLink + +// url preceeding with `link:` MUST be followed by square brackets +RelativeLink <- "link:" url:(Location) inlineAttributes:(InlineAttributes) { + return types.NewInlineLink(url.(*types.Location), inlineAttributes.(types.Attributes)) + } + +ExternalLink <- url:(LocationWithScheme) inlineAttributes:(InlineAttributes)? { + return types.NewInlineLink(url.(*types.Location), inlineAttributes) + } + + +// ----------------------------------------------------------------------------------------------------------------------- +// List +// ----------------------------------------------------------------------------------------------------------------------- +ListElements <- + firstElement:(ListElement) + extraElements:(ExtraListElements) { + return types.NewListElements(append([]interface{}{firstElement}, extraElements.([]interface{})...)) + } + +ListElement <- + OrderedListElement + / UnorderedListElement + / CalloutListElement + / LabeledListElement + +ExtraListElements <- elements:(ExtraListElement)* { + return types.Flatten(elements.([]interface{})), nil } -OrderedListItemPrefix <- +ExtraListElement <- // other elements can be separated by blankline WITHOUT attributes, or can have attributes but NO blankline before + !EOF + element:( + ( BlankLine* + element:OrderedListElement { + return element, nil + }) + / ( attributes:(BlockAttributes)+ + element:OrderedListElement { + return append(attributes.([]interface{}), element), nil + }) + / ( BlankLine* + element:UnorderedListElement { + return element, nil + }) + / ( attributes:(BlockAttributes)+ + element:UnorderedListElement { + return append(attributes.([]interface{}), element), nil + }) + / ( BlankLine* + element:CalloutListElement { + return element, nil + }) + / ( attributes:(BlockAttributes)+ + element:CalloutListElement { + return append(attributes.([]interface{}), element), nil + }) + / ListElementContinuation + / ( BlankLine* + element:LabeledListElement { + return element, nil + }) + / ( attributes:(BlockAttributes)+ + element:LabeledListElement { + return append(attributes.([]interface{}), element), nil + }) + / SingleLineComment + / ( element:ListElementParagraphLine { + return element, nil + }) // must follow directly a list element + ) { + return element, nil + } + +ListElementParagraphLine <- + !BlankLine + !ListElementContinuationMarker + !OrderedListElementPrefix + !UnorderedListElementPrefix + !CalloutListElementPrefix + !(LabeledListElementTerm LabeledListElementSeparator) + !BlockDelimiter + content:([^\r\n]+ { + return strings.TrimSpace(string(c.text)), nil + }) + EOL { // do not retain the EOL chars + return types.NewRawLine(content.(string)) + } + +ListElementContent <- + rawline:([^\r\n]+ { + return types.NewRawLine(string(c.text)) + }) + EOL { + return types.NewParagraph(rawline) + } + +// --------------------------- +// List Element Continuations +// --------------------------- +ListElementContinuation <- + offset:(Space* Newline)* + ListElementContinuationMarker + element:ListElementContinuationElement? + { + return types.NewListElementContinuation(len(offset.([]interface{})), element) + } + +ListElementContinuationMarker <- "+" Space* Newline + +ListElementContinuationElement <- // TODO: same as DelimitedBlockElement? + !EOF // quick escapes + !ListElement + attributes:(BlockAttributes)? + element:( + BlankLine + / AttributeDeclaration + / AttributeReset + / DelimitedBlock + / ThematicBreak // must appear before ListElement :/ + / ImageBlock + / FileInclusion + / Table + / SingleLineComment + / AdmonitionParagraph + / LiteralParagraph + / ListContinuationParagraph // must be the last one... + ) { + if element,ok := element.(types.BlockWithAttributes); ok && attributes != nil { + element.AddAttributes(attributes.(types.Attributes)) + } + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("returning element '%s'\n", spew.Sdump(element)) + // } + return element, nil + } + +// new paragraph with single line (other lines will be appended afterwards) +ListContinuationParagraph <- + content:([^\r\n]+ { + return string(c.text), nil + }) + EOL { // do not retain the EOL chars + return types.NewParagraph(types.RawLine(content.(string))) + } + +// ------------------------ +// Ordered List Elements +// ------------------------ +OrderedListElement <- + prefix:(OrderedListElementPrefix) + content:(ListElementContent) + { + return types.NewOrderedListElement(prefix.(types.OrderedListElementPrefix), content) + } + +OrderedListElementPrefix <- Space* prefix:( // implicit numbering: "." to "....." depth:((".")+ { @@ -711,47 +1451,43 @@ OrderedListItemPrefix <- { switch depth.(int){ case 1: - return types.NewOrderedListItemPrefix(types.Arabic, 1) + return types.NewOrderedListElementPrefix(types.Arabic) case 2: - return types.NewOrderedListItemPrefix(types.LowerAlpha, 2) + return types.NewOrderedListElementPrefix(types.LowerAlpha) case 3: - return types.NewOrderedListItemPrefix(types.LowerRoman, 3) + return types.NewOrderedListElementPrefix(types.LowerRoman) case 4: - return types.NewOrderedListItemPrefix(types.UpperAlpha, 4) + return types.NewOrderedListElementPrefix(types.UpperAlpha) default: - return types.NewOrderedListItemPrefix(types.UpperRoman, 5) + return types.NewOrderedListElementPrefix(types.UpperRoman) } } // explicit numbering - / ([0-9])+ "." { // numbering style: "1." - return types.NewOrderedListItemPrefix(types.Arabic, 1) - } / ([a-z]) "." { // numbering style: "a." - return types.NewOrderedListItemPrefix(types.LowerAlpha, 1) - } / ([A-Z]) "." { // numbering style: "A." - return types.NewOrderedListItemPrefix(types.UpperAlpha, 1) - } / ([ivxdlcm])+ ")" { // numbering style: "i)" - return types.NewOrderedListItemPrefix(types.LowerRoman, 1) - } / ([IVXDLCM])+ ")" { // numbering style: "I)" - return types.NewOrderedListItemPrefix(types.UpperRoman, 1) - }) Space+ { + / ([0-9])+ "." { // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + } / ([a-z]) "." { // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + } / ([A-Z]) "." { // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + } / ([ivxdlcm])+ ")" { // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + } / ([IVXDLCM])+ ")" { // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + }) Spaces { return prefix, nil } -OrderedListItemContent <- elements:(ListParagraph+) { - return types.NewListItemContent(elements.([]interface{})) -} - -// ------------------------------------------ -// Unordered List Items -// ------------------------------------------ -UnorderedListItem <- - prefix:(UnorderedListItemPrefix) - checkstyle:(UnorderedListItemCheckStyle)? - content:(UnorderedListItemContent) { - return types.NewUnorderedListItem(prefix.(types.UnorderedListItemPrefix), checkstyle, content.([]interface{}), c.globalStore.getAttributes()) +// ------------------------ +// Unordered list Elements +// ------------------------ +UnorderedListElement <- + prefix:(UnorderedListElementPrefix) + checkstyle:(UnorderedListElementCheckStyle)? + content:(ListElementContent) { + return types.NewUnorderedListElement(prefix.(types.UnorderedListElementPrefix), checkstyle, content) } -UnorderedListItemPrefix <- +UnorderedListElementPrefix <- Space* prefix:(( // implicit numbering: "*" to "*****" depth:(("*")+ { @@ -765,252 +1501,207 @@ UnorderedListItemPrefix <- { switch depth.(int){ case 1: - return types.NewUnorderedListItemPrefix(types.OneAsterisk, 1) + return types.NewUnorderedListElementPrefix(types.OneAsterisk) case 2: - return types.NewUnorderedListItemPrefix(types.TwoAsterisks, 2) + return types.NewUnorderedListElementPrefix(types.TwoAsterisks) case 3: - return types.NewUnorderedListItemPrefix(types.ThreeAsterisks, 3) + return types.NewUnorderedListElementPrefix(types.ThreeAsterisks) case 4: - return types.NewUnorderedListItemPrefix(types.FourAsterisks, 4) + return types.NewUnorderedListElementPrefix(types.FourAsterisks) default: - return types.NewUnorderedListItemPrefix(types.FiveAsterisks, 5) + return types.NewUnorderedListElementPrefix(types.FiveAsterisks) } }) / depth:(("-") { - return types.NewUnorderedListItemPrefix(types.Dash, 1) - })) Space+ { + return types.NewUnorderedListElementPrefix(types.Dash) + })) Spaces { return prefix, nil } -UnorderedListItemCheckStyle <- &"[" style:( - "[ ]" { return types.Unchecked, nil } - / "[*]" { return types.Checked, nil } - / "[x]" { return types.Checked, nil } - ) Space+ { - return style, nil - } - -UnorderedListItemContent <- elements:(ListParagraph+) { // Another list or a literal paragraph immediately following a list item will be implicitly included in the list item - return types.NewListItemContent(elements.([]interface{})) -} - -// ------------------------------------------ -// Labeled List Items -// ------------------------------------------ -LabeledListItem <- term:(VerbatimLabeledListItemTerm) separator:(LabeledListItemSeparator) description:(LabeledListItemDescription)? { - return types.NewLabeledListItem(len(separator.(string)) - 1, term.([]interface{}), description, c.globalStore.getAttributes()) -} - -LabeledListItemPrefix <- VerbatimLabeledListItemTerm LabeledListItemSeparator - -VerbatimLabeledListItemChars <- [^:\r\n]+ / ":" !":" -VerbatimLabeledListItemTerm <- content:( VerbatimLabeledListItemChars + { - return types.NewStringElement(strings.TrimSpace(string(c.text))) -}) { - return types.NewInlineElements(content) -} - -// extra entrypoint -LabeledListItemTerm <- elements:(!Newline !"::" LabeledListItemTermElement)+ { - return types.NewInlineElements(elements.([]interface{})) -} - -LabeledListItemTermElement <- element:(Word - / LineBreak // must appear before spaces - / Space+ - / CrossReference - / ConcealedIndexTerm - / IndexTerm - / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) - / InlineIcon - / InlineImage - / Link - / InlineFootnote - / QuotedString - / QuotedText - / SpecialCharacter - / Symbol - / AttributeSubstitution - / AnyChar ) { - return element, nil -} - -LabeledListItemSeparator <- - separator:((":")+ { - return string(c.text), nil - }) - &{ - // use a predicate to make sure that only `::` to `::::` are allowed - return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil - } - ((Space / Newline)+ / EOL) { - return separator, nil -} - -LabeledListItemDescription <- elements:(ListParagraph)+ { - return types.NewListItemContent(elements.([]interface{})) -} - -// ------------------------------------------ -// Admonitions -// ------------------------------------------ -AdmonitionKind <- "TIP" { - return types.Tip, nil -} / "NOTE" { - return types.Note, nil -} / "IMPORTANT" { - return types.Important, nil -} / "WARNING" { - return types.Warning, nil -} / "CAUTION" { - return types.Caution, nil -} - -// ------------------------------------------ -// Paragraphs -// ------------------------------------------ - -// Paragraphs with special treatment, such as -// OpenParagraph <- - -// a "raw paragraph" is the intermediate representation of a paragraph (see below), -// but with "raw line", ie, content which has not been substituted yet. -RawParagraph <- - // admonition paragraph - t:(AdmonitionKind) ": " lines:(SingleLineComment / RawParagraphLine)+ { - return types.NewAdmonitionParagraph(lines.([]interface{}), t.(string), c.globalStore.getAttributes()) - } / - // markdown-style blockquote paragraph - // TODO: move with other Delimited block rules? - "> " content:(MarkdownQuoteBlockRawContent) { - return types.NewMarkdownQuoteBlock(content.([]interface{}), c.globalStore.getAttributes()) - } / - // passthrough open block: requires `[pass]` - &{ - // verify that one of the attributes is `kind:passthrough` - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Passthrough), nil - } content:(RawParagraphLine)+ { - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) - } / - // other kind of paragraph (verse, regular, etc.) - lines:(SingleLineComment / RawParagraphLine)+ { - return types.NewParagraph(lines.([]interface{}), c.globalStore.getAttributes()) - } - -MarkdownQuoteBlockRawContent <- (!BlankLine "> "? content:(RawLine) { - return content, nil -})+ - -RawParagraphLine <- !BlockDelimiter - content:(RawParagraphLineContent) EOL &{ - // exclude line if it is a blankline - if strings.Trim(content.(string), " \t") == "" { - return false, nil - } - return true, nil +UnorderedListElementCheckStyle <- + &"[" style:( + "[ ]" { return types.Unchecked, nil } + / "[*]" { return types.Checked, nil } + / "[x]" { return types.Checked, nil } + ) Spaces { + return style, nil + } + +// ------------------------ +// Labelled list elements +// ------------------------ +LabeledListElement <- + term:(LabeledListElementTerm) + separator:(LabeledListElementSeparator) + description:(LabeledListElementDescription) + { + return types.NewLabeledListElement(len(separator.(string)) - 1, term, description) + } + +LabeledListElementTerm <- + (!LabeledListElementSeparator !EOL .)+ { + return types.NewRawLine(string(c.text)) + } + +LabeledListElementSeparator <- + separator:((":")+ { + return string(c.text), nil + }) + &{ + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil } { - return types.NewRawLine(content.(string)) + return separator, nil } -RawParagraphLineContent <- [^\r\n]+ { - return string(c.text), nil -} +LabeledListElementDescription <- + ( + // no description on the same line as the term + Space* EOL + BlankLine* + content:(ListElementParagraphLine)? { + if content == nil { + return nil, nil + } + return types.NewParagraph(content) + } + ) / ( + // description on the same line as the term + Spaces // trim spaces right after delimiter + content:([^\r\n]+ { + return types.NewRawLine(string(c.text)) + }) + EOL { + return types.NewParagraph(content) + } + ) -// a paragraph whose first line begins with a word followed by spaces -SimpleRawParagraph <- - !{ - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Literal), nil +// ------------------------ +// Callout list elements +// ------------------------ +Callout <- + // check if enabled with the current substitution context + &{ + return c.isSubstitutionEnabled(Callouts) } - firstLine: FirstParagraphRawLine - otherLines:(SingleLineComment / RawParagraphLine)* { - return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...), c.globalStore.getAttributes()) + "<" ref:([0-9]+ { return strconv.Atoi(string(c.text)) }) ">" Space* &(EOL / Callout) { + return types.NewCallout(ref.(int)) } -FirstParagraphRawLine <- - content:(elements:Word [^\r\n]* { return string(c.text), nil}) EOL { - return types.NewRawLine(content.(string)) -} +CalloutListElement <- + ref:(CalloutListElementPrefix) + description:(CalloutListElementContent) { + return types.NewCalloutListElement(ref.(int), description.(types.RawLine)) + } +CalloutListElementPrefix <- + "<" ref:([0-9]+ { return strconv.Atoi(string(c.text)) }) ">" Spaces { + return ref, nil + } +CalloutListElementContent <- + rawline:([^\r\n]+ { + return string(c.text), nil + }) + EOL { + return types.NewRawLine(rawline.(string)) + } -// ------------------------------------------ -// Continued Paragraphs -// ------------------------------------------ +// ----------------------------------------------------------------------------------------------------------------------- +// Paragraphs +// ----------------------------------------------------------------------------------------------------------------------- +ShortcutParagraph <- + &(Alphanum) // make sure that the line starts with an alphanum and it's not an ordered list element prefix + &(!OrderedListElementPrefix) + &(!UnorderedListElementPrefix) + &(!AdmonitionKind) + firstLine:(ParagraphRawLine) + &{ + // also, make sure that there is no LabeledListElement delimiter (`::` - `::::`) + // in the middle of the line (with space afterwards) + // or at the end of the line + return !strings.Contains(string(firstLine.(types.RawLine)), ":: ") && + !strings.HasSuffix(string(firstLine.(types.RawLine)), "::"), nil + } + otherLines:( + !EOF + !BlankLine + !ListElementContinuationMarker + line:(SingleLineComment / ParagraphRawLine) { + return line, nil + })* + { + return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...)...) + } -// same as RawParagraph, but without allowing for ListItemContinuation (`+`) -ContinuedRawParagraph <- - // admonition paragraph - t:(AdmonitionKind) ": " lines:(ContinuedRawParagraphLines) { - return types.NewAdmonitionParagraph(lines.([]interface{}), t.(string), c.globalStore.getAttributes()) - } / - // other kind of paragraph (verse, regular, etc.) - lines:(ContinuedRawParagraphLines) { - return types.NewParagraph(lines.([]interface{}), c.globalStore.getAttributes()) -} +Paragraph <- + firstLine:(ParagraphRawLine) + otherLines:( + !EOF + !ListElementContinuationMarker + line:(SingleLineComment / ParagraphRawLine) { + return line, nil + })* + { + return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...)...) + } -ContinuedRawParagraphLines <- firstLine:(FirstParagraphRawLine) otherLines:(!ListItemContinuation line:(SingleLineComment / RawParagraphLine) { return line, nil })* { - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil -} +// TODO: reuse `Paragraph` rule +AdmonitionParagraph <- + kind:(AdmonitionKind) ": " + firstLine:(ParagraphRawLine) + otherLines:( + !ListElementContinuationMarker + line:(SingleLineComment / ParagraphRawLine) { + return line, nil + })* + { + return types.NewAdmonitionParagraph(kind.(string), append([]interface{}{firstLine}, otherLines.([]interface{})...)) + } -// ------------------------------------------ -// Inline Elements -// ------------------------------------------ - -InlineElements <- !BlankLine - elements:(comment:(SingleLineComment) { - return types.NewInlineElements([]interface{}{comment}) - } / elements:(InlineElement)+ EOL { - return types.NewInlineElements(elements.([]interface{})) - }) { - return elements, nil +ParagraphRawLine <- + content:([^\r\n]+ { + return string(c.text), nil + }) + &{ + return len(strings.TrimSpace(string(c.text))) > 0, nil + } + EOL { + return types.NewRawLine(content.(string)) } -InlineElement <- - element:(InlineWord // more permissive than the 'Word' rule - / LineBreak // must be before spaces - / Space+ - / !EOL ( - QuotedString - / QuotedText - / InlineIcon - / InlineImage - / Link - / InlinePassthrough // must be before the SpecialCharacter rule (because of `+`) - / InlineFootnote - / CrossReference // must appear before SpecialCharacter - / SpecialCharacter - / Symbol - / InlineUserMacro - / AttributeSubstitution - / InlineElementID - / ConcealedIndexTerm - / IndexTerm - / ElementPlaceHolder - / AnyChar)) { - return element, nil -} +LiteralParagraph <- + firstLine:(LiteralParagraphRawLine) + otherLines:(SingleLineComment / ParagraphRawLine)* + { + return types.NewLiteralParagraph(types.LiteralBlockWithSpacesOnFirstLine, append([]interface{}{firstLine}, otherLines.([]interface{})...)) + } -// ---------------------------------------------------------------------------- -// Explicit line breaks -// ---------------------------------------------------------------------------- -LineBreak <- Space "+" Space* &EOL { - return types.NewLineBreak() -} +LiteralParagraphRawLine <- + content:(Spaces [^\r\n]+ { + return string(c.text), nil + }) + &{ + return len(strings.TrimSpace(string(c.text))) > 0, nil + } + EOL { + return types.NewRawLine(content.(string)) + } -// ---------------------------------------------------------------------------- -// Quoted Texts (bold, italic and monospace) including substitution prevention -// ---------------------------------------------------------------------------- +// ----------------------------------------------------------------------------------------------------------------------- +// Quoted Texts (bold, italic, monospace, marked, superscript and subscript) +// ----------------------------------------------------------------------------------------------------------------------- QuotedText <- ( - attributes:(LongHandAttributes)? + attributes:(LongHandAttributes)? // TODO: do not check for attributes on quoted text if we're already parsing an attribute value? text:(UnconstrainedQuotedText / ConstrainedQuotedText) { - return text.(types.QuotedText).WithAttributes(attributes) + return text.(*types.QuotedText).WithAttributes(attributes) } ) / EscapedQuotedText ConstrainedQuotedTextMarker <- "*" !"*" / "_" !"_" / "#" !"#" / "`" !"`" -UnconstrainedQuotedTextPrefix <- "**" / "__" / "``" / "##" / "^" / "~" +UnconstrainedQuotedTextPrefix <- "**" / "__" / "``" / DoubleQuoteMarkedTextDelimiter / "^" / "~" ConstrainedQuotedText <- SingleQuoteBoldText @@ -1026,95 +1717,141 @@ UnconstrainedQuotedText <- / DoubleQuoteMarkedText / DoubleQuoteMonospaceText -EscapedQuotedText <- - EscapedBoldText - / EscapedItalicText - / EscapedMarkedText - / EscapedMonospaceText - / EscapedSubscriptText - / EscapedSuperscriptText +EscapedQuotedText <- // TODO: use something like `&('\')` to quickly escape? + &(`\`) + element:( + EscapedBoldText + / EscapedItalicText + / EscapedMarkedText + / EscapedMonospaceText + / EscapedSubscriptText + / EscapedSuperscriptText + ) { + return element, nil + } SubscriptOrSuperscriptPrefix <- "^" / "~" { // rule used within `words` to detect superscript or subscript portions, eg in math formulae. - return string(c.text), nil -} + return string(c.text), nil + } OneOrMoreBackslashes <- `\`+ { - return string(c.text), nil -} + return string(c.text), nil + } TwoOrMoreBackslashes <- `\\` `\`* { - return string(c.text), nil -} - -// ----------------- -// Bold text -// ----------------- + return string(c.text), nil + } +// --------------------------------------------------- +// Quoted Bold Text +// --------------------------------------------------- BoldText <- DoubleQuoteBoldText / SingleQuoteBoldText // double punctuation must be evaluated first -DoubleQuoteBoldText <- "**" elements:(DoubleQuoteBoldTextElements) "**" { - return types.NewQuotedText(types.DoubleQuoteBold, elements.([]interface{})) -} - -DoubleQuoteBoldTextElements <- DoubleQuoteBoldTextElement* +BoldTextDelimiter <- "*" -DoubleQuoteBoldTextElement <- !("**") element:(Word - / Space // may start and end with spaces - / Newline !Newline - / QuotedString - / QuotedTextInDoubleQuoteBoldText - / ElementPlaceHolder - / DoubleQuoteBoldTextFallbackCharacter) { - return element, nil +BoldTextWord <- + [\pL0-9,?!;]+ &(Space / BoldTextDelimiter) { + return types.NewStringElement(string(c.text)) } +// ------------------------------- +// Bold text within double quotes +// ------------------------------- +DoubleQuoteBoldTextDelimiter <- "**" + +DoubleQuoteBoldText <- + DoubleQuoteBoldTextDelimiter + elements:(DoubleQuoteBoldTextElements) + DoubleQuoteBoldTextDelimiter { + return types.NewQuotedText(types.DoubleQuoteBold, elements.([]interface{})) + } + +DoubleQuoteBoldTextElements <- DoubleQuoteBoldTextElement+ + +DoubleQuoteBoldTextElement <- + !DoubleQuoteBoldTextDelimiter + element:( + BoldTextWord + / Spaces // may start and end with spaces + / Newline !Newline // 2 newlines split the paragraph + / AttributeSubstitution + / SpecialCharacter + / Symbol + / InlineMacro + / QuotedString + / QuotedTextInDoubleQuoteBoldText + / ElementPlaceHolder + / DoubleQuoteBoldTextFallbackCharacter) { + return element, nil + } + QuotedTextInDoubleQuoteBoldText <- attributes:(LongHandAttributes)? - text:(SingleQuoteBoldText + text:( + SingleQuoteBoldText / ItalicText / MarkedText / MonospaceText / SubscriptText / SuperscriptText) { - return text.(types.QuotedText).WithAttributes(attributes) + return text.(*types.QuotedText).WithAttributes(attributes) } DoubleQuoteBoldTextFallbackCharacter <- [^\r\n*] // anything except EOL and bold delimiter (fallback in case nothing else matched) - / "**" Alphanums { // or a bold delimiter when immediately followed by an alphanum (ie, in the middle of some text) + / DoubleQuoteBoldTextDelimiter Alphanums { // or a bold delimiter when immediately followed by an alphanum (ie, in the middle of some text) return types.NewStringElement(string(c.text)) } +// ------------------------------- +// Bold text within single quotes +// ------------------------------- +SingleQuoteBoldTextStartDelimiter <- "*" + +SingleQuoteBoldTextEndDelimiter <- "*" + SingleQuoteBoldText <- - ("*" !"*") elements:(SingleQuoteBoldTextElements) "*" &(!Alphanum) { // single punctuation cannot be followed by a character (needs '**' to emphazise a portion of a word) + SingleQuoteBoldTextStartDelimiter + elements:(SingleQuoteBoldTextElements) + SingleQuoteBoldTextEndDelimiter { return types.NewQuotedText(types.SingleQuoteBold, elements.([]interface{})) - } / "*" elements:("*" SingleQuoteBoldTextElements) "*" { // unbalanced `**` vs `*` punctuation. - return types.NewQuotedText(types.SingleQuoteBold, elements.([]interface{})) // include the second heading `*` as a regular StringElement in the bold content } -SingleQuoteBoldTextElements <- !Space SingleQuoteBoldTextElement+ +SingleQuoteBoldTextElements <- + !EOF !Space // cannot start with spaces + elements:(SingleQuoteBoldTextElement)+ + &{ + return validateSingleQuoteElements(elements.([]interface{})) // cannot end with spaces + }{ + return elements, nil + } SingleQuoteBoldTextElement <- - Word - / Newline !Newline + BoldTextWord + / Spaces + / Newline !Newline // 2 newlines split the paragraph + / AttributeSubstitution + / SpecialCharacter + / Symbol + / InlineMacro / QuotedString - / Space+ ('*' !'*')? / QuotedTextInSingleQuoteBoldText / ElementPlaceHolder / SingleQuoteBoldTextFallbackCharacter QuotedTextInSingleQuoteBoldText <- attributes:(LongHandAttributes)? - text:(DoubleQuoteBoldText + text:( + DoubleQuoteBoldText / ItalicText - / MarkedText / MonospaceText + / MarkedText / SubscriptText / SuperscriptText) { - return text.(types.QuotedText).WithAttributes(attributes) + return text.(*types.QuotedText).WithAttributes(attributes) } SingleQuoteBoldTextFallbackCharacter <- - [^\r\n*] // anything except EOL and bold delimiter (fallback in case nothing else matched) + [^\r\n *] // anything except EOL, space and bold delimiter (fallback in case nothing else matched) / "*" Alphanums { // or a bold delimiter when immediately followed by an alphanum (ie, in the middle of some text) return types.NewStringElement(string(c.text)) } @@ -1127,31 +1864,52 @@ EscapedBoldText <- return types.NewEscapedQuotedText(backslashes.(string), "*", result) } / backslashes:(OneOrMoreBackslashes) "*" elements:(SingleQuoteBoldTextElements) "*" { // simple punctuation must be evaluated last return types.NewEscapedQuotedText(backslashes.(string), "*", elements.([]interface{})) -} + } -// ----------------- -// Italic text -// ----------------- +// --------------------------------------------------------- +// Quoted Italic Text +// --------------------------------------------------------- ItalicText <- DoubleQuoteItalicText / SingleQuoteItalicText -DoubleQuoteItalicText <- "__" elements:(DoubleQuoteItalicTextElements) "__" { // double punctuation must be evaluated first - return types.NewQuotedText(types.DoubleQuoteItalic, elements.([]interface{})) -} +ItalicTextDelimiter <- "_" + +ItalicTextWord <- + [\pL0-9]+ &(Space / ItalicTextDelimiter) { + return types.NewStringElement(string(c.text)) + } -DoubleQuoteItalicTextElements <- DoubleQuoteItalicTextElement* +// --------------------------------- +// Italic text within double quotes +// --------------------------------- +DoubleQuoteItalicTextDelimiter <- "__" -DoubleQuoteItalicTextElement <- - !("__") element:(Word - / Space // may start and end with spaces - / Newline !Newline - / QuotedString - / QuotedTextInDoubleQuoteItalicText - / ElementPlaceHolder - / DoubleQuoteItalicTextFallbackCharacter) { - return element, nil +DoubleQuoteItalicText <- + DoubleQuoteItalicTextDelimiter + elements:(DoubleQuoteItalicTextElements) + DoubleQuoteItalicTextDelimiter { // double punctuation must be evaluated first + return types.NewQuotedText(types.DoubleQuoteItalic, elements.([]interface{})) } +DoubleQuoteItalicTextElements <- DoubleQuoteItalicTextElement+ + +DoubleQuoteItalicTextElement <- + !DoubleQuoteItalicTextDelimiter + element:( + ItalicTextWord + / Spaces // may start and end with spaces + / Newline !Newline // 2 newlines split the paragraph + / AttributeSubstitution + / SpecialCharacter + / Symbol + / InlineMacro + / QuotedString + / QuotedTextInDoubleQuoteItalicText + / ElementPlaceHolder + / DoubleQuoteItalicTextFallbackCharacter) { + return element, nil + } + QuotedTextInDoubleQuoteItalicText <- attributes:(LongHandAttributes)? text:(SingleQuoteItalicText @@ -1160,7 +1918,7 @@ QuotedTextInDoubleQuoteItalicText <- / MonospaceText / SubscriptText / SuperscriptText) { - return text.(types.QuotedText).WithAttributes(attributes) + return text.(*types.QuotedText).WithAttributes(attributes) } DoubleQuoteItalicTextFallbackCharacter <- @@ -1169,20 +1927,38 @@ DoubleQuoteItalicTextFallbackCharacter <- return types.NewStringElement(string(c.text)) } +// --------------------------------- +// Italic text within single quotes +// --------------------------------- +SingleQuoteItalicTextStartDelimiter <- "_" + +SingleQuoteItalicTextEndDelimiter <- "_" + SingleQuoteItalicText <- - ("_" !"_") elements:(SingleQuoteItalicTextElements) "_" { // single punctuation cannot be followed by a character (needs '__' to emphazise a portion of a word) + SingleQuoteItalicTextStartDelimiter + elements:(SingleQuoteItalicTextElements) + SingleQuoteItalicTextEndDelimiter { return types.NewQuotedText(types.SingleQuoteItalic, elements.([]interface{})) - } / "_" elements:("_" SingleQuoteItalicTextElements) "_" { // unbalanced `__` vs `_` punctuation. - return types.NewQuotedText(types.SingleQuoteItalic, elements.([]interface{})) // include the second heading `_` as a regular StringElement in the italic content } -SingleQuoteItalicTextElements <- !Space SingleQuoteItalicTextElement+ +SingleQuoteItalicTextElements <- + !EOF !Space // cannot start with spaces + elements:(SingleQuoteItalicTextElement)+ + &{ + return validateSingleQuoteElements(elements.([]interface{})) // cannot end with spaces + }{ + return elements, nil + } SingleQuoteItalicTextElement <- - Word - / Newline !Newline + ItalicTextWord + / Spaces + / Newline !Newline // 2 newlines split the paragraph + / AttributeSubstitution + / SpecialCharacter + / Symbol + / InlineMacro / QuotedString - / Space+ ('_' !'_')? / QuotedTextInSingleQuoteItalicText / ElementPlaceHolder / SingleQuoteItalicTextFallbackCharacter @@ -1195,14 +1971,14 @@ QuotedTextInSingleQuoteItalicText <- / MonospaceText / SubscriptText / SuperscriptText) { - return text.(types.QuotedText).WithAttributes(attributes) + return text.(*types.QuotedText).WithAttributes(attributes) } SingleQuoteItalicTextFallbackCharacter <- - [^\r\n_] // anything except EOL and italic delimiter (fallback in case nothing else matched) + [^\r\n _] // anything except EOL, space and italic delimiter (fallback in case nothing else matched) / "_" Alphanums { // or an italic delimiter when immediately followed by an alphanum (ie, in the middle of some text) - return types.NewStringElement(string(c.text)) -} + return types.NewStringElement(string(c.text)) + } EscapedItalicText <- backslashes:(TwoOrMoreBackslashes) "__" elements:(DoubleQuoteItalicTextElements) "__" { // double punctuation must be evaluated first @@ -1212,40 +1988,62 @@ EscapedItalicText <- return types.NewEscapedQuotedText(backslashes.(string), "_", result) } / backslashes:(OneOrMoreBackslashes) "_" elements:(SingleQuoteItalicTextElements) "_" { // simple punctuation must be evaluated last return types.NewEscapedQuotedText(backslashes.(string), "_", elements.([]interface{})) -} + } -// ----------------- -// Monospace text -// ----------------- +// ------------------------------------------------------------------ +// Quoted Monospace Text +// ------------------------------------------------------------------ MonospaceText <- DoubleQuoteMonospaceText / SingleQuoteMonospaceText -DoubleQuoteMonospaceText <- "``" elements:(DoubleQuoteMonospaceTextElements) "``" { // double punctuation must be evaluated first - return types.NewQuotedText(types.DoubleQuoteMonospace, elements.([]interface{})) -} +MonospaceTextDelimiter <- "`" -DoubleQuoteMonospaceTextElements <- DoubleQuoteMonospaceTextElement* // may start and end with spaces +MonospaceTextWord <- + [\pL0-9]+ &(Space / MonospaceTextDelimiter) { + return types.NewStringElement(string(c.text)) + } -DoubleQuoteMonospaceTextElement <- - !("``") element:(Word - / Space // may start and end with spaces - / Newline !Newline - / QuotedString - / RawApostrophe // must be before SingleQuoteMonospaceText - / QuotedTextInDoubleQuoteMonospaceText - / ElementPlaceHolder - / DoubleQuoteMonospaceTextFallbackCharacter) { - return element, nil +// ------------------------------------ +// Monospace text within double quotes +// ------------------------------------ +DoubleQuoteMonospaceTextDelimiter <- "``" + +DoubleQuoteMonospaceText <- + DoubleQuoteMonospaceTextDelimiter + elements:(DoubleQuoteMonospaceTextElements) + DoubleQuoteMonospaceTextDelimiter { + return types.NewQuotedText(types.DoubleQuoteMonospace, elements.([]interface{})) } +DoubleQuoteMonospaceTextElements <- DoubleQuoteMonospaceTextElement+ // may start and end with spaces + +DoubleQuoteMonospaceTextElement <- + !DoubleQuoteMonospaceTextDelimiter + element:( + MonospaceTextWord + / Spaces // may start and end with spaces + / Newline !Newline // 2 newlines split the paragraph + / AttributeSubstitution + / SpecialCharacter + / Symbol + / InlineMacro + / QuotedString + / RawApostrophe // must be before SingleQuoteMonospaceText + / QuotedTextInDoubleQuoteMonospaceText + / ElementPlaceHolder + / DoubleQuoteMonospaceTextFallbackCharacter) { + return element, nil + } + QuotedTextInDoubleQuoteMonospaceText <- attributes:(LongHandAttributes)? - text:(SingleQuoteMonospaceText + text:( + SingleQuoteMonospaceText / BoldText / ItalicText / MarkedText / SubscriptText / SuperscriptText) { - return text.(types.QuotedText).WithAttributes(attributes) + return text.(*types.QuotedText).WithAttributes(attributes) } DoubleQuoteMonospaceTextFallbackCharacter <- @@ -1254,20 +2052,40 @@ DoubleQuoteMonospaceTextFallbackCharacter <- return types.NewStringElement(string(c.text)) } +// ------------------------------------ +// Monospace text within single quotes +// ------------------------------------ + +// need to distinguish start vs end because of quoted string which also use the same "`" +SingleQuoteMonospaceTextStartDelimiter <- "`" + +SingleQuoteMonospaceTextEndDelimiter <- "`" + SingleQuoteMonospaceText <- - ("`" !"`") elements:(SingleQuoteMonospaceTextElements) "`" { // single punctuation cannot be followed by a character (needs "``" to emphazise a portion of a word) + SingleQuoteMonospaceTextStartDelimiter + elements:(SingleQuoteMonospaceTextElements) + SingleQuoteMonospaceTextEndDelimiter { return types.NewQuotedText(types.SingleQuoteMonospace, elements.([]interface{})) - } / "`" elements:("`" SingleQuoteMonospaceTextElements) "`" { // unbalanced "``" vs "`" punctuation. - return types.NewQuotedText(types.SingleQuoteMonospace, elements.([]interface{})) // include the second heading "`" as a regular StringElement in the monospace content - } + } -SingleQuoteMonospaceTextElements <- !Space SingleQuoteMonospaceTextElement+ +SingleQuoteMonospaceTextElements <- + !EOF !Space // cannot start with spaces + elements:(SingleQuoteMonospaceTextElement)+ + &{ + return validateSingleQuoteElements(elements.([]interface{})) // cannot end with spaces + }{ + return elements, nil + } SingleQuoteMonospaceTextElement <- Word - / Newline !Newline + / Spaces + / Newline !Newline // 2 newlines split the paragraph + / AttributeSubstitution + / SpecialCharacter + / Symbol + / InlineMacro / QuotedString - / Space+ ('`' !'`')? // allow for content such as "`some `nested monospace`". Also, do not allow for double backticks after spaces. / QuotedTextInSingleQuoteMonospaceText / RawApostrophe / ElementPlaceHolder @@ -1275,18 +2093,19 @@ SingleQuoteMonospaceTextElement <- QuotedTextInSingleQuoteMonospaceText <- attributes:(LongHandAttributes)? - text:(DoubleQuoteMonospaceText + text:( + DoubleQuoteMonospaceText / BoldText / ItalicText / MarkedText / SubscriptText / SuperscriptText) { - return text.(types.QuotedText).WithAttributes(attributes) + return text.(*types.QuotedText).WithAttributes(attributes) } SingleQuoteMonospaceTextFallbackCharacter <- - ([^\r\n`] // ` anything except EOL and monospace delimiter (fallback in case nothing else matched) - / "`" Alphanums) { // or an monospace delimiter when immediately followed by an alphanum (ie, in the middle of some text) + ([^\r\n` ] // ` anything except EOL, space and monospace delimiter (fallback in case nothing else matched) + / MonospaceTextDelimiter Alphanums) { // or an monospace delimiter when immediately followed by an alphanum (ie, in the middle of some text) return types.NewStringElement(string(c.text)) } @@ -1298,159 +2117,123 @@ EscapedMonospaceText <- return types.NewEscapedQuotedText(backslashes.(string), "`", result) } / backslashes:(OneOrMoreBackslashes) "`" elements:(SingleQuoteMonospaceTextElements) "`" { // simple punctuation must be evaluated last return types.NewEscapedQuotedText(backslashes.(string), "`", elements.([]interface{})) -} - -// ------------------------------------------------------ -// Quoted Strings (between curly single or double quotes) -// ------------------------------------------------------ - -QuotedString <- SingleQuotedString / DoubleQuotedString - -SingleQuotedString <- SingleQuoteStringStart elements:SingleQuotedStringElements SingleQuoteStringEnd { - return types.NewQuotedString(types.SingleQuote, elements.([]interface{})) -} - -SingleQuotedStringElements <- elements:(SingleQuotedStringElement+) { - return types.NewInlineElements(elements) -} - -SingleQuoteStringStart <- "'`" ![ \t\r\n] - -SingleQuoteStringEnd <- "`'" - -// We have to treat this one special, because of ambiguity with monospace markup. -SingleQuotedStringElement <- - element:( - LineBreak !SingleQuoteStringEnd // must be before spaces - / Space+ !SingleQuoteStringEnd - / (!"`" element:(Symbol) { return element, nil}) // Exclude the explicit quote - / QuotedTextInSingleQuotedString - / DoubleQuotedString - / SingleQuotedStringFallbackCharacter - ) { - return element, nil } -QuotedTextInSingleQuotedString <- - attributes:(LongHandAttributes)? - text:(BoldText - / ItalicText - / (!"`'" element:(MonospaceText) { return element, nil}) - / SubscriptText - / SuperscriptText - / MarkedText) { - return text.(types.QuotedText).WithAttributes(attributes) - } - -SingleQuotedStringFallbackCharacter <- [^\r\n\t `] / "`" !"'" { // ' - return types.NewStringElement(string(c.text)) -} - -DoubleQuotedString <- DoubleQuoteStringStart elements:DoubleQuotedStringElements DoubleQuoteStringEnd { - return types.NewQuotedString(types.DoubleQuote, elements.([]interface{})) -} - -DoubleQuotedStringElements <- elements:(DoubleQuotedStringElement+) { - return types.NewInlineElements(elements) -} - -// We have to treat this one special, because of ambiguity with monospace markup. -DoubleQuotedStringElement <- element:( - LineBreak !DoubleQuoteStringEnd // must be before spaces - / Space+ !DoubleQuoteStringEnd - / QuotedTextInDoubleQuotedString - / SingleQuotedString - / DoubleQuotedStringFallbackCharacter) { - return element, nil -} - -QuotedTextInDoubleQuotedString <- - attributes:(LongHandAttributes)? - text:(BoldText - / ItalicText - / (!"`\"" element:(MonospaceText) { return element, nil}) - / SubscriptText - / SuperscriptText - / MarkedText) { - return text.(types.QuotedText).WithAttributes(attributes) - } - -DoubleQuoteStringStart <- "\"`" ![ \t\r\n] - -DoubleQuoteStringEnd <- "`\"" - -DoubleQuotedStringFallbackCharacter <- ([^\r\n\t `] / "`" !"\"") { - return types.NewStringElement(string(c.text)) -} +// --------------------------------------------------------- +// Quoted Marked Text +// --------------------------------------------------------- +MarkedText <- DoubleQuoteMarkedText / SingleQuoteMarkedText +MarkedTextDelimiter <- "#" -// ----------------- -// Marked text -// ----------------- +MarkedTextWord <- + [\pL0-9,?!;]+ &(Space / MarkedTextDelimiter) { + return types.NewStringElement(string(c.text)) + } -MarkedText <- DoubleQuoteMarkedText / SingleQuoteMarkedText +// ------------------------------------ +// Marked text within double quotes +// ------------------------------------ +DoubleQuoteMarkedTextDelimiter <- "##" -DoubleQuoteMarkedText <- "##" elements:(DoubleQuoteMarkedTextElements) "##" { // double punctuation must be evaluated first - return types.NewQuotedText(types.DoubleQuoteMarked, elements.([]interface{})) -} +DoubleQuoteMarkedText <- + DoubleQuoteMarkedTextDelimiter + elements:(DoubleQuoteMarkedTextElements) + DoubleQuoteMarkedTextDelimiter { + return types.NewQuotedText(types.DoubleQuoteMarked, elements.([]interface{})) + } -DoubleQuoteMarkedTextElements <- DoubleQuoteMarkedTextElement (!("##") (Space / DoubleQuoteMarkedTextElement))* // may start and end with spaces +DoubleQuoteMarkedTextElements <- DoubleQuoteMarkedTextElement* -DoubleQuoteMarkedTextElement <- Word - / Newline !Newline +DoubleQuoteMarkedTextElement <- // may start and end with spaces + !DoubleQuoteMarkedTextDelimiter + element:( + MarkedTextWord + / Spaces // may start and end with spaces + / Newline !Newline // 2 newlines split the paragraph + / AttributeSubstitution + / SpecialCharacter + / Symbol + / InlineMacro / QuotedString - / NonDoubleQuoteMarkedText + / QuotedTextInDoubleMarkedBoldText / ElementPlaceHolder / DoubleQuoteMarkedTextFallbackCharacter + ) { + return element, nil + } -NonDoubleQuoteMarkedText <- +QuotedTextInDoubleMarkedBoldText <- attributes:(LongHandAttributes)? - text:(BoldText + text:( + SingleQuoteMarkedText + / BoldText / ItalicText / MonospaceText - / SingleQuoteMarkedText / SubscriptText / SuperscriptText) { - return text.(types.QuotedText).WithAttributes(attributes) + return text.(*types.QuotedText).WithAttributes(attributes) } DoubleQuoteMarkedTextFallbackCharacter <- [^\r\n#] // anything except EOL and marked delimiter (fallback in case nothing else matched) - / "##" Alphanums { // or a marked delimiter when immediately followed by an alphanum (ie, in the middle of some text) - return types.NewStringElement(string(c.text)) -} + / DoubleQuoteMarkedTextDelimiter Alphanums { // or a marked delimiter when immediately followed by an alphanum (ie, in the middle of some text) + return types.NewStringElement(string(c.text)) + } -SingleQuoteMarkedText <- ("#" !"#") elements:(SingleQuoteMarkedTextElements) "#" { // single punctuation cannot be followed by a character (needs '##' to emphazise a portion of a word) - return types.NewQuotedText(types.SingleQuoteMarked, elements.([]interface{})) -} / "#" elements:("#" SingleQuoteMarkedTextElements) "#" { // unbalanced `##` vs `#` punctuation. - return types.NewQuotedText(types.SingleQuoteMarked, elements.([]interface{})) // include the second heading `_` as a regular StringElement in the italic content -} +// ------------------------------------ +// Marked text within single quotes +// ------------------------------------ +SingleQuoteMarkedTextStartDelimiter <- "#" -SingleQuoteMarkedTextElements <- !Space SingleQuoteMarkedTextElement+ +SingleQuoteMarkedTextEndDelimiter <- "#" -SingleQuoteMarkedTextElement <- Word - / Newline !Newline - / QuotedString - / Space+ ('#' !'#')? - / NonSingleQuoteMarkedText - / ElementPlaceHolder - / SingleQuoteMarkedTextFallbackCharacter +SingleQuoteMarkedText <- + SingleQuoteMarkedTextStartDelimiter + elements:(SingleQuoteMarkedTextElements) + SingleQuoteMarkedTextEndDelimiter { + return types.NewQuotedText(types.SingleQuoteMarked, elements.([]interface{})) + } + +SingleQuoteMarkedTextElements <- + !EOF !Space // cannot start with spaces + elements:(SingleQuoteMarkedTextElement)+ + &{ + return validateSingleQuoteElements(elements.([]interface{})) // cannot end with spaces + }{ + return elements, nil + } + +SingleQuoteMarkedTextElement <- + MarkedTextWord + / Spaces + / Newline !Newline // 2 newlines split the paragraph + / AttributeSubstitution + / SpecialCharacter + / Symbol + / InlineMacro + / QuotedString + / QuotedTextInSingleQuoteMarkedText + / ElementPlaceHolder + / SingleQuoteMarkedTextFallbackCharacter -NonSingleQuoteMarkedText <- +QuotedTextInSingleQuoteMarkedText <- attributes:(LongHandAttributes)? - text:(DoubleQuoteMarkedText + text:( + DoubleQuoteMarkedText / BoldText / ItalicText / MonospaceText / SubscriptText / SuperscriptText) { - return text.(types.QuotedText).WithAttributes(attributes) + return text.(*types.QuotedText).WithAttributes(attributes) } + SingleQuoteMarkedTextFallbackCharacter <- - [^\r\n#] // anything except EOL and mark delimiter (fallback in case nothing else matched) + [^\r\n #] // anything except EOL, space and mark delimiter (fallback in case nothing else matched) / "#" Alphanums { // or a mark delimiter when immediately followed by an alphanum (ie, in the middle of some text) - return types.NewStringElement(string(c.text)) -} + return types.NewStringElement(string(c.text)) + } EscapedMarkedText <- backslashes:(TwoOrMoreBackslashes) "##" elements:(DoubleQuoteMarkedTextElements) "##" { // double punctuation must be evaluated first @@ -1460,820 +2243,723 @@ EscapedMarkedText <- return types.NewEscapedQuotedText(backslashes.(string), "#", result) } / backslashes:(OneOrMoreBackslashes) "#" elements:(SingleQuoteMarkedTextElements) "#" { // simple punctuation must be evaluated last return types.NewEscapedQuotedText(backslashes.(string), "#", elements.([]interface{})) -} + } +// --------------------------------------------------------------- +// Quoted Subscript Text +// --------------------------------------------------------------- +SubscriptText <- + SubscriptTextDelimiter + element:(SubscriptTextElement) + SubscriptTextDelimiter { // wraps a single word + return types.NewQuotedText(types.SingleQuoteSubscript, element) + } -SubscriptText <- "~" element:(SubscriptTextElement) "~" { // wraps a single word - return types.NewQuotedText(types.SingleQuoteSubscript, element) -} +SubscriptTextDelimiter <- "~" SubscriptTextElement <- QuotedText / NonSubscriptText NonSubscriptText <- [^\r\n ~]+ { // anything except spaces, EOL or '~' - return c.text, nil -} + return c.text, nil + } -EscapedSubscriptText <- backslashes:(OneOrMoreBackslashes) "~" element:(SubscriptTextElement) "~" { // simple punctuation must be evaluated last - return types.NewEscapedQuotedText(backslashes.(string), "~", element) -} +EscapedSubscriptText <- + backslashes:(OneOrMoreBackslashes) + SubscriptTextDelimiter + element:(SubscriptTextElement) + SubscriptTextDelimiter { // simple punctuation must be evaluated last + return types.NewEscapedQuotedText(backslashes.(string), "~", element) + } -SuperscriptText <- "^" element:(SuperscriptTextElement) "^" { // wraps a single word - return types.NewQuotedText(types.SingleQuoteSuperscript, element) -} +// ----------------------- +// Quoted Superscript Text +// ----------------------- +SuperscriptText <- + SuperscriptTextDelimiter + element:(SuperscriptTextElement) + SuperscriptTextDelimiter { // wraps a single word + return types.NewQuotedText(types.SingleQuoteSuperscript, element) + } + +SuperscriptTextDelimiter <- "^" SuperscriptTextElement <- QuotedText / NonSuperscriptText NonSuperscriptText <- [^\r\n ^]+ { // anything except spaces, EOL or '^' - return c.text, nil -} - -EscapedSuperscriptText <- backslashes:(OneOrMoreBackslashes) "^" element:(SuperscriptTextElement) "^" { // simple punctuation must be evaluated last - return types.NewEscapedQuotedText(backslashes.(string), "^", element) -} - -// ------------------------------------------ -// InlinePassthrough -// ------------------------------------------ -InlinePassthrough <- TriplePlusPassthrough / SinglePlusPassthrough / PassthroughMacro - -SinglePlusPassthroughPrefix <- "+" - -SinglePlusPassthrough <- SinglePlusPassthroughPrefix content:(SinglePlusPassthroughContent) SinglePlusPassthroughPrefix !Alphanum { - return types.NewInlinePassthrough(types.SinglePlusPassthrough, []interface{}{content}) -} - -SinglePlusPassthroughContent <- ((!SinglePlusPassthroughPrefix !Space !Newline .) (!(Space+ SinglePlusPassthroughPrefix) !SinglePlusPassthroughPrefix !Newline .)* { // no space in the first or last position of the content, but allowed elsewhere - return types.NewStringElement(string(c.text)) -}) / ((!Space !Newline !SinglePlusPassthroughPrefix .) { // a single character - return types.NewStringElement(string(c.text)) -}) - -TriplePlusPassthroughPrefix <- "+++" + return c.text, nil + } -TriplePlusPassthrough <- TriplePlusPassthroughPrefix content:(TriplePlusPassthroughContent) TriplePlusPassthroughPrefix !Alphanum { - return types.NewInlinePassthrough(types.TriplePlusPassthrough, []interface{}{content}) -} +EscapedSuperscriptText <- + backslashes:(OneOrMoreBackslashes) + SuperscriptTextDelimiter + element:(SuperscriptTextElement) + SuperscriptTextDelimiter { // simple punctuation must be evaluated last + return types.NewEscapedQuotedText(backslashes.(string), "^", element) + } -TriplePlusPassthroughContent <- ((!TriplePlusPassthroughPrefix .)* { // spaces and newlines are also allowed in the first or last position of the content and elsewhere too - return types.NewStringElement(string(c.text)) -}) / ((!Space !Newline !TriplePlusPassthroughPrefix .)? { // a single character - return types.NewStringElement(string(c.text)) -}) +// ------------------------------------------------------------------------------------------------- +// Quoted Strings (between curly single or double quotes) +// ------------------------------------------------------------------------------------------------- -PassthroughMacro <- "pass:[" content:(PassthroughMacroCharacter)* "]" { - return types.NewInlinePassthrough(types.PassthroughMacro, []interface{}{content}) -} / "pass:q[" content:(QuotedText / PassthroughMacroCharacter)* "]" { - return types.NewInlinePassthrough(types.PassthroughMacro, content.([]interface{})) -} +QuotedString <- SingleQuotedString / DoubleQuotedString -PassthroughMacroCharacter <- [^\]] { - return types.NewStringElement(string(c.text)) -} +SingleQuotedString <- + SingleQuoteStringStart + elements:SingleQuotedStringElements + SingleQuoteStringEnd { + return types.NewQuotedString(types.SingleQuote, elements.([]interface{})) + } -// ------------------------------------------ -// Cross References -// ------------------------------------------ -CrossReference <- InternalCrossReference / ExternalCrossReference +SingleQuotedStringElements <- + elements:(SingleQuotedStringElement)+ { + c.resetSpaceSuffixTracking() + return types.NewInlineElements(elements) + } -InternalCrossReference <- "<<" id:(Id) Space* "," label:(CrossReferenceLabel) ">>" { - return types.NewInternalCrossReference(id, label) -} / "<<" id:(Id) ">>" { - return types.NewInternalCrossReference(id, nil) -} +SingleQuoteStringStart <- "'`" ![ \t\r\n] -ExternalCrossReference <- "xref:" url:(FileLocation) inlineAttributes:(InlineAttributes) { - return types.NewExternalCrossReference(url.(types.Location), inlineAttributes.(types.Attributes)) -} +SingleQuoteStringEnd <- "`'" -CrossReferenceLabel <- ( - ([\pL0-9][^\r\n{<>]+ { // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references - return types.NewStringElement(string(c.text)) - }) / - AttrSub / - ("{" { +QuotedStringWord <- [\pL0-9]+ &(Space / SingleQuoteStringEnd) { return types.NewStringElement(string(c.text)) - }) - )+ - -// ------------------------------------------ -// Links -// ------------------------------------------ -Link <- RelativeLink / ExternalLink - -// url preceeding with `link:` MUST be followed by square brackets -RelativeLink <- "link:" url:(Location) inlineAttributes:(InlineAttributes) { - return types.NewInlineLink(url.(types.Location), inlineAttributes.(types.Attributes)) -} - -ExternalLink <- url:(LocationWithScheme) inlineAttributes:(InlineAttributes)? { - return types.NewInlineLink(url.(types.Location), inlineAttributes) -} + } -// ------------------------------------------ -// Images -// ------------------------------------------ -ImageBlock <- - &{ - // AttrPositional1 must not be set - return types.HasNotAttribute(c.globalStore.getAttributes(), types.AttrPositional1), nil +// We have to treat this one special, because of ambiguity with monospace markup. +SingleQuotedStringElement <- + !SingleQuoteStringEnd + element:( + QuotedStringWord + / Space !SingleQuoteStringEnd + / Newline !Newline // 2 newlines split the paragraph + / AttributeSubstitution + / SpecialCharacter + / InlineMacro + / LineBreak !SingleQuoteStringEnd + / Symbol + / QuotedTextInSingleQuotedString + / DoubleQuotedString + / SingleQuotedStringFallbackCharacter + ) { + c.trackSpaceSuffix(element) + return element, nil } - "image::" path:(Location) inlineAttributes:(InlineAttributes) Space* EOL { - // 'imagesdir' attribute is added after applying the attribute substitutions on the image location - return types.NewImageBlock(path.(types.Location), inlineAttributes.(types.Attributes), c.globalStore.getAttributes()) -} -InlineImage <- "image:" !":" path:(Location) inlineAttributes:(InlineAttributes) { - return types.NewInlineImage(path.(types.Location), inlineAttributes.(types.Attributes), c.globalStore["imagesdir"]) -} +QuotedTextInSingleQuotedString <- + attributes:(LongHandAttributes)? + text:(BoldText + / ItalicText + / (!"`'" element:(MonospaceText) { return element, nil}) + / SubscriptText + / SuperscriptText + / MarkedText) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -// ------------------------------------------------------------------------------------ -// Inline icons -// ------------------------------------------------------------------------------------ -InlineIcon <- "icon:" icon:([\pL0-9_-]+ { return string(c.text), nil }) attributes:(InlineAttributes) { - return types.NewIcon(icon.(string), attributes) -} +SingleQuotedStringFallbackCharacter <- [^\r\n\t `] / "`" !"'" { // ' + return types.NewStringElement(string(c.text)) + } -// ------------------------------------------------------------------------------------ -// Inline foot notes -// ------------------------------------------------------------------------------------ -InlineFootnote <- "footnote:[" content:(FootnoteContent) "]" { - return types.NewFootnote("", content.([]interface{})) -} / "footnote:" ref:(FootnoteRef) "[" content:(FootnoteContent)? "]" { - return types.NewFootnote(ref.(string), content) -} +DoubleQuotedString <- DoubleQuoteStringStart elements:DoubleQuotedStringElements DoubleQuoteStringEnd { + return types.NewQuotedString(types.DoubleQuote, elements.([]interface{})) + } -FootnoteRef <- Alphanums +DoubleQuotedStringElements <- elements:(DoubleQuotedStringElement+) { + c.resetSpaceSuffixTracking() + return types.NewInlineElements(elements) + } -FootnoteContent <- elements:(!"]" InlineElement)+ { // footnote content may span multiple lines - return types.NewInlineElements(elements.([]interface{})) -} +// We have to treat this one special, because of ambiguity with monospace markup. +DoubleQuotedStringElement <- + !DoubleQuoteStringEnd + element:( + QuotedStringWord + / Space !DoubleQuoteStringEnd + / Newline !Newline // 2 newlines split the paragraph + / LineBreak !SingleQuoteStringEnd + / AttributeSubstitution + / SpecialCharacter + / InlineMacro + / QuotedTextInDoubleQuotedString + / SingleQuotedString + / DoubleQuotedStringFallbackCharacter) { + c.trackSpaceSuffix(element) + return element, nil + } -// ------------------------------------------------------------------------------------ -// Callouts -// ------------------------------------------------------------------------------------ +QuotedTextInDoubleQuotedString <- + attributes:(LongHandAttributes)? + text:( + BoldText + / ItalicText + / (!"`\"" element:(MonospaceText) { return element, nil}) + / SubscriptText + / SuperscriptText + / MarkedText) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -Callout <- "<" ref:([0-9]+ { return strconv.Atoi(string(c.text)) }) ">" Space* &(EOL / Callout) { - return types.NewCallout(ref.(int)) -} +DoubleQuoteStringStart <- "\"`" ![ \t\r\n] -CalloutListItem <- ref:(CalloutListItemPrefix) description:(ListParagraph+) { - return types.NewCalloutListItem(ref.(int), description.([]interface{})) -} +DoubleQuoteStringEnd <- "`\"" -CalloutListItemPrefix <- "<" ref:([0-9]+ { return strconv.Atoi(string(c.text)) }) ">" Space+ { - return ref, nil -} +DoubleQuotedStringFallbackCharacter <- ([^\r\n\t `] / "`" !"\"") { + return types.NewStringElement(string(c.text)) + } // ------------------------------------------------------------------------------------- -// Thematic break +// Sections // ------------------------------------------------------------------------------------- +// we need to identify section titles to properly handle file inclusions with level offsets +Section <- + &{ + return !c.isWithinDelimitedBlock(), nil + } + level:(("=")+ { + // `=` is level 0, `==` is level 1, etc. + return (len(c.text)-1), nil + }) + &{ + // use a predicate to make sure that only `=` (level 0) to `======` (level 5) are allowed + return level.(int) <= 5, nil + } + Spaces title:(RawSectionTitle) EOL { + return types.NewRawSection(level.(int), title.([]interface{})) + } -// Thematic break -ThematicBreak <- ("***" / "* * *" / "---" / "- - -" / "___" / "_ _ _") EOL { - return types.NewThematicBreak() +RawSectionTitle <- [^\r\n]+ { // can't have empty title, that may collide with example block delimiter (`====`) + return []interface{}{ + types.RawLine(c.text), + }, nil } // ------------------------------------------------------------------------------------- -// -// Delimited blocks -// +// Substitutions // ------------------------------------------------------------------------------------- -DelimitedBlock <- !Alphanum // delimited blocks, even without attributes, never start with an alphanum - block:(FencedBlock - / ListingBlock - / ExampleBlock - / VerseBlock - / QuoteBlock - / SidebarBlock - / PassthroughBlock - / CommentBlock) { - return block, nil -} - -BlockDelimiter <- !(Alphanum) LiteralBlockDelimiter //TODO: use "start" delimiters - / FencedBlockDelimiter - / ListingBlockDelimiter - / ExampleBlockDelimiter - / CommentBlockDelimiter - / QuoteBlockDelimiter - / SidebarBlockDelimiter - / PassthroughBlockDelimiter - -// ------------------------------------------------------------------------------------- -// Example blocks -// ------------------------------------------------------------------------------------- -ExampleBlock <- - ExampleBlockStartDelimiter - blocks:(ExampleBlockRawContent) - ExampleBlockEndDelimiter - { - return types.NewExampleBlock(blocks.([]interface{}), c.globalStore.getAttributes()) +// Substitution group for 'attributes' only +AttributesGroup <- elements:( + Alphanums + / Space + / SpecialCharacter + / Quote + / InlinePassthrough + / AttributeSubstitution + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / AnyChar)+ EOF { + return types.NewInlineElements(elements) } -ExampleBlockDelimiter <- "====" Space* EOL - -ExampleBlockStartDelimiter <- "====" Space* EOL +// Substitution group element attributes +ElementAttributesGroup <- elements:( + InlineWord + / Space + / AttributeSubstitution + / Quote + / SpecialCharacter + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / AnyChar)+ EOF { + return types.NewInlineElements(elements) + } -ExampleBlockEndDelimiter <- ("====" Space* EOL) / EOF +// Default substitutions for Section Titles +HeaderGroup <- + elements:(HeaderGroupElement)+ EOF { + return types.NewInlineElements(elements) + } -ExampleBlockRawContent <- - elements:( - !ExampleBlockEndDelimiter - attributes:(BlockAttributes)? - #{ - c.globalStore.pushAttributes(attributes) - return nil - } - element:( - LabeledListItem // must appear before simple paragraph - / SimpleRawParagraph - / BlankLine - / ImageBlock - / ThematicBreak - / OrderedListItem - / UnorderedListItem - / ContinuedListItemElement - / FencedBlock - / ListingBlock - / VerseBlock - / QuoteBlock - / SidebarBlock - / SingleLineComment - / PassthroughBlock - / Table - / CommentBlock - / LiteralBlock - / RawParagraph - / ExampleBlockDelimiter { // for standalone attributes at the end of the delomited block - return types.NewStandaloneAttributes(c.globalStore.getAttributes()) // will be discarded anyways - } - ) { - c.globalStore.discardAttributes() +HeaderGroupElement <- + !EOF + element:( + InlineWord + / Space + / InlinePassthrough + / SpecialCharacter + / Quote + / Link + / InlineIcon + / AttributeSubstitution + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / Replacement + / ShortHandAnchor + / InlineFootnote + / AnyChar) { return element, nil } - )* { - return elements, nil - } -// ------------------------------------------------------------------------------------- -// Quote blocks -// ------------------------------------------------------------------------------------- -QuoteBlock <- - &{ - // AttrPositional1 may be missing or must be equal to `quote` - attrs := c.globalStore.getAttributes() - if types.HasNotAttribute(attrs, types.AttrPositional1) || - types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Quote) { - return true, nil - } - return false, nil - } - QuoteBlockStartDelimiter content:(QuoteBlockRawContent) QuoteBlockEndDelimiter { - return types.NewQuoteBlock(content.([]interface{}), c.globalStore.getAttributes()) +// Substitution group for 'macros' only +MacrosGroup <- elements:( + InlineWord + / InlineMacro + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / AnyChar)+ EOF { + return types.NewInlineElements(elements) } -QuoteBlockDelimiter <- "____" Space* EOL // same for verse blocks - -QuoteBlockStartDelimiter <- "____" Space* EOL // same for verse blocks - -QuoteBlockEndDelimiter <- ("____" Space* EOL) / EOF // same for verse blocks +// TODO: do we really need a grammar rule? can't we just skip substitutions? +// The 'none' substitution +NoneGroup <- elements:(NoneGroupElement)+ EOF { + return types.NewInlineElements(elements) + } -QuoteBlockRawContent <- - elements:( - !QuoteBlockEndDelimiter - attributes:(BlockAttributes)? - #{ - c.globalStore.pushAttributes(attributes) - return nil - } - element:(LabeledListItem // must appear before simple paragraph - / SimpleRawParagraph - / BlankLine - / ImageBlock - / ThematicBreak - / OrderedListItem - / UnorderedListItem - / ContinuedListItemElement - / FencedBlock - / ListingBlock - / VerseBlock - / ExampleBlock - / SidebarBlock - / SingleLineComment - / PassthroughBlock - / Table - / CommentBlock - / LiteralBlock - / RawParagraph - / QuoteBlockEndDelimiter { // for standalone attributes at the end of the delomited block - return types.NewStandaloneAttributes(c.globalStore.getAttributes()) // will be discarded anyways - } - ) { - c.globalStore.discardAttributes() +NoneGroupElement <- + !EOF + element:( + InlineWord + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / AnyChar)+ EOF { return element, nil } - )* { - return elements, nil - } - - -// ------------------------------------------------------------------------------------- -// Sidebar blocks -// ------------------------------------------------------------------------------------- -SidebarBlock <- SidebarBlockStartDelimiter content:(SidebarBlockRawContent) SidebarBlockEndDelimiter { - return types.NewSidebarBlock(content.([]interface{}), c.globalStore.getAttributes()) -} -SidebarBlockDelimiter <- "****" Space* EOL - -SidebarBlockStartDelimiter <- "****" Space* EOL - -SidebarBlockEndDelimiter <- ("****" Space* EOL) / EOF +// Default substitutions for Paragrapghs +// TODO: extract the substitutionContext once and check every rule choice here. Will also avoid setting "fake" context for BlockAttributes, SectionTitle, etc. +NormalGroup <- + elements:(NormalGroupElement)+ EOF { + c.resetSpaceSuffixTracking() + return types.NewInlineElements(elements) + } -SidebarBlockRawContent <- - elements:( - !SidebarBlockEndDelimiter - attributes:(BlockAttributes)? - #{ - c.globalStore.pushAttributes(attributes) - return nil - } - element:(LabeledListItem // must appear before simple paragraph - / SimpleRawParagraph - / BlankLine - / ImageBlock - / ThematicBreak - / OrderedListItem - / UnorderedListItem - / ContinuedListItemElement - / FencedBlock - / ListingBlock - / VerseBlock - / ExampleBlock - / QuoteBlock - / SingleLineComment - / PassthroughBlock - / Table - / CommentBlock - / LiteralBlock - / RawParagraph - / SidebarBlockEndDelimiter { // for standalone attributes at the end of the delomited block - return types.NewStandaloneAttributes(c.globalStore.getAttributes()) // will be discarded anyways - } - ) { - c.globalStore.discardAttributes() +NormalGroupElement <- + !EOF + element:( + InlineWord + / Space + / Newline + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / LineBreak + / Punctuation + / Quote + / InlinePassthrough + / InlineMacro // must be before 'specialcharacter' (because of 'crossreference') + / SpecialCharacter + / AttributeSubstitution + / Symbol + / AnyChar) { + c.trackSpaceSuffix(element) return element, nil } - )* { - return elements, nil +PostReplacementsGroup <- + elements:(PostReplacementsGroupElement)+ EOF { + c.resetSpaceSuffixTracking() + return types.NewInlineElements(elements) } -// ------------------------------------------------------------------------------------- -// Fenced blocks -// ------------------------------------------------------------------------------------- -FencedBlock <- FencedBlockStartDelimiter content:(FencedBlockRawContent) FencedBlockEndDelimiter { - return types.NewFencedBlock(content.([]interface{}), c.globalStore.getAttributes()) -} - -FencedBlockDelimiter <- "```" Space* EOL // Deprecated: use 'FencedBlockStartDelimiter' instead - -FencedBlockStartDelimiter <- "```" Space* EOL - -FencedBlockEndDelimiter <- ("```" Space* EOL) / EOF - -FencedBlockRawContent <- (!FencedBlockEndDelimiter line:(RawLine) { - return line, nil -})* - -// ------------------------------------------------------------------------------------- -// Listing blocks -// ------------------------------------------------------------------------------------- -ListingBlock <- ListingBlockStartDelimiter content:(ListingBlockRawContent) ListingBlockEndDelimiter { - return types.NewListingBlock(content.([]interface{}), c.globalStore.getAttributes()) -} +PostReplacementsGroupElement <- + !EOF + element:( + InlineWord + / Space + / LineBreak + / Newline + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / AnyChar) { + c.trackSpaceSuffix(element) + return element, nil + } -ListingBlockDelimiter <- "----" Space* EOL +// Substitution group for 'quotes' only +QuotesGroup <- elements:( + InlineWord + / Quote + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / AnyChar)+ EOF { + return types.NewInlineElements(elements) + } -ListingBlockStartDelimiter <- "----" Space* EOL +// Substitution group for 'replacements' only +ReplacementsGroup <- elements:( + InlineWord + / Replacement + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / AnyChar)+ EOF { + return types.NewInlineElements(elements) + } -ListingBlockEndDelimiter <- ("----" Space* EOL) / EOF +// Substitution group for 'specialcharacters' (or 'specialchars') only +SpecialCharactersGroup <- elements:( + InlineWord + / SpecialCharacter + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / AnyChar)+ EOF { + return types.NewInlineElements(elements) + } -ListingBlockRawContent <- (!ListingBlockEndDelimiter line:(RawLine) { - return line, nil -})* +VerbatimGroup <- elements:( + InlineWord + / Callout // must be placed before SpecialCharacter + / SpecialCharacter + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / AnyChar)+ EOF { + return types.NewInlineElements(elements) + } + +InlineMacro <- + // check if enabled with the current substitution context + &{ + return c.isSubstitutionEnabled(Macros) + } + element:( + InlineIcon + / InlineImage + / Link + / InlinePassthrough + / InlineFootnote + / CrossReference + / InlineUserMacro + / InlineElementID + / ConcealedIndexTerm + / IndexTerm + / InlineUserMacro) { + return element, nil + } -// ------------------------------------------------------------------------------------- -// Verse blocks -// ------------------------------------------------------------------------------------- -VerseBlock <- +InlinePassthrough <- + // check if enabled with the current substitution context &{ - // AttrPositional1 must be equal to `verse` - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Verse), nil + return c.isSubstitutionEnabled(InlinePassthroughs) } - QuoteBlockStartDelimiter content:(VerseBlockRawContent) QuoteBlockEndDelimiter { - return types.NewVerseBlock(content.([]interface{}), c.globalStore.getAttributes()) + element:( + TriplePlusPassthrough / SinglePlusPassthrough / PassthroughMacro + ) { + return element, nil } -VerseBlockRawContent <- (!QuoteBlockEndDelimiter line:(RawLine) { - return line, nil -})* - -// ------------------------------------------------------------------------------------- -// Passthrough blocks -// ------------------------------------------------------------------------------------- -PassthroughBlock <- PassthroughBlockStartDelimiter content:(PassthroughBlockRawContent) PassthroughBlockEndDelimiter { - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) -} - -PassthroughBlockDelimiter <- "++++" Space* EOL - -PassthroughBlockStartDelimiter <- "++++" Space* EOL +Quote <- + // check if enabled with the current substitution context + &{ + return c.isSubstitutionEnabled(Quotes) + } + element:( + QuotedText + / QuotedString) { + return element, nil + } -PassthroughBlockEndDelimiter <- ("++++" Space* EOL) / EOF +Replacement <- + // check if enabled with the current substitution context + &{ + return c.isSubstitutionEnabled(Replacements) + } + element:( + Symbol + ) { + return element, nil + } -PassthroughBlockRawContent <- (!PassthroughBlockEndDelimiter line:(RawLine) { - return line, nil -})* +SpecialCharacter <- + // check if enabled with the current substitution context + &{ + return c.isSubstitutionEnabled(SpecialCharacters) + } + element:( + // if we have a InternalCrossReference we just return a StringElement. + InternalCrossReference { + return types.NewStringElement(string(c.text)) + } + / ("<" / ">" / "&" ) { + return types.NewSpecialCharacter(string(c.text)) + }) { + return element, nil + } // ------------------------------------------------------------------------------------- -// Comment blocks +// Single Line Comment // ------------------------------------------------------------------------------------- -CommentBlockDelimiter <- "////" Space* EOL - -CommentBlockStartDelimiter <- "////" Space* EOL - -CommentBlockEndDelimiter <- ("////" Space* EOL) / EOF - -CommentBlock <- CommentBlockStartDelimiter content:(CommentBlockRawContent) CommentBlockEndDelimiter { - return types.NewCommentBlock(content.([]interface{}), nil) -} - -CommentBlockRawContent <- (!CommentBlockEndDelimiter line:(RawLine) { - return line, nil -})* +SingleLineComment <- SingleLineCommentDelimiter content:(SingleLineCommentContent) EOL { + return types.NewSingleLineComment(content.(string)) + } -SingleLineComment <- !CommentBlockDelimiter "//" content:(SingleLineCommentContent) EOL { - return types.NewSingleLineComment(content.(string)) -} +// can be `//` but not `////` (comment block delimiter) +SingleLineCommentDelimiter <- "//" !"//" SingleLineCommentContent <- [^\r\n]* { - return string(c.text), nil -} + return string(c.text), nil + } // ------------------------------------------------------------------------------------- -// DelimitedBlock and Paragraph Substitutions (standalone rules) +// Symbols // ------------------------------------------------------------------------------------- +Symbol <- Apostrophe / Copyright / Trademark / Registered / Ellipsis / ImpliedApostrophe -InlineMacros <- - InlineIcon - / InlineImage - / Link - / InlinePassthrough - / InlineFootnote - / CrossReference - / InlineUserMacro - / InlineElementID - / ConcealedIndexTerm - / IndexTerm - -ElementPlaceHolder <- "\uFFFD" ref:([0-9]+ { return string(c.text), nil }) "\uFFFD" { - return types.NewElementPlaceHolder(ref.(string)) -} - -// internal rule to detect passthrough blocks before other substitutions are applied -InlinePassthroughSubs <- - (InlinePassthrough - / InlineWord // more permissive than the 'Word' rule - / ElementPlaceHolder - / Space+ - / AnyChar - / Newline)* EOF +Apostrophe <- "`'" { + return types.NewStringElement("\u2019") + } -// standalone rule for the "specialcharacters" substitution when callouts should be processed as special characters -SpecialCharacterSubs <- - (InlineWord // more permissive than the 'Word' rule - / SpecialCharacter - / ElementPlaceHolder - / Space+ - / AnyChar - / Newline)* EOF - -// standalone rule for the "quotes" substitution -QuotedTextSubs <- - (InlineWord // more permissive than the 'Word' rule // TODO: find something even more permissive, based on QuotedText/QuotedString delimiters - / Space+ - / QuotedText - / QuotedString - / ElementPlaceHolder - / AnyChar - / Newline)* EOF +RawApostrophe <- "`'" // no conversion -// standalone rule for the "attributes" substitution -AttributeSubs <- - (InlineWord // more permissive than the 'Word' rule - / Space+ - / AttributeSubstitution - / ElementPlaceHolder - / AnyChar - / Newline)* EOF - -// standalone rule for the "macros" substitution -InlineMacroSubs <- - (InlineWord // more permissive than the 'Word' rule - / Space+ - / InlineMacros - / ElementPlaceHolder - / AnyChar - / Newline)* EOF +Copyright <- "(C)" { + return types.NewStringElement("\u00a9") + } -// standalone rule for the "macros" substitution for Markdown Quote blocks -MarkdownQuoteMacroSubs <- lines:(MarkdownQuoteLine)* EOF { - return types.NewParagraph(lines.([]interface{}), nil) -} +Trademark <- "(TM)" { + return types.NewStringElement("\u2122") + } -MarkdownQuoteLine <- - elements:(InlineWord // more permissive than the 'Word' rule - / Space+ - / InlineMacros - / ElementPlaceHolder - / AnyChar)+ EOL { - return types.NewInlineElements(elements.([]interface{})) +Registered <- "(R)" { + return types.NewStringElement("\u00ae") } -MarkdownQuoteAttribution <- "-- " author:(([^\r\n]+) { - return string(c.text), nil - }) EOL { - return author, nil -} +Ellipsis <- "..." { + return types.NewStringElement("\u2026\u200b") + } -// standalone rule for the "replacements" substitution -ReplacementSubs <- - (InlineWord // more permissive than the 'Word' rule - / Space+ - / Symbol - / ElementPlaceHolder - / AnyChar - / Newline)* EOF +// The implied apostrophe is used in interior words, and intended to help +// cases like "mother's day". asciidoctor requires that it be followed by +// a letter (not a digit) but it can have a digit just before it. -// standalone rule for the "post_replacements" substitution -// TODO: simplify as we only need to search for LineBreak at the end of the line? -PostReplacementSubs <- - (InlineWord // more permissive than the 'Word' rule - / ElementPlaceHolder - / LineBreak // must be before `Space+` - / Space+ - / AnyChar - / Newline)* EOF - -// standalone rule for the "callouts" substitution -CalloutSubs <- - (InlineWord // more permissive than the 'Word' rule - / ElementPlaceHolder - / Space+ - / Callout - / AnyChar - / Newline)* EOF - -// standalone rule for the "none" substitution -NoneSubs <- ( - ElementPlaceHolder - / (!EOF [^\r\n]* EOL { // just text, including empty lines - return types.NewStringElement(string(c.text)) - }))* EOF +ImpliedApostrophe <- Alphanum "'" &[\pL] { + return types.NewStringElement(string(c.text[:1])+"\u2019") + } // ------------------------------------------------------------------------------------- // Tables // ------------------------------------------------------------------------------------- -Table <- TableDelimiter - header:(TableLineHeader)? - lines:(TableLine)* - (TableDelimiter / EOF) { // end delimiter or end of file - return types.NewTable(header, lines.([]interface{}), c.globalStore.getAttributes()) +Table <- + TableStartDelimiter + header:(TableHeader)? + rows:(TableRow)* + TableEndDelimiter { + return types.NewTable(header, rows.([]interface{})) } -TableCellSeparator <- "|" Space* - -TableDelimiter <- "|===" Space* EOL - -// table line header is a line followed by a blankline -TableLineHeader <- !TableDelimiter cells:(TableCell)+ EOL BlankLine { - return types.NewTableLine(cells.([]interface{})) -} +TableDelimiter <- "|===" Space* EOL -TableLine <- !TableDelimiter cells:(TableCell)+ EOL BlankLine* { - return types.NewTableLine(cells.([]interface{})) -} +TableStartDelimiter <- TableDelimiter -TableCell <- TableCellSeparator elements:(!TableCellSeparator !EOL Space* InlineElement Space*)+ { - return types.NewInlineElements(elements) -} +TableEndDelimiter <- TableDelimiter / EOF -// ------------------------------------------------------------------------------------- -// Literal Blocks (see http://asciidoctor.org/docs/user-manual/#literal-text-and-blocks) -// ------------------------------------------------------------------------------------- -LiteralBlock <- ParagraphWithLiteralAttribute / ParagraphWithHeadingSpaces / ParagraphWithLiteralBlockDelimiter +TableHeader <- + // header cells MUST be on the same line + cells:(HeaderCell)+ EOL + BlankLine+ { + return types.NewTableRow(cells.([]interface{})) + } -LiteralBlockDelimiter <- "...." +HeaderCell <- + "|" Space* + content:(CellContent?) { + return types.NewTableCell(content.(types.RawContent)) + } -// paragraph indented with one or more spaces on the first line -ParagraphWithHeadingSpaces <- lines:(ParagraphWithHeadingSpacesLines) { - return types.NewLiteralBlock(types.LiteralBlockWithSpacesOnFirstLine, lines.([]interface{}), c.globalStore.getAttributes()) -} +TableRow <- MultiLineTableRow / SingleLineTableRow -// first line MUST start with one (or more) space. Stop when reaching a blank line -ParagraphWithHeadingSpacesLines <- - firstLine:(ParagraphWithHeadingSpacesLine) - otherLines:(LiteralParagraphLine)* { - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil -} +SingleLineTableRow <- + !TableEndDelimiter + cells:(TableCell)+ EOL + BlankLine* { + return types.NewTableRow(cells.([]interface{})) + } -ParagraphWithHeadingSpacesLine <- line:(Space+ [^\r\n]+ { - return types.NewRawLine(string(c.text)) - }) EOL { // do not include the trailing 'EOL' on the first line - return line, nil -} +MultiLineTableRow <- + !TableEndDelimiter + cells:(cell:(TableCell) EOL { + return cell, nil + })+ + (BlankLine+ / &TableEndDelimiter) // last series of cells may not be followed by a blankline + { + return types.NewTableRow(cells.([]interface{})) + } -// paragraph with the literal block delimiter (`....`) -ParagraphWithLiteralBlockDelimiter <- LiteralBlockDelimiter Space* Newline lines:(ParagraphWithLiteralBlockDelimiterLines) ((LiteralBlockDelimiter Space* EOL) / EOF) { - return types.NewLiteralBlock(types.LiteralBlockWithDelimiter, lines.([]interface{}), c.globalStore.getAttributes()) -} +TableCell <- + !TableEndDelimiter + !BlankLine + "|" Space* content:(CellContent?) // TODO: also support cell styles + { + return types.NewTableCell(content.(types.RawContent)) + } -// include all lines until delimiter is reached -ParagraphWithLiteralBlockDelimiterLines <- lines:(ParagraphWithLiteralBlockDelimiterLine)* { - return lines.([]interface{}), nil -} +CellContent <- + content:([^\r\n|]+ { + return string(c.text), nil + }) { + return types.NewRawContent(content.(string)) + } -ParagraphWithLiteralBlockDelimiterLine <- - line:(!LiteralBlockDelimiter [^\r\n]* { - return types.NewRawLine(string(c.text)) - }) EOL { - return line, nil // do not include the trailing 'EOL' -} +// rule for the optional `cols` attribute on a Table +TableColumnsAttribute <- cols:(Column)* EOF { + return cols, nil + } -// paragraph with the literal attribute (`[literal]`) -ParagraphWithLiteralAttribute <- +Column <- + !EOF + // TODO: `multiplier` and `weight` with multiple digits and max values + // TODO: also support column styles + multiplier:(n:Number "*" { return n, nil })? + halign:( + "<" { return types.HAlignLeft, nil } + / ">" { return types.HAlignRight, nil } + / "^" { return types.HAlignCenter, nil } + )? + valign:( + ".<" { return types.VAlignTop, nil } + / ".>" { return types.VAlignBottom, nil } + / ".^" { return types.VAlignMiddle, nil } + )? + weight:(Number / ("~" { return string(c.text), nil }))? + style:([adehlms] { return string(c.text), nil })? + // style:(("a" / "e" / "h" / "l" / "m" / "s") { return string(c.text), nil })? + comma:(",")? &{ - attrs := c.globalStore.getAttributes() - return types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Literal), nil + // make sure that at least something was set + // (otherwise the parser will run indefinitely) + return multiplier != nil || + halign != nil || + valign != nil || + weight != nil || + style != nil || + comma != nil, nil } - lines:(LiteralParagraphLine)+ { - return types.NewLiteralBlock(types.LiteralBlockWithAttribute, lines.([]interface{}), c.globalStore.getAttributes()) + { + return types.NewTableColumn(multiplier, halign, valign, weight, style) } -LiteralKind <- "literal" { - return string(c.text), nil -} - -LiteralParagraphLine <- !BlankLine content:([^\r\n]+ { - return types.NewRawLine(string(c.text)) -}) EOL { - return content, nil // do not include the trailing 'EOL' -} - -// ------------------------------------------ -// Index Terms -// ------------------------------------------ -IndexTerm <- "((" term:(IndexTermContent) "))" { - return types.NewIndexTerm(term.([]interface{})) -} - -IndexTermContent <- elements:(Word / QuotedString / QuotedText / Space / SpecialCharacter / ElementPlaceHolder / (!"))" .) { - return string(c.text), nil -})+ { - return types.NewInlineElements(elements.([]interface{})) -} - -ConcealedIndexTerm <- "(((" term1:(ConcealedIndexTermContent) - term2:(Space* "," Space* content:(ConcealedIndexTermContent) { return content, nil })? - term3:(Space* "," Space* content:(ConcealedIndexTermContent) { return content, nil })? - ")))" { - return types.NewConcealedIndexTerm(term1, term2, term3) +// ------------------------------------------------------------------------------------- +// Thematic break +// ------------------------------------------------------------------------------------- +ThematicBreak <- ("***" / "* * *" / "---" / "- - -" / "___" / "_ _ _") EOF { // TODO: Space* before EOF + return types.NewThematicBreak() } -ConcealedIndexTermContent <- (Alphanum / Space)+ { - return string(c.text), nil -} - -// ------------------------------------------ -// BlankLine -// ------------------------------------------ -BlankLine <- !EOF Space* EOL { - return types.NewBlankLine() -} - -// ------------------------------------------ -// Symbols -// ------------------------------------------ - -Symbol <- Apostrophe / Copyright / Trademark / Registered / Ellipsis / ImpliedApostrophe - -Apostrophe <- "`'" { - return types.NewStringElement("\u2019") -} - -RawApostrophe <- "`'" // no conversion - -Copyright <- "(C)" { - return types.NewStringElement("\u00a9") -} -Trademark <- "(TM)" { - return types.NewStringElement("\u2122") -} -Registered <- "(R)" { - return types.NewStringElement("\u00ae") -} -Ellipsis <- "..." { - return types.NewStringElement("\u2026\u200b") -} - -// The implied apostrophe is used in interior words, and intended to help -// cases like "mother's day". asciidoctor requires that it be followed by -// a letter (not a digit) but it can have a digit just before it. +// ------------------------------------------------------------------------------------- +// User Macro +// ------------------------------------------------------------------------------------- +UserMacroBlock <- + name:(UserMacroName) + &{ + // skip if no macro was registered under the given name + return c.globalStore.hasUserMacro(name.(string)), nil + } + "::" + value:(UserMacroValue) + inlineAttributes:(InlineAttributes) EOL { + return types.NewUserMacroBlock(name.(string), value.(string), inlineAttributes.(types.Attributes), string(c.text)) + } -ImpliedApostrophe <- Alphanum "'" &[\pL] { - return types.NewStringElement(string(c.text[:1])+"\u2019") -} +InlineUserMacro <- + name:(UserMacroName) + &{ + // skip if no macro was registered under the given name + return c.globalStore.hasUserMacro(name.(string)), nil + } + ":" + value:(UserMacroValue) + inlineAttributes:(InlineAttributes) { + return types.NewInlineUserMacro(name.(string), value.(string), inlineAttributes.(types.Attributes), string(c.text)) + } -// ------------------------------------------------------------------------------------ -// Special Characters -// They need to be identified as they may have a special treatment during the rendering -// ------------------------------------------------------------------------------------ +UserMacroName <- ([\pL0-9_-]+) { + return string(c.text), nil + } -SpecialCharacter <- InternalCrossReference { - // if we have a InternalCrossReference we just return a StringElement. - return types.NewStringElement(string(c.text)) - } / ("<" / ">" / "&" ) { - return types.NewSpecialCharacter(string(c.text)) +UserMacroValue <- [^:[ \r\n]* { + return string(c.text), nil } -// ------------------------------------------ +// ------------------------------------------------------------------------------------- // Base Types -// ------------------------------------------ +// ------------------------------------------------------------------------------------- Alphanum <- [\pL0-9] Parenthesis <- "(" / ")" / "[" / "]" / "{" / "}" Alphanums <- [\pL0-9]+ { - return string(c.text), nil -} + return string(c.text), nil + } Word <- - // very straightforward content: alphanums followed by attached simple quote delimiter and more characters + // very straightforward content: alphanums followed by attached single quote delimiter and more characters // (in this case, the quoted text delimiters are intepreted as regular characters) // then followed by spaces but not the "+" signs because it needs a heading space to become a LineBreak element - [\pL0-9]+ &([\r\n ,\]] / EOF) { + [\pL0-9]+ &([\r\n ,\]] / EOF) { return types.NewStringElement(string(c.text)) } / [\pL0-9]+ ([=*_`] [\pL0-9]+)+ { // allow ` return types.NewStringElement(string(c.text)) } -InlineWord <- // same as word, but may also contain some punctuation markers - [\pL0-9,?!;]+ &([\r\n ] / EOF) { + +// InlineWord <- +// // same as word, but: +// // - may also contain some punctuation markers +// // - must be followed by space / newline / EOF / ElementPlaceHolder delimiter (not consumed) +// content:([\pL0-9,?!;]+ { +// return types.NewStringElement(string(c.text)) +// }) +// &(Space / "." / Alphanum / ElementPlaceHolderDelimiter / EOL) { +// return content, nil +// } +// / Word +// / Punctuation + +InlineWord <- + [\pL0-9,;!?]+ + (Space / &("." / ElementPlaceHolderDelimiter / EOL)) { return types.NewStringElement(string(c.text)) - } / Word + } + + +Punctuation <- ("." / "," / ";" / "!" / "?") &(Space / EOL) { + return string(c.text), nil +} // this is a fall-back rule in case all preceeding rules failed to match the current content. -AnyChar <- [^\r\n] { - return types.NewStringElement(string(c.text)) -} +// AnyChar <- [^\r\n] { +AnyChar <- . { + return types.NewStringElement(string(c.text)) + } FileLocation <- path:(Filename / ElementPlaceHolder)+ { - return types.NewLocation("", path.([]interface{})) -} + return types.NewLocation("", path.([]interface{})) + } Location <- scheme:(Scheme)? path:(Filename / ElementPlaceHolder)+ { - return types.NewLocation(scheme, path.([]interface{})) -} + return types.NewLocation(scheme, path.([]interface{})) + } -LocationWithScheme <- scheme:(Scheme) path:(Filename / ElementPlaceHolder)+ { - return types.NewLocation(scheme, path.([]interface{})) -} +LocationWithScheme <- !"[" scheme:(Scheme) path:(Filename / ElementPlaceHolder)+ { + return types.NewLocation(scheme, path.([]interface{})) + } -Filename <- ([^\r\n[\]\uFFFD ])+ { // not supported for now: EOL, space, "[", "]" - return types.NewStringElement(string(c.text)) -} +Filename <- elements:( + ([^\r\n[\]\uFFFD&<>{ ])+ { // not supported for now: EOL, space, "{", "[", "]" + return types.NewStringElement(string(c.text)) + } + / AttributeSubstitution + / SpecialCharacter + // / ElementPlaceHolder + / "{" { + return types.NewStringElement(string(c.text)) + })+ { + return types.NewInlineElements(elements.([]interface{})) + } Scheme <- "http://" / "https://" / "ftp://" / "irc://" / "mailto:" Id <- [^[\]<>,]+ { // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil -} + return string(c.text), nil + } Digit <- [0-9] { - return string(c.text), nil -} + return string(c.text), nil + } -Number <- "-"? Digit+ { - return strconv.Atoi(string(c.text)) -} +Number <- ("-"? Digit+) { + return strconv.Atoi(string(c.text)) + } + +Space <- (" " / "\t") { + log.Debug("matched single space") + return string(c.text), nil + } -Space <- " " / "\t" { +Spaces <- (" " / "\t")+ { + log.Debug("matched multiple spaces") + return string(c.text), nil + } + +Newline <- ("\n" / "\r\n" / "\r") { // TODO: just use "\n" return string(c.text), nil } -Newline <- "\r\n" / "\r" / "\n" - EOF <- !. +// TODO: remove and use `EOF` instead? EOL <- Newline / EOF \ No newline at end of file diff --git a/pkg/parser/parser_ext.go b/pkg/parser/parser_ext.go new file mode 100644 index 00000000..97355c83 --- /dev/null +++ b/pkg/parser/parser_ext.go @@ -0,0 +1,154 @@ +package parser + +import ( + "errors" + "fmt" + "sort" + "strings" + + "github.com/bytesparadise/libasciidoc/pkg/types" + "github.com/davecgh/go-spew/spew" + log "github.com/sirupsen/logrus" +) + +// extra methods for the parser + +func (p *parser) setup(g *grammar) (err error) { + if len(g.rules) == 0 { + p.addErr(errNoRule) + return p.errs.err() + } + + // TODO : not super critical but this could be generated + p.buildRulesTable(g) + + if p.recover { + // panic can be used in action code to stop parsing immediately + // and return the panic as an error. + defer func() { + if e := recover(); e != nil { + switch e := e.(type) { + case error: + p.addErr(e) + default: + p.addErr(fmt.Errorf("%v", e)) + } + err = p.errs.err() + } + }() + } + p.read() // advance to first rune + + return p.errs.err() +} + +// TODO: return immediately if end of doc was reached? (would simplify the grammar, avoiding to check for !EOF before parsing a new element) +func (p *parser) next() (val interface{}, err error) { + if p.pt.offset == len(p.data) { + log.Debugf("reached end of document") + return nil, nil + } + if p.recover { + // panic can be used in action code to stop parsing immediately + // and return the panic as an error. + defer func() { + if e := recover(); e != nil { + val = nil + switch e := e.(type) { + case error: + p.addErr(e) + default: + p.addErr(fmt.Errorf("%v", e)) + } + err = p.errs.err() + } + }() + } + startRule, ok := p.rules[p.entrypoint] + if !ok { + log.Errorf("invalid entrypoint: '%s'", p.entrypoint) + p.addErr(errInvalidEntrypoint) + return nil, p.errs.err() + } + + val, ok = p.parseRule(startRule) + if !ok { + if len(*p.errs) == 0 { + // If parsing fails, but no errors have been recorded, the expected values + // for the farthest parser position are returned as error. + maxFailExpectedMap := make(map[string]struct{}, len(p.maxFailExpected)) + for _, v := range p.maxFailExpected { + maxFailExpectedMap[v] = struct{}{} + } + expected := make([]string, 0, len(maxFailExpectedMap)) + eof := false + if _, ok := maxFailExpectedMap["!."]; ok { + delete(maxFailExpectedMap, "!.") + eof = true + } + for k := range maxFailExpectedMap { + expected = append(expected, k) + } + sort.Strings(expected) + if eof { + expected = append(expected, "EOF") + } + p.addErrAt(errors.New("no match found, expected: "+listJoin(expected, ", ", "or")), p.maxFailPos, expected) + } + + return nil, p.errs.err() + } + return val, p.errs.err() +} + +const spaceSuffixTrackingKey = "space_suffix_tracking" + +func (c *current) trackSpaceSuffix(element interface{}) { + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("tracking space at the end of:\n%s", spew.Sdump(element)) + } + switch e := element.(type) { + case string: + c.globalStore[spaceSuffixTrackingKey] = strings.HasSuffix(e, " ") + case *types.StringElement: + c.globalStore[spaceSuffixTrackingKey] = strings.HasSuffix(e.Content, " ") + default: + delete(c.state, spaceSuffixTrackingKey) + } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("space suffix detected: %t", c.globalStore[spaceSuffixTrackingKey]) + } +} + +func (c *current) isPreceededBySpace() bool { + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("checking if element ends with space: %t", c.globalStore[spaceSuffixTrackingKey]) + } + s, ok := c.globalStore[spaceSuffixTrackingKey].(bool) + return ok && s +} + +func (c *current) resetSpaceSuffixTracking() { + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("resetting space suffix tracking") + } + delete(c.globalStore, spaceSuffixTrackingKey) +} + +// verifies that the content does not end with a space +func validateSingleQuoteElements(elements []interface{}) (bool, error) { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("checking that there is no space at the end of:\n%s", spew.Sdump(elements)) + // } + if len(elements) == 0 { + return true, nil + } + switch s := elements[len(elements)-1].(type) { + case *types.StringElement: + return !strings.HasSuffix(s.Content, " "), nil + case string: + return !strings.HasSuffix(s, " "), nil + default: + return true, nil + } +} diff --git a/pkg/parser/parser_storedict.go b/pkg/parser/parser_storedict.go index 0d6548a0..33a51254 100644 --- a/pkg/parser/parser_storedict.go +++ b/pkg/parser/parser_storedict.go @@ -10,22 +10,6 @@ const attributesKey = "attributes" const usermacrosKey = "user_macros" -func (c storeDict) pushAttributes(value interface{}) { - if s, ok := c[attributesKey].(*stack); ok { - s.push(value) - return - } - s := newStack() - s.push(value) - c[attributesKey] = s -} - -func (c storeDict) discardAttributes() { - if s, ok := c[attributesKey].(*stack); ok { - s.pop() - } -} - func (c storeDict) getAttributes() interface{} { if s, ok := c[attributesKey].(*stack); ok { return s.get() @@ -38,5 +22,6 @@ func (c storeDict) hasUserMacro(name string) bool { _, exists := macros[name] return exists } + // log.Debugf("no user macro registered") return false } diff --git a/pkg/parser/passthrough_test.go b/pkg/parser/passthrough_test.go index 8cbec7ce..ceb05863 100644 --- a/pkg/parser/passthrough_test.go +++ b/pkg/parser/passthrough_test.go @@ -10,23 +10,21 @@ import ( var _ = Describe("passthroughs", func() { - Context("final documents", func() { + Context("in final documents", func() { Context("tripleplus inline passthrough", func() { It("tripleplus inline passthrough with words", func() { source := `+++hello, world+++` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{ - Content: "hello, world", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{ + Content: "hello, world", }, }, }, @@ -39,15 +37,13 @@ var _ = Describe("passthroughs", func() { It("tripleplus empty passthrough ", func() { source := `++++++` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{}, }, }, }, @@ -60,20 +56,22 @@ var _ = Describe("passthroughs", func() { source := `:hello: HELLO +++ {hello}, world +++` // attribute susbsitution must not occur - expected := types.Document{ - Attributes: types.Attributes{ - "hello": "HELLO", - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // "hello": "HELLO", + // }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{ - Content: " {hello}, world ", - }, + &types.AttributeDeclaration{ + Name: "hello", + Value: "HELLO", + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{ + Content: " {hello}, world ", }, }, }, @@ -86,17 +84,15 @@ var _ = Describe("passthroughs", func() { It("tripleplus inline passthrough with spaces aned nested quoted text", func() { source := `+++ *hello*, world +++` // macro susbsitution must not occur - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{ - Content: " *hello*, world ", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{ + Content: " *hello*, world ", }, }, }, @@ -109,17 +105,15 @@ var _ = Describe("passthroughs", func() { It("tripleplus inline passthrough with only spaces", func() { source := `+++ +++` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{ - Content: " ", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{ + Content: " ", }, }, }, @@ -132,17 +126,15 @@ var _ = Describe("passthroughs", func() { It("tripleplus inline passthrough with line breaks", func() { source := "+++\nhello,\nworld\n+++" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{ - Content: "\nhello,\nworld\n", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{ + Content: "\nhello,\nworld\n", }, }, }, @@ -155,22 +147,20 @@ var _ = Describe("passthroughs", func() { It("tripleplus inline passthrough in paragraph", func() { source := `The text +++underline & me+++ is underlined.` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "The text "}, - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{ - Content: "underline & me", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "The text "}, + &types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{ + Content: "underline & me", }, }, - types.StringElement{Content: " is underlined."}, }, + &types.StringElement{Content: " is underlined."}, }, }, }, @@ -180,17 +170,15 @@ var _ = Describe("passthroughs", func() { It("tripleplus inline passthrough with embedded image", func() { source := `+++image:foo.png[]+++` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{ - Content: "image:foo.png[]", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{ + Content: "image:foo.png[]", }, }, }, @@ -207,17 +195,15 @@ var _ = Describe("passthroughs", func() { It("singleplus passthrough with words", func() { source := `+hello, world+` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlinePassthrough{ - Kind: types.SinglePlusPassthrough, - Elements: []interface{}{ - types.StringElement{ - Content: "hello, world", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ + Kind: types.SinglePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{ + Content: "hello, world", }, }, }, @@ -230,14 +216,12 @@ var _ = Describe("passthroughs", func() { It("singleplus empty passthrough", func() { source := `++` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "++", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "++", }, }, }, @@ -248,17 +232,15 @@ var _ = Describe("passthroughs", func() { It("singleplus passthrough with embedded image", func() { source := `+image:foo.png[]+` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlinePassthrough{ - Kind: types.SinglePlusPassthrough, - Elements: []interface{}{ - types.StringElement{ - Content: "image:foo.png[]", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ + Kind: types.SinglePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{ + Content: "image:foo.png[]", }, }, }, @@ -271,27 +253,25 @@ var _ = Describe("passthroughs", func() { It("invalid singleplus passthrough with spaces - case 1", func() { source := `+*hello*, world +` // invalid: space before last `+` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "+", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "hello", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "+", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "hello", }, }, - types.StringElement{ - Content: ", world", - }, - types.LineBreak{}, }, + &types.StringElement{ + Content: ", world", + }, + &types.LineBreak{}, }, }, }, @@ -301,25 +281,23 @@ var _ = Describe("passthroughs", func() { It("invalid singleplus passthrough with spaces - case 2", func() { source := `+ *hello*, world+` // invalid: space after first `+` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "+ ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "hello", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "+ ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "hello", }, }, - types.StringElement{ - Content: ", world+", - }, + }, + &types.StringElement{ + Content: ", world+", }, }, }, @@ -330,27 +308,25 @@ var _ = Describe("passthroughs", func() { It("invalid singleplus passthrough with spaces - case 3", func() { source := `+ *hello*, world +` // invalid: spaces within - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "+ ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "hello", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "+ ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "hello", }, }, - types.StringElement{ - Content: ", world", - }, - types.LineBreak{}, }, + &types.StringElement{ + Content: ", world", + }, + &types.LineBreak{}, }, }, }, @@ -360,19 +336,12 @@ var _ = Describe("passthroughs", func() { It("invalid singleplus passthrough with line break", func() { source := "+hello,\nworld+" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "+hello,", - }, - }, - { - types.StringElement{ - Content: "world+", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "+hello,\nworld+", }, }, }, @@ -384,25 +353,23 @@ var _ = Describe("passthroughs", func() { Context("invalid cases", func() { It("invalid singleplus passthrough in paragraph", func() { source := `The text + *hello*, world + is not passed through.` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "The text + ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "hello", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "The text + ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "hello", }, }, - types.StringElement{ - Content: ", world + is not passed through.", - }, + }, + &types.StringElement{ + Content: ", world + is not passed through.", }, }, }, @@ -422,19 +389,18 @@ var _ = Describe("passthroughs", func() { It("passthrough macro with single word", func() { source := `pass:[hello]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.InlinePassthrough{ + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ Kind: types.PassthroughMacro, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "hello", }, }, }, - }, }, }, }, @@ -444,19 +410,18 @@ var _ = Describe("passthroughs", func() { It("passthrough macro with words", func() { source := `pass:[hello, world]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.InlinePassthrough{ + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ Kind: types.PassthroughMacro, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "hello, world", }, }, }, - }, }, }, }, @@ -466,15 +431,14 @@ var _ = Describe("passthroughs", func() { It("empty passthrough macro", func() { source := `pass:[]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.InlinePassthrough{ + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ Kind: types.PassthroughMacro, Elements: []interface{}{}, }, - }, }, }, }, @@ -484,19 +448,18 @@ var _ = Describe("passthroughs", func() { It("passthrough macro with spaces", func() { source := `pass:[ *hello*, world ]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.InlinePassthrough{ + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ Kind: types.PassthroughMacro, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: " *hello*, world ", }, }, }, - }, }, }, }, @@ -506,19 +469,18 @@ var _ = Describe("passthroughs", func() { It("passthrough macro with line break", func() { source := "pass:[hello,\nworld]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.InlinePassthrough{ + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ Kind: types.PassthroughMacro, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "hello,\nworld", }, }, }, - }, }, }, }, @@ -531,24 +493,23 @@ var _ = Describe("passthroughs", func() { It("passthrough macro with single quoted word", func() { source := `pass:q[*hello*]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.InlinePassthrough{ + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ Kind: types.PassthroughMacro, Elements: []interface{}{ - types.QuotedText{ + &types.QuotedText{ Kind: types.SingleQuoteBold, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "hello", }, }, }, }, }, - }, }, }, }, @@ -558,30 +519,29 @@ var _ = Describe("passthroughs", func() { It("passthrough macro with quoted word in sentence", func() { source := `pass:q[ a *hello*, world ]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.InlinePassthrough{ + &types.Paragraph{ + Elements: []interface{}{ + &types.InlinePassthrough{ Kind: types.PassthroughMacro, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: " a ", }, - types.QuotedText{ + &types.QuotedText{ Kind: types.SingleQuoteBold, Elements: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "hello", }, }, }, - types.StringElement{ + &types.StringElement{ Content: ", world ", }, }, }, - }, }, }, }, @@ -591,5 +551,50 @@ var _ = Describe("passthroughs", func() { }) }) + Context("as delimited blocks", func() { + + It("should apply the 'quotes' substitutions", func() { + source := `[subs=quotes] +.a title +++++ +_foo_ + +*bar* +++++` + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Passthrough, + Attributes: types.Attributes{ + types.AttrSubstitutions: "quotes", + types.AttrTitle: "a title", + }, + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "foo", + }, + }, + }, + &types.StringElement{ + Content: "\n\n", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "bar", + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) }) }) diff --git a/pkg/parser/q_a_list_test.go b/pkg/parser/q_a_list_test.go index 70bab9ad..33c39ffb 100644 --- a/pkg/parser/q_a_list_test.go +++ b/pkg/parser/q_a_list_test.go @@ -10,54 +10,52 @@ import ( var _ = Describe("q and a lists", func() { - It("q and a with title", func() { + It("with title", func() { source := `.Q&A [qanda] What is libasciidoc?:: An implementation of the AsciiDoc processor in Golang. What is the answer to the Ultimate Question?:: 42` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ + &types.List{ + Kind: types.LabeledListKind, Attributes: types.Attributes{ types.AttrTitle: "Q&A", types.AttrStyle: "qanda", }, - Items: []types.LabeledListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: "::", Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "What is libasciidoc?", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "An implementation of the AsciiDoc processor in Golang.", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + // heading spaces are trimmed + Content: "An implementation of the AsciiDoc processor in Golang.", }, }, }, }, }, - { - Level: 1, + &types.LabeledListElement{ + Style: "::", Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "What is the answer to the Ultimate Question?", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "42", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "42", }, }, }, @@ -72,7 +70,7 @@ What is the answer to the Ultimate Question?:: 42` Expect(result).To(MatchDocument(expected)) }) - It("q and a with role and id", func() { + It("with role and id", func() { source := `.Q&A [qanda#quiz] [.role1.role2] @@ -80,47 +78,44 @@ What is libasciidoc?:: An implementation of the AsciiDoc processor in Golang. What is the answer to the Ultimate Question?:: 42` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LabeledList{ + &types.List{ + Kind: types.LabeledListKind, Attributes: types.Attributes{ types.AttrTitle: "Q&A", types.AttrStyle: "qanda", types.AttrID: "quiz", types.AttrRoles: []interface{}{"role1", "role2"}, }, - Items: []types.LabeledListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: "::", Term: []interface{}{ - types.StringElement{Content: "What is libasciidoc?"}, + &types.StringElement{Content: "What is libasciidoc?"}, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "An implementation of the AsciiDoc processor in Golang.", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "An implementation of the AsciiDoc processor in Golang.", // heading spaces are trimmed }, }, }, }, }, - { - Level: 1, + &types.LabeledListElement{ + Style: "::", Term: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "What is the answer to the Ultimate Question?", }, }, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "42", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "42", }, }, }, diff --git a/pkg/parser/quoted_string_test.go b/pkg/parser/quoted_string_test.go index 9f2f8fb3..f4b4bb75 100644 --- a/pkg/parser/quoted_string_test.go +++ b/pkg/parser/quoted_string_test.go @@ -10,167 +10,227 @@ import ( var _ = Describe("quoted strings", func() { - Context("draft documents", func() { + Context("in final documents", func() { It("simple single quoted string", func() { source := "'`curly was single`'" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly was single"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly was single"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("interior spaces with single quoted string", func() { source := "'` curly was single `'" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "'` curly was single \u2019"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "'` curly was single \u2019"}, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("interior ending space with single quoted string", func() { source := "'`curly was single `'" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "'`curly was single \u2019"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "'`curly was single \u2019"}, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("interior leading space with single quoted string", func() { source := "'` curly was single`'" - expected := types.DraftDocument{ + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "'` curly was single\u2019"}, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("apostrophe in single bold word", func() { + source := "this *cookie`'*" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "this ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie\u2019", + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("apostrophes in single bold", func() { + source := "this *mother's brothers' sisters`'*" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "'` curly was single\u2019"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "this ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "mother\u2019s brothers' sisters\u2019", + }, + }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("apostrophes in double bold", func() { + source := "this **mother's brothers' sisters`'**" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "this ", + }, + &types.QuotedText{ + Kind: types.DoubleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "mother\u2019s brothers' sisters\u2019", + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("bold in single quoted string", func() { source := "'`curly *was* single`'" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "was"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "was"}, }, - types.StringElement{Content: " single"}, }, + &types.StringElement{Content: " single"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("italics in single quoted string", func() { source := "'`curly _was_ single`'" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "was"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly "}, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "was"}, }, - types.StringElement{Content: " single"}, }, + &types.StringElement{Content: " single"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("span in single quoted string", func() { source := "'`curly [.strikeout]#was#_is_ single`'" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{ - Content: "curly ", + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{ + Content: "curly ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteMarked, + Attributes: types.Attributes{ + types.AttrRoles: []interface{}{"strikeout"}, }, - types.QuotedText{ - Kind: types.SingleQuoteMarked, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"strikeout"}, - }, - Elements: []interface{}{ - types.StringElement{ - Content: "was", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "was", }, }, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "is", - }, + }, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "is", }, }, + }, - types.StringElement{ - Content: " single", - }, + &types.StringElement{ + Content: " single", }, }, }, @@ -178,50 +238,48 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("curly in monospace string", func() { source := "'`curly `is` single`'" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "is"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly "}, + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "is"}, }, - types.StringElement{Content: " single"}, }, + &types.StringElement{Content: " single"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("curly as monospace string", func() { source := "'``curly``'" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "curly"}, }, }, }, @@ -230,25 +288,23 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("curly with nested double curly", func() { source := "'`single\"`double`\"`'" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "single"}, - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "double"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "single"}, + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "double"}, }, }, }, @@ -257,24 +313,22 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("curly in monospace string", func() { source := "`'`curly`'`" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly"}, }, }, }, @@ -283,23 +337,22 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("curly in italics", func() { source := "_'`curly`'_" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly"}, }, }, }, @@ -308,23 +361,22 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("curly in bold", func() { source := "*'`curly`'*" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly"}, }, }, }, @@ -333,31 +385,65 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("curly in link", func() { source := "https://www.example.com/a['`example`']" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{Content: "www.example.com/a"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{Content: "www.example.com/a"}, + }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{ + Content: "example", + }, + }, }, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: []interface{}{ - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{ - Content: "example", - }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("single curly in single quoted link attribute", func() { + source := "https://www.example.com/a['an '`example`'']" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{Content: "www.example.com/a"}, + }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: []interface{}{ + &types.StringElement{ + Content: "an ", + }, + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{ + Content: "example", }, }, }, @@ -368,33 +454,32 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("curly in quoted link", func() { + + It("single curly in double quoted link attribute", func() { source := "https://www.example.com/a[\"an '`example`'\"]" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{Content: "www.example.com/a"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{Content: "www.example.com/a"}, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: []interface{}{ - types.StringElement{ - Content: "an ", - }, - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{ - Content: "example", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: []interface{}{ + &types.StringElement{ + Content: "an ", + }, + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{ + Content: "example", }, }, }, @@ -405,26 +490,24 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("image in curly", func() { source := "'`a image:foo.png[]`'" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlineImage{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "foo.png", }, }, }, @@ -435,23 +518,21 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("icon in curly", func() { source := "'`a icon:note[]`'" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.Icon{ - Class: "note", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.Icon{ + Class: "note", }, }, }, @@ -459,166 +540,155 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("simple double quoted string", func() { source := "\"`curly was single`\"" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly was single"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly was single"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("interior spaces with double quoted string", func() { source := "\"` curly was single `\"" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "\"` curly was single `\""}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "\"` curly was single `\""}, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("interior ending space with double quoted string", func() { source := "\"`curly was single `\"" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "\"`curly was single `\""}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "\"`curly was single `\""}, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("interior leading space with double quoted string", func() { source := "\"` curly was single`\"" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "\"` curly was single`\""}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "\"` curly was single`\""}, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("bold in double quoted string", func() { source := "\"`curly *was* single`\"" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "was"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "was"}, }, - types.StringElement{Content: " single"}, }, + &types.StringElement{Content: " single"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("italics in double quoted string", func() { source := "\"`curly _was_ single`\"" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "was"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly "}, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "was"}, }, - types.StringElement{Content: " single"}, }, + &types.StringElement{Content: " single"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("span in double quoted string", func() { source := "\"`curly [.strikeout]#was#_is_ single`\"" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{ - Content: "curly ", + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{ + Content: "curly ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteMarked, + Attributes: types.Attributes{ + types.AttrRoles: []interface{}{"strikeout"}, }, - types.QuotedText{ - Kind: types.SingleQuoteMarked, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"strikeout"}, - }, - Elements: []interface{}{ - types.StringElement{ - Content: "was", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: "was", }, }, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "is", - }, + }, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "is", }, }, - types.StringElement{ - Content: " single", - }, + }, + &types.StringElement{ + Content: " single", }, }, }, @@ -626,51 +696,48 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("double curly in monospace string", func() { source := "\"`curly `is` single`\"" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly "}, - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "is"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly "}, + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "is"}, }, - types.StringElement{Content: " single"}, }, + &types.StringElement{Content: " single"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("double curly as monospace string", func() { source := "\"``curly``\"" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "curly"}, }, }, }, @@ -679,24 +746,23 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("double curly with nested single curly", func() { source := "\"`double'`single`'`\"" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "double"}, - types.QuotedString{ - Kind: types.SingleQuote, - Elements: []interface{}{ - types.StringElement{Content: "single"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "double"}, + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "single"}, }, }, }, @@ -705,23 +771,22 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("double curly in monospace string", func() { source := "`\"`curly`\"`" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly"}, }, }, }, @@ -730,23 +795,22 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("double curly in italics", func() { source := "_\"`curly`\"_" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly"}, }, }, }, @@ -755,23 +819,22 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + It("double curly in bold", func() { source := "*\"`curly`\"*" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "curly"}, }, }, }, @@ -780,33 +843,31 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) // In a link, the quotes are ambiguous, and we default to assuming they are for enclosing // the link text. Nest them explicitly if this is needed. - It("double curly in link (becomes mono)", func() { + It("double curly in link attribute", func() { source := "https://www.example.com/a[\"`example`\"]" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{Content: "www.example.com/a"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{Content: "www.example.com/a"}, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{ - Content: "example", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{ + Content: "example", }, }, }, @@ -817,32 +878,30 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) // This is the unambiguous form. - It("curly in quoted link", func() { - source := "https://www.example.com/a[\"\"`example`\"\"]" - expected := types.DraftDocument{ + It("double curly in double quoted link attribute", func() { + source := "https://www.example.com/a['\"`example`\"']" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{Content: "www.example.com/a"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{Content: "www.example.com/a"}, }, - Attributes: types.Attributes{ - types.AttrInlineLinkText: []interface{}{ - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{ - Content: "example", - }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{ + Content: "example", }, }, }, @@ -853,25 +912,30 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("image in double curly", func() { - source := "\"`a image:foo.png[]`\"" - expected := types.DraftDocument{ + + // This is the unambiguous form. + It("double curly in double quoted link attribute", func() { + source := "https://www.example.com/a[\"\"`example`\"\"]" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{Content: "www.example.com/a"}, + }, + }, + Attributes: types.Attributes{ + types.AttrInlineLinkText: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{ + Content: "example", }, }, }, @@ -882,21 +946,26 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("icon in double curly", func() { - source := "\"`a icon:note[]`\"" - expected := types.DraftDocument{ + + It("image in double curly", func() { + source := "\"`a image:foo.png[]`\"" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.Icon{ - Class: "note", + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlineImage{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "foo.png", + }, + }, }, }, }, @@ -905,86 +974,118 @@ var _ = Describe("quoted strings", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - }) - - Context("draft documents", func() { - It("curly in title", func() { - source := "== a '`curly`' episode" - expected := types.DraftDocument{ + It("icon in double curly", func() { + source := "\"`a icon:note[]`\"" + expected := &types.Document{ Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_episode", - }, - Level: 1, - Title: []interface{}{ - types.StringElement{Content: "a "}, - types.QuotedString{ - Kind: types.SingleQuote, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, Elements: []interface{}{ - types.StringElement{Content: "curly"}, + &types.StringElement{Content: "a "}, + &types.Icon{ + Class: "note", + }, }, }, - types.StringElement{Content: " episode"}, }, - Elements: []interface{}{}, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + }) - It("curly in list element", func() { - source := "* a '`curly`' episode" - expected := types.DraftDocument{ + It("curly in title", func() { + source := "== a '`curly`' episode" + title := []interface{}{ + &types.StringElement{Content: "a "}, + &types.QuotedString{ + Kind: types.SingleQuote, Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - CheckStyle: types.NoCheck, - BulletStyle: types.OneAsterisk, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a "}, - types.QuotedString{ + &types.StringElement{Content: "curly"}, + }, + }, + &types.StringElement{Content: " episode"}, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_a_episode", + }, + Title: title, + }, + }, + ElementReferences: types.ElementReferences{ + "_a_episode": title, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("curly in list element", func() { + source := "* a '`curly`' episode" + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + CheckStyle: types.NoCheck, + BulletStyle: types.OneAsterisk, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.QuotedString{ Kind: types.SingleQuote, Elements: []interface{}{ - types.StringElement{Content: "curly"}, + &types.StringElement{Content: "curly"}, }, }, - types.StringElement{Content: " episode"}, + &types.StringElement{Content: " episode"}, }, }, }, }, }, }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("curly in labeled list", func() { - source := "'`term`':: something '`quoted`'" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{Content: "'`term`'"}, // parsed later - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "something "}, - types.QuotedString{ + It("curly in labeled list", func() { + source := "'`term`':: something '`quoted`'" + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, + Term: []interface{}{ + &types.QuotedString{ + Kind: types.SingleQuote, + Elements: []interface{}{ + &types.StringElement{Content: "term"}, + }, + }, + }, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "something "}, + &types.QuotedString{ Kind: types.SingleQuote, Elements: []interface{}{ - types.StringElement{Content: "quoted"}, + &types.StringElement{Content: "quoted"}, }, }, }, @@ -993,54 +1094,67 @@ var _ = Describe("quoted strings", func() { }, }, }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("double curly in title", func() { - source := "== a \"`curly`\" episode" - expected := types.DraftDocument{ + It("double curly in title", func() { + source := "== a \"`curly`\" episode" + title := []interface{}{ + &types.StringElement{Content: "a "}, + &types.QuotedString{ + Kind: types.DoubleQuote, Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_episode", - }, - Level: 1, - Title: []interface{}{ - types.StringElement{Content: "a "}, - types.QuotedString{ - Kind: types.DoubleQuote, - Elements: []interface{}{ - types.StringElement{Content: "curly"}, - }, - }, - types.StringElement{Content: " episode"}, - }, - Elements: []interface{}{}, + &types.StringElement{Content: "curly"}, + }, + }, + &types.StringElement{Content: " episode"}, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_a_episode", }, + Title: title, }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + }, + ElementReferences: types.ElementReferences{ + "_a_episode": title, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("double curly in labeled list", func() { - source := "\"`term`\":: something \"`quoted`\"" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LabeledListItem{ - Level: 1, - Term: []interface{}{ - types.StringElement{Content: "\"`term`\""}, // parsed later - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "something "}, - types.QuotedString{ + It("double curly in labeled list", func() { + source := "\"`term`\":: something \"`quoted`\"" + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.LabeledListKind, + Elements: []types.ListElement{ + &types.LabeledListElement{ + Style: types.DoubleColons, + Term: []interface{}{ + &types.QuotedString{ + Kind: types.DoubleQuote, + Elements: []interface{}{ + &types.StringElement{ + Content: "term", + }, + }, + }, + }, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "something "}, + &types.QuotedString{ Kind: types.DoubleQuote, Elements: []interface{}{ - types.StringElement{Content: "quoted"}, + &types.StringElement{Content: "quoted"}, }, }, }, @@ -1049,39 +1163,41 @@ var _ = Describe("quoted strings", func() { }, }, }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("double in list element", func() { - source := "* a \"`curly`\" episode" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - CheckStyle: types.NoCheck, - BulletStyle: types.OneAsterisk, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a "}, - types.QuotedString{ + It("double in list element", func() { + source := "* a \"`curly`\" episode" + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + CheckStyle: types.NoCheck, + BulletStyle: types.OneAsterisk, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.QuotedString{ Kind: types.DoubleQuote, Elements: []interface{}{ - types.StringElement{Content: "curly"}, + &types.StringElement{Content: "curly"}, }, }, - types.StringElement{Content: " episode"}, + &types.StringElement{Content: " episode"}, }, }, }, }, }, }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) }) diff --git a/pkg/parser/quoted_text_test.go b/pkg/parser/quoted_text_test.go index 46cb8d12..a15246dd 100644 --- a/pkg/parser/quoted_text_test.go +++ b/pkg/parser/quoted_text_test.go @@ -10,211 +10,177 @@ import ( var _ = Describe("quoted texts", func() { - Context("draft documents", func() { + Context("in final documents", func() { - Context("with single punctuations", func() { + Context("with single punctuation", func() { - It("bold text with newline", func() { - source := "*some bold\ncontent*" - expected := types.DraftDocument{ + It("bold text with 1 word", func() { + source := "*hello*" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "some bold\ncontent", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "hello"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("italic text with 3 words in single quote", func() { - source := "_some italic content_" - expected := types.DraftDocument{ + It("bold text with 2 words", func() { + source := "*bold content*" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "some italic content", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold content"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("italic text with newline", func() { - source := "_some italic\ncontent_" - expected := types.DraftDocument{ + It("bold text with 3 words", func() { + source := "*some bold content*" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "some italic\ncontent", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "some bold content"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("monospace text with 3 words", func() { - source := "`some monospace content`" - expected := types.DraftDocument{ + It("italic text with 3 words in single quote", func() { + source := "_some italic content_" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{ - Content: "some monospace content", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "some italic content"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("monospace text with newline", func() { - source := "`some monospace\ncontent`" - expected := types.DraftDocument{ + It("monospace text with 3 words", func() { + source := "`some monospace content`" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{ - Content: "some monospace\ncontent", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "some monospace content"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("invalid subscript text with 3 words", func() { source := "~some subscript content~" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "~some subscript content~", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "~some subscript content~"}, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("invalid superscript text with 3 words", func() { source := "^some superscript content^" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "^some superscript content^", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "^some superscript content^"}, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("bold text within italic text", func() { source := "_some *bold* content_" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold"}, }, - types.StringElement{Content: " content"}, }, + &types.StringElement{Content: " content"}, }, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("monospace text within bold text within italic quote", func() { source := "*some _italic and `monospaced content`_*" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic and "}, - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{ - Content: "monospaced content", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "italic and "}, + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "monospaced content"}, }, }, }, @@ -225,3432 +191,58 @@ var _ = Describe("quoted texts", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("italic text within italic text", func() { - source := "_some _very italic_ content_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some _very italic"}, - }, - }, - types.StringElement{Content: " content_"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("bold delimiter text within bold text", func() { - source := "*bold*content*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold*content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("italic delimiter text within italic text", func() { - source := "_italic_content_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic_content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("monospace delimiter text within monospace text", func() { - source := "`monospace`content`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "monospace`content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("non-bold text then bold text", func() { - source := "non*bold*content *bold content*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "non*bold*content ", - }, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - It("non-italic text then italic text", func() { - source := "non_italic_content _italic content_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "non_italic_content ", - }, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("non-monospace text then monospace text", func() { - source := "non`monospace`content `monospace content`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "non`monospace`content ", - }, - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "monospace content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("subscript text attached", func() { source := "O~2~ is a molecule" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "O"}, - types.QuotedText{ - Kind: types.SingleQuoteSubscript, - Elements: []interface{}{ - types.StringElement{Content: "2"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "O"}, + &types.QuotedText{ + Kind: types.SingleQuoteSubscript, + Elements: []interface{}{ + &types.StringElement{Content: "2"}, }, - types.StringElement{Content: " is a molecule"}, }, + &types.StringElement{Content: " is a molecule"}, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("superscript text attached", func() { source := "M^me^ White" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "M"}, - types.QuotedText{ - Kind: types.SingleQuoteSuperscript, - Elements: []interface{}{ - types.StringElement{Content: "me"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "M"}, + &types.QuotedText{ + Kind: types.SingleQuoteSuperscript, + Elements: []interface{}{ + &types.StringElement{Content: "me"}, }, - types.StringElement{Content: " White"}, }, + &types.StringElement{Content: " White"}, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("invalid subscript text with 3 words", func() { source := "~some subscript content~" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "~some subscript content~"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("with double punctuations", func() { - - It("bold text of 1 word in double quote", func() { - source := "**hello**" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "hello"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("bold text with newline", func() { - source := "**some bold\ncontent**" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some bold\ncontent"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("italic text with 3 words in double quote", func() { - source := "__some italic content__" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some italic content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("italic text with newline", func() { - source := "__some italic\ncontent__" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some italic\ncontent"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("monospace text with 3 words in double quote", func() { - source := "`` some monospace content ``" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: " some monospace content "}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("monospace text with newline", func() { - source := "``some monospace\ncontent``" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "some monospace\ncontent"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("superscript text within italic text", func() { - source := "__some ^superscript^ content__" - expected := types.DraftDocument{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteSuperscript, - Elements: []interface{}{ - types.StringElement{Content: "superscript"}, - }, - }, - types.StringElement{Content: " content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("superscript text within italic text within bold quote", func() { - source := "**some _italic and ^superscriptcontent^_**" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic and "}, - types.QuotedText{ - Kind: types.SingleQuoteSuperscript, - Elements: []interface{}{ - types.StringElement{Content: "superscriptcontent"}, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("inline", func() { - - It("inline content with bold text", func() { - source := "a paragraph with *some bold content*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some bold content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("inline content with invalid bold text - use case 1", func() { - source := "a paragraph with *some bold content" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with *some bold content"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("inline content with invalid bold text - use case 2", func() { - source := "a paragraph with *some bold content *" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with *some bold content *"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("inline content with invalid bold text - use case 3", func() { - source := "a paragraph with * some bold content*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with * some bold content*"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("invalid italic text within bold text", func() { - source := "some *bold and _italic content _ together*." - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold and _italic content _ together"}, - }, - }, - types.StringElement{Content: "."}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("italic text within invalid bold text", func() { - source := "some *bold and _italic content_ together *." - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "some *bold and "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, - }, - }, - types.StringElement{Content: " together *."}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("inline content with invalid subscript text - use case 1", func() { - source := "a paragraph with ~some subscript content" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with ~some subscript content"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("inline content with invalid subscript text - use case 2", func() { - source := "a paragraph with ~some subscript content ~" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with ~some subscript content ~"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("inline content with invalid subscript text - use case 3", func() { - source := "a paragraph with ~ some subscript content~" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with ~ some subscript content~"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("inline content with invalid superscript text - use case 1", func() { - source := "a paragraph with ^some superscript content" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with ^some superscript content"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("inline content with invalid superscript text - use case 2", func() { - source := "a paragraph with ^some superscript content ^" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with ^some superscript content ^"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("inline content with invalid superscript text - use case 3", func() { - source := "a paragraph with ^ some superscript content^" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with ^ some superscript content^"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("marked text with newline", func() { - source := "#some marked\ncontent#" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMarked, - Elements: []interface{}{ - types.StringElement{Content: "some marked\ncontent"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("double marked text with newline", func() { - source := "##some marked\ncontent##" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteMarked, - Elements: []interface{}{ - types.StringElement{Content: "some marked\ncontent"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - }) - - Context("with attributes", func() { - - It("simple dot.role italics", func() { - source := "[.myrole]_italics_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italics"}, - }, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"myrole"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("simple dot.role italics unconstrained", func() { - source := "it[.uncle]__al__ic" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "it", - }, - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "al"}, - }, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"uncle"}, - }, - }, - types.StringElement{ - Content: "ic", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("simple dot.role bold", func() { - source := "[.myrole]*bold*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"myrole"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("simple dot.role bold unconstrained", func() { - source := "it[.uncle]**al**ic" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "it", - }, - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "al"}, - }, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"uncle"}, - }, - }, - types.StringElement{ - Content: "ic", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("simple dot.role mono", func() { - source := "[.myrole]`true`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "true"}, - }, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"myrole"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("simple dot.role mono unconstrained", func() { - source := "int[.uncle]``eg``rate" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "int", - }, - types.QuotedText{ - Kind: types.DoubleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "eg"}, - }, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"uncle"}, - }, - }, - types.StringElement{ - Content: "rate", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("role with extra attribute", func() { - source := "[myrole,and=nothing]_italics_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"myrole"}, - "and": "nothing", - }, - Elements: []interface{}{ - types.StringElement{Content: "italics"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("dot.role with extra attribute", func() { - source := "[.myrole,and=nothing]_italics_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"myrole"}, - "and": "nothing", - }, - Elements: []interface{}{ - types.StringElement{Content: "italics"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("short-hand ID only", func() { - source := "[#here]*bold*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - Attributes: types.Attributes{ - types.AttrID: "here", - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("short-hand role only", func() { - source := "[bob]**bold**" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"bob"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("short-hand dot.role only", func() { - source := "[.bob]**bold**" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"bob"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("short-hand role with special characters", func() { - source := `["a "]**bold**` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{ - []interface{}{ - types.StringElement{ - Content: "a ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "role", - }, - types.SpecialCharacter{ - Name: ">", - }, - }, - }, - }, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("short-hand dot.role with special characters", func() { - source := `[."a "]**bold**` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{ - []interface{}{ - types.StringElement{ - Content: "a ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "role", - }, - types.SpecialCharacter{ - Name: ">", - }, - }, - }, - }, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("marked short-hand dot.role only", func() { - source := "[.bob]##the builder##" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteMarked, - Elements: []interface{}{ - types.StringElement{Content: "the builder"}, - }, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"bob"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("short-hand multiple roles and id", func() { - source := "[.role1#anchor.role2.role3]**bold**[#here.second.class]_text_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"role1", "role2", "role3"}, - types.AttrID: "anchor", - }, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - }, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"second", "class"}, - types.AttrID: "here", - }, - Elements: []interface{}{ - types.StringElement{Content: "text"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("empty role", func() { - source := "[]**bold**" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("quoted dot.role", func() { - source := "[.'here, again']**bold**" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - // NB: This will confuse the renderer. - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{"here, again"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("quoted dot.role with special chars", func() { - source := "[.\"something \"]**bold**" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - // NB: This will confuse the renderer. - Attributes: types.Attributes{ - types.AttrRoles: []interface{}{ - []interface{}{ - types.StringElement{ - Content: "something ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "wicked", - }, - types.SpecialCharacter{ - Name: ">", - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - // This demonstrates that we cannot inject malicious data in these attributes. - // The content is escaped by the renderer, not the parser. - It("bad syntax", func() { - source := "[.]**bold**" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "[.", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "something \"wicked", - }, - types.SpecialCharacter{ - Name: ">", - }, - types.StringElement{ - Content: "]", - }, - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - }, - }, - }, - }, - }, - } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) - }) - - }) - - Context("with nested quoted text", func() { - - It("italic text within bold text", func() { - source := "some *bold and _italic content_ together*." - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold and "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, - }, - }, - types.StringElement{Content: " together"}, - }, - }, - types.StringElement{Content: "."}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("single-quote bold within single-quote bold text", func() { - // here we don't allow for bold text within bold text, to comply with the existing implementations (asciidoc and asciidoctor) - source := "*some *nested bold* content*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some *nested bold"}, - }, - }, - types.StringElement{Content: " content*"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("double-quote bold within double-quote bold text", func() { - // here we don't allow for bold text within bold text, to comply with the existing implementations (asciidoc and asciidoctor) - source := "**some **nested bold** content**" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - }, - }, - types.StringElement{Content: "nested bold"}, - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: " content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("single-quote bold within double-quote bold text", func() { - // here we don't allow for bold text within bold text, to comply with the existing implementations (asciidoc and asciidoctor) - source := "**some *nested bold* content**" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "nested bold"}, - }, - }, - types.StringElement{Content: " content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("double-quote bold within single-quote bold text", func() { - // here we don't allow for bold text within bold text, to comply with the existing implementations (asciidoc and asciidoctor) - source := "*some **nested bold** content*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "nested bold"}, - }, - }, - types.StringElement{Content: " content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("single-quote italic within single-quote italic text", func() { - // here we don't allow for italic text within italic text, to comply with the existing implementations (asciidoc and asciidoctor) - source := "_some _nested italic_ content_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some _nested italic"}, - }, - }, - types.StringElement{Content: " content_"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("double-quote italic within double-quote italic text", func() { - // here we don't allow for italic text within italic text, to comply with the existing implementations (asciidoc and asciidoctor) - source := "__some __nested italic__ content__" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - }, - }, - types.StringElement{Content: "nested italic"}, - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: " content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("single-quote italic within double-quote italic text", func() { - // here we allow for italic text within italic text, to comply with the existing implementations (asciidoc and asciidoctor) - source := "_some __nested italic__ content_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "nested italic"}, - }, - }, - types.StringElement{Content: " content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("double-quote italic within single-quote italic text", func() { - // here we allow for italic text within italic text, to comply with the existing implementations (asciidoc and asciidoctor) - source := "_some __nested italic__ content_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "nested italic"}, - }, - }, - types.StringElement{Content: " content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("single-quote monospace within single-quote monospace text", func() { - // here we don't allow for monospace text within monospace text, to comply with the existing implementations (asciidoc and asciidoctor) - source := "`some `nested monospace` content`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "some `nested monospace"}, - }, - }, - types.StringElement{Content: " content`"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("double-quote monospace within double-quote monospace text", func() { - // here we don't allow for monospace text within monospace text, to comply with the existing implementations (asciidoc and asciidoctor) - source := "``some ``nested monospace`` content``" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - }, - }, - types.StringElement{Content: "nested monospace"}, - types.QuotedText{ - Kind: types.DoubleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: " content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("single-quote monospace within double-quote monospace text", func() { - // here we allow for monospace text within monospace text, to comply with the existing implementations (asciidoc and asciidoctor) - source := "`some ``nested monospace`` content`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.DoubleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "nested monospace"}, - }, - }, - types.StringElement{Content: " content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("double-quote monospace within single-quote monospace text", func() { - // here we allow for monospace text within monospace text, to comply with the existing implementations (asciidoc and asciidoctor) - source := "`some ``nested monospace`` content`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.DoubleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "nested monospace"}, - }, - }, - types.StringElement{Content: " content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("quoted text within marked text", func() { - source := "some #marked and _italic_ and *bold* and `monospaced` content together#." - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteMarked, - Elements: []interface{}{ - types.StringElement{Content: "marked and "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic"}, - }, - }, - types.StringElement{Content: " and "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - }, - types.StringElement{Content: " and "}, - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "monospaced"}, - }, - }, - types.StringElement{Content: " content together"}, - }, - }, - types.StringElement{Content: "."}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unbalanced bold in monospace - case 1", func() { - source := "`*a`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "*a"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unbalanced bold in monospace - case 2", func() { - source := "`a*b`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a*b"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("italic in monospace", func() { - source := "`_a_`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "a"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unbalanced italic in monospace", func() { - source := "`a_b`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a_b"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unparsed bold in monospace", func() { - source := "`a*b*`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a*b*"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("parsed subscript in monospace", func() { - source := "`a~b~`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a"}, - types.QuotedText{ - Kind: types.SingleQuoteSubscript, - Elements: []interface{}{ - types.StringElement{Content: "b"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("multiline in single quoted monospace - case 1", func() { - source := "`a\nb`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a\nb"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("multiline in double quoted monospace - case 1", func() { - source := "`a\nb`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a\nb"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("multiline in single quoted monospace - case 2", func() { - source := "`a\n*b*`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a\n"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "b"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("multiline in double quoted monospace - case 2", func() { - source := "`a\n*b*`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a\n"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "b"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("link in bold", func() { - source := "*a link:/[b]*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineLink{ - Attributes: types.Attributes{ - types.AttrInlineLinkText: "b", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "/", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("image in bold", func() { - source := "*a image:foo.png[]*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("singleplus passthrough in bold", func() { - source := "*a +image:foo.png[]+*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.SinglePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("tripleplus passthrough in bold", func() { - source := "*a +++image:foo.png[]+++*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("link in italic", func() { - source := "_a link:/[b]_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineLink{ - Attributes: types.Attributes{ - types.AttrInlineLinkText: "b", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "/", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("image in italic", func() { - source := "_a image:foo.png[]_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("singleplus passthrough in italic", func() { - source := "_a +image:foo.png[]+_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.SinglePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("tripleplus passthrough in italic", func() { - source := "_a +++image:foo.png[]+++_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("link in monospace", func() { - source := "`a link:/[b]`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineLink{ - Attributes: types.Attributes{ - types.AttrInlineLinkText: "b", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "/", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("image in monospace", func() { - source := "`a image:foo.png[]`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("singleplus passthrough in monospace", func() { - source := "`a +image:foo.png[]+`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.SinglePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("tripleplus passthrough in monospace", func() { - source := "`a +++image:foo.png[]+++`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - }) - - Context("unbalanced quoted text", func() { - - Context("unbalanced bold text", func() { - - It("unbalanced bold text - extra on left", func() { - source := "**some bold content*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "*some bold content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unbalanced bold text - extra on right", func() { - source := "*some bold content**" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some bold content"}, - }, - }, - types.StringElement{Content: "*"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("unbalanced italic text", func() { - - It("unbalanced italic text - extra on left", func() { - source := "__some italic content_" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "_some italic content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unbalanced italic text - extra on right", func() { - source := "_some italic content__" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some italic content"}, - }, - }, - types.StringElement{Content: "_"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("unbalanced monospace text", func() { - - It("unbalanced monospace text - extra on left", func() { - source := "``some monospace content`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "`some monospace content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unbalanced monospace text - extra on right", func() { - source := "`some monospace content``" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "some monospace content"}, - }, - }, - types.StringElement{Content: "`"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - It("inline content with unbalanced bold text", func() { - source := "a paragraph with *some bold content" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with *some bold content"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - }) - - Context("prevented substitution", func() { - - Context("prevented bold text substitution", func() { - - Context("without nested quoted text", func() { - - It("escaped bold text with single backslash", func() { - source := `\*bold content*` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "*bold content*"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped bold text with multiple backslashes", func() { - source := `\\*bold content*` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\*bold content*`}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped bold text with double quote", func() { - source := `\\**bold content**` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `**bold content**`}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped bold text with double quote and more backslashes", func() { - source := `\\\**bold content**` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\**bold content**`}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped bold text with unbalanced double quote", func() { - source := `\**bold content*` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `**bold content*`}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped bold text with unbalanced double quote and more backslashes", func() { - source := `\\\**bold content*` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\\**bold content*`}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("with nested quoted text", func() { - - It("escaped bold text with nested italic text", func() { - source := `\*_italic content_*` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "*"}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, - }, - }, - types.StringElement{Content: "*"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped bold text with unbalanced double quote and nested italic test", func() { - source := `\**_italic content_*` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "**"}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, - }, - }, - types.StringElement{Content: "*"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped bold text with nested italic", func() { - source := `\*bold _and italic_ content*` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "*bold "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "and italic"}, - }, - }, - types.StringElement{Content: " content*"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - }) - - Context("prevented italic text substitution", func() { - - Context("without nested quoted text", func() { - - It("escaped italic text with single quote", func() { - source := `\_italic content_` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "_italic content_"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped italic text with single quote and more backslashes", func() { - source := `\\_italic content_` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\_italic content_`}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped italic text with double quote with 2 backslashes", func() { - source := `\\__italic content__` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `__italic content__`}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped italic text with double quote with 3 backslashes", func() { - source := `\\\__italic content__` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\__italic content__`}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped italic text with unbalanced double quote", func() { - source := `\__italic content_` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `__italic content_`}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped italic text with unbalanced double quote and more backslashes", func() { - source := `\\\__italic content_` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\\__italic content_`}, // only 1 backslash remove - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("with nested quoted text", func() { - - It("escaped italic text with nested monospace text", func() { - source := `\` + "_`monospace content`_" // gives: \_`monospace content`_ - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "_"}, - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "monospace content"}, - }, - }, - types.StringElement{Content: "_"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped italic text with unbalanced double quote and nested bold test", func() { - source := `\__*bold content*_` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "__"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, - }, - types.StringElement{Content: "_"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped italic text with nested bold text", func() { - source := `\_italic *and bold* content_` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "_italic "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "and bold"}, - }, - }, - types.StringElement{Content: " content_"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("prevented monospace text substitution", func() { - - Context("without nested quoted text", func() { - - It("escaped monospace text with single quote", func() { - source := `\` + "`monospace content`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "`monospace content`"}, // backslash removed - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped monospace text with single quote and more backslashes", func() { - source := `\\` + "`monospace content`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\` + "`monospace content`"}, // only 1 backslash removed - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped monospace text with double quote", func() { - source := `\\` + "`monospace content``" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\` + "`monospace content``"}, // 2 back slashes "consumed" - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped monospace text with double quote and more backslashes", func() { - source := `\\\` + "``monospace content``" // 3 backslashes - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\` + "``monospace content``"}, // 2 back slashes "consumed" - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped monospace text with unbalanced double quote", func() { - source := `\` + "``monospace content`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "``monospace content`"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped monospace text with unbalanced double quote and more backslashes", func() { - source := `\\\` + "``monospace content`" // 3 backslashes - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\\` + "``monospace content`"}, // 2 backslashes removed - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("with nested quoted text", func() { - - It("escaped monospace text with nested bold text", func() { - source := `\` + "`*bold content*`" // gives: \`*bold content*` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "`"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, - }, - types.StringElement{Content: "`"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped monospace text with unbalanced double backquote and nested bold test", func() { - source := `\` + "``*bold content*`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "``"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, - }, - types.StringElement{Content: "`"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped monospace text with nested bold text", func() { - source := `\` + "`monospace *and bold* content`" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "`monospace "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "and bold"}, - }, - }, - types.StringElement{Content: " content`"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("prevented subscript text substitution", func() { - - Context("without nested quoted text", func() { - - It("escaped subscript text with single quote", func() { - source := `\~subscriptcontent~` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "~subscriptcontent~"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped subscript text with single quote and more backslashes", func() { - source := `\\~subscriptcontent~` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\~subscriptcontent~`}, // only 1 backslash removed - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - }) - - Context("with nested quoted text", func() { - - It("escaped subscript text with nested bold text", func() { - source := `\~*boldcontent*~` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "~"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "boldcontent"}, - }, - }, - types.StringElement{Content: "~"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped subscript text with nested bold text", func() { - source := `\~subscript *and bold* content~` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\~subscript `}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "and bold"}, - }, - }, - types.StringElement{Content: " content~"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("prevented superscript text substitution", func() { - - Context("without nested quoted text", func() { - - It("escaped superscript text with single quote", func() { - source := `\^superscriptcontent^` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "^superscriptcontent^"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped superscript text with single quote and more backslashes", func() { - source := `\\^superscriptcontent^` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\^superscriptcontent^`}, // only 1 backslash removed - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - }) - - Context("with nested quoted text", func() { - - It("escaped superscript text with nested bold text - case 1", func() { - source := `\^*bold content*^` // valid escaped superscript since it has no space within - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `^`}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, - }, - types.StringElement{Content: "^"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped superscript text with unbalanced double backquote and nested bold test", func() { - source := `\^*bold content*^` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "^"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, - }, - types.StringElement{Content: "^"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("escaped superscript text with nested bold text - case 2", func() { - source := `\^superscript *and bold* content^` // invalid superscript text since it has spaces within - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\^superscript `}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "and bold"}, - }, - }, - types.StringElement{Content: " content^"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - }) - - Context("with quoted string", func() { - - It("apostrophes in single bold", func() { - source := "this *mother's mothers' mothers`'*\n" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "this "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "mother\u2019s mothers' mothers\u2019", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("apostrophes in double bold", func() { - source := "this **mother's mothers' mothers`'**\n" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "this "}, - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{ - Content: "mother\u2019s mothers' mothers\u2019", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("apostrophes in single italic", func() { - source := "this _mother's mothers' mothers`'_\n" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "this "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "mother\u2019s mothers' mothers\u2019", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("apostrophes in double italic", func() { - source := "this __mother's mothers' mothers`'__\n" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "this "}, - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{ - Content: "mother\u2019s mothers' mothers\u2019", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("apostrophes in single mono", func() { - source := "this `mother's mothers`' day`\n" // no typographic quotes here - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "this "}, - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{ - Content: "mother\u2019s mothers\u2019 day", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("apostrophes in double mono", func() { - source := "this ``mother's mothers`' day``\n" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "this "}, - types.QuotedText{ - Kind: types.DoubleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{ - Content: "mother\u2019s mothers\u2019 day", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("apostrophes in single marked", func() { - source := "this #mother's mothers' mothers`'#\n" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "this "}, - types.QuotedText{ - Kind: types.SingleQuoteMarked, - Elements: []interface{}{ - types.StringElement{ - Content: "mother\u2019s mothers' mothers\u2019", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("apostrophes in double marked", func() { - source := "this ##mother's mothers' mothers`'##\n" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "this "}, - types.QuotedText{ - Kind: types.DoubleQuoteMarked, - Elements: []interface{}{ - types.StringElement{ - Content: "mother\u2019s mothers' mothers\u2019", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("final documents", func() { - - Context("with single punctuation", func() { - - It("bold text with 1 word", func() { - source := "*hello*" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "hello"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("bold text with 2 words", func() { - source := "*bold content*" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("bold text with 3 words", func() { - source := "*some bold content*" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some bold content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("italic text with 3 words in single quote", func() { - source := "_some italic content_" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some italic content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("monospace text with 3 words", func() { - source := "`some monospace content`" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "some monospace content"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("invalid subscript text with 3 words", func() { - source := "~some subscript content~" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "~some subscript content~"}, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("invalid superscript text with 3 words", func() { - source := "^some superscript content^" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "^some superscript content^"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "~some subscript content~"}, }, }, }, @@ -3658,27 +250,18 @@ var _ = Describe("quoted texts", func() { Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("bold text within italic text", func() { - source := "_some *bold* content_" - expected := types.Document{ + It("bold text across paragraph", func() { + source := "*some bold\n\ncontent*" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold"}, - }, - }, - types.StringElement{Content: " content"}, - }, - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "*some bold"}, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "content*"}, }, }, }, @@ -3686,32 +269,18 @@ var _ = Describe("quoted texts", func() { Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("monospace text within bold text within italic quote", func() { - source := "*some _italic and `monospaced content`_*" - expected := types.Document{ + It("italic text across paragraph", func() { + source := "_some italic\n\ncontent_" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic and "}, - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "monospaced content"}, - }, - }, - }, - }, - }, - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "_some italic"}, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "content_"}, }, }, }, @@ -3719,21 +288,18 @@ var _ = Describe("quoted texts", func() { Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("italic text within italic text", func() { - source := "_some _very italic_ content_" - expected := types.Document{ + It("monospace text across paragraph", func() { + source := "`some monospace\n\ncontent`" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some _very italic"}, - }, - }, - types.StringElement{Content: " content_"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "`some monospace"}, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "content`"}, }, }, }, @@ -3741,21 +307,21 @@ var _ = Describe("quoted texts", func() { Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("subscript text attached", func() { - source := "O~2~ is a molecule" - expected := types.Document{ + It("marked text across paragraph", func() { + source := "#some marked\n\ncontent#" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "O"}, - types.QuotedText{ - Kind: types.SingleQuoteSubscript, - Elements: []interface{}{ - types.StringElement{Content: "2"}, - }, - }, - types.StringElement{Content: " is a molecule"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "#some marked", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content#", }, }, }, @@ -3764,21 +330,38 @@ var _ = Describe("quoted texts", func() { Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("superscript text attached", func() { - source := "M^me^ White" - expected := types.Document{ + It("suite of regular text mised with bold, italic and monospaced content", func() { + source := "a _a_ b *b* c `c`" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "M"}, - types.QuotedText{ - Kind: types.SingleQuoteSuperscript, - Elements: []interface{}{ - types.StringElement{Content: "me"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "a ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "a"}, + }, + }, + &types.StringElement{ + Content: " b ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "b"}, + }, + }, + &types.StringElement{ + Content: " c ", + }, + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "c"}, }, - types.StringElement{Content: " White"}, }, }, }, @@ -3787,14 +370,23 @@ var _ = Describe("quoted texts", func() { Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("invalid subscript text with 3 words", func() { - source := "~some subscript content~" - expected := types.Document{ + It("with role and other attr", func() { + source := "[.myrole,and=nothing_else]_italics_" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "~some subscript content~"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Attributes: types.Attributes{ + types.AttrRoles: []interface{}{ + "myrole", + }, + "and": "nothing_else", + }, + Elements: []interface{}{ + &types.StringElement{Content: "italics"}, + }, }, }, }, @@ -3803,21 +395,25 @@ var _ = Describe("quoted texts", func() { Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("bold text across paragraph", func() { - source := "*some bold\n\ncontent*" - expected := types.Document{ + It("bold with delimiter within", func() { + source := "Write result to file *OUT*FILE*." + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "*some bold"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Write result to file ", }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "content*"}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "OUT*FILE", + }, + }, + }, + &types.StringElement{ + Content: ".", }, }, }, @@ -3826,21 +422,25 @@ var _ = Describe("quoted texts", func() { Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("italic text across paragraph", func() { - source := "_some italic\n\ncontent_" - expected := types.Document{ + It("italic with delimiter within", func() { + source := `Write result to file _OUT_FILE_.` + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "_some italic"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Write result to file ", }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "content_"}, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "OUT_FILE", + }, + }, + }, + &types.StringElement{ + Content: ".", }, }, }, @@ -3849,21 +449,25 @@ var _ = Describe("quoted texts", func() { Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("monospace text across paragraph", func() { - source := "`some monospace\n\ncontent`" - expected := types.Document{ + It("monospace with delimiter within", func() { + source := "Write result to file `OUT`FILE`." + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "`some monospace"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Write result to file ", }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "content`"}, + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{ + Content: "OUT`FILE", + }, + }, + }, + &types.StringElement{ + Content: ".", }, }, }, @@ -3872,49 +476,46 @@ var _ = Describe("quoted texts", func() { Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("marked text across paragraph", func() { - source := "#some marked\n\ncontent#" - expected := types.Document{ + It("marked with delimiter within", func() { + source := "Write result to file #OUT#FILE#." + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "#some marked", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Write result to file ", }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content#", + &types.QuotedText{ + Kind: types.SingleQuoteMarked, + Elements: []interface{}{ + &types.StringElement{ + Content: "OUT#FILE", + }, }, }, + &types.StringElement{ + Content: ".", + }, }, }, }, } Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - }) Context("with double punctuation", func() { It("bold text of 1 word in double quote", func() { source := "**hello**" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "hello"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.DoubleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "hello"}, }, }, }, @@ -3926,16 +527,14 @@ var _ = Describe("quoted texts", func() { It("italic text with 3 words in double quote", func() { source := "__some italic content__" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some italic content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.DoubleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "some italic content"}, }, }, }, @@ -3947,16 +546,14 @@ var _ = Describe("quoted texts", func() { It("monospace text with 3 words in double quote", func() { source := "`` some monospace content ``" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: " some monospace content "}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.DoubleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: " some monospace content "}, }, }, }, @@ -3968,23 +565,21 @@ var _ = Describe("quoted texts", func() { It("superscript text within italic text", func() { source := "__some ^superscript^ content__" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteSuperscript, - Elements: []interface{}{ - types.StringElement{Content: "superscript"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.DoubleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.SingleQuoteSuperscript, + Elements: []interface{}{ + &types.StringElement{Content: "superscript"}, }, - types.StringElement{Content: " content"}, }, + &types.StringElement{Content: " content"}, }, }, }, @@ -3996,24 +591,22 @@ var _ = Describe("quoted texts", func() { It("superscript text within italic text within bold quote", func() { source := "**some _italic and ^superscriptcontent^_**" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic and "}, - types.QuotedText{ - Kind: types.SingleQuoteSuperscript, - Elements: []interface{}{ - types.StringElement{Content: "superscriptcontent"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.DoubleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "italic and "}, + &types.QuotedText{ + Kind: types.SingleQuoteSuperscript, + Elements: []interface{}{ + &types.StringElement{Content: "superscriptcontent"}, }, }, }, @@ -4029,22 +622,18 @@ var _ = Describe("quoted texts", func() { It("bold text across paragraph", func() { source := "**some bold\n\ncontent**" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "**some bold", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "**some bold", }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "content**"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "content**"}, }, }, }, @@ -4054,22 +643,18 @@ var _ = Describe("quoted texts", func() { It("italic text across paragraph", func() { source := "__some italic\n\ncontent__" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "__some italic", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "__some italic", }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "content__"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "content__"}, }, }, }, @@ -4079,22 +664,18 @@ var _ = Describe("quoted texts", func() { It("monospace text across paragraph", func() { source := "``some monospace\n\ncontent``" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "``some monospace", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "``some monospace", }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "content``"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "content``"}, }, }, }, @@ -4104,21 +685,41 @@ var _ = Describe("quoted texts", func() { It("double marked text across paragraph", func() { source := "##some marked\n\ncontent##" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "##some marked", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "##some marked", }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "content##"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "content##"}, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("with quoted role attr", func() { + source := `[."something "]**bold**` + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.DoubleQuoteBold, + Attributes: types.Attributes{ + types.AttrRoles: []interface{}{ + "something ", // TODO: do we need to parse SpecialCharacters in inline attributes? + }, + }, + Elements: []interface{}{ + &types.StringElement{Content: "bold"}, + }, }, }, }, @@ -4133,17 +734,15 @@ var _ = Describe("quoted texts", func() { It("inline content with bold text", func() { source := "a paragraph with *some bold content*" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "some bold content"}, }, }, }, @@ -4155,13 +754,11 @@ var _ = Describe("quoted texts", func() { It("inline content with invalid bold text - use case 1", func() { source := "a paragraph with *some bold content" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with *some bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with *some bold content"}, }, }, }, @@ -4171,13 +768,11 @@ var _ = Describe("quoted texts", func() { It("inline content with invalid bold text - use case 2", func() { source := "a paragraph with *some bold content *" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with *some bold content *"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with *some bold content *"}, }, }, }, @@ -4187,13 +782,11 @@ var _ = Describe("quoted texts", func() { It("inline content with invalid bold text - use case 3", func() { source := "a paragraph with * some bold content*" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with * some bold content*"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with * some bold content*"}, }, }, }, @@ -4203,20 +796,18 @@ var _ = Describe("quoted texts", func() { It("invalid italic text within bold text", func() { source := "some *bold and _italic content _ together*." - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold and _italic content _ together"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold and _italic content _ together"}, }, - types.StringElement{Content: "."}, }, + &types.StringElement{Content: "."}, }, }, }, @@ -4226,20 +817,18 @@ var _ = Describe("quoted texts", func() { It("italic text within invalid bold text", func() { source := "some *bold and _italic content_ together *." - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "some *bold and "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "some *bold and "}, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "italic content"}, }, - types.StringElement{Content: " together *."}, }, + &types.StringElement{Content: " together *."}, }, }, }, @@ -4249,13 +838,11 @@ var _ = Describe("quoted texts", func() { It("inline content with invalid subscript text - use case 1", func() { source := "a paragraph with ~some subscript content" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with ~some subscript content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with ~some subscript content"}, }, }, }, @@ -4265,13 +852,11 @@ var _ = Describe("quoted texts", func() { It("inline content with invalid subscript text - use case 2", func() { source := "a paragraph with ~some subscript content ~" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with ~some subscript content ~"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with ~some subscript content ~"}, }, }, }, @@ -4281,13 +866,11 @@ var _ = Describe("quoted texts", func() { It("inline content with invalid subscript text - use case 3", func() { source := "a paragraph with ~ some subscript content~" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with ~ some subscript content~"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with ~ some subscript content~"}, }, }, }, @@ -4297,13 +880,11 @@ var _ = Describe("quoted texts", func() { It("inline content with invalid superscript text - use case 1", func() { source := "a paragraph with ^some superscript content" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with ^some superscript content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with ^some superscript content"}, }, }, }, @@ -4313,13 +894,11 @@ var _ = Describe("quoted texts", func() { It("inline content with invalid superscript text - use case 2", func() { source := "a paragraph with ^some superscript content ^" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with ^some superscript content ^"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with ^some superscript content ^"}, }, }, }, @@ -4329,13 +908,11 @@ var _ = Describe("quoted texts", func() { It("inline content with invalid superscript text - use case 3", func() { source := "a paragraph with ^ some superscript content^" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with ^ some superscript content^"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with ^ some superscript content^"}, }, }, }, @@ -4348,27 +925,25 @@ var _ = Describe("quoted texts", func() { It("italic text within bold text", func() { source := "some *bold and _italic content_ together*." - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold and "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold and "}, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "italic content"}, }, - types.StringElement{Content: " together"}, }, + &types.StringElement{Content: " together"}, }, - types.StringElement{Content: "."}, }, + &types.StringElement{Content: "."}, }, }, }, @@ -4377,21 +952,19 @@ var _ = Describe("quoted texts", func() { }) It("single-quote bold within single-quote bold text", func() { - // here we don't allow for bold text within bold text, to comply with the existing implementations (asciidoc and asciidoctor) + // kinda invalid content, and Asciidoc has the same way of parsing this content source := "*some *nested bold* content*" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some *nested bold"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "some *nested bold"}, }, - types.StringElement{Content: " content*"}, }, + &types.StringElement{Content: " content*"}, }, }, }, @@ -4402,23 +975,21 @@ var _ = Describe("quoted texts", func() { It("double-quote bold within double-quote bold text", func() { // here we don't allow for bold text within bold text, to comply with the existing implementations (asciidoc and asciidoctor) source := "**some **nested bold** content**" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.DoubleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "some "}, }, - types.StringElement{Content: "nested bold"}, - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: " content"}, - }, + }, + &types.StringElement{Content: "nested bold"}, + &types.QuotedText{ + Kind: types.DoubleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: " content"}, }, }, }, @@ -4431,23 +1002,21 @@ var _ = Describe("quoted texts", func() { It("single-quote bold within double-quote bold text", func() { // here we don't allow for bold text within bold text, to comply with the existing implementations (asciidoc and asciidoctor) source := "**some *nested bold* content**" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "nested bold"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.DoubleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "nested bold"}, }, - types.StringElement{Content: " content"}, }, + &types.StringElement{Content: " content"}, }, }, }, @@ -4460,23 +1029,21 @@ var _ = Describe("quoted texts", func() { It("double-quote bold within single-quote bold text", func() { // here we don't allow for bold text within bold text, to comply with the existing implementations (asciidoc and asciidoctor) source := "*some **nested bold** content*" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.DoubleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "nested bold"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.DoubleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "nested bold"}, }, - types.StringElement{Content: " content"}, }, + &types.StringElement{Content: " content"}, }, }, }, @@ -4487,21 +1054,19 @@ var _ = Describe("quoted texts", func() { }) It("single-quote italic within single-quote italic text", func() { - // here we don't allow for italic text within italic text, to comply with the existing implementations (asciidoc and asciidoctor) + // kinda invalid content, and Asciidoc has the same way of parsing this content source := "_some _nested italic_ content_" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some _nested italic"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "some _nested italic"}, }, - types.StringElement{Content: " content_"}, }, + &types.StringElement{Content: " content_"}, }, }, }, @@ -4512,23 +1077,21 @@ var _ = Describe("quoted texts", func() { It("double-quote italic within double-quote italic text", func() { // here we don't allow for italic text within italic text, to comply with the existing implementations (asciidoc and asciidoctor) source := "__some __nested italic__ content__" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.DoubleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "some "}, }, - types.StringElement{Content: "nested italic"}, - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: " content"}, - }, + }, + &types.StringElement{Content: "nested italic"}, + &types.QuotedText{ + Kind: types.DoubleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: " content"}, }, }, }, @@ -4541,23 +1104,21 @@ var _ = Describe("quoted texts", func() { It("single-quote italic within double-quote italic text", func() { // here we allow for italic text within italic text, to comply with the existing implementations (asciidoc and asciidoctor) source := "__some _nested italic_ content__" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "nested italic"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.DoubleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "nested italic"}, }, - types.StringElement{Content: " content"}, }, + &types.StringElement{Content: " content"}, }, }, }, @@ -4570,23 +1131,21 @@ var _ = Describe("quoted texts", func() { It("double-quote italic within single-quote italic text", func() { // here we allow for italic text within italic text, to comply with the existing implementations (asciidoc and asciidoctor) source := "_some __nested italic__ content_" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.DoubleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "nested italic"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.DoubleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "nested italic"}, }, - types.StringElement{Content: " content"}, }, + &types.StringElement{Content: " content"}, }, }, }, @@ -4597,21 +1156,19 @@ var _ = Describe("quoted texts", func() { }) It("single-quote monospace within single-quote monospace text", func() { - // here we don't allow for monospace text within monospace text, to comply with the existing implementations (asciidoc and asciidoctor) + // kinda invalid content, and Asciidoc has the same way of parsing this content source := "`some `nested monospace` content`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "some `nested monospace"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "some `nested monospace"}, }, - types.StringElement{Content: " content`"}, }, + &types.StringElement{Content: " content`"}, }, }, }, @@ -4622,23 +1179,21 @@ var _ = Describe("quoted texts", func() { It("double-quote monospace within double-quote monospace text", func() { // here we don't allow for monospace text within monospace text, to comply with the existing implementations (asciidoc and asciidoctor) source := "``some ``nested monospace`` content``" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.DoubleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.DoubleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "some "}, }, - types.StringElement{Content: "nested monospace"}, - types.QuotedText{ - Kind: types.DoubleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: " content"}, - }, + }, + &types.StringElement{Content: "nested monospace"}, + &types.QuotedText{ + Kind: types.DoubleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: " content"}, }, }, }, @@ -4651,23 +1206,21 @@ var _ = Describe("quoted texts", func() { It("single-quote monospace within double-quote monospace text", func() { // here we allow for monospace text within monospace text, to comply with the existing implementations (asciidoc and asciidoctor) source := "`some ``nested monospace`` content`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.DoubleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "nested monospace"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.DoubleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "nested monospace"}, }, - types.StringElement{Content: " content"}, }, + &types.StringElement{Content: " content"}, }, }, }, @@ -4680,23 +1233,21 @@ var _ = Describe("quoted texts", func() { It("double-quote monospace within single-quote monospace text", func() { // here we allow for monospace text within monospace text, to comply with the existing implementations (asciidoc and asciidoctor) source := "`some ``nested monospace`` content`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "some "}, - types.QuotedText{ - Kind: types.DoubleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "nested monospace"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "some "}, + &types.QuotedText{ + Kind: types.DoubleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "nested monospace"}, }, - types.StringElement{Content: " content"}, }, + &types.StringElement{Content: " content"}, }, }, }, @@ -4708,16 +1259,14 @@ var _ = Describe("quoted texts", func() { It("unbalanced bold in monospace - case 1", func() { source := "`*a`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "*a"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "*a"}, }, }, }, @@ -4729,16 +1278,14 @@ var _ = Describe("quoted texts", func() { It("unbalanced bold in monospace - case 2", func() { source := "`a*b`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a*b"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "a*b"}, }, }, }, @@ -4750,19 +1297,17 @@ var _ = Describe("quoted texts", func() { It("italic in monospace", func() { source := "`_a_`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "a"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "a"}, }, }, }, @@ -4776,16 +1321,14 @@ var _ = Describe("quoted texts", func() { It("unbalanced italic in monospace", func() { source := "`a_b`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a_b"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "a_b"}, }, }, }, @@ -4797,16 +1340,14 @@ var _ = Describe("quoted texts", func() { It("unparsed bold in monospace", func() { source := "`a*b*`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a*b*"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "a*b*"}, }, }, }, @@ -4818,20 +1359,18 @@ var _ = Describe("quoted texts", func() { It("parsed subscript in monospace", func() { source := "`a~b~`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a"}, - types.QuotedText{ - Kind: types.SingleQuoteSubscript, - Elements: []interface{}{ - types.StringElement{Content: "b"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "a"}, + &types.QuotedText{ + Kind: types.SingleQuoteSubscript, + Elements: []interface{}{ + &types.StringElement{Content: "b"}, }, }, }, @@ -4845,16 +1384,14 @@ var _ = Describe("quoted texts", func() { It("multiline in single quoted monospace - case 1", func() { source := "`a\nb`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a\nb"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "a\nb"}, }, }, }, @@ -4866,16 +1403,14 @@ var _ = Describe("quoted texts", func() { It("multiline in double quoted monospace - case 1", func() { source := "`a\nb`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a\nb"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "a\nb"}, }, }, }, @@ -4887,20 +1422,18 @@ var _ = Describe("quoted texts", func() { It("multiline in single quoted monospace - case 2", func() { source := "`a\n*b*`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a\n"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "b"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "a\n"}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "b"}, }, }, }, @@ -4914,20 +1447,18 @@ var _ = Describe("quoted texts", func() { It("multiline in double quoted monospace - case 2", func() { source := "`a\n*b*`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a\n"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "b"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "a\n"}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "b"}, }, }, }, @@ -4941,24 +1472,22 @@ var _ = Describe("quoted texts", func() { It("link in bold", func() { source := "*a link:/[b]*" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineLink{ - Attributes: types.Attributes{ - types.AttrInlineLinkText: "b", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "/", - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "b", + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "/", }, }, }, @@ -4974,21 +1503,19 @@ var _ = Describe("quoted texts", func() { It("image in bold", func() { source := "*a image:foo.png[]*" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlineImage{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "foo.png", }, }, }, @@ -5004,20 +1531,18 @@ var _ = Describe("quoted texts", func() { It("singleplus passthrough in bold", func() { source := "*a +image:foo.png[]+*" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.SinglePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlinePassthrough{ + Kind: types.SinglePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{Content: "image:foo.png[]"}, }, }, }, @@ -5031,20 +1556,18 @@ var _ = Describe("quoted texts", func() { It("tripleplus passthrough in bold", func() { source := "*a +++image:foo.png[]+++*" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{Content: "image:foo.png[]"}, }, }, }, @@ -5058,24 +1581,22 @@ var _ = Describe("quoted texts", func() { It("link in italic", func() { source := "_a link:/[b]_" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineLink{ - Attributes: types.Attributes{ - types.AttrInlineLinkText: "b", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "/", - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "b", + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "/", }, }, }, @@ -5091,21 +1612,19 @@ var _ = Describe("quoted texts", func() { It("image in italic", func() { source := "_a image:foo.png[]_" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlineImage{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "foo.png", }, }, }, @@ -5121,20 +1640,18 @@ var _ = Describe("quoted texts", func() { It("singleplus passthrough in italic", func() { source := "_a +image:foo.png[]+_" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.SinglePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlinePassthrough{ + Kind: types.SinglePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{Content: "image:foo.png[]"}, }, }, }, @@ -5148,20 +1665,18 @@ var _ = Describe("quoted texts", func() { It("tripleplus passthrough in italic", func() { source := "_a +++image:foo.png[]+++_" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{Content: "image:foo.png[]"}, }, }, }, @@ -5175,24 +1690,22 @@ var _ = Describe("quoted texts", func() { It("link in monospace", func() { source := "`a link:/[b]`" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineLink{ - Attributes: types.Attributes{ - types.AttrInlineLinkText: "b", - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "/", - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlineLink{ + Attributes: types.Attributes{ + types.AttrInlineLinkText: "b", + }, + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "/", }, }, }, @@ -5208,21 +1721,19 @@ var _ = Describe("quoted texts", func() { It("image in monospace", func() { source := "`a image:foo.png[]`" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlineImage{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "foo.png", }, }, }, @@ -5238,20 +1749,18 @@ var _ = Describe("quoted texts", func() { It("singleplus passthrough in monospace", func() { source := "`a +image:foo.png[]+`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.SinglePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlinePassthrough{ + Kind: types.SinglePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{Content: "image:foo.png[]"}, }, }, }, @@ -5265,20 +1774,18 @@ var _ = Describe("quoted texts", func() { It("tripleplus passthrough in monospace", func() { source := "`a +++image:foo.png[]+++`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlinePassthrough{ - Kind: types.TriplePlusPassthrough, - Elements: []interface{}{ - types.StringElement{Content: "image:foo.png[]"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlinePassthrough{ + Kind: types.TriplePlusPassthrough, + Elements: []interface{}{ + &types.StringElement{Content: "image:foo.png[]"}, }, }, }, @@ -5294,20 +1801,20 @@ var _ = Describe("quoted texts", func() { Context("unbalanced quoted text", func() { + // NOTE: differs from Asciidoctor. + Context("unbalanced bold text", func() { It("unbalanced bold text - extra on left", func() { source := "**some bold content*" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "*some bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "*some bold content"}, }, }, }, @@ -5319,20 +1826,31 @@ var _ = Describe("quoted texts", func() { It("unbalanced bold text - extra on right", func() { source := "*some bold content**" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "some bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "some bold content"}, }, - types.StringElement{Content: "*"}, }, + &types.StringElement{Content: "*"}, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("inline content with unclosed bold text", func() { + source := "a paragraph with *some unclosed bold content" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with *some unclosed bold content"}, }, }, }, @@ -5345,17 +1863,14 @@ var _ = Describe("quoted texts", func() { It("unbalanced italic text - extra on left", func() { source := "__some italic content_" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "_some italic content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "_some italic content"}, }, }, }, @@ -5367,19 +1882,31 @@ var _ = Describe("quoted texts", func() { It("unbalanced italic text - extra on right", func() { source := "_some italic content__" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "some italic content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "some italic content"}, }, - types.StringElement{Content: "_"}, }, + &types.StringElement{Content: "_"}, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("inline content with unclosed italic text", func() { + source := "a paragraph with _some unclosed italic content" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with _some unclosed italic content"}, }, }, }, @@ -5392,16 +1919,14 @@ var _ = Describe("quoted texts", func() { It("unbalanced monospace text - extra on left", func() { source := "``some monospace content`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "`some monospace content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "`some monospace content"}, }, }, }, @@ -5413,43 +1938,94 @@ var _ = Describe("quoted texts", func() { It("unbalanced monospace text - extra on right", func() { source := "`some monospace content``" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "some monospace content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "some monospace content"}, }, - types.StringElement{Content: "`"}, }, + &types.StringElement{Content: "`"}, }, }, }, } Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - }) - It("inline content with unbalanced bold text", func() { - source := "a paragraph with *some bold content" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with *some bold content"}, + It("inline content with unclosed monospace text", func() { + source := "a paragraph with `some unclosed monospace content" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with `some unclosed monospace content"}, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) }) + Context("unbalanced marked text", func() { + + It("unbalanced marked text - extra on left", func() { + source := "##some marked content#" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMarked, + Elements: []interface{}{ + &types.StringElement{Content: "#some marked content"}, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("unbalanced marked text - extra on right", func() { + source := "#some marked content##" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMarked, + Elements: []interface{}{ + &types.StringElement{Content: "some marked content"}, + }, + }, + &types.StringElement{Content: "#"}, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("inline content with unclosed marked text", func() { + source := "a paragraph with #some unclosed marked content" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with #some unclosed marked content"}, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) }) Context("prevented substitution", func() { @@ -5460,13 +2036,11 @@ var _ = Describe("quoted texts", func() { It("escaped bold text with single backslash", func() { source := `\*bold content*` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "*bold content*"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "*bold content*"}, }, }, }, @@ -5476,13 +2050,11 @@ var _ = Describe("quoted texts", func() { It("escaped bold text with multiple backslashes", func() { source := `\\*bold content*` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\*bold content*`}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\*bold content*`}, }, }, }, @@ -5492,13 +2064,11 @@ var _ = Describe("quoted texts", func() { It("escaped bold text with double quote", func() { source := `\\**bold content**` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `**bold content**`}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `**bold content**`}, }, }, }, @@ -5508,13 +2078,11 @@ var _ = Describe("quoted texts", func() { It("escaped bold text with double quote and more backslashes", func() { source := `\\\**bold content**` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\**bold content**`}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\**bold content**`}, }, }, }, @@ -5524,13 +2092,11 @@ var _ = Describe("quoted texts", func() { It("escaped bold text with unbalanced double quote", func() { source := `\**bold content*` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `**bold content*`}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `**bold content*`}, }, }, }, @@ -5540,13 +2106,11 @@ var _ = Describe("quoted texts", func() { It("escaped bold text with unbalanced double quote and more backslashes", func() { source := `\\\**bold content*` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\\**bold content*`}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\\**bold content*`}, }, }, }, @@ -5559,20 +2123,18 @@ var _ = Describe("quoted texts", func() { It("escaped bold text with nested italic text", func() { source := `\*_italic content_*` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "*"}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "*"}, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "italic content"}, }, - types.StringElement{Content: "*"}, }, + &types.StringElement{Content: "*"}, }, }, }, @@ -5582,20 +2144,18 @@ var _ = Describe("quoted texts", func() { It("escaped bold text with unbalanced double quote and nested italic test", func() { source := `\**_italic content_*` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "**"}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "italic content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "**"}, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "italic content"}, }, - types.StringElement{Content: "*"}, }, + &types.StringElement{Content: "*"}, }, }, }, @@ -5605,20 +2165,18 @@ var _ = Describe("quoted texts", func() { It("escaped bold text with nested italic", func() { source := `\*bold _and italic_ content*` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "*bold "}, - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "and italic"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "*bold "}, + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "and italic"}, }, - types.StringElement{Content: " content*"}, }, + &types.StringElement{Content: " content*"}, }, }, }, @@ -5635,13 +2193,11 @@ var _ = Describe("quoted texts", func() { It("escaped italic text with single quote", func() { source := `\_italic content_` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "_italic content_"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "_italic content_"}, }, }, }, @@ -5651,13 +2207,11 @@ var _ = Describe("quoted texts", func() { It("escaped italic text with single quote and more backslashes", func() { source := `\\_italic content_` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\_italic content_`}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\_italic content_`}, }, }, }, @@ -5667,13 +2221,11 @@ var _ = Describe("quoted texts", func() { It("escaped italic text with double quote with 2 backslashes", func() { source := `\\__italic content__` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `__italic content__`}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `__italic content__`}, }, }, }, @@ -5683,13 +2235,11 @@ var _ = Describe("quoted texts", func() { It("escaped italic text with double quote with 3 backslashes", func() { source := `\\\__italic content__` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\__italic content__`}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\__italic content__`}, }, }, }, @@ -5699,13 +2249,11 @@ var _ = Describe("quoted texts", func() { It("escaped italic text with unbalanced double quote", func() { source := `\__italic content_` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `__italic content_`}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `__italic content_`}, }, }, }, @@ -5715,13 +2263,11 @@ var _ = Describe("quoted texts", func() { It("escaped italic text with unbalanced double quote and more backslashes", func() { source := `\\\__italic content_` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\\__italic content_`}, // only 1 backslash remove - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\\__italic content_`}, // only 1 backslash remove }, }, }, @@ -5734,20 +2280,18 @@ var _ = Describe("quoted texts", func() { It("escaped italic text with nested monospace text", func() { source := `\` + "_`monospace content`_" // gives: \_`monospace content`_ - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "_"}, - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "monospace content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "_"}, + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "monospace content"}, }, - types.StringElement{Content: "_"}, }, + &types.StringElement{Content: "_"}, }, }, }, @@ -5757,20 +2301,18 @@ var _ = Describe("quoted texts", func() { It("escaped italic text with unbalanced double quote and nested bold test", func() { source := `\__*bold content*_` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "__"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "__"}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold content"}, }, - types.StringElement{Content: "_"}, }, + &types.StringElement{Content: "_"}, }, }, }, @@ -5780,20 +2322,18 @@ var _ = Describe("quoted texts", func() { It("escaped italic text with nested bold text", func() { source := `\_italic *and bold* content_` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "_italic "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "and bold"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "_italic "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "and bold"}, }, - types.StringElement{Content: " content_"}, }, + &types.StringElement{Content: " content_"}, }, }, }, @@ -5809,13 +2349,11 @@ var _ = Describe("quoted texts", func() { It("escaped monospace text with single quote", func() { source := `\` + "`monospace content`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "`monospace content`"}, // backslash removed - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "`monospace content`"}, // backslash removed }, }, }, @@ -5825,13 +2363,11 @@ var _ = Describe("quoted texts", func() { It("escaped monospace text with single quote and more backslashes", func() { source := `\\` + "`monospace content`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\` + "`monospace content`"}, // only 1 backslash removed - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\` + "`monospace content`"}, // only 1 backslash removed }, }, }, @@ -5841,13 +2377,11 @@ var _ = Describe("quoted texts", func() { It("escaped monospace text with double quote", func() { source := `\\` + "`monospace content``" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\` + "`monospace content``"}, // 2 back slashes "consumed" - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\` + "`monospace content``"}, // 2 back slashes "consumed" }, }, }, @@ -5857,13 +2391,11 @@ var _ = Describe("quoted texts", func() { It("escaped monospace text with double quote and more backslashes", func() { source := `\\\` + "``monospace content``" // 3 backslashes - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\` + "``monospace content``"}, // 2 back slashes "consumed" - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\` + "``monospace content``"}, // 2 back slashes "consumed" }, }, }, @@ -5873,13 +2405,11 @@ var _ = Describe("quoted texts", func() { It("escaped monospace text with unbalanced double quote", func() { source := `\` + "``monospace content`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "``monospace content`"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "``monospace content`"}, }, }, }, @@ -5889,13 +2419,11 @@ var _ = Describe("quoted texts", func() { It("escaped monospace text with unbalanced double quote and more backslashes", func() { source := `\\\` + "``monospace content`" // 3 backslashes - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\\` + "``monospace content`"}, // 2 backslashes removed - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\\` + "``monospace content`"}, // 2 backslashes removed }, }, }, @@ -5908,20 +2436,18 @@ var _ = Describe("quoted texts", func() { It("escaped monospace text with nested bold text", func() { source := `\` + "`*bold content*`" // gives: \`*bold content*` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "`"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "`"}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold content"}, }, - types.StringElement{Content: "`"}, }, + &types.StringElement{Content: "`"}, }, }, }, @@ -5931,20 +2457,18 @@ var _ = Describe("quoted texts", func() { It("escaped monospace text with unbalanced double backquote and nested bold test", func() { source := `\` + "``*bold content*`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "``"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "``"}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold content"}, }, - types.StringElement{Content: "`"}, }, + &types.StringElement{Content: "`"}, }, }, }, @@ -5954,20 +2478,18 @@ var _ = Describe("quoted texts", func() { It("escaped monospace text with nested bold text", func() { source := `\` + "`monospace *and bold* content`" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "`monospace "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "and bold"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "`monospace "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "and bold"}, }, - types.StringElement{Content: " content`"}, }, + &types.StringElement{Content: " content`"}, }, }, }, @@ -5983,13 +2505,11 @@ var _ = Describe("quoted texts", func() { It("escaped subscript text with single quote", func() { source := `\~subscriptcontent~` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "~subscriptcontent~"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "~subscriptcontent~"}, }, }, }, @@ -5999,13 +2519,11 @@ var _ = Describe("quoted texts", func() { It("escaped subscript text with single quote and more backslashes", func() { source := `\\~subscriptcontent~` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\~subscriptcontent~`}, // only 1 backslash removed - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\~subscriptcontent~`}, // only 1 backslash removed }, }, }, @@ -6019,20 +2537,18 @@ var _ = Describe("quoted texts", func() { It("escaped subscript text with nested bold text", func() { source := `\~*boldcontent*~` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "~"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "boldcontent"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "~"}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "boldcontent"}, }, - types.StringElement{Content: "~"}, }, + &types.StringElement{Content: "~"}, }, }, }, @@ -6042,20 +2558,18 @@ var _ = Describe("quoted texts", func() { It("escaped subscript text with nested bold text", func() { source := `\~subscript *and bold* content~` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\~subscript `}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "and bold"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\~subscript `}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "and bold"}, }, - types.StringElement{Content: " content~"}, }, + &types.StringElement{Content: " content~"}, }, }, }, @@ -6071,13 +2585,11 @@ var _ = Describe("quoted texts", func() { It("escaped superscript text with single quote", func() { source := `\^superscriptcontent^` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "^superscriptcontent^"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "^superscriptcontent^"}, }, }, }, @@ -6087,13 +2599,11 @@ var _ = Describe("quoted texts", func() { It("escaped superscript text with single quote and more backslashes", func() { source := `\\^superscriptcontent^` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\^superscriptcontent^`}, // only 1 backslash removed - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\^superscriptcontent^`}, // only 1 backslash removed }, }, }, @@ -6107,20 +2617,18 @@ var _ = Describe("quoted texts", func() { It("escaped superscript text with nested bold text - case 1", func() { source := `\^*bold content*^` // valid escaped superscript since it has no space within - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `^`}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `^`}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold content"}, }, - types.StringElement{Content: "^"}, }, + &types.StringElement{Content: "^"}, }, }, }, @@ -6130,20 +2638,18 @@ var _ = Describe("quoted texts", func() { It("escaped superscript text with unbalanced double backquote and nested bold test", func() { source := `\^*bold content*^` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "^"}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "^"}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold content"}, }, - types.StringElement{Content: "^"}, }, + &types.StringElement{Content: "^"}, }, }, }, @@ -6153,20 +2659,18 @@ var _ = Describe("quoted texts", func() { It("escaped superscript text with nested bold text - case 2", func() { source := `\^superscript *and bold* content^` // invalid superscript text since it has spaces within - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: `\^superscript `}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "and bold"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: `\^superscript `}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "and bold"}, }, - types.StringElement{Content: " content^"}, }, + &types.StringElement{Content: " content^"}, }, }, }, @@ -6181,21 +2685,19 @@ var _ = Describe("quoted texts", func() { It("image in bold", func() { source := "*a image:foo.png[]*" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlineImage{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "foo.png", }, }, }, @@ -6211,21 +2713,19 @@ var _ = Describe("quoted texts", func() { It("image in italic", func() { source := "_a image:foo.png[]_" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlineImage{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "foo.png", }, }, }, @@ -6241,21 +2741,19 @@ var _ = Describe("quoted texts", func() { It("image in monospace", func() { source := "`a image:foo.png[]`" - expected := types.Document{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteMonospace, - Elements: []interface{}{ - types.StringElement{Content: "a "}, - types.InlineImage{ - Location: types.Location{ - Path: []interface{}{ - types.StringElement{ - Content: "foo.png", - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteMonospace, + Elements: []interface{}{ + &types.StringElement{Content: "a "}, + &types.InlineImage{ + Location: &types.Location{ + Path: []interface{}{ + &types.StringElement{ + Content: "foo.png", }, }, }, diff --git a/pkg/parser/section_test.go b/pkg/parser/section_test.go index 8ab2581d..17a66373 100644 --- a/pkg/parser/section_test.go +++ b/pkg/parser/section_test.go @@ -10,48 +10,42 @@ import ( var _ = Describe("sections", func() { - Context("draft documents", func() { + Context("in raw documents", func() { Context("valid sections", func() { It("header only", func() { source := "= a header" doctitle := []interface{}{ - types.StringElement{Content: "a header"}, + types.RawLine("a header"), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, }, - Level: 0, - Title: doctitle, - Elements: []interface{}{}, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("header with many spaces around content", func() { source := "= a header " doctitle := []interface{}{ - types.StringElement{Content: "a header "}, + types.RawLine("a header "), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, }, - Level: 0, - Title: doctitle, - Elements: []interface{}{}, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("header and paragraph", func() { @@ -60,31 +54,32 @@ var _ = Describe("sections", func() { and a paragraph` doctitle := []interface{}{ - types.StringElement{Content: "a header"}, + types.RawLine("a header"), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", - }, - Level: 0, - Title: doctitle, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "and a paragraph", - }, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, + }, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("and a paragraph"), }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("two sections with level 0", func() { @@ -92,56 +87,53 @@ and a paragraph` = a second header` doctitle := []interface{}{ - types.StringElement{Content: "a first header"}, + types.RawLine("a first header"), } otherDoctitle := []interface{}{ - types.StringElement{Content: "a second header"}, + types.RawLine("a second header"), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_first_header", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, }, - Level: 0, - Title: doctitle, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_second_header", + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Section{ + Level: 0, + Title: otherDoctitle, }, - Level: 0, - Title: otherDoctitle, - Elements: []interface{}{}, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("section level 1 alone", func() { source := `== section 1` section1Title := []interface{}{ - types.StringElement{Content: "section 1"}, + types.RawLine("section 1"), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_1", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: section1Title, }, - Level: 1, - Title: section1Title, - Elements: []interface{}{}, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("section level 1 with custom idseparator", func() { @@ -149,54 +141,50 @@ and a paragraph` == section 1` section1Title := []interface{}{ - types.StringElement{Content: "section 1"}, + types.RawLine("section 1"), } - expected := types.DraftDocument{ - Attributes: types.Attributes{ - types.AttrIDSeparator: "-", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrIDSeparator, + Value: "-", + }, + }, }, - Elements: []interface{}{ - types.AttributeDeclaration{ - Name: types.AttrIDSeparator, - Value: "-", + { + Elements: []interface{}{ + &types.BlankLine{}, }, - types.BlankLine{}, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section-1", + }, + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: section1Title, }, - Level: 1, - Title: section1Title, - Elements: []interface{}{}, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("section level 1 with quoted text", func() { source := `== *2 spaces and bold content*` sectionTitle := []interface{}{ - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "2 spaces and bold content"}, - }, - }, + types.RawLine("*2 spaces and bold content*"), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_2_spaces_and_bold_content", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: sectionTitle, }, - Level: 1, - Title: sectionTitle, - Elements: []interface{}{}, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("section level 0 with nested section level 1", func() { @@ -204,33 +192,34 @@ and a paragraph` == section 1` doctitle := []interface{}{ - types.StringElement{Content: "a header"}, + types.RawLine("a header"), } section1Title := []interface{}{ - types.StringElement{Content: "section 1"}, + types.RawLine("section 1"), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, }, - Level: 0, - Title: doctitle, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_1", + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: section1Title, }, - Level: 1, - Title: section1Title, - Elements: []interface{}{}, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("section level 0 with nested section level 2", func() { @@ -238,61 +227,62 @@ and a paragraph` === section 2` doctitle := []interface{}{ - types.StringElement{Content: "a header"}, + types.RawLine("a header"), } section2Title := []interface{}{ - types.StringElement{Content: "section 2"}, + types.RawLine("section 2"), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, }, - Level: 0, - Title: doctitle, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_2", + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Section{ + Level: 2, + Title: section2Title, }, - Level: 2, - Title: section2Title, - Elements: []interface{}{}, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("section level 1 with immediate paragraph", func() { source := `== a title and a paragraph` section1Title := []interface{}{ - types.StringElement{Content: "a title"}, + types.RawLine("a title"), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_title", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: section1Title, }, - Level: 1, - Title: section1Title, - Elements: []interface{}{}, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "and a paragraph"}, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("and a paragraph"), }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("section level 1 with a paragraph separated by empty line", func() { @@ -300,57 +290,65 @@ and a paragraph` and a paragraph` section1Title := []interface{}{ - types.StringElement{Content: "a title"}, + types.RawLine("a title"), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_title", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: section1Title, }, - Level: 1, - Title: section1Title, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "and a paragraph"}, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("and a paragraph"), }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("section level 1 with a paragraph separated by non-empty line", func() { source := "== a title\n \nand a paragraph" section1Title := []interface{}{ - types.StringElement{Content: "a title"}, + types.RawLine("a title"), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_title", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: section1Title, }, - Level: 1, - Title: section1Title, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "and a paragraph"}, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("and a paragraph"), }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("section levels 1, 2, 3, 2", func() { @@ -364,97 +362,112 @@ a paragraph == Section B a paragraph` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", - }, - Level: 0, - Title: []interface{}{ - types.StringElement{Content: "a header"}, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + types.RawLine("a header"), + }, }, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - Level: 1, - Title: []interface{}{ - types.StringElement{Content: "Section A"}, - }, - Elements: []interface{}{}, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, + }, + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: []interface{}{ + types.RawLine("Section A"), }, }, }, - types.BlankLine{}, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a", - }, - Level: 2, - Title: []interface{}{ - types.StringElement{Content: "Section A.a"}, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("a paragraph"), + }, }, - Elements: []interface{}{}, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Section{ + Level: 2, + Title: []interface{}{ + types.RawLine("Section A.a"), }, }, }, - types.BlankLine{}, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_b", + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("a paragraph"), + }, }, - Level: 1, - Title: []interface{}{ - types.StringElement{Content: "Section B"}, + }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: []interface{}{ + types.RawLine("Section B"), + }, }, - Elements: []interface{}{}, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("a paragraph"), }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) - It("single section with custom IDs", func() { + It("single section with custom ID", func() { source := `[[custom_header]] == a header` sectionTitle := []interface{}{ - types.StringElement{Content: "a header"}, + types.RawLine("a header"), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "custom_header", - types.AttrCustomID: true, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "custom_header", + }, + Title: sectionTitle, }, - Level: 1, - Title: sectionTitle, - Elements: []interface{}{}, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("multiple sections with custom IDs", func() { @@ -467,57 +480,65 @@ a paragraph` == Section B a paragraph` doctitle := []interface{}{ - types.StringElement{Content: "a header"}, + types.RawLine("a header"), } fooTitle := []interface{}{ - types.StringElement{Content: "Section F "}, + types.RawLine("Section F [[ignored]] [[foo]]"), } barTitle := []interface{}{ - types.StringElement{Content: "Section B"}, + types.RawLine("Section B"), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "custom_header", - types.AttrCustomID: true, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: doctitle, + Attributes: types.Attributes{ + types.AttrID: "custom_header", + }, }, - Level: 0, - Title: doctitle, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "foo", - types.AttrCustomID: true, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: fooTitle, }, - Level: 1, - Title: fooTitle, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "bar", - types.AttrCustomID: true, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "bar", + }, + Title: barTitle, }, - Level: 1, - Title: barTitle, - Elements: []interface{}{}, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("a paragraph"), }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("sections with same title", func() { @@ -525,118 +546,35 @@ a paragraph` == section 1` section1aTitle := []interface{}{ - types.StringElement{Content: "section 1"}, + types.RawLine("section 1"), } section1bTitle := []interface{}{ - types.StringElement{Content: "section 1"}, - } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_1", - }, - Level: 1, - Title: section1aTitle, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_1", - }, - Level: 1, - Title: section1bTitle, - Elements: []interface{}{}, - }, - }, + types.RawLine("section 1"), } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("section with link in title", func() { - source := `== link to https://foo.bar -` - section1aTitle := []interface{}{ - types.StringElement{Content: "link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{Content: "foo.bar"}, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: section1aTitle, }, }, }, - } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_link_to_httpsfoo_bar", - }, - Level: 1, - Title: section1aTitle, - Elements: []interface{}{}, + { + Elements: []interface{}{ + &types.BlankLine{}, }, }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("section 0, 1 and paragraph with bold quote", func() { - - source := `= a header - -== section 1 - -a paragraph with *bold content*` - - title := []interface{}{ - types.StringElement{Content: "a header"}, - } - section1Title := []interface{}{ - types.StringElement{Content: "section 1"}, - } - expected := types.Document{ - ElementReferences: types.ElementReferences{ - "_a_header": title, - "_section_1": section1Title, - }, - Elements: []interface{}{ - types.Section{ - Level: 0, - Attributes: types.Attributes{ - types.AttrID: "_a_header", - }, - Title: title, - Elements: []interface{}{ - types.Section{ - Level: 1, - Title: section1Title, - Attributes: types.Attributes{ - types.AttrID: "_section_1", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph with "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, - }, - }, - }, - }, - }, - }, + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: section1bTitle, }, }, }, } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("header with preamble then section level 1", func() { @@ -645,40 +583,47 @@ a paragraph with *bold content*` a short preamble == section 1` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_title", - }, - Level: 0, - Title: []interface{}{ - types.StringElement{Content: "a title"}, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + types.RawLine("a title"), + }, }, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a short preamble"}, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("a short preamble"), }, }, }, - types.BlankLine{}, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_1", - }, - Level: 1, - Title: []interface{}{ - types.StringElement{Content: "section 1"}, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: []interface{}{ + types.RawLine("section 1"), + }, }, - Elements: []interface{}{}, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("header with doc attributes and preamble then section level 1", func() { @@ -688,81 +633,96 @@ a short preamble a short preamble == section 1` - expected := types.DraftDocument{ - Attributes: types.Attributes{ - types.AttrTableOfContents: nil, - }, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_title", - }, - Level: 0, - Title: []interface{}{ - types.StringElement{Content: "a title"}, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + types.RawLine("a title"), + }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "toc", + }, + }, }, - Elements: []interface{}{}, }, - types.AttributeDeclaration{ - Name: "toc", + }, + { + Elements: []interface{}{ + &types.BlankLine{}, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a short preamble"}, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("a short preamble"), }, }, }, - types.BlankLine{}, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_1", - }, - Level: 1, - Title: []interface{}{ - types.StringElement{Content: "section 1"}, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Section{ + Level: 1, + Title: []interface{}{ + types.RawLine("section 1"), + }, }, - Elements: []interface{}{}, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("header with 2 paragraphs and CRLFs", func() { source := "= a title\r\n\r\na first paragraph\r\n\r\na second paragraph" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_title", - }, - Level: 0, - Title: []interface{}{ - types.StringElement{Content: "a title"}, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + types.RawLine("a title"), + }, }, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first paragraph"}, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("a first paragraph"), }, }, }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second paragraph"}, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("a second paragraph"), }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) }) @@ -770,41 +730,38 @@ a short preamble Context("invalid sections", func() { It("header invalid - missing space", func() { source := "=a header" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "=a header"}, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + types.RawLine("=a header"), }, }, }, - }} - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }, + } + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("header invalid - header space", func() { source := " = a header with a prefix space" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.LiteralBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Literal, - types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: " = a header with a prefix space", - }, + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrStyle: types.Literal, + types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, + }, + Elements: []interface{}{ + types.RawLine(" = a header with a prefix space"), }, }, }, }, } - result, err := ParseDraftDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) It("header with invalid section1", func() { @@ -812,152 +769,164 @@ a short preamble == section with prefix space` title := []interface{}{ - types.StringElement{Content: "a header"}, + types.RawLine("a header"), } - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", + expected := []types.DocumentFragment{ + { + Elements: []interface{}{ + &types.DocumentHeader{ + Title: title, }, - Level: 0, - Title: title, - Elements: []interface{}{}, }, - types.BlankLine{}, - types.LiteralBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Literal, - types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: " == section with prefix space", - }, + }, + { + Elements: []interface{}{ + &types.BlankLine{}, + }, + }, + { + Elements: []interface{}{ + &types.Paragraph{ + Attributes: types.Attributes{ + types.AttrStyle: types.Literal, + types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, + }, + Elements: []interface{}{ + types.RawLine(" == section with prefix space"), }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocumentFragments(source)).To(MatchDocumentFragments(expected)) }) - }) + }) - Context("unsupported syntax", func() { + Context("in final documents", func() { - It("should not fail with underlined title", func() { - source := `Document Title -============== -Doc Writer ` - expected := types.DraftDocument{ + Context("valid sections", func() { + + It("header only", func() { + source := "= a header" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "Document Title"}, - }, - { - types.StringElement{Content: "=============="}, + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "a header", }, - { - types.StringElement{ - Content: "Doc Writer ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "thedoc@asciidoctor.org", - }, - types.SpecialCharacter{ - Name: ">", - }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("header with many spaces around content", func() { + source := "= a header " + expected := &types.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "a header ", }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - }) - }) - Context("final documents", func() { + It("header and paragraph", func() { + source := `= a header - Context("valid sections", func() { +and a paragraph` - It("header only", func() { - source := "= a header" - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } - expected := types.Document{ - ElementReferences: types.ElementReferences{ - "_a_header": doctitle, - }, + expected := &types.Document{ Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "a header"}, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "and a paragraph"}, }, - Level: 0, - Title: doctitle, - Elements: []interface{}{}, }, }, } Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("header with many spaces around content", func() { - source := "= a header " - doctitle := []interface{}{ - types.StringElement{Content: "a header "}, + It("section with link in title", func() { + source := `== link to https://foo.bar +` + section1aTitle := []interface{}{ + &types.StringElement{Content: "link to "}, + &types.InlineLink{ + Location: &types.Location{ + Scheme: "https://", + Path: []interface{}{ + &types.StringElement{Content: "foo.bar"}, + }, + }, + }, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "_a_header": doctitle, + "_link_to_httpsfoo_bar": section1aTitle, }, Elements: []interface{}{ - types.Section{ + &types.Section{ Attributes: types.Attributes{ - types.AttrID: "_a_header", + types.AttrID: "_link_to_httpsfoo_bar", }, - Level: 0, - Title: doctitle, - Elements: []interface{}{}, + Level: 1, + Title: section1aTitle, }, }, } Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("header and paragraph", func() { + It("section 0, 1 and paragraph with bold quote", func() { source := `= a header + +== section 1 -and a paragraph` +a paragraph with *bold content*` - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, + section1Title := []interface{}{ + &types.StringElement{Content: "section 1"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "_a_header": doctitle, + "_section_1": section1Title, }, Elements: []interface{}{ - types.Section{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "a header"}, + }, + }, + &types.Section{ + Level: 1, + Title: section1Title, Attributes: types.Attributes{ - types.AttrID: "_a_header", + types.AttrID: "_section_1", }, - Level: 0, - Title: doctitle, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "and a paragraph"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph with "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold content"}, + }, }, }, }, @@ -972,34 +941,26 @@ and a paragraph` source := `= a first header = a second header` - doctitle := []interface{}{ - types.StringElement{Content: "a first header"}, - } otherDoctitle := []interface{}{ - types.StringElement{Content: "a second header"}, + &types.StringElement{Content: "a second header"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "_a_first_header": doctitle, "_a_second_header": otherDoctitle, }, Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_first_header", + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "a first header"}, }, - Level: 0, - Title: doctitle, - Elements: []interface{}{}, }, - types.Section{ + &types.Section{ Attributes: types.Attributes{ types.AttrID: "_a_second_header", }, - Level: 0, - Title: otherDoctitle, - Elements: []interface{}{}, + Level: 0, + Title: otherDoctitle, }, }, } @@ -1009,20 +970,19 @@ and a paragraph` It("section level 1 alone", func() { source := `== section 1` section1Title := []interface{}{ - types.StringElement{Content: "section 1"}, + &types.StringElement{Content: "section 1"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ "_section_1": section1Title, }, Elements: []interface{}{ - types.Section{ + &types.Section{ Attributes: types.Attributes{ types.AttrID: "_section_1", }, - Level: 1, - Title: section1Title, - Elements: []interface{}{}, + Level: 1, + Title: section1Title, }, }, } @@ -1032,25 +992,24 @@ and a paragraph` It("section level 1 with quoted text", func() { source := `== *2 spaces and bold content*` sectionTitle := []interface{}{ - types.QuotedText{ + &types.QuotedText{ Kind: types.SingleQuoteBold, Elements: []interface{}{ - types.StringElement{Content: "2 spaces and bold content"}, + &types.StringElement{Content: "2 spaces and bold content"}, }, }, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ "_2_spaces_and_bold_content": sectionTitle, }, Elements: []interface{}{ - types.Section{ + &types.Section{ Attributes: types.Attributes{ types.AttrID: "_2_spaces_and_bold_content", }, - Level: 1, - Title: sectionTitle, - Elements: []interface{}{}, + Level: 1, + Title: sectionTitle, }, }, } @@ -1061,34 +1020,25 @@ and a paragraph` source := `= a header == section 1` - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } section1Title := []interface{}{ - types.StringElement{Content: "section 1"}, + &types.StringElement{Content: "section 1"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "_a_header": doctitle, "_section_1": section1Title, }, Elements: []interface{}{ - types.Section{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "a header"}, + }, + }, + &types.Section{ Attributes: types.Attributes{ - types.AttrID: "_a_header", - }, - Level: 0, - Title: doctitle, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_1", - }, - Level: 1, - Title: section1Title, - Elements: []interface{}{}, - }, + types.AttrID: "_section_1", }, + Level: 1, + Title: section1Title, }, }, } @@ -1099,34 +1049,25 @@ and a paragraph` source := `= a header === section 2` - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } section2Title := []interface{}{ - types.StringElement{Content: "section 2"}, + &types.StringElement{Content: "section 2"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "_a_header": doctitle, "_section_2": section2Title, }, Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "a header"}, }, - Level: 0, - Title: doctitle, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_2", - }, - Level: 2, - Title: section2Title, - Elements: []interface{}{}, - }, + }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_2", }, + Level: 2, + Title: section2Title, }, }, } @@ -1137,25 +1078,23 @@ and a paragraph` source := `== a title and a paragraph` section1Title := []interface{}{ - types.StringElement{Content: "a title"}, + &types.StringElement{Content: "a title"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ "_a_title": section1Title, }, Elements: []interface{}{ - types.Section{ + &types.Section{ Attributes: types.Attributes{ types.AttrID: "_a_title", }, Level: 1, Title: section1Title, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "and a paragraph"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "and a paragraph"}, }, }, }, @@ -1170,25 +1109,23 @@ and a paragraph` and a paragraph` section1Title := []interface{}{ - types.StringElement{Content: "a title"}, + &types.StringElement{Content: "a title"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ "_a_title": section1Title, }, Elements: []interface{}{ - types.Section{ + &types.Section{ Attributes: types.Attributes{ types.AttrID: "_a_title", }, Level: 1, Title: section1Title, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "and a paragraph"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "and a paragraph"}, }, }, }, @@ -1201,25 +1138,23 @@ and a paragraph` It("section level 1 with a paragraph separated by non-empty line", func() { source := "== a title\n \nand a paragraph" section1Title := []interface{}{ - types.StringElement{Content: "a title"}, + &types.StringElement{Content: "a title"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ "_a_title": section1Title, }, Elements: []interface{}{ - types.Section{ + &types.Section{ Attributes: types.Attributes{ types.AttrID: "_a_title", }, Level: 1, Title: section1Title, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "and a paragraph"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "and a paragraph"}, }, }, }, @@ -1229,7 +1164,7 @@ and a paragraph` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("section levels 1, 2, 3, 2", func() { + It("section levels 0, 1, 2, 1", func() { source := `= a header == Section A @@ -1240,79 +1175,65 @@ a paragraph == Section B a paragraph` - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } sectionATitle := []interface{}{ - types.StringElement{Content: "Section A"}, + &types.StringElement{Content: "Section A"}, } sectionAaTitle := []interface{}{ - types.StringElement{Content: "Section A.a"}, + &types.StringElement{Content: "Section A.a"}, } sectionBTitle := []interface{}{ - types.StringElement{Content: "Section B"}, + &types.StringElement{Content: "Section B"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "_a_header": doctitle, "_section_a": sectionATitle, "_section_a_a": sectionAaTitle, "_section_b": sectionBTitle, }, Elements: []interface{}{ - types.Section{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "a header"}, + }, + }, + &types.Section{ Attributes: types.Attributes{ - types.AttrID: "_a_header", + types.AttrID: "_section_a", }, - Level: 0, - Title: doctitle, + Level: 1, + Title: sectionATitle, Elements: []interface{}{ - types.Section{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph"}, + }, + }, + &types.Section{ Attributes: types.Attributes{ - types.AttrID: "_section_a", + types.AttrID: "_section_a_a", }, - Level: 1, - Title: sectionATitle, + Level: 2, + Title: sectionAaTitle, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a", - }, - Level: 2, - Title: sectionAaTitle, + &types.Paragraph{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, + &types.StringElement{Content: "a paragraph"}, }, }, }, }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_b", - }, - Level: 1, - Title: sectionBTitle, + }, + }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_b", + }, + Level: 1, + Title: sectionBTitle, + Elements: []interface{}{ + &types.Paragraph{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, + &types.StringElement{Content: "a paragraph"}, }, }, }, @@ -1333,77 +1254,63 @@ a paragraph === Section A.b a paragraph` - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } sectionATitle := []interface{}{ - types.StringElement{Content: "Section A"}, + &types.StringElement{Content: "Section A"}, } sectionAaTitle := []interface{}{ - types.StringElement{Content: "Section A.a"}, + &types.StringElement{Content: "Section A.a"}, } sectionBTitle := []interface{}{ - types.StringElement{Content: "Section A.b"}, + &types.StringElement{Content: "Section A.b"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "_a_header": doctitle, "_section_a": sectionATitle, "_section_a_a": sectionAaTitle, "_section_a_b": sectionBTitle, }, Elements: []interface{}{ - types.Section{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "a header"}, + }, + }, + &types.Section{ Attributes: types.Attributes{ - types.AttrID: "_a_header", + types.AttrID: "_section_a", }, - Level: 0, - Title: doctitle, + Level: 1, + Title: sectionATitle, Elements: []interface{}{ - types.Section{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph"}, + }, + }, + &types.Section{ Attributes: types.Attributes{ - types.AttrID: "_section_a", + types.AttrID: "_section_a_a", }, - Level: 1, - Title: sectionATitle, + Level: 2, + Title: sectionAaTitle, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a", - }, - Level: 2, - Title: sectionAaTitle, + &types.Paragraph{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, + &types.StringElement{Content: "a paragraph"}, }, }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_b", - }, - Level: 2, - Title: sectionBTitle, + }, + }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_a_b", + }, + Level: 2, + Title: sectionBTitle, + Elements: []interface{}{ + &types.Paragraph{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, + &types.StringElement{Content: "a paragraph"}, }, }, }, @@ -1426,77 +1333,63 @@ a paragraph ==== Section A.b a paragraph` - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } sectionATitle := []interface{}{ - types.StringElement{Content: "Section A"}, + &types.StringElement{Content: "Section A"}, } sectionAaTitle := []interface{}{ - types.StringElement{Content: "Section A.a"}, + &types.StringElement{Content: "Section A.a"}, } sectionBTitle := []interface{}{ - types.StringElement{Content: "Section A.b"}, + &types.StringElement{Content: "Section A.b"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "_a_header": doctitle, "_section_a": sectionATitle, "_section_a_a": sectionAaTitle, "_section_a_b": sectionBTitle, }, Elements: []interface{}{ - types.Section{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "a header"}, + }, + }, + &types.Section{ Attributes: types.Attributes{ - types.AttrID: "_a_header", + types.AttrID: "_section_a", }, - Level: 0, - Title: doctitle, + Level: 2, + Title: sectionATitle, Elements: []interface{}{ - types.Section{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a paragraph"}, + }, + }, + &types.Section{ Attributes: types.Attributes{ - types.AttrID: "_section_a", + types.AttrID: "_section_a_a", }, - Level: 2, - Title: sectionATitle, + Level: 3, + Title: sectionAaTitle, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a", - }, - Level: 3, - Title: sectionAaTitle, + &types.Paragraph{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, + &types.StringElement{Content: "a paragraph"}, }, }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_b", - }, - Level: 3, - Title: sectionBTitle, + }, + }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_section_a_b", + }, + Level: 3, + Title: sectionBTitle, + Elements: []interface{}{ + &types.Paragraph{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, + &types.StringElement{Content: "a paragraph"}, }, }, }, @@ -1508,25 +1401,24 @@ a paragraph` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("single section with custom IDs", func() { + It("single section with custom ID", func() { source := `[[custom_header]] == a header` sectionTitle := []interface{}{ - types.StringElement{Content: "a header"}, + &types.StringElement{Content: "a header"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ "custom_header": sectionTitle, }, Elements: []interface{}{ - types.Section{ + &types.Section{ Attributes: types.Attributes{ types.AttrID: "custom_header", types.AttrCustomID: true, }, - Level: 1, - Title: sectionTitle, - Elements: []interface{}{}, + Level: 1, + Title: sectionTitle, }, }, } @@ -1542,54 +1434,57 @@ a paragraph` [[bar]] == Section B a paragraph` - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } fooTitle := []interface{}{ - types.StringElement{Content: "Section F "}, + &types.StringElement{Content: "Section F "}, + &types.Attribute{ + Key: "id", + Value: "ignored", + }, + &types.StringElement{ + Content: " ", + }, + &types.Attribute{ + Key: "id", + Value: "foo", + }, } barTitle := []interface{}{ - types.StringElement{Content: "Section B"}, + &types.StringElement{Content: "Section B"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "custom_header": doctitle, - "foo": fooTitle, - "bar": barTitle, + "foo": fooTitle, + "bar": barTitle, }, Elements: []interface{}{ - types.Section{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "a header"}, + }, Attributes: types.Attributes{ - types.AttrID: "custom_header", + types.AttrID: "custom_header", + // types.AttrCustomID: true, + }, + }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "foo", types.AttrCustomID: true, }, - Level: 0, - Title: doctitle, + Level: 1, + Title: fooTitle, + }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "bar", + types.AttrCustomID: true, + }, + Level: 1, + Title: barTitle, Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "foo", - types.AttrCustomID: true, - }, - Level: 1, - Title: fooTitle, - Elements: []interface{}{}, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "bar", - types.AttrCustomID: true, - }, - Level: 1, - Title: barTitle, + &types.Paragraph{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, + &types.StringElement{Content: "a paragraph"}, }, }, }, @@ -1604,33 +1499,31 @@ a paragraph` == section 1` section1aTitle := []interface{}{ - types.StringElement{Content: "section 1"}, + &types.StringElement{Content: "section 1"}, } section1bTitle := []interface{}{ - types.StringElement{Content: "section 1"}, + &types.StringElement{Content: "section 1"}, } - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ "_section_1": section1aTitle, "_section_1_2": section1bTitle, }, Elements: []interface{}{ - types.Section{ + &types.Section{ Attributes: types.Attributes{ types.AttrID: "_section_1", }, - Level: 1, - Title: section1aTitle, - Elements: []interface{}{}, + Level: 1, + Title: section1aTitle, }, - types.Section{ + &types.Section{ Attributes: types.Attributes{ types.AttrID: "_section_1_2", }, - Level: 1, - Title: section1bTitle, - Elements: []interface{}{}, + Level: 1, + Title: section1bTitle, }, }, } @@ -1642,38 +1535,35 @@ a paragraph` :idprefix: custom_ == section 1` - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } section1Title := []interface{}{ - types.StringElement{Content: "section 1"}, + &types.StringElement{Content: "section 1"}, } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrIDPrefix: "custom_", - }, + expected := &types.Document{ + // Attributes: types.Attributes{ + // types.AttrIDPrefix: "custom_", + // }, ElementReferences: types.ElementReferences{ - "custom_a_header": doctitle, "custom_section_1": section1Title, }, Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "custom_a_header", + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "a header"}, }, - Level: 0, - Title: doctitle, Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "custom_section_1", - }, - Level: 1, - Title: section1Title, - Elements: []interface{}{}, + &types.AttributeDeclaration{ + Name: types.AttrIDPrefix, + Value: "custom_", }, }, }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "custom_section_1", + }, + Level: 1, + Title: section1Title, + }, }, } Expect(ParseDocument(source)).To(MatchDocument(expected)) @@ -1688,50 +1578,49 @@ a paragraph` :idprefix: custom1b_ == section 1b` - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } section1aTitle := []interface{}{ - types.StringElement{Content: "section 1a"}, + &types.StringElement{Content: "section 1a"}, } section1bTitle := []interface{}{ - types.StringElement{Content: "section 1b"}, + &types.StringElement{Content: "section 1b"}, } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrIDPrefix: "custom1b_", // overridden by second occurrence of attribute declaration - }, + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "custom1a_a_header": doctitle, "custom1a_section_1a": section1aTitle, "custom1b_section_1b": section1bTitle, }, Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "custom1a_a_header", + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "a header"}, }, - Level: 0, - Title: doctitle, Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "custom1a_section_1a", - }, - Level: 1, - Title: section1aTitle, - Elements: []interface{}{}, + &types.AttributeDeclaration{ + Name: "idprefix", + Value: "custom1a_", }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "custom1b_section_1b", - }, - Level: 1, - Title: section1bTitle, - Elements: []interface{}{}, + }, + }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "custom1a_section_1a", + }, + Level: 1, + Title: section1aTitle, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "idprefix", + Value: "custom1b_", }, }, }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "custom1b_section_1b", + }, + Level: 1, + Title: section1bTitle, + }, }, } Expect(ParseDocument(source)).To(MatchDocument(expected)) @@ -1747,50 +1636,47 @@ a paragraph` :idprefix: custom1b_ == section 1b` - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } section1aTitle := []interface{}{ - types.StringElement{Content: "section 1a"}, + &types.StringElement{Content: "section 1a"}, } section1bTitle := []interface{}{ - types.StringElement{Content: "section 1b"}, + &types.StringElement{Content: "section 1b"}, } - expected := types.Document{ - Attributes: types.Attributes{ - "idprefix": "custom1b_", // overridden by second attribute declaration - }, + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "_a_header": doctitle, "custom1a_section_1a": section1aTitle, "custom1b_section_1b": section1bTitle, }, Elements: []interface{}{ - types.Section{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{Content: "a header"}, + }, + }, + &types.AttributeDeclaration{ // separated from header by blankline + Name: "idprefix", + Value: "custom1a_", + }, + &types.Section{ Attributes: types.Attributes{ - types.AttrID: "_a_header", + types.AttrID: "custom1a_section_1a", }, - Level: 0, - Title: doctitle, + Level: 1, + Title: section1aTitle, Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "custom1a_section_1a", - }, - Level: 1, - Title: section1aTitle, - Elements: []interface{}{}, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "custom1b_section_1b", - }, - Level: 1, - Title: section1bTitle, - Elements: []interface{}{}, + &types.AttributeDeclaration{ + Name: "idprefix", + Value: "custom1b_", }, }, }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "custom1b_section_1b", + }, + Level: 1, + Title: section1bTitle, + }, }, } Expect(ParseDocument(source)).To(MatchDocument(expected)) @@ -1802,123 +1688,52 @@ a paragraph` a short preamble == Section 1` - expected := types.Document{ + expected := &types.Document{ ElementReferences: types.ElementReferences{ - "_a_title": []interface{}{ - types.StringElement{Content: "A Title"}, - }, "_section_1": []interface{}{ - types.StringElement{Content: "Section 1"}, + &types.StringElement{Content: "Section 1"}, }, }, Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_title", - }, - Level: 0, + &types.DocumentHeader{ Title: []interface{}{ - types.StringElement{Content: "A Title"}, + &types.StringElement{Content: "A Title"}, }, + }, + &types.Preamble{ Elements: []interface{}{ - types.Preamble{ + &types.Paragraph{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a short preamble"}, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_1", - }, - Level: 1, - Title: []interface{}{ - types.StringElement{Content: "Section 1"}, + &types.StringElement{Content: "a short preamble"}, }, - Elements: []interface{}{}, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("header with doc attributes and preamble then section level 1", func() { - source := `= A Title -:toc: - -a short preamble - -== Section 1` - expected := types.Document{ - Attributes: types.Attributes{ - "toc": nil, - }, - ElementReferences: types.ElementReferences{ - "_a_title": []interface{}{ - types.StringElement{Content: "A Title"}, - }, - "_section_1": []interface{}{ - types.StringElement{Content: "Section 1"}, - }, - }, - Elements: []interface{}{ - types.Section{ + &types.Section{ Attributes: types.Attributes{ - types.AttrID: "_a_title", + types.AttrID: "_section_1", }, - Level: 0, + Level: 1, Title: []interface{}{ - types.StringElement{Content: "A Title"}, - }, - Elements: []interface{}{ - types.TableOfContentsPlaceHolder{}, - types.Preamble{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a short preamble"}, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_1", - }, - Level: 1, - Title: []interface{}{ - types.StringElement{Content: "Section 1"}, - }, - Elements: []interface{}{}, - }, + &types.StringElement{Content: "Section 1"}, }, }, }, } Expect(ParseDocument(source)).To(MatchDocument(expected)) }) + }) Context("invalid sections", func() { It("header invalid - too many spaces", func() { source := "======= a header" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "======= a header"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "======= a header"}, }, }, }} @@ -1927,13 +1742,11 @@ a short preamble It("header invalid - missing space", func() { source := "=a header" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "=a header"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "=a header"}, }, }, }} @@ -1942,18 +1755,16 @@ a short preamble It("header invalid - header space", func() { source := " = a header with a prefix space" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.LiteralBlock{ + &types.Paragraph{ Attributes: types.Attributes{ types.AttrStyle: types.Literal, types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: " = a header with a prefix space", - }, + Elements: []interface{}{ + &types.StringElement{ + Content: " = a header with a prefix space", }, }, }, @@ -1967,32 +1778,21 @@ a short preamble == section with prefix space` title := []interface{}{ - types.StringElement{Content: "a header"}, + &types.StringElement{Content: "a header"}, } - expected := types.Document{ - ElementReferences: types.ElementReferences{ - "_a_header": title, - }, + expected := &types.Document{ Elements: []interface{}{ - types.Section{ + &types.DocumentHeader{ + Title: title, + }, + &types.Paragraph{ Attributes: types.Attributes{ - types.AttrID: "_a_header", + types.AttrStyle: types.Literal, + types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, }, - Level: 0, - Title: title, Elements: []interface{}{ - types.LiteralBlock{ - Attributes: types.Attributes{ - types.AttrStyle: types.Literal, - types.AttrLiteralBlockType: types.LiteralBlockWithSpacesOnFirstLine, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: " == section with prefix space", - }, - }, - }, + &types.StringElement{ + Content: " == section with prefix space", }, }, }, @@ -2009,33 +1809,21 @@ a short preamble source := `Document Title ============== Doc Writer ` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "Document Title", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "Document Title\n==============\nDoc Writer ", }, - { - types.StringElement{ - Content: "==============", - }, + &types.SpecialCharacter{ + Name: "<", }, - { - types.StringElement{ - Content: "Doc Writer ", - }, - types.SpecialCharacter{ - Name: "<", - }, - types.StringElement{ - Content: "thedoc@asciidoctor.org", - }, - types.SpecialCharacter{ - Name: ">", - }, + &types.StringElement{ + Content: "thedoc@asciidoctor.org", + }, + &types.SpecialCharacter{ + Name: ">", }, }, }, diff --git a/pkg/parser/special_character_test.go b/pkg/parser/special_character_test.go index d90c535f..f3e31cdb 100644 --- a/pkg/parser/special_character_test.go +++ b/pkg/parser/special_character_test.go @@ -10,107 +10,107 @@ import ( var _ = Describe("special characters", func() { - It("should parse in paragraph", func() { - source := "* ' &" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.SpecialCharacter{ + Context("in final documents", func() { + + It("should parse in paragraph", func() { + source := "* ' &" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.SpecialCharacter{ Name: "<", }, - types.StringElement{ + &types.StringElement{ Content: "b", }, - types.SpecialCharacter{ + &types.SpecialCharacter{ Name: ">", }, - types.StringElement{ + &types.StringElement{ Content: "*", }, - types.SpecialCharacter{ + &types.SpecialCharacter{ Name: "<", }, - types.StringElement{ + &types.StringElement{ Content: "/b", }, - types.SpecialCharacter{ + &types.SpecialCharacter{ Name: ">", }, - types.StringElement{ + &types.StringElement{ Content: " ", }, - types.SpecialCharacter{ + &types.SpecialCharacter{ Name: "&", }, - types.StringElement{ + &types.StringElement{ Content: "apos; ", }, - types.SpecialCharacter{ + &types.SpecialCharacter{ Name: "&", }, - types.StringElement{ + &types.StringElement{ Content: "amp;", }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("should parse in delimited block", func() { - source := "```" + "\n" + - "* ' &" + "\n" + - "```" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.FencedBlock{ - Lines: [][]interface{}{ - { - types.SpecialCharacter{ + It("should parse in delimited block", func() { + source := "```" + "\n" + + "* ' &" + "\n" + + "```" + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Fenced, + Elements: []interface{}{ + &types.SpecialCharacter{ Name: "<", }, - types.StringElement{ + &types.StringElement{ Content: "b", }, - types.SpecialCharacter{ + &types.SpecialCharacter{ Name: ">", }, - types.StringElement{ + &types.StringElement{ Content: "*", }, - types.SpecialCharacter{ + &types.SpecialCharacter{ Name: "<", }, - types.StringElement{ + &types.StringElement{ Content: "/b", }, - types.SpecialCharacter{ + &types.SpecialCharacter{ Name: ">", }, - types.StringElement{ + &types.StringElement{ Content: " ", }, - types.SpecialCharacter{ + &types.SpecialCharacter{ Name: "&", }, - types.StringElement{ + &types.StringElement{ Content: "apos; ", }, - types.SpecialCharacter{ + &types.SpecialCharacter{ Name: "&", }, - types.StringElement{ + &types.StringElement{ Content: "amp;", }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) }) }) diff --git a/pkg/parser/stats.go b/pkg/parser/stats.go new file mode 100644 index 00000000..a8535f67 --- /dev/null +++ b/pkg/parser/stats.go @@ -0,0 +1,25 @@ +package parser + +import ( + "fmt" + "sort" + "strings" +) + +func PrettyPrintStats(stats *Stats) string { + rules := make([]string, 0, len(stats.ChoiceAltCnt)) + for r := range stats.ChoiceAltCnt { + rules = append(rules, r) + } + sort.Strings(rules) + buf := &strings.Builder{} + for _, r := range rules { + buf.WriteString(fmt.Sprintf("%s ", r)) + for choice, count := range stats.ChoiceAltCnt[r] { + buf.WriteString(fmt.Sprintf("| %s->%dx ", choice, count)) + } + buf.WriteString("\n") + } + buf.WriteString(fmt.Sprintf("---------------\nTotal: %d\n\n", stats.ExprCnt)) + return buf.String() +} diff --git a/pkg/parser/table_of_contents_test.go b/pkg/parser/table_of_contents_test.go new file mode 100644 index 00000000..ed346c98 --- /dev/null +++ b/pkg/parser/table_of_contents_test.go @@ -0,0 +1,390 @@ +package parser_test + +import ( + "github.com/bytesparadise/libasciidoc/pkg/configuration" + "github.com/bytesparadise/libasciidoc/pkg/parser" + "github.com/bytesparadise/libasciidoc/pkg/types" + . "github.com/bytesparadise/libasciidoc/testsupport" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("tables of contents", func() { + + Context("in final documents", func() { + + It("with default level", func() { + /* + = A title + :toc: + == Section A + === Section A.a + === Section A.b + ==== Section that shall not be in ToC + == Section B + === Section B.a + == Section C + */ + c := make(chan types.DocumentFragment, 10) + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "A title", + }, + }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrTableOfContents, + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_section_a", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section A", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 2, + Attributes: types.Attributes{ + types.AttrID: "_section_a_a", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section A.a", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 2, + Attributes: types.Attributes{ + types.AttrID: "_section_a_b", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section A.b", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 3, + Attributes: types.Attributes{ + types.AttrID: "_section_that_shall_not_be_in_ToC", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section that shall not be in ToC", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_section_b", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section B", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 2, + Attributes: types.Attributes{ + types.AttrID: "_section_b_a", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section B.a", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_section_c", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section C", + }, + }, + }, + }, + } + close(c) + + expectedToC := &types.TableOfContents{ + Sections: []*types.ToCSection{ + { + ID: "_section_a", + Level: 1, + Title: "Section A", + Children: []*types.ToCSection{ + { + ID: "_section_a_a", + Level: 2, + Title: "Section A.a", + }, + { + ID: "_section_a_b", + Level: 2, + Title: "Section A.b", + }, + }, + }, + { + ID: "_section_b", + Level: 1, + Title: "Section B", + Children: []*types.ToCSection{ + { + ID: "_section_b_a", + Level: 2, + Title: "Section B.a", + }, + }, + }, + { + ID: "_section_c", + Level: 1, + Title: "Section C", + }, + }, + } + ctx := parser.NewParseContext(configuration.NewConfiguration()) + _, toc, err := parser.Aggregate(ctx, c) + Expect(err).ToNot(HaveOccurred()) + Expect(toc).To(MatchTableOfContents(expectedToC)) + }) + + It("with custom level", func() { + /* + = A title + :toc: + :toclevels: 3 + + == Section A + === Section A.a + === Section A.b + ==== Section that shall be in ToC + == Section B + === Section B.a + == Section C + */ + c := make(chan types.DocumentFragment, 10) + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "A title", + }, + }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: types.AttrTableOfContents, + }, + &types.AttributeDeclaration{ + Name: types.AttrTableOfContentsLevels, + Value: "3", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_section_a", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section A", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 2, + Attributes: types.Attributes{ + types.AttrID: "_section_a_a", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section A.a", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 2, + Attributes: types.Attributes{ + types.AttrID: "_section_a_b", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section A.b", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 3, + Attributes: types.Attributes{ + types.AttrID: "_section_that_shall_be_in_ToC", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section that shall be in ToC", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_section_b", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section B", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 2, + Attributes: types.Attributes{ + types.AttrID: "_section_b_a", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section B.a", + }, + }, + }, + }, + } + c <- types.DocumentFragment{ + Elements: []interface{}{ + &types.Section{ + Level: 1, + Attributes: types.Attributes{ + types.AttrID: "_section_c", + }, + Title: []interface{}{ + &types.StringElement{ + Content: "Section C", + }, + }, + }, + }, + } + close(c) + + expectedToC := &types.TableOfContents{ + Sections: []*types.ToCSection{ + { + ID: "_section_a", + Level: 1, + Title: "Section A", + Children: []*types.ToCSection{ + { + ID: "_section_a_a", + Level: 2, + Title: "Section A.a", + }, + { + ID: "_section_a_b", + Level: 2, + Title: "Section A.b", + Children: []*types.ToCSection{ + { + ID: "_section_that_shall_be_in_ToC", + Level: 3, + Title: "Section that shall be in ToC", + }, + }, + }, + }, + }, + { + ID: "_section_b", + Level: 1, + Title: "Section B", + Children: []*types.ToCSection{ + { + ID: "_section_b_a", + Level: 2, + Title: "Section B.a", + }, + }, + }, + { + ID: "_section_c", + Level: 1, + Title: "Section C", + }, + }, + } + ctx := parser.NewParseContext(configuration.NewConfiguration()) + _, toc, err := parser.Aggregate(ctx, c) + Expect(err).ToNot(HaveOccurred()) + Expect(toc).To(MatchTableOfContents(expectedToC)) + }) + }) +}) diff --git a/pkg/parser/table_test.go b/pkg/parser/table_test.go index 3dc652c7..a122d700 100644 --- a/pkg/parser/table_test.go +++ b/pkg/parser/table_test.go @@ -1,122 +1,210 @@ package parser_test import ( + "strings" + + "github.com/bytesparadise/libasciidoc/pkg/parser" "github.com/bytesparadise/libasciidoc/pkg/types" . "github.com/bytesparadise/libasciidoc/testsupport" + log "github.com/sirupsen/logrus" - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/ginkgo/extensions/table" //nolint golint + . "github.com/onsi/gomega" //nolint golint ) var _ = Describe("tables", func() { - It("1-line table with 2 cells", func() { - source := `|=== -| *foo* foo | _bar_ + Context("in final documents", func() { + + It("1-line table with 2 cells", func() { + source := `|=== +| *cookie* cookie | _pasta_ |=== ` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Table{ - Columns: []types.TableColumn{ - {Width: "50", VAlign: "top", HAlign: "left"}, - {Width: "50", VAlign: "top", HAlign: "left"}, - }, - Lines: []types.TableLine{ - { - Cells: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, + expected := &types.Document{ + Elements: []interface{}{ + &types.Table{ + // Columns: []*types.TableColumn{ + // {Width: "50", VAlign: "top", HAlign: "left"}, + // {Width: "50", VAlign: "top", HAlign: "left"}, + // }, + Rows: []*types.TableRow{ + { + Cells: []*types.TableCell{ + { Elements: []interface{}{ - types.StringElement{ - Content: "foo", + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie", + }, + }, + }, + &types.StringElement{ + Content: " cookie ", }, }, }, - types.StringElement{ - Content: " foo ", + { + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "pasta", + }, + }, + }, + &types.StringElement{ + Content: " ", + }, + }, }, }, - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("1-line table with 3 cells", func() { + source := `|=== +| *cookie* cookie | _pasta_ | chocolate +|===` + expected := &types.Document{ + Elements: []interface{}{ + &types.Table{ + // Columns: []*types.TableColumn{ + // {Width: "33.3333", VAlign: "top", HAlign: "left"}, + // {Width: "33.3333", VAlign: "top", HAlign: "left"}, + // {Width: "33.3334", VAlign: "top", HAlign: "left"}, + // }, + Rows: []*types.TableRow{ + { + Cells: []*types.TableCell{ + { + Elements: []interface{}{ + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{ + Content: "cookie", + }, + }, + }, + &types.StringElement{ + Content: " cookie ", + }, + }, + }, + { Elements: []interface{}{ - types.StringElement{ - Content: "bar", + &types.QuotedText{ + Kind: types.SingleQuoteItalic, + Elements: []interface{}{ + &types.StringElement{ + Content: "pasta", + }, + }, + }, + &types.StringElement{ + Content: " ", }, }, }, - types.StringElement{ - Content: " ", + { + Elements: []interface{}{ + &types.StringElement{ + Content: "chocolate", + }, + }, }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("1-line table with 3 cells", func() { - source := `|=== -| *foo* foo | _bar_ | baz + It("2-line table with 3 cells", func() { + source := `|=== +| some cookies | some chocolate | some pasta +| more cookies | more chocolate | more pasta |===` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Table{ - Columns: []types.TableColumn{ - {Width: "33.3333", VAlign: "top", HAlign: "left"}, - {Width: "33.3333", VAlign: "top", HAlign: "left"}, - {Width: "33.3334", VAlign: "top", HAlign: "left"}, - }, - Lines: []types.TableLine{ - { - Cells: [][]interface{}{ - { - types.QuotedText{ - Kind: types.SingleQuoteBold, + expected := &types.Document{ + Elements: []interface{}{ + &types.Table{ + // Columns: []*types.TableColumn{ + // {Width: "33.3333", VAlign: "top", HAlign: "left"}, + // {Width: "33.3333", VAlign: "top", HAlign: "left"}, + // {Width: "33.3334", VAlign: "top", HAlign: "left"}, + // }, + Rows: []*types.TableRow{ + { + Cells: []*types.TableCell{ + { Elements: []interface{}{ - types.StringElement{ - Content: "foo", + &types.StringElement{ + Content: "some cookies ", }, }, }, - types.StringElement{ - Content: " foo ", + { + Elements: []interface{}{ + &types.StringElement{ + Content: "some chocolate ", + }, + }, + }, + { + Elements: []interface{}{ + &types.StringElement{ + Content: "some pasta", + }, + }, }, }, - { - types.QuotedText{ - Kind: types.SingleQuoteItalic, + }, + { + Cells: []*types.TableCell{ + { Elements: []interface{}{ - types.StringElement{ - Content: "bar", + &types.StringElement{ + Content: "more cookies ", }, }, }, - types.StringElement{ - Content: " ", + { + Elements: []interface{}{ + &types.StringElement{ + Content: "more chocolate ", + }, + }, }, - }, - { - types.StringElement{ - Content: "baz", + { + Elements: []interface{}{ + &types.StringElement{ + Content: "more pasta", + }, + }, }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("table with title, headers and 1 line per cell", func() { - source := `.table title + It("table with title, headers and 1 line per cell", func() { + source := `.table title |=== |heading 1 |heading 2 @@ -126,70 +214,82 @@ var _ = Describe("tables", func() { |row 2, column 1 |row 2, column 2 |===` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Table{ - Attributes: types.Attributes{ - types.AttrTitle: "table title", - }, - Columns: []types.TableColumn{ - {Width: "50", HAlign: "left", VAlign: "top"}, - {Width: "50", HAlign: "left", VAlign: "top"}, - }, - - Header: types.TableLine{ - Cells: [][]interface{}{ - { - types.StringElement{ - Content: "heading 1 ", - }, - }, - { - types.StringElement{ - Content: "heading 2", - }, - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.Table{ + Attributes: types.Attributes{ + types.AttrTitle: "table title", }, - }, + // Columns: []*types.TableColumn{ + // {Width: "50", HAlign: "left", VAlign: "top"}, + // {Width: "50", HAlign: "left", VAlign: "top"}, + // }, - Lines: []types.TableLine{ - { - Cells: [][]interface{}{ + Header: &types.TableRow{ + Cells: []*types.TableCell{ { - types.StringElement{ - Content: "row 1, column 1", + Elements: []interface{}{ + &types.StringElement{ + Content: "heading 1 ", + }, }, }, { - types.StringElement{ - Content: "row 1, column 2", + Elements: []interface{}{ + &types.StringElement{ + Content: "heading 2", + }, }, }, }, }, - { - Cells: [][]interface{}{ - { - types.StringElement{ - Content: "row 2, column 1", + + Rows: []*types.TableRow{ + { + Cells: []*types.TableCell{ + { + Elements: []interface{}{ + &types.StringElement{ + Content: "row 1, column 1", + }, + }, + }, + { + Elements: []interface{}{ + &types.StringElement{ + Content: "row 1, column 2", + }, + }, }, }, - { - types.StringElement{ - Content: "row 2, column 2", + }, + { + Cells: []*types.TableCell{ + { + Elements: []interface{}{ + &types.StringElement{ + Content: "row 2, column 1", + }, + }, + }, + { + Elements: []interface{}{ + &types.StringElement{ + Content: "row 2, column 2", + }, + }, }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("table with title, headers, id and multiple roles, stretch", func() { - source := `.table title + It("table with title, headers, id and multiple roles, stretch", func() { + source := `.table title [#anchor.role1%autowidth.stretch] |=== |heading 1 |heading 2 @@ -200,206 +300,384 @@ var _ = Describe("tables", func() { |row 2, column 1 |row 2, column 2 |===` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Table{ - Attributes: types.Attributes{ - types.AttrTitle: "table title", - types.AttrOptions: []interface{}{"autowidth"}, - types.AttrRoles: []interface{}{"role1", "stretch"}, - types.AttrID: "anchor", - }, - Header: types.TableLine{ - Cells: [][]interface{}{ - { - types.StringElement{ - Content: "heading 1 ", - }, - }, - { - types.StringElement{ - Content: "heading 2", - }, - }, + expected := &types.Document{ + Elements: []interface{}{ + &types.Table{ + Attributes: types.Attributes{ + types.AttrTitle: "table title", + types.AttrOptions: []interface{}{"autowidth"}, + types.AttrRoles: []interface{}{"role1", "stretch"}, + types.AttrID: "anchor", }, - }, - Columns: []types.TableColumn{ - // autowidth clears width - {HAlign: "left", VAlign: "top"}, - {HAlign: "left", VAlign: "top"}, - }, - Lines: []types.TableLine{ - { - Cells: [][]interface{}{ + Header: &types.TableRow{ + Cells: []*types.TableCell{ { - types.StringElement{ - Content: "row 1, column 1", + Elements: []interface{}{ + &types.StringElement{ + Content: "heading 1 ", + }, }, }, { - types.StringElement{ - Content: "row 1, column 2", + Elements: []interface{}{ + &types.StringElement{ + Content: "heading 2", + }, }, }, }, }, - { - Cells: [][]interface{}{ - { - types.StringElement{ - Content: "row 2, column 1", + // Columns: []*types.TableColumn{ + // // autowidth clears width + // {HAlign: "left", VAlign: "top"}, + // {HAlign: "left", VAlign: "top"}, + // }, + Rows: []*types.TableRow{ + { + Cells: []*types.TableCell{ + { + Elements: []interface{}{ + &types.StringElement{ + Content: "row 1, column 1", + }, + }, + }, + { + Elements: []interface{}{ + &types.StringElement{ + Content: "row 1, column 2", + }, + }, }, }, - { - types.StringElement{ - Content: "row 2, column 2", + }, + { + Cells: []*types.TableCell{ + { + Elements: []interface{}{ + &types.StringElement{ + Content: "row 2, column 1", + }, + }, + }, + { + Elements: []interface{}{ + &types.StringElement{ + Content: "row 2, column 2", + }, + }, }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("empty table ", func() { - source := `|=== + It("empty table ", func() { + source := `|=== |===` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Table{ - Columns: []types.TableColumn{}, - Lines: []types.TableLine{}, + expected := &types.Document{ + Elements: []interface{}{ + &types.Table{ + // Columns: []*types.TableColumn{}, + // Lines: []*types.TableLine{}, + }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("empty table with cols attr", func() { - source := "[cols=\"3,2,5\"]\n|===\n|===" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Table{ - Attributes: types.Attributes{ - types.AttrCols: "3,2,5", - }, - Columns: []types.TableColumn{ - {Width: "30", HAlign: "left", VAlign: "top"}, - {Width: "20", HAlign: "left", VAlign: "top"}, - {Width: "50", HAlign: "left", VAlign: "top"}, + It("with cols attribute", func() { + source := `[cols="2*^.^,<,.>"] +|=== +|===` + expected := &types.Document{ + Elements: []interface{}{ + &types.Table{ + Attributes: types.Attributes{ + types.AttrCols: []interface{}{ + &types.TableColumn{ + Multiplier: 2, + HAlign: types.HAlignCenter, + VAlign: types.VAlignMiddle, + Weight: 1, + }, + &types.TableColumn{ + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignTop, + Weight: 1, + }, + &types.TableColumn{ + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignBottom, + Weight: 1, + }, + }, + }, }, - Lines: []types.TableLine{}, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("autowidth overrides column widths", func() { - source := "[%autowidth,cols=\"3,2,5\"]\n|===\n|===" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Table{ - Attributes: types.Attributes{ - types.AttrOptions: []interface{}{"autowidth"}, - types.AttrCols: "3,2,5", + It("columns as document attribute", func() { + source := `:cols: 2*^.^d,s + +[cols={cols}] +|=== +|===` + expected := &types.Document{ + // Attributes: types.Attributes{ + // "cols": "2*^.^d,s", + // }, + Elements: []interface{}{ + &types.AttributeDeclaration{ + Name: "cols", + Value: "2*^.^d,s", }, - Columns: []types.TableColumn{ - {HAlign: "left", VAlign: "top"}, - {HAlign: "left", VAlign: "top"}, - {HAlign: "left", VAlign: "top"}, + &types.Table{ + Attributes: types.Attributes{ + types.AttrCols: []interface{}{ + &types.TableColumn{ + Multiplier: 2, + HAlign: types.HAlignCenter, + VAlign: types.VAlignMiddle, + Style: types.DefaultStyle, + Weight: 1, + }, + &types.TableColumn{ + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignTop, + Style: types.EmphasisStyle, + Weight: 1, + }, + &types.TableColumn{ + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignBottom, + Style: types.StrongStyle, + Weight: 1, + }, + }, + }, }, - Lines: []types.TableLine{}, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) }) +}) - It("column autowidth", func() { - source := "[cols=\"30,~,~\"]\n|===\n|===" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Table{ - Attributes: types.Attributes{ - types.AttrCols: "30,~,~", - }, - Columns: []types.TableColumn{ - {Width: "30", HAlign: "left", VAlign: "top"}, - {HAlign: "left", VAlign: "top"}, - {HAlign: "left", VAlign: "top"}, - }, - Lines: []types.TableLine{}, +var _ = Describe("table cols", func() { + + DescribeTable("valid", + func(source string, expected []*types.TableColumn) { + // given + log.Debugf("processing '%s'", source) + content := strings.NewReader(source) + // when parsing only (ie, no substitution applied) + result, err := parser.ParseReader("", content, parser.Entrypoint("TableColumnsAttribute")) + // then + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(BeAssignableToTypeOf([]interface{}{})) + cols := result.([]interface{}) + // now, set the attribute in the table and call the `Columns()` method + t := &types.Table{ + Attributes: types.Attributes{ + types.AttrCols: result, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + Rows: []*types.TableRow{{}}, + } + t.Rows[0].Cells = make([]*types.TableCell, len(cols)) + for i := range cols { + t.Rows[0].Cells[i] = &types.TableCell{} + } + Expect(t.Columns()).To(Equal(expected)) + }, - It("columns with repeat", func() { - source := "[cols=\"3*10,2*~\"]\n|===\n|===" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Table{ - Attributes: types.Attributes{ - types.AttrCols: "3*10,2*~", - }, - Columns: []types.TableColumn{ - {Width: "10", HAlign: "left", VAlign: "top"}, - {Width: "10", HAlign: "left", VAlign: "top"}, - {Width: "10", HAlign: "left", VAlign: "top"}, - {HAlign: "left", VAlign: "top"}, - {HAlign: "left", VAlign: "top"}, - }, - Lines: []types.TableLine{}, + Entry(`1`, `1`, + []*types.TableColumn{ + { + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignTop, + Weight: 1, + Width: "100", }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - It("columns with alignment changes", func() { - source := "[cols=\"2*^.^,<,.>\"]\n|===\n|===" - expected := types.DraftDocument{Elements: []interface{}{ - types.Table{ - Attributes: types.Attributes{ - types.AttrCols: "2*^.^,<,.>", + }), + Entry(`20,~,~`, `20,~,~`, + []*types.TableColumn{ + { + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignTop, + Weight: 20, + Width: "20", }, - Columns: []types.TableColumn{ - {Width: "25", HAlign: "center", VAlign: "middle"}, - {Width: "25", HAlign: "center", VAlign: "middle"}, - {Width: "25", HAlign: "left", VAlign: "top"}, - {Width: "25", HAlign: "left", VAlign: "bottom"}, + { + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignTop, + Autowidth: true, + Width: "", }, - Lines: []types.TableLine{}, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + { + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignTop, + Autowidth: true, + Width: "", + }, + }), - // TODO: This checks that we parse the styles -- we don't actually do anything with them further yet. - It("columns with alignment changes and styles", func() { - source := "[cols=\"2*^.^d,s\"]\n|===\n|===" - expected := types.DraftDocument{ - FrontMatter: types.FrontMatter{Content: nil}, - Elements: []interface{}{ - types.Table{ - Attributes: types.Attributes{ - types.AttrCols: "2*^.^d,s", - }, - Columns: []types.TableColumn{ - {Width: "25", HAlign: "center", VAlign: "middle"}, // "d" is aliased to "" - {Width: "25", HAlign: "center", VAlign: "middle"}, - {Width: "25", HAlign: "left", VAlign: "top", Style: "e"}, - {Width: "25", HAlign: "left", VAlign: "bottom", Style: "s"}, - }, - Lines: []types.TableLine{}, + Entry(`<,>`, `<,>`, + []*types.TableColumn{ + { + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignTop, + Weight: 1, + Width: "50", }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + { + Multiplier: 1, + HAlign: types.HAlignRight, + VAlign: types.VAlignTop, + Weight: 1, + Width: "50", + }, + }), + Entry(`.<,.>`, `.<,.>`, + []*types.TableColumn{ + { + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignTop, + Weight: 1, + Width: "50", + }, + { + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignBottom, + Weight: 1, + Width: "50", + }, + }), + Entry(`<.<,>.>`, `<.<,>.>`, + []*types.TableColumn{ + { + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignTop, + Weight: 1, + Width: "50", + }, + { + Multiplier: 1, + HAlign: types.HAlignRight, + VAlign: types.VAlignBottom, + Weight: 1, + Width: "50", + }, + }), + Entry(`<.<1,>.>2`, `<.<1,>.>2`, + []*types.TableColumn{ + { + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignTop, + Weight: 1, + Width: "33.3333", + }, + { + Multiplier: 1, + HAlign: types.HAlignRight, + VAlign: types.VAlignBottom, + Weight: 2, + Width: "66.6667", + }, + }), + Entry(`2*<.<1,1*>.>2`, `2*<.<1,1*>.>2`, + []*types.TableColumn{ + { + Multiplier: 2, + HAlign: types.HAlignLeft, + VAlign: types.VAlignTop, + Weight: 1, + Width: "25", + }, + { + Multiplier: 2, + HAlign: types.HAlignLeft, + VAlign: types.VAlignTop, + Weight: 1, + Width: "25", + }, + { + Multiplier: 1, + HAlign: types.HAlignRight, + VAlign: types.VAlignBottom, + Weight: 2, + Width: "50", + }, + }), + // with style + Entry(`2*^.^d,s`, `2*^.^d,s`, + []*types.TableColumn{ + { + Multiplier: 2, + HAlign: types.HAlignCenter, + VAlign: types.VAlignMiddle, + Style: types.DefaultStyle, + Weight: 1, + Width: "25", + }, + { + Multiplier: 2, + HAlign: types.HAlignCenter, + VAlign: types.VAlignMiddle, + Style: types.DefaultStyle, + Weight: 1, + Width: "25", + }, + { + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignTop, + Style: types.EmphasisStyle, + Weight: 1, + Width: "25", + }, + { + Multiplier: 1, + HAlign: types.HAlignLeft, + VAlign: types.VAlignBottom, + Style: types.StrongStyle, + Weight: 1, + Width: "25", + }, + }), + ) + + DescribeTable("invalid", + func(source string) { + // given + log.Debugf("processing '%s'", source) + content := strings.NewReader(source) + // when parsing only (ie, no substitution applied) + _, err := parser.ParseReader("", content, parser.Entrypoint("TableColumnsAttribute")) + // then + Expect(err).To(HaveOccurred()) + }, + + // unknown case: should return an error + Entry(`invalid`, `invalid`), + ) }) diff --git a/pkg/parser/thematic_break_test.go b/pkg/parser/thematic_break_test.go new file mode 100644 index 00000000..b67b5a33 --- /dev/null +++ b/pkg/parser/thematic_break_test.go @@ -0,0 +1,118 @@ +package parser_test + +import ( + "github.com/bytesparadise/libasciidoc/pkg/types" + . "github.com/bytesparadise/libasciidoc/testsupport" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("paragraphs", func() { + + Context("in final documents", func() { + + Context("thematic breaks", func() { + + It("form1 by itself", func() { + source := "***" + expected := &types.Document{ + Elements: []interface{}{ + &types.ThematicBreak{}, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("form2 by itself", func() { + source := "* * *" + expected := &types.Document{ + Elements: []interface{}{ + &types.ThematicBreak{}, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("form3 by itself", func() { + source := "---" + expected := &types.Document{ + Elements: []interface{}{ + &types.ThematicBreak{}, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("form4 by itself", func() { + source := "- - -" + expected := &types.Document{ + Elements: []interface{}{ + &types.ThematicBreak{}, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("form5 by itself", func() { + source := "___" + expected := &types.Document{ + Elements: []interface{}{ + &types.ThematicBreak{}, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("form4 by itself", func() { + source := "_ _ _" + expected := &types.Document{ + Elements: []interface{}{ + &types.ThematicBreak{}, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + It("with leading text", func() { + source := "text ***" + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "text ***"}, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + + // NB: three asterisks gets confused with bullets if with trailing text + It("with trailing text", func() { + source := "* * * text" + expected := &types.Document{ + Elements: []interface{}{ + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "* * text"}, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + }) + }) +}) diff --git a/pkg/parser/unordered_list_test.go b/pkg/parser/unordered_list_test.go index a13af186..0619d069 100644 --- a/pkg/parser/unordered_list_test.go +++ b/pkg/parser/unordered_list_test.go @@ -10,1523 +10,24 @@ import ( var _ = Describe("unordered lists", func() { - Context("draft documents", func() { + Context("in final documents", func() { Context("valid content", func() { - It("unordered list with a basic single item", func() { - source := `* a list item` - expected := types.DraftDocument{ + It("with a basic single item", func() { + source := `* a list element` + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a list item"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered list with ID, title, role and a single item", func() { - source := `.mytitle -[#listID] -[.myrole] -* a list item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Attributes: types.Attributes{ - types.AttrTitle: "mytitle", - types.AttrID: "listID", - types.AttrRoles: []interface{}{"myrole"}, - }, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a list item"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered list with style ID, title, role and a single item", func() { - source := `.mytitle -[square#listID] -[.myrole] -* a list item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Attributes: types.Attributes{ - types.AttrTitle: "mytitle", - types.AttrID: "listID", - types.AttrRoles: []interface{}{"myrole"}, - types.AttrStyle: "square", - }, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a list item"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered list with a title and a single item", func() { - source := `.a title - * a list item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Attributes: types.Attributes{ - types.AttrTitle: "a title", - }, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a list item"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered list with 2 items with stars", func() { - source := `* a first item - * a second item with *bold content*` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second item with "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered list based on article.adoc (with heading spaces)", func() { - source := `.Unordered list title - * list item 1 - ** nested list item A - *** nested nested list item A.1 - *** nested nested list item A.2 - ** nested list item B - *** nested nested list item B.1 - *** nested nested list item B.2 - * list item 2` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Attributes: types.Attributes{ - types.AttrTitle: "Unordered list title", - }, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "list item 1"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested list item A"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item A.1"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item A.2"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested list item B"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item B.1"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item B.2"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "list item 2"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered list with 2 items with carets", func() { - source := "- a first item\n" + - "- a second item with *bold content*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second item with "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered list with items with mixed styles", func() { - source := `- a parent item - * a child item - - another parent item - * another child item - ** with a sub child item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a parent item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a child item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "another parent item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "another child item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "with a sub child item"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered list with 2 items with empty line in-between", func() { - // fist line after list item is swallowed - source := "* a first item\n" + - "\n" + - "* a second item with *bold content*" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first item"}, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second item with "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered list with 2 items on multiple lines", func() { - source := `* item 1 - on 2 lines. -* item 2 -on 2 lines, too.` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, - { - types.StringElement{Content: "on 2 lines."}, // heading spaces are trimmed - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, - { - types.StringElement{Content: "on 2 lines, too."}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered lists with 2 empty lines in-between", func() { - source := `* an item in the first list - - -* an item in the second list` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "an item in the first list"}, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "an item in the second list"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) // parse the whole document to get 2 lists - }) - - It("unordered list with items on 3 levels", func() { - source := `* item 1 - ** item 1.1 - ** item 1.2 - *** item 1.2.1 - ** item 1.3 - ** item 1.4 - * item 2 - ** item 2.1` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2.1"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.3"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.4"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2.1"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("max level of unordered items - case 1", func() { - source := `.Unordered, max nesting -* level 1 -** level 2 -*** level 3 -**** level 4 -***** level 5 -* level 1` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Attributes: types.Attributes{ - types.AttrTitle: "Unordered, max nesting", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 4, - BulletStyle: types.FourAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 5, - BulletStyle: types.FiveAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("max level of unordered items - case 2", func() { - source := `.Unordered, max nesting -* level 1 -** level 2 -*** level 3 -**** level 4 -***** level 5 -** level 2` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Attributes: types.Attributes{ - types.AttrTitle: "Unordered, max nesting", - }, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{Level: 4, - BulletStyle: types.FourAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 5, - BulletStyle: types.FiveAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered list item with dash on multiple lines", func() { - source := `- an item (quite - short) breaks` // with heading spaces - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "an item (quite", - }, - }, - { - types.StringElement{ - Content: "short) breaks", // heading spaces are trimmed - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered list item with asterisk on multiple lines", func() { - source := `* an item (quite - short) breaks` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "an item (quite", - }, - }, - { - types.StringElement{ - Content: "short) breaks", // heading spaces are trimmed - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("invalid content", func() { - - It("unordered list with items on 2 levels - bad numbering", func() { - source := `* item 1 - *** item 1.1 - *** item 1.1.1 - ** item 1.2 - * item 2` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1.1"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("invalid list item", func() { - source := "*an invalid list item" - expected := types.DraftDocument{ - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "*an invalid list item"}, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("list item continuation", func() { - - It("unordered list with item continuation - case 1", func() { - source := `* foo -+ ----- -a delimited block ----- -+ ----- -another delimited block ----- -* bar -` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - }, - }, - }, - }, - types.ContinuedListItemElement{ - Offset: 0, - Element: types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a delimited block", - }, - }, - }, - }, - }, - types.ContinuedListItemElement{ - Offset: 0, - Element: types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "another delimited block", - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "bar"}, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered list with item continuation - case 2", func() { - source := `.Unordered, complex -* level 1 -** level 2 -*** level 3 -This is a new line inside an unordered list using {plus} symbol. -We can even force content to start on a separate line... + -Amazing, isn't it? -**** level 4 -+ -The {plus} symbol is on a new line. - -***** level 5 -` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Attributes: types.Attributes{ - types.AttrTitle: "Unordered, complex", - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", - }, - }, - { - types.StringElement{ - Content: "This is a new line inside an unordered list using ", - }, - types.PredefinedAttribute{ - Name: "plus", - }, - types.StringElement{ - Content: " symbol.", - }, - }, - { - types.StringElement{ - Content: "We can even force content to start on a separate line\u2026\u200b", - }, - types.LineBreak{}, - }, - { - types.StringElement{ - Content: "Amazing, isn\u2019t it?", - }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 4, - BulletStyle: types.FourAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", - }, - }, - }, - }, - }, - }, - // the `+` continuation produces the second paragraph below - types.ContinuedListItemElement{ - Offset: 0, - Element: types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "The ", - }, - types.PredefinedAttribute{ - Name: "plus", - }, - types.StringElement{ - Content: " symbol is on a new line.", - }, - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 5, - BulletStyle: types.FiveAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("unordered list without item continuation", func() { - source := `* foo ----- -a delimited block ----- -* bar ----- -another delimited block -----` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, - }, - }, - }, - }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a delimited block", - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "bar"}, - }, - }, - }, - }, - }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "another delimited block", - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - - Context("attach to ancestor", func() { - - It("attach to grandparent item", func() { - source := `* grandparent list item -** parent list item -*** child list item - - -+ -paragraph attached to grandparent list item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.ContinuedListItemElement{ - Offset: 0, - Element: types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to grandparent list item"}, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - - It("attach to parent item", func() { - source := `* grandparent list item -** parent list item -*** child list item - -+ -paragraph attached to parent list item` - expected := types.DraftDocument{ - Elements: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, - }, - }, - }, - }, - }, - types.BlankLine{}, - types.ContinuedListItemElement{ - Offset: 0, - Element: types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to parent list item"}, - }, - }, - }, - }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - }) - }) - - Context("final documents", func() { - - Context("valid content", func() { - - It("unordered list with a basic single item", func() { - source := `* a list item` - expected := types.Document{ - Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a list item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a list element"}, }, }, }, @@ -1538,30 +39,28 @@ paragraph attached to parent list item` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("unordered list with ID, title, role and a single item", func() { + It("with ID, title, role and a single item", func() { source := `.mytitle [#listID] [.myrole] -* a list item` - expected := types.Document{ +* a list element` + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ + &types.List{ + Kind: types.UnorderedListKind, Attributes: types.Attributes{ types.AttrID: "listID", types.AttrTitle: "mytitle", types.AttrRoles: []interface{}{"myrole"}, }, - Items: []types.UnorderedListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a list item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a list element"}, }, }, }, @@ -1572,26 +71,25 @@ paragraph attached to parent list item` } Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("unordered list with a title and a single item", func() { + + It("with a title and a single item", func() { source := `.a title - * a list item` - expected := types.Document{ + * a list element` + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ + &types.List{ + Kind: types.UnorderedListKind, Attributes: types.Attributes{ types.AttrTitle: "a title", }, - Items: []types.UnorderedListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a list item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a list element"}, }, }, }, @@ -1603,41 +101,36 @@ paragraph attached to parent list item` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("unordered list with 2 items with stars", func() { + It("with 2 items with stars", func() { source := `* a first item * a second item with *bold content*` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a first item"}, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second item with "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a second item with "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold content"}, }, }, }, @@ -1651,75 +144,66 @@ paragraph attached to parent list item` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("unordered list based on article.adoc (with heading spaces)", func() { + It("with multiple levels", func() { source := `.Unordered list title - * list item 1 - ** nested list item A - *** nested nested list item A.1 - *** nested nested list item A.2 - ** nested list item B - *** nested nested list item B.1 - *** nested nested list item B.2 - * list item 2` - expected := types.Document{ + * list element 1 + ** nested list element A + *** nested nested list element A.1 + *** nested nested list element A.2 + ** nested list element B + *** nested nested list element B.1 + *** nested nested list element B.2 + * list element 2` + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ + &types.List{ + Kind: types.UnorderedListKind, Attributes: types.Attributes{ types.AttrTitle: "Unordered list title", }, - Items: []types.UnorderedListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "list item 1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "list element 1"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested list item A"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "nested list element A"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.ThreeAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item A.1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "nested nested list element A.1"}, }, }, }, }, - { - Level: 3, + &types.UnorderedListElement{ BulletStyle: types.ThreeAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item A.2"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "nested nested list element A.2"}, }, }, }, @@ -1728,44 +212,36 @@ paragraph attached to parent list item` }, }, }, - { - Level: 2, + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested list item B"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "nested list element B"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.ThreeAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item B.1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "nested nested list element B.1"}, }, }, }, }, - { - Level: 3, + &types.UnorderedListElement{ BulletStyle: types.ThreeAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item B.2"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "nested nested list element B.2"}, }, }, }, @@ -1778,16 +254,13 @@ paragraph attached to parent list item` }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "list item 2"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "list element 2"}, }, }, }, @@ -1799,41 +272,36 @@ paragraph attached to parent list item` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("unordered list with 2 items with carets", func() { + It("with 2 items with carets", func() { source := "- a first item\n" + "- a second item with *bold content*" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.Dash, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a first item"}, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.Dash, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second item with "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a second item with "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold content"}, }, }, }, @@ -1847,40 +315,36 @@ paragraph attached to parent list item` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("unordered list with items with mixed styles", func() { + It("with items with mixed styles", func() { source := `- a parent item * a child item - another parent item * another child item ** with a sub child item` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.Dash, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a parent item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a parent item"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a child item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a child item"}, }, }, }, @@ -1889,44 +353,37 @@ paragraph attached to parent list item` }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.Dash, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "another parent item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "another parent item"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "another child item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "another child item"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "with a sub child item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "with a sub child item"}, }, }, }, @@ -1946,43 +403,38 @@ paragraph attached to parent list item` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("unordered list with 2 items with empty line in-between", func() { - // fist line after list item is swallowed + It("with 2 items with empty line in-between", func() { + // fist line after list element is swallowed source := "* a first item\n" + "\n" + "* a second item with *bold content*" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a first item"}, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second item with "}, - types.QuotedText{ - Kind: types.SingleQuoteBold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "a second item with "}, + &types.QuotedText{ + Kind: types.SingleQuoteBold, + Elements: []interface{}{ + &types.StringElement{Content: "bold content"}, }, }, }, @@ -1995,45 +447,34 @@ paragraph attached to parent list item` } Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("unordered list with 2 items on multiple lines", func() { + It("with 2 items on multiple lines", func() { source := `* item 1 on 2 lines. * item 2 on 2 lines, too.` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, - { - types.StringElement{Content: "on 2 lines."}, // heading spaces are trimmed - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 1\non 2 lines."}, // heading spaces are trimmed }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, - { - types.StringElement{Content: "on 2 lines, too."}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 2\non 2 lines, too."}, }, }, }, @@ -2045,39 +486,34 @@ on 2 lines, too.` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) It("unordered lists with 2 empty lines in-between", func() { - // the first blank lines after the first list is swallowed (for the list item) + // the first blank lines after the first list is swallowed (for the list element) source := "* an item in the first list\n" + "\n" + "\n" + "* an item in the second list" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "an item in the first list"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "an item in the first list"}, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "an item in the second list"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "an item in the second list"}, }, }, }, @@ -2089,7 +525,7 @@ on 2 lines, too.` Expect(ParseDocument(source)).To(MatchDocument(expected)) // parse the whole document to get 2 lists }) - It("unordered list with items on 3 levels", func() { + It("with items on 3 levels", func() { source := `* item 1 ** item 1.1 ** item 1.2 @@ -2098,62 +534,53 @@ on 2 lines, too.` ** item 1.4 * item 2 ** item 2.1` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 1"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 1.1"}, }, }, }, }, - { - Level: 2, + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 1.2"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.ThreeAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2.1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 1.2.1"}, }, }, }, @@ -2162,30 +589,24 @@ on 2 lines, too.` }, }, }, - { - Level: 2, + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.3"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 1.3"}, }, }, }, }, - { - Level: 2, + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.4"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 1.4"}, }, }, }, @@ -2194,30 +615,25 @@ on 2 lines, too.` }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 2"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2.1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 2.1"}, }, }, }, @@ -2241,89 +657,69 @@ on 2 lines, too.` **** level 4 ***** level 5 * level 1` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ + &types.List{ + Kind: types.UnorderedListKind, Attributes: types.Attributes{ types.AttrTitle: "Unordered, max nesting", }, - Items: []types.UnorderedListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 1"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 2"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.ThreeAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 3"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 4, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.FourAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 4"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 5, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.FiveAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 5"}, }, }, }, @@ -2344,18 +740,13 @@ on 2 lines, too.` }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 1"}, }, }, }, @@ -2375,89 +766,69 @@ on 2 lines, too.` **** level 4 ***** level 5 ** level 2` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ + &types.List{ + Kind: types.UnorderedListKind, Attributes: types.Attributes{ types.AttrTitle: "Unordered, max nesting", }, - Items: []types.UnorderedListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 1"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 2"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.ThreeAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 3"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 4, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.FourAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 4"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 5, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.FiveAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 5"}, }, }, }, @@ -2474,18 +845,13 @@ on 2 lines, too.` }, }, }, - { - Level: 2, + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 2"}, }, }, }, @@ -2501,24 +867,20 @@ on 2 lines, too.` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("unordered list item with predefined attribute", func() { + It("unordered list element with predefined attribute", func() { source := `* {amp}` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.PredefinedAttribute{ - Name: "amp", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.PredefinedAttribute{Name: "amp"}, }, }, }, @@ -2532,54 +894,48 @@ on 2 lines, too.` }) Context("invalid content", func() { - It("unordered list with items on 2 levels - bad numbering", func() { + It("with items on 3 levels and bad numbering", func() { source := `* item 1 *** item 1.1 *** item 1.1.1 ** item 1.2 * item 2` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 1"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 1.1"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.ThreeAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1.1"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 1.1.1"}, }, }, }, @@ -2588,16 +944,13 @@ on 2 lines, too.` }, }, }, - { - Level: 2, + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 1.2"}, }, }, }, @@ -2606,16 +959,13 @@ on 2 lines, too.` }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "item 2"}, }, }, }, @@ -2627,13 +977,13 @@ on 2 lines, too.` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("invalid list item", func() { - source := "*an invalid list item" - expected := types.Document{ + It("invalid list element", func() { + source := "*an invalid list element" + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{Content: "*an invalid list item"}}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "*an invalid list element"}, }, }, }, @@ -2642,9 +992,9 @@ on 2 lines, too.` }) }) - Context("list item continuation", func() { + Context("list element continuation", func() { - It("unordered list with item continuation - case 1", func() { + It("with item continuation - case 1", func() { source := `* foo + ---- @@ -2656,51 +1006,48 @@ another delimited block ---- * bar ` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "foo", }, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a delimited block", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "a delimited block", }, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "another delimited block", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "another delimited block", }, }, }, }, }, - { - Level: 1, + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "bar"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "bar", }, }, }, @@ -2713,7 +1060,7 @@ another delimited block Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("unordered list with item continuation - case 2", func() { + It("with item continuation - case 2", func() { source := `.Unordered, complex * level 1 ** level 2 @@ -2727,127 +1074,100 @@ The {plus} symbol is on a new line. ***** level 5 ` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ + &types.List{ + Kind: types.UnorderedListKind, Attributes: types.Attributes{ types.AttrTitle: "Unordered, complex", }, - Items: []types.UnorderedListItem{ - { - Level: 1, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "level 1"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "level 2", }, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.ThreeAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "level 3\nThis is a new line inside an unordered list using ", }, - { - types.StringElement{ - Content: "This is a new line inside an unordered list using ", - }, - types.PredefinedAttribute{ - Name: "plus", - }, - types.StringElement{ - Content: " symbol.", - }, + &types.PredefinedAttribute{ + Name: "plus", }, - { - types.StringElement{ - Content: "We can even force content to start on a separate line\u2026\u200b", - }, - types.LineBreak{}, + &types.StringElement{ + Content: " symbol.\nWe can even force content to start on a separate line\u2026\u200b", }, - { - types.StringElement{ - Content: "Amazing, isn\u2019t it?", - }, + &types.LineBreak{}, + &types.StringElement{ + Content: "\nAmazing, isn\u2019t it?", }, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 4, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.FourAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "level 4", }, }, }, // the `+` continuation produces the second paragrap below - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "The ", - }, - types.PredefinedAttribute{ - Name: "plus", - }, - types.StringElement{ - Content: " symbol is on a new line.", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "The ", + }, + &types.PredefinedAttribute{ + Name: "plus", + }, + &types.StringElement{ + Content: " symbol is on a new line.", }, }, }, - - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 5, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.FiveAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "level 5", }, }, }, @@ -2876,68 +1196,65 @@ The {plus} symbol is on a new line. Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("unordered list without item continuation", func() { + It("without item continuation", func() { source := `* foo + ---- a delimited block ---- + * bar + ---- another delimited block ----` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "foo"}, }, }, }, }, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a delimited block", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "a delimited block", }, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "bar"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "bar"}, }, }, }, }, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "another delimited block", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "another delimited block", }, }, }, @@ -2950,55 +1267,49 @@ another delimited block Context("attach to ancestor", func() { It("attach to grandparent item", func() { - source := `* grandparent list item -** parent list item -*** child list item + source := `* grandparent list element +** parent list element +*** child list element + -paragraph attached to grandparent list item` - expected := types.Document{ +paragraph attached to grandparent list element` + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "grandparent list element"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "parent list element"}, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.ThreeAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "child list element"}, }, }, }, @@ -3009,11 +1320,9 @@ paragraph attached to grandparent list item` }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to grandparent list item"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{Content: "paragraph attached to grandparent list element"}, }, }, }, @@ -3026,53 +1335,53 @@ paragraph attached to grandparent list item` }) It("attach to parent item", func() { - source := `* grandparent list item -** parent list item -*** child list item + source := `* grandparent list element +** parent list element +*** child list element + -paragraph attached to parent list item` - expected := types.Document{ +paragraph attached to parent list element` + expected := &types.Document{ Elements: []interface{}{ - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.OneAsterisk, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "grandparent list element", }, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 2, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.TwoAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "parent list element", }, }, }, - types.UnorderedList{ - Items: []types.UnorderedListItem{ - { - Level: 3, + &types.List{ + Kind: types.UnorderedListKind, + Elements: []types.ListElement{ + &types.UnorderedListElement{ BulletStyle: types.ThreeAsterisks, CheckStyle: types.NoCheck, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "child list element", }, }, }, @@ -3080,10 +1389,10 @@ paragraph attached to parent list item` }, }, }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to parent list item"}, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "paragraph attached to parent list element", }, }, }, diff --git a/pkg/parser/user_macro_test.go b/pkg/parser/user_macro_test.go index b15d97ad..71041cbd 100644 --- a/pkg/parser/user_macro_test.go +++ b/pkg/parser/user_macro_test.go @@ -13,7 +13,7 @@ import ( var _ = Describe("user macros", func() { - Context("final documents", func() { + Context("in final documents", func() { userTmpl := &texttemplate.Template{} @@ -21,20 +21,18 @@ var _ = Describe("user macros", func() { It("without attributes", func() { source := "AAA hello:[]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "AAA ", - }, - types.UserMacro{ - Kind: types.InlineMacro, - Name: "hello", - Value: "", - RawText: "hello:[]", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "AAA ", + }, + &types.UserMacro{ + Kind: types.InlineMacro, + Name: "hello", + Value: "", + RawText: "hello:[]", }, }, }, @@ -45,23 +43,22 @@ var _ = Describe("user macros", func() { It("with double quoted attributes", func() { source := `AAA hello:[prefix="hello ",suffix="!!"]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "AAA ", }, - types.UserMacro{ - Kind: types.InlineMacro, - Name: "hello", - Value: "", - Attributes: types.Attributes{ - "prefix": "hello ", - "suffix": "!!", - }, - RawText: `hello:[prefix="hello ",suffix="!!"]`, + &types.UserMacro{ + Kind: types.InlineMacro, + Name: "hello", + Value: "", + Attributes: types.Attributes{ + "prefix": "hello ", + "suffix": "!!", }, + RawText: `hello:[prefix="hello ",suffix="!!"]`, }, }, }, @@ -72,19 +69,18 @@ var _ = Describe("user macros", func() { It("with value", func() { source := `AAA hello:JohnDoe[]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - {types.StringElement{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ Content: "AAA ", }, - types.UserMacro{ - Kind: types.InlineMacro, - Name: "hello", - Value: "JohnDoe", - RawText: "hello:JohnDoe[]", - }, + &types.UserMacro{ + Kind: types.InlineMacro, + Name: "hello", + Value: "JohnDoe", + RawText: "hello:JohnDoe[]", }, }, }, @@ -95,24 +91,22 @@ var _ = Describe("user macros", func() { It("with value and attributes", func() { source := "repository: git:some/url.git[key1=value1,key2=value2]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "repository: ", - }, - types.UserMacro{ - Kind: types.InlineMacro, - Name: "git", - Value: "some/url.git", - Attributes: types.Attributes{ - "key1": "value1", - "key2": "value2", - }, - RawText: "git:some/url.git[key1=value1,key2=value2]", + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "repository: ", + }, + &types.UserMacro{ + Kind: types.InlineMacro, + Name: "git", + Value: "some/url.git", + Attributes: types.Attributes{ + "key1": "value1", + "key2": "value2", }, + RawText: "git:some/url.git[key1=value1,key2=value2]", }, }, }, @@ -123,14 +117,12 @@ var _ = Describe("user macros", func() { It("unknown", func() { source := "AAA hello:[]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "AAA hello:[]", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "AAA hello:[]", }, }, }, @@ -145,9 +137,9 @@ var _ = Describe("user macros", func() { It("without value", func() { source := "git::[]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UserMacro{ + &types.UserMacro{ Kind: types.BlockMacro, Name: "git", Value: "", @@ -160,9 +152,9 @@ var _ = Describe("user macros", func() { It("with value and attributes", func() { source := "git::some/url.git[key1=value1,key2=value2]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UserMacro{ + &types.UserMacro{ Kind: types.BlockMacro, Name: "git", Value: "some/url.git", @@ -179,9 +171,9 @@ var _ = Describe("user macros", func() { It("with attribute", func() { source := `git::[key1="value1"]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UserMacro{ + &types.UserMacro{ Kind: types.BlockMacro, Name: "git", Value: "", @@ -195,11 +187,11 @@ var _ = Describe("user macros", func() { Expect(ParseDocument(source, configuration.WithMacroTemplate("git", userTmpl))).To(MatchDocument(expected)) }) - It("with value", func() { + It("with value only", func() { source := `git::some/url.git[]` - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.UserMacro{ + &types.UserMacro{ Kind: types.BlockMacro, Name: "git", Value: "some/url.git", @@ -213,14 +205,12 @@ var _ = Describe("user macros", func() { It("unknown", func() { source := "git::[]" - expected := types.Document{ + expected := &types.Document{ Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "git::[]", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "git::[]", }, }, }, diff --git a/pkg/renderer/context.go b/pkg/renderer/context.go index 96e4ae0a..4b95334e 100644 --- a/pkg/renderer/context.go +++ b/pkg/renderer/context.go @@ -8,7 +8,7 @@ import ( // Context is a custom implementation of the standard golang context.Context interface, // which carries the types.Document which is being processed type Context struct { - Config configuration.Configuration + Config *configuration.Configuration // TableOfContents exists even if the document did not specify the `:toc:` attribute. // It will take into account the configured `:toclevels:` attribute value. TableOfContents types.TableOfContents @@ -17,24 +17,44 @@ type Context struct { WithinList int counters map[string]int Attributes types.Attributes - Footnotes []types.Footnote + Footnotes []*types.Footnote ElementReferences types.ElementReferences HasHeader bool - UseUnicode bool } // NewContext returns a new rendering context for the given document. -func NewContext(doc types.Document, config configuration.Configuration) *Context { - _, hasHeader := doc.Header() - return &Context{ +func NewContext(doc *types.Document, config *configuration.Configuration) *Context { + header, _, hasHeader := doc.Header() + ctx := &Context{ Config: config, counters: make(map[string]int), - Attributes: doc.Attributes, + Attributes: config.Attributes, ElementReferences: doc.ElementReferences, Footnotes: doc.Footnotes, HasHeader: hasHeader, EncodeSpecialChars: true, } + // TODO: add other attributes from https://docs.asciidoctor.org/asciidoc/latest/attributes/document-attributes-ref/#builtin-attributes-i18n + ctx.Attributes[types.AttrFigureCaption] = "Figure" + ctx.Attributes[types.AttrExampleCaption] = "Example" + ctx.Attributes[types.AttrTableCaption] = "Table" + ctx.Attributes[types.AttrVersionLabel] = "version" + // also, expand authors and revision + if hasHeader { + if authors := header.Authors(); authors != nil { + ctx.Attributes.AddAll(authors.Expand()) + } + + if revision := header.Revision(); revision != nil { + ctx.Attributes.AddAll(revision.Expand()) + + } + } + return ctx +} + +func (ctx *Context) UseUnicode() bool { + return ctx.Attributes.Has(types.AttrUnicode) } const tableCounter = "tableCounter" diff --git a/pkg/renderer/sgml/attribute_substitution.go b/pkg/renderer/sgml/attribute_substitution.go new file mode 100644 index 00000000..18826d76 --- /dev/null +++ b/pkg/renderer/sgml/attribute_substitution.go @@ -0,0 +1,18 @@ +package sgml + +import ( + "github.com/bytesparadise/libasciidoc/pkg/renderer" + "github.com/bytesparadise/libasciidoc/pkg/types" +) + +func (r *sgmlRenderer) renderAttributeSubstitution(ctx *renderer.Context, e *types.AttributeSubstitution) (string, error) { + if v, found := ctx.Attributes[e.Name]; found { + switch v := v.(type) { + case string: + return v, nil + default: + return r.renderElement(ctx, v) + } + } + return "{" + e.Name + "}", nil +} diff --git a/pkg/renderer/sgml/attribution.go b/pkg/renderer/sgml/attribution.go index 3a98b1ac..1e382d48 100644 --- a/pkg/renderer/sgml/attribution.go +++ b/pkg/renderer/sgml/attribution.go @@ -8,42 +8,18 @@ type Attribution struct { // TODO: unexport this type? Second string } -// paragraphAttribution return a new attribution for the given Paragraph. -// Can be empty if no attribution was specified. -func paragraphAttribution(p types.Paragraph) (Attribution, error) { - return newAttribution(p.Attributes) -} - -// quoteBlockAttribution return a new attribution for the given QuoteBlock. -// Can be empty if no attribution was specified. -func quoteBlockAttribution(b types.QuoteBlock) (Attribution, error) { - return newAttribution(b.Attributes) -} - -// verseBlockAttribution return a new attribution for the given VerseBlock. -// Can be empty if no attribution was specified. -func verseBlockAttribution(b types.VerseBlock) (Attribution, error) { - return newAttribution(b.Attributes) -} - -// markdownQuoteBlockAttribution return a new attribution for the given MarkdownQuoteBlock. -// Can be empty if no attribution was specified. -func markdownQuoteBlockAttribution(b types.MarkdownQuoteBlock) (Attribution, error) { - return newAttribution(b.Attributes) -} - -func newAttribution(attrs types.Attributes) (Attribution, error) { +func newAttribution(b types.BlockWithAttributes) (Attribution, error) { result := Attribution{} - if author, found, err := attrs.GetAsString(types.AttrQuoteAuthor); err != nil { + if author, found, err := b.GetAttributes().GetAsString(types.AttrQuoteAuthor); err != nil { return Attribution{}, err } else if found { result.First = author - if title, found, err := attrs.GetAsString(types.AttrQuoteTitle); err != nil { + if title, found, err := b.GetAttributes().GetAsString(types.AttrQuoteTitle); err != nil { return Attribution{}, err } else if found { result.Second = title } - } else if title, found, err := attrs.GetAsString(types.AttrQuoteTitle); err != nil { + } else if title, found, err := b.GetAttributes().GetAsString(types.AttrQuoteTitle); err != nil { return Attribution{}, err } else if found { result.First = title diff --git a/pkg/renderer/sgml/blank_line.go b/pkg/renderer/sgml/blank_line.go index a4632d81..42b32220 100644 --- a/pkg/renderer/sgml/blank_line.go +++ b/pkg/renderer/sgml/blank_line.go @@ -2,14 +2,8 @@ package sgml import ( "strings" - - "github.com/bytesparadise/libasciidoc/pkg/types" ) -func (r *sgmlRenderer) renderBlankLine(ctx *Context, _ types.BlankLine) (string, error) { - return "", nil -} - func (r *sgmlRenderer) renderLineBreak() (string, error) { buf := &strings.Builder{} if err := r.lineBreak.Execute(buf, nil); err != nil { diff --git a/pkg/renderer/sgml/callout_list.go b/pkg/renderer/sgml/callout_list.go deleted file mode 100644 index db53786a..00000000 --- a/pkg/renderer/sgml/callout_list.go +++ /dev/null @@ -1,72 +0,0 @@ -package sgml - -import ( - "io" - "strings" - - "github.com/bytesparadise/libasciidoc/pkg/renderer" - "github.com/bytesparadise/libasciidoc/pkg/types" - "github.com/pkg/errors" -) - -func (r *sgmlRenderer) renderCalloutList(ctx *renderer.Context, l types.CalloutList) (string, error) { - result := &strings.Builder{} - content := &strings.Builder{} - - for _, item := range l.Items { - - err := r.renderCalloutListItem(ctx, content, item) - if err != nil { - return "", errors.Wrap(err, "unable to render callout list item") - } - } - roles, err := r.renderElementRoles(ctx, l.Attributes) - if err != nil { - return "", errors.Wrap(err, "unable to render callout list roles") - } - title, err := r.renderElementTitle(l.Attributes) - if err != nil { - return "", errors.Wrap(err, "unable to render callout list roles") - } - - err = r.calloutList.Execute(result, struct { - Context *renderer.Context - ID string - Title string - Roles string - Content string - Items []types.CalloutListItem - }{ - Context: ctx, - ID: r.renderElementID(l.Attributes), - Title: title, - Roles: roles, - Content: string(content.String()), - Items: l.Items, - }) - if err != nil { - return "", errors.Wrap(err, "unable to render callout list") - } - return result.String(), nil -} - -func (r *sgmlRenderer) renderCalloutListItem(ctx *renderer.Context, w io.Writer, item types.CalloutListItem) error { - - content, err := r.renderListElements(ctx, item.Elements) - if err != nil { - return errors.Wrap(err, "unable to render callout list item content") - } - err = r.calloutListItem.Execute(w, struct { - Context *renderer.Context - Ref int - Content string - }{ - Context: ctx, - Ref: item.Ref, - Content: string(content), - }) - if err != nil { - return errors.Wrap(err, "unable to render callout list") - } - return nil -} diff --git a/pkg/renderer/sgml/cross_reference.go b/pkg/renderer/sgml/cross_reference.go index 9b618f3f..af92eca5 100644 --- a/pkg/renderer/sgml/cross_reference.go +++ b/pkg/renderer/sgml/cross_reference.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" ) -func (r *sgmlRenderer) renderInternalCrossReference(ctx *renderer.Context, xref types.InternalCrossReference) (string, error) { +func (r *sgmlRenderer) renderInternalCrossReference(ctx *renderer.Context, xref *types.InternalCrossReference) (string, error) { // log.Debugf("rendering cross reference with ID: %s", xref.ID) result := &strings.Builder{} var label string @@ -45,12 +45,12 @@ func (r *sgmlRenderer) renderInternalCrossReference(ctx *renderer.Context, xref return result.String(), nil } -func (r *sgmlRenderer) renderExternalCrossReference(ctx *renderer.Context, xref types.ExternalCrossReference) (string, error) { +func (r *sgmlRenderer) renderExternalCrossReference(ctx *renderer.Context, xref *types.ExternalCrossReference) (string, error) { // log.Debugf("rendering cross reference with ID: %s", xref.Location) result := &strings.Builder{} var label string var err error - switch l := xref.Label.(type) { + switch l := xref.Attributes[types.AttrXRefLabel].(type) { case string: label = l case []interface{}: @@ -58,7 +58,7 @@ func (r *sgmlRenderer) renderExternalCrossReference(ctx *renderer.Context, xref return "", errors.Wrap(err, "unable to render external cross reference") } default: - return "", errors.Errorf("unable to render external cross reference label of type '%T'", xref.Label) + return "", errors.Errorf("unable to render external cross reference label of type '%T'", xref.Attributes) } err = r.externalCrossReference.Execute(result, struct { Href string @@ -73,7 +73,7 @@ func (r *sgmlRenderer) renderExternalCrossReference(ctx *renderer.Context, xref return result.String(), nil } -func getCrossReferenceLocation(xref types.ExternalCrossReference) string { +func getCrossReferenceLocation(xref *types.ExternalCrossReference) string { loc := xref.Location.Stringify() ext := filepath.Ext(xref.Location.Stringify()) // log.Debugf("ext of '%s': '%s'", loc, ext) diff --git a/pkg/renderer/sgml/delimited_block.go b/pkg/renderer/sgml/delimited_block.go new file mode 100644 index 00000000..63d44c02 --- /dev/null +++ b/pkg/renderer/sgml/delimited_block.go @@ -0,0 +1,37 @@ +package sgml + +import ( + "fmt" + + "github.com/bytesparadise/libasciidoc/pkg/renderer" + "github.com/bytesparadise/libasciidoc/pkg/types" +) + +func (r *sgmlRenderer) renderDelimitedBlock(ctx *renderer.Context, b *types.DelimitedBlock) (string, error) { + switch b.Kind { + case types.Example: + if b.Attributes.Has(types.AttrStyle) { + return r.renderAdmonitionBlock(ctx, b) + } + return r.renderExampleBlock(ctx, b) + case types.Fenced: + return r.renderFencedBlock(ctx, b) + case types.Literal: + return r.renderLiteralBlock(ctx, b) + case types.Listing: + return r.renderListingBlock(ctx, b) + case types.MarkdownQuote: + return r.renderMarkdownQuoteBlock(ctx, b) + case types.Passthrough: + return r.renderPassthroughBlock(ctx, b) + case types.Quote: + return r.renderQuoteBlock(ctx, b) + case types.Verse: + return r.renderVerseBlock(ctx, b) + case types.Sidebar: + return r.renderSidebarBlock(ctx, b) + default: + return "", fmt.Errorf("unsupported kind of delimited block: '%s'", b.Kind) + } + +} diff --git a/pkg/renderer/sgml/delimited_block_admonition.go b/pkg/renderer/sgml/delimited_block_admonition.go index dfd59581..0691e7a0 100644 --- a/pkg/renderer/sgml/delimited_block_admonition.go +++ b/pkg/renderer/sgml/delimited_block_admonition.go @@ -9,7 +9,7 @@ import ( log "github.com/sirupsen/logrus" ) -func (r *sgmlRenderer) renderAdmonitionBlock(ctx *renderer.Context, b types.ExampleBlock) (string, error) { +func (r *sgmlRenderer) renderAdmonitionBlock(ctx *renderer.Context, b *types.DelimitedBlock) (string, error) { kind, _, err := b.Attributes.GetAsString(types.AttrStyle) if err != nil { return "", err @@ -54,7 +54,7 @@ func (r *sgmlRenderer) renderAdmonitionBlock(ctx *renderer.Context, b types.Exam return result.String(), err } -func (r *sgmlRenderer) renderAdmonitionParagraph(ctx *renderer.Context, p types.Paragraph) (string, error) { +func (r *sgmlRenderer) renderAdmonitionParagraph(ctx *renderer.Context, p *types.Paragraph) (string, error) { log.Debug("rendering admonition paragraph...") result := &strings.Builder{} kind, ok, err := p.Attributes.GetAsString(types.AttrStyle) @@ -69,7 +69,7 @@ func (r *sgmlRenderer) renderAdmonitionParagraph(ctx *renderer.Context, p types. if err != nil { return "", err } - content, err := r.renderLines(ctx, p.Lines) + content, err := r.renderParagraphElements(ctx, p) if err != nil { return "", err } @@ -90,7 +90,6 @@ func (r *sgmlRenderer) renderAdmonitionParagraph(ctx *renderer.Context, p types. Icon string Kind string Content string - Lines [][]interface{} }{ Context: ctx, ID: r.renderElementID(p.Attributes), @@ -99,7 +98,6 @@ func (r *sgmlRenderer) renderAdmonitionParagraph(ctx *renderer.Context, p types. Roles: roles, Icon: icon, Content: content, - Lines: p.Lines, }) return result.String(), err diff --git a/pkg/renderer/sgml/delimited_block_discard_lines.go b/pkg/renderer/sgml/delimited_block_discard_lines.go index a142169f..0ee3cd4a 100644 --- a/pkg/renderer/sgml/delimited_block_discard_lines.go +++ b/pkg/renderer/sgml/delimited_block_discard_lines.go @@ -4,38 +4,6 @@ import ( "github.com/bytesparadise/libasciidoc/pkg/types" ) -func discardEmptyLines(lines [][]interface{}) [][]interface{} { - // discard blank elements at the end - // log.Debugf("discarding empty lines on %d elements...", len(lines)) - filteredLines := make([][]interface{}, len(lines)) - copy(filteredLines, lines) - // heading empty lines - for { - if len(filteredLines) == 0 { - break - } - if len(filteredLines[0]) == 0 { - // remove last element of the slice since it's a blank line - filteredLines = filteredLines[1:] - } else { - break - } - } - // trailing empty lines - for { - if len(filteredLines) == 0 { - break - } - if len(filteredLines[len(filteredLines)-1]) == 0 { - // remove last element of the slice since it's a blank line - filteredLines = filteredLines[:len(filteredLines)-1] - } else { - break - } - } - return filteredLines -} - func discardBlankLines(lines []interface{}) []interface{} { // discard blank elements at the end // log.Debugf("discarding blank lines on %d elements...", len(lines)) diff --git a/pkg/renderer/sgml/delimited_block_example.go b/pkg/renderer/sgml/delimited_block_example.go index 08dcb078..723ade20 100644 --- a/pkg/renderer/sgml/delimited_block_example.go +++ b/pkg/renderer/sgml/delimited_block_example.go @@ -10,10 +10,7 @@ import ( log "github.com/sirupsen/logrus" ) -func (r *sgmlRenderer) renderExampleBlock(ctx *renderer.Context, b types.ExampleBlock) (string, error) { - if b.Attributes.Has(types.AttrStyle) { - return r.renderAdmonitionBlock(ctx, b) - } +func (r *sgmlRenderer) renderExampleBlock(ctx *renderer.Context, b *types.DelimitedBlock) (string, error) { result := &strings.Builder{} caption := &strings.Builder{} @@ -21,19 +18,22 @@ func (r *sgmlRenderer) renderExampleBlock(ctx *renderer.Context, b types.Example number := 0 content, err := r.renderElements(ctx, b.Elements) if err != nil { - return "", errors.Wrap(err, "unable to render example block content") + return "", errors.Wrap(err, "unable to render example block") } roles, err := r.renderElementRoles(ctx, b.Attributes) if err != nil { - return "", errors.Wrap(err, "unable to render fenced block content") + return "", errors.Wrap(err, "unable to render example block") } - c, ok, err := b.Attributes.GetAsString(types.AttrCaption) + c, found, err := b.Attributes.GetAsString(types.AttrCaption) if err != nil { - return "", errors.Wrap(err, "unable to render fenced block content") + return "", errors.Wrap(err, "unable to render example block") } - if !ok { - c = ctx.Attributes.GetAsStringWithDefault(types.AttrExampleCaption, "Example") - if c != "" { + if !found { + c, found, err = ctx.Attributes.GetAsString(types.AttrExampleCaption) + if err != nil { + return "", errors.Wrap(err, "unable to render example block") + } + if found && c != "" { c += " {counter:example-number}. " } } @@ -67,10 +67,10 @@ func (r *sgmlRenderer) renderExampleBlock(ctx *renderer.Context, b types.Example return result.String(), err } -func (r *sgmlRenderer) renderExampleParagraph(ctx *renderer.Context, p types.Paragraph) (string, error) { +func (r *sgmlRenderer) renderExampleParagraph(ctx *renderer.Context, p *types.Paragraph) (string, error) { log.Debug("rendering example paragraph...") result := &strings.Builder{} - content, err := r.renderLines(ctx, p.Lines) + content, err := r.renderElements(ctx, p.Elements) if err != nil { return "", errors.Wrap(err, "unable to render quote paragraph lines") } diff --git a/pkg/renderer/sgml/delimited_block_fenced.go b/pkg/renderer/sgml/delimited_block_fenced.go index 15fb884c..8cb5e099 100644 --- a/pkg/renderer/sgml/delimited_block_fenced.go +++ b/pkg/renderer/sgml/delimited_block_fenced.go @@ -8,15 +8,15 @@ import ( "github.com/pkg/errors" ) -func (r *sgmlRenderer) renderFencedBlock(ctx *renderer.Context, b types.FencedBlock) (string, error) { +func (r *sgmlRenderer) renderFencedBlock(ctx *renderer.Context, b *types.DelimitedBlock) (string, error) { previousWithinDelimitedBlock := ctx.WithinDelimitedBlock defer func() { ctx.WithinDelimitedBlock = previousWithinDelimitedBlock }() ctx.WithinDelimitedBlock = true result := &strings.Builder{} - lines := discardEmptyLines(b.Lines) - content, err := r.renderLines(ctx, lines) + // lines := discardEmptyLines(b.Elements) + content, err := r.renderElements(ctx, b.Elements) if err != nil { return "", errors.Wrap(err, "unable to render fenced block content") } diff --git a/pkg/renderer/sgml/delimited_block_listing.go b/pkg/renderer/sgml/delimited_block_listing.go index b23ff6a5..8397271c 100644 --- a/pkg/renderer/sgml/delimited_block_listing.go +++ b/pkg/renderer/sgml/delimited_block_listing.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" ) -func (r *sgmlRenderer) renderListingBlock(ctx *renderer.Context, b types.ListingBlock) (string, error) { +func (r *sgmlRenderer) renderListingBlock(ctx *renderer.Context, b *types.DelimitedBlock) (string, error) { if k, found := b.Attributes[types.AttrStyle]; found && k == types.Source { return r.renderSourceBlock(ctx, b) } @@ -18,8 +18,8 @@ func (r *sgmlRenderer) renderListingBlock(ctx *renderer.Context, b types.Listing }() ctx.WithinDelimitedBlock = true result := &strings.Builder{} - lines := discardEmptyLines(b.Lines) - content, err := r.renderLines(ctx, lines) + // lines := [][]interface{}{} // discardEmptyLines(b.Elements) + content, err := r.renderElements(ctx, b.Elements) if err != nil { return "", errors.Wrap(err, "unable to render listing block content") } @@ -48,9 +48,9 @@ func (r *sgmlRenderer) renderListingBlock(ctx *renderer.Context, b types.Listing return result.String(), err } -func (r *sgmlRenderer) renderListingParagraph(ctx *renderer.Context, p types.Paragraph) (string, error) { +func (r *sgmlRenderer) renderListingParagraph(ctx *renderer.Context, p *types.Paragraph) (string, error) { result := &strings.Builder{} - content, err := r.renderLines(ctx, p.Lines) + content, err := r.renderElements(ctx, p.Elements) if err != nil { return "", errors.Wrap(err, "unable to render listing block content") } diff --git a/pkg/renderer/sgml/delimited_block_markdown_quote.go b/pkg/renderer/sgml/delimited_block_markdown_quote.go index 1801e1f8..dc1697c2 100644 --- a/pkg/renderer/sgml/delimited_block_markdown_quote.go +++ b/pkg/renderer/sgml/delimited_block_markdown_quote.go @@ -8,9 +8,9 @@ import ( "github.com/pkg/errors" ) -func (r *sgmlRenderer) renderMarkdownQuoteBlock(ctx *renderer.Context, b types.MarkdownQuoteBlock) (string, error) { +func (r *sgmlRenderer) renderMarkdownQuoteBlock(ctx *renderer.Context, b *types.DelimitedBlock) (string, error) { result := &strings.Builder{} - content, err := r.renderLines(ctx, b.Lines) + content, err := r.renderElements(ctx, b.Elements) if err != nil { return "", errors.Wrap(err, "unable to render example block content") } @@ -18,7 +18,7 @@ func (r *sgmlRenderer) renderMarkdownQuoteBlock(ctx *renderer.Context, b types.M if err != nil { return "", errors.Wrap(err, "unable to render fenced block content") } - attribution, err := markdownQuoteBlockAttribution(b) + attribution, err := newAttribution(b) if err != nil { return "", errors.Wrap(err, "unable to render fenced block content") } diff --git a/pkg/renderer/sgml/delimited_block_passthrough.go b/pkg/renderer/sgml/delimited_block_passthrough.go index 1a5bec85..a373d1e6 100644 --- a/pkg/renderer/sgml/delimited_block_passthrough.go +++ b/pkg/renderer/sgml/delimited_block_passthrough.go @@ -8,15 +8,15 @@ import ( "github.com/pkg/errors" ) -func (r *sgmlRenderer) renderPassthroughBlock(ctx *renderer.Context, b types.PassthroughBlock) (string, error) { +func (r *sgmlRenderer) renderPassthroughBlock(ctx *renderer.Context, b *types.DelimitedBlock) (string, error) { result := &strings.Builder{} - lines := discardEmptyLines(b.Lines) + // lines := discardEmptyLines(b.Lines) previousWithinDelimitedBlock := ctx.WithinDelimitedBlock defer func() { ctx.WithinDelimitedBlock = previousWithinDelimitedBlock }() ctx.WithinDelimitedBlock = true - content, err := r.renderLines(ctx, lines) + content, err := r.renderElements(ctx, b.Elements) if err != nil { return "", errors.Wrap(err, "unable to render passthrough") } diff --git a/pkg/renderer/sgml/delimited_block_quote.go b/pkg/renderer/sgml/delimited_block_quote.go index 8d8f3a00..19b21131 100644 --- a/pkg/renderer/sgml/delimited_block_quote.go +++ b/pkg/renderer/sgml/delimited_block_quote.go @@ -9,7 +9,7 @@ import ( log "github.com/sirupsen/logrus" ) -func (r *sgmlRenderer) renderQuoteBlock(ctx *renderer.Context, b types.QuoteBlock) (string, error) { +func (r *sgmlRenderer) renderQuoteBlock(ctx *renderer.Context, b *types.DelimitedBlock) (string, error) { result := &strings.Builder{} content, err := r.renderElements(ctx, b.Elements) if err != nil { @@ -19,7 +19,7 @@ func (r *sgmlRenderer) renderQuoteBlock(ctx *renderer.Context, b types.QuoteBloc if err != nil { return "", errors.Wrap(err, "unable to render fenced block content") } - attribution, err := quoteBlockAttribution(b) + attribution, err := newAttribution(b) if err != nil { return "", errors.Wrap(err, "unable to render fenced block content") } @@ -46,15 +46,15 @@ func (r *sgmlRenderer) renderQuoteBlock(ctx *renderer.Context, b types.QuoteBloc return result.String(), err } -func (r *sgmlRenderer) renderQuoteParagraph(ctx *renderer.Context, p types.Paragraph) (string, error) { +func (r *sgmlRenderer) renderQuoteParagraph(ctx *renderer.Context, p *types.Paragraph) (string, error) { log.Debug("rendering quote paragraph...") result := &strings.Builder{} - content, err := r.renderLines(ctx, p.Lines) + content, err := r.renderParagraphElements(ctx, p) if err != nil { return "", errors.Wrap(err, "unable to render quote paragraph lines") } - attribution, err := paragraphAttribution(p) + attribution, err := newAttribution(p) if err != nil { return "", errors.Wrap(err, "unable to render quote paragraph lines") } @@ -69,14 +69,12 @@ func (r *sgmlRenderer) renderQuoteParagraph(ctx *renderer.Context, p types.Parag Title string Attribution Attribution Content string - Lines [][]interface{} }{ Context: ctx, ID: r.renderElementID(p.Attributes), Title: title, Attribution: attribution, Content: string(content), - Lines: p.Lines, }) return result.String(), err diff --git a/pkg/renderer/sgml/delimited_block_sidebar.go b/pkg/renderer/sgml/delimited_block_sidebar.go index 5c560ac0..ae8dd4dc 100644 --- a/pkg/renderer/sgml/delimited_block_sidebar.go +++ b/pkg/renderer/sgml/delimited_block_sidebar.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" ) -func (r *sgmlRenderer) renderSidebarBlock(ctx *renderer.Context, b types.SidebarBlock) (string, error) { +func (r *sgmlRenderer) renderSidebarBlock(ctx *renderer.Context, b *types.DelimitedBlock) (string, error) { result := &strings.Builder{} blocks := discardBlankLines(b.Elements) diff --git a/pkg/renderer/sgml/delimited_block_source.go b/pkg/renderer/sgml/delimited_block_source.go index ac08585b..b7508196 100644 --- a/pkg/renderer/sgml/delimited_block_source.go +++ b/pkg/renderer/sgml/delimited_block_source.go @@ -11,13 +11,14 @@ import ( "github.com/alecthomas/chroma/styles" "github.com/bytesparadise/libasciidoc/pkg/renderer" "github.com/bytesparadise/libasciidoc/pkg/types" + "github.com/davecgh/go-spew/spew" "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) -func (r *sgmlRenderer) renderSourceBlock(ctx *renderer.Context, b types.ListingBlock) (string, error) { +func (r *sgmlRenderer) renderSourceBlock(ctx *renderer.Context, b *types.DelimitedBlock) (string, error) { // first, render the content - content, highlighter, language, err := r.renderSourceLines(ctx, b) + content, highlighter, language, err := r.renderSourceBlockElements(ctx, b) if err != nil { return "", errors.Wrap(err, "unable to render source block content") } @@ -61,124 +62,118 @@ func (r *sgmlRenderer) renderSourceBlock(ctx *renderer.Context, b types.ListingB return result.String(), err } -func (r *sgmlRenderer) renderSourceParagraph(ctx *renderer.Context, p types.Paragraph) (string, error) { - lines := make([][]interface{}, len(p.Lines)) - copy(lines, p.Lines) +func (r *sgmlRenderer) renderSourceParagraph(ctx *renderer.Context, p *types.Paragraph) (string, error) { attributes := p.Attributes attributes[types.AttrStyle] = types.Source - return r.renderSourceBlock(ctx, types.ListingBlock{ + return r.renderSourceBlock(ctx, &types.DelimitedBlock{ Attributes: attributes, - Lines: lines, + Elements: p.Elements, }) } -func (r *sgmlRenderer) renderSourceLines(ctx *renderer.Context, b types.ListingBlock) (string, string, string, error) { +func (r *sgmlRenderer) renderSourceBlockElements(ctx *renderer.Context, b *types.DelimitedBlock) (string, string, string, error) { previousWithinDelimitedBlock := ctx.WithinDelimitedBlock defer func() { ctx.WithinDelimitedBlock = previousWithinDelimitedBlock }() ctx.WithinDelimitedBlock = true + highlighter := ctx.Attributes.GetAsStringWithDefault(types.AttrSyntaxHighlighter, "") + language := b.Attributes.GetAsStringWithDefault(types.AttrLanguage, "") - lines := discardEmptyLines(b.Lines) - highlighter, _, err := ctx.Attributes.GetAsString(types.AttrSyntaxHighlighter) - if err != nil { - return "", "", "", err + // render without syntax highlight + if language == "" || (highlighter != "chroma" && highlighter != "pygments") { + log.Debug("rendering souce block without syntax highlighting") + content, err := r.renderElements(ctx, b.Elements) + return content, highlighter, language, err } - language, found, err := b.Attributes.GetAsString(types.AttrLanguage) - if err != nil { + + log.Debug("rendering souce block with syntax highlighting") + // render with syntax highlight + lines := types.SplitElementsPerLine(b.Elements) + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("splitted lines:\n%s", spew.Sdump(lines)) + } + ctx.EncodeSpecialChars = false + defer func() { + ctx.EncodeSpecialChars = true + }() + // using github.com/alecthomas/chroma to highlight the content + lexer := lexers.Get(language) + if lexer == nil { + lexer = lexers.Fallback + } + lexer = chroma.Coalesce(lexer) + style := styles.Fallback + if s, found, err := ctx.Attributes.GetAsString(highlighter + "-style"); err != nil { return "", "", "", err + } else if found { + style = styles.Get(s) } - if found && (highlighter == "chroma" || highlighter == "pygments") { - ctx.EncodeSpecialChars = false - defer func() { - ctx.EncodeSpecialChars = true - }() - // using github.com/alecthomas/chroma to highlight the content - lexer := lexers.Get(language) - if lexer == nil { - lexer = lexers.Fallback + options := []html.Option{ + html.ClassPrefix("tok-"), + html.PreventSurroundingPre(true), + } + // extra option: inline CSS instead of classes + if ctx.Attributes.GetAsStringWithDefault(highlighter+"-css", "classes") == "style" { + options = append(options, html.WithClasses(false)) + } else { + options = append(options, html.WithClasses(true)) + } + result := &strings.Builder{} + for i, line := range lines { + // extra option: line numbers + if b.Attributes.Has(types.AttrLineNums) { + options = append(options, html.WithLineNumbers(true), html.BaseLineNumber(i+1)) } - lexer = chroma.Coalesce(lexer) - style := styles.Fallback - if s, found, err := ctx.Attributes.GetAsString(highlighter + "-style"); err != nil { + + renderedLine, callouts, err := r.renderSourceLine(ctx, line) + if err != nil { return "", "", "", err - } else if found { - style = styles.Get(s) } - options := []html.Option{ - html.ClassPrefix("tok-"), - html.PreventSurroundingPre(true), + highlightedLineBuf := &strings.Builder{} + iterator, err := lexer.Tokenise(nil, renderedLine) + if err != nil { + return "", "", "", err } - // extra option: inline CSS instead of classes - if ctx.Attributes.GetAsStringWithDefault(highlighter+"-css", "classes") == "style" { - options = append(options, html.WithClasses(false)) - } else { - options = append(options, html.WithClasses(true)) + if err = html.New(options...).Format(highlightedLineBuf, style, iterator); err != nil { + return "", "", "", err } - result := &strings.Builder{} - for i, line := range lines { - // extra option: line numbers - if b.Attributes.Has(types.AttrLineNums) { - options = append(options, html.WithLineNumbers(true), html.BaseLineNumber(i+1)) - } - - renderedLine, callouts, err := r.renderSourceLine(ctx, line) - if err != nil { - return "", "", "", err - } - highlightedLineBuf := &strings.Builder{} - iterator, err := lexer.Tokenise(nil, renderedLine) + result.WriteString(highlightedLineBuf.String()) + // append callouts at the end of the highlighted line + for _, callout := range callouts { + renderedCallout, err := r.renderCalloutRef(callout) if err != nil { return "", "", "", err } - if err = html.New(options...).Format(highlightedLineBuf, style, iterator); err != nil { - return "", "", "", err - } - result.WriteString(highlightedLineBuf.String()) - // append callouts at the end of the highlighted line - for _, callout := range callouts { - renderedCallout, err := r.renderCalloutRef(callout) - if err != nil { - return "", "", "", err - } - result.WriteString(renderedCallout) - } - if i < len(lines)-1 { - result.WriteRune('\n') - } - + result.WriteString(renderedCallout) } - if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("source block content:") - fmt.Fprintln(log.StandardLogger().Out, result.String()) + if i < len(lines)-1 { + result.WriteRune('\n') } - return result.String(), highlighter, language, nil + } - result, err := r.renderLines(ctx, lines) - if err != nil { - if err != nil { - return "", "", "", err - } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("source block content:\n%s", result.String()) } - return result, highlighter, language, nil + return result.String(), highlighter, language, nil } -func (r *sgmlRenderer) renderSourceLine(ctx *renderer.Context, line interface{}) (string, []types.Callout, error) { +func (r *sgmlRenderer) renderSourceLine(ctx *renderer.Context, line interface{}) (string, []*types.Callout, error) { elements, ok := line.([]interface{}) if !ok { return "", nil, fmt.Errorf("invalid type of line: '%T'", line) } result := strings.Builder{} - callouts := make([]types.Callout, 0, len(elements)) + callouts := make([]*types.Callout, 0, len(elements)) for _, e := range elements { switch e := e.(type) { - case types.StringElement, types.SpecialCharacter: + case *types.StringElement, *types.SpecialCharacter: s, err := r.renderElement(ctx, e) if err != nil { return "", nil, err } result.WriteString(s) - case types.Callout: + case *types.Callout: callouts = append(callouts, e) default: return "", nil, fmt.Errorf("unexpected type of element: '%T'", line) @@ -187,7 +182,7 @@ func (r *sgmlRenderer) renderSourceLine(ctx *renderer.Context, line interface{}) return result.String(), callouts, nil } -func (r *sgmlRenderer) renderCalloutRef(co types.Callout) (string, error) { +func (r *sgmlRenderer) renderCalloutRef(co *types.Callout) (string, error) { result := &strings.Builder{} err := r.calloutRef.Execute(result, co) if err != nil { diff --git a/pkg/renderer/sgml/delimited_block_verse.go b/pkg/renderer/sgml/delimited_block_verse.go index 5fc198aa..b993a930 100644 --- a/pkg/renderer/sgml/delimited_block_verse.go +++ b/pkg/renderer/sgml/delimited_block_verse.go @@ -9,7 +9,7 @@ import ( log "github.com/sirupsen/logrus" ) -func (r *sgmlRenderer) renderVerseBlock(ctx *renderer.Context, b types.VerseBlock) (string, error) { +func (r *sgmlRenderer) renderVerseBlock(ctx *renderer.Context, b *types.DelimitedBlock) (string, error) { result := &strings.Builder{} roles, err := r.renderElementRoles(ctx, b.Attributes) if err != nil { @@ -20,11 +20,11 @@ func (r *sgmlRenderer) renderVerseBlock(ctx *renderer.Context, b types.VerseBloc ctx.WithinDelimitedBlock = previousWithinDelimitedBlock }() ctx.WithinDelimitedBlock = true - content, err := r.renderLines(ctx, discardEmptyLines(b.Lines)) + content, err := r.renderElements(ctx, b.Elements) if err != nil { return "", errors.Wrap(err, "unable to render verse block") } - attribution, err := verseBlockAttribution(b) + attribution, err := newAttribution(b) if err != nil { return "", errors.Wrap(err, "unable to render verse block") } @@ -51,15 +51,15 @@ func (r *sgmlRenderer) renderVerseBlock(ctx *renderer.Context, b types.VerseBloc return result.String(), err } -func (r *sgmlRenderer) renderVerseParagraph(ctx *renderer.Context, p types.Paragraph) (string, error) { +func (r *sgmlRenderer) renderVerseParagraph(ctx *renderer.Context, p *types.Paragraph) (string, error) { log.Debug("rendering verse paragraph...") result := &strings.Builder{} - content, err := r.renderLines(ctx, p.Lines, r.withPlainText()) + content, err := r.renderParagraphElements(ctx, p, withRenderer(r.renderPlainText)) if err != nil { return "", errors.Wrap(err, "unable to render verse paragraph lines") } - attribution, err := paragraphAttribution(p) + attribution, err := newAttribution(p) if err != nil { return "", errors.Wrap(err, "unable to render verse block") } @@ -74,14 +74,12 @@ func (r *sgmlRenderer) renderVerseParagraph(ctx *renderer.Context, p types.Parag Title string Attribution Attribution Content string - Lines [][]interface{} }{ Context: ctx, ID: r.renderElementID(p.Attributes), Title: title, Attribution: attribution, Content: string(content), - Lines: p.Lines, }) return result.String(), err diff --git a/pkg/renderer/sgml/document_details.go b/pkg/renderer/sgml/document_details.go index b936d216..477311e4 100644 --- a/pkg/renderer/sgml/document_details.go +++ b/pkg/renderer/sgml/document_details.go @@ -17,7 +17,10 @@ func (r *sgmlRenderer) renderDocumentDetails(ctx *renderer.Context) (*string, er return nil, errors.Wrap(err, "error while rendering the document details") } documentDetailsBuff := &bytes.Buffer{} - revLabel := ctx.Attributes.GetAsStringWithDefault("version-label", "version") + revLabel, _, err := ctx.Attributes.GetAsString(types.AttrVersionLabel) + if err != nil { + return nil, errors.Wrap(err, "error while rendering the document details") + } revNumber, _, err := ctx.Attributes.GetAsString("revnumber") if err != nil { return nil, errors.Wrap(err, "error while rendering the document details") diff --git a/pkg/renderer/sgml/elements.go b/pkg/renderer/sgml/elements.go index f6703c81..6e8ee5c5 100644 --- a/pkg/renderer/sgml/elements.go +++ b/pkg/renderer/sgml/elements.go @@ -12,26 +12,11 @@ import ( func (r *sgmlRenderer) renderElements(ctx *renderer.Context, elements []interface{}) (string, error) { // log.Debugf("rendering %d elements(s)...", len(elements)) buff := &strings.Builder{} - if !ctx.Config.WrapInHTMLBodyElement && len(elements) > 0 { - if s, ok := elements[0].(types.Section); ok && s.Level == 0 { - // don't render the top-level section, but only its elements (plus the rest if there's anything) - if len(elements) > 1 { - elements = append(s.Elements, elements[1:]) - } else { - elements = s.Elements - } - } - } for _, element := range elements { renderedElement, err := r.renderElement(ctx, element) if err != nil { return "", err // no need to wrap the error here } - // insert new line if there's already some content (except for BlankLine) - _, isVerbatimLine := element.(types.VerbatimLine) - if buff.Len() > 0 && isVerbatimLine { - buff.WriteString("\n") - } buff.WriteString(renderedElement) } return buff.String(), nil @@ -47,12 +32,12 @@ func (r *sgmlRenderer) renderListElements(ctx *renderer.Context, elements []inte ctx.WithinList++ } renderedElement, err := r.renderElement(ctx, element) + if err != nil { + return "", errors.Wrap(err, "unable to render a list element") + } if i == 0 { ctx.WithinList-- } - if err != nil { - return "", errors.Wrap(err, "unable to render a list block") - } buff.WriteString(renderedElement) } return buff.String(), nil @@ -64,84 +49,69 @@ func (r *sgmlRenderer) renderElement(ctx *renderer.Context, element interface{}) switch e := element.(type) { case []interface{}: return r.renderElements(ctx, e) - case types.TableOfContentsPlaceHolder: - return r.renderTableOfContents(ctx, ctx.TableOfContents) - case types.Section: + case *types.TableOfContents: + return r.renderTableOfContents(ctx, e) + case *types.Section: return r.renderSection(ctx, e) - case types.Preamble: + case *types.Preamble: return r.renderPreamble(ctx, e) - case types.BlankLine: - return r.renderBlankLine(ctx, e) - case types.LabeledList: - return r.renderLabeledList(ctx, e) - case types.OrderedList: - return r.renderOrderedList(ctx, e) - case types.UnorderedList: - return r.renderUnorderedList(ctx, e) - case types.CalloutList: - return r.renderCalloutList(ctx, e) - case types.Callout: + case *types.List: + return r.renderList(ctx, e) + case *types.Callout: return r.renderCalloutRef(e) - case types.Paragraph: + case *types.Paragraph: return r.renderParagraph(ctx, e) - case types.InternalCrossReference: + case *types.InternalCrossReference: return r.renderInternalCrossReference(ctx, e) - case types.ExternalCrossReference: + case *types.ExternalCrossReference: return r.renderExternalCrossReference(ctx, e) - case types.QuotedText: + case *types.QuotedText: return r.renderQuotedText(ctx, e) - case types.InlinePassthrough: + case *types.InlinePassthrough: return r.renderInlinePassthrough(ctx, e) - case types.ImageBlock: + case *types.ImageBlock: return r.renderImageBlock(ctx, e) - case types.Icon: - return r.renderInlineIcon(ctx, e) - case types.InlineImage: + case *types.InlineImage: return r.renderInlineImage(ctx, e) - case types.ExampleBlock: - return r.renderExampleBlock(ctx, e) - case types.QuoteBlock: - return r.renderQuoteBlock(ctx, e) - case types.SidebarBlock: - return r.renderSidebarBlock(ctx, e) - case types.FencedBlock: - return r.renderFencedBlock(ctx, e) - case types.ListingBlock: - return r.renderListingBlock(ctx, e) - case types.PassthroughBlock: - return r.renderPassthroughBlock(ctx, e) - case types.MarkdownQuoteBlock: - return r.renderMarkdownQuoteBlock(ctx, e) - case types.VerseBlock: - return r.renderVerseBlock(ctx, e) - case types.Table: + case *types.Icon: + return r.renderInlineIcon(ctx, e) + case *types.DelimitedBlock: + return r.renderDelimitedBlock(ctx, e) + case *types.Table: return r.renderTable(ctx, e) - case types.LiteralBlock: - return r.renderLiteralBlock(ctx, e) - case types.InlineLink: + case *types.InlineLink: return r.renderLink(ctx, e) - case types.StringElement: + case *types.StringElement: return r.renderStringElement(ctx, e) - case types.FootnoteReference: + case *types.FootnoteReference: return r.renderFootnoteReference(e) - case types.LineBreak: + case *types.LineBreak: return r.renderLineBreak() - case types.UserMacro: + case *types.UserMacro: return r.renderUserMacro(ctx, e) - case types.IndexTerm: + case *types.IndexTerm: return r.renderIndexTerm(ctx, e) - case types.ConcealedIndexTerm: + case *types.ConcealedIndexTerm: return r.renderConcealedIndexTerm(e) - case types.VerbatimLine: - return r.renderVerbatimLine(e) - case types.QuotedString: + case *types.QuotedString: return r.renderQuotedString(ctx, e) - case types.ThematicBreak: + case *types.ThematicBreak: return r.renderThematicBreak() - case types.SpecialCharacter: + case *types.SpecialCharacter: return r.renderSpecialCharacter(ctx, e) - case types.PredefinedAttribute: + case *types.PredefinedAttribute: return r.renderPredefinedAttribute(e) + case *types.AttributeDeclaration: + ctx.Attributes[e.Name] = e.Value + return "", nil + case *types.AttributeReset: + delete(ctx.Attributes, e.Name) + return "", nil + case *types.FrontMatter: + ctx.Attributes.AddAll(e.Attributes) + return "", nil + case *types.AttributeSubstitution: + return r.renderAttributeSubstitution(ctx, e) default: return "", errors.Errorf("unsupported type of element: %T", element) } @@ -152,27 +122,27 @@ func (r *sgmlRenderer) renderPlainText(ctx *renderer.Context, element interface{ // log.Debugf("rendering plain string for element of type %T", element) switch element := element.(type) { case []interface{}: - return r.renderInlineElements(ctx, element, r.withVerbatim()) - case types.QuotedText: + return r.renderInlineElements(ctx, element, withRenderer(r.renderPlainText)) + case *types.QuotedText: return r.renderPlainText(ctx, element.Elements) - case types.Icon: + case *types.Icon: return element.Attributes.GetAsStringWithDefault(types.AttrImageAlt, ""), nil - case types.InlineImage: + case *types.InlineImage: return element.Attributes.GetAsStringWithDefault(types.AttrImageAlt, ""), nil - case types.InlineLink: + case *types.InlineLink: if alt, ok := element.Attributes[types.AttrInlineLinkText].([]interface{}); ok { return r.renderPlainText(ctx, alt) } return element.Location.Stringify(), nil - case types.BlankLine, types.ThematicBreak: + case *types.BlankLine, types.ThematicBreak: return "\n\n", nil - case types.StringElement: + case *types.StringElement: return element.Content, nil - case types.QuotedString: + case *types.QuotedString: return r.renderQuotedStringPlain(ctx, element) - case types.Paragraph: - return r.renderLines(ctx, element.Lines, r.withPlainText()) - case types.FootnoteReference: + // case *types.Paragraph: + // return r.renderParagraph(ctx, element, withRenderer(r.renderPlainText)) + case *types.FootnoteReference: // footnotes are rendered in HTML so they can appear as such in the table of contents return r.renderFootnoteReferencePlainText(element) default: diff --git a/pkg/renderer/sgml/footnote_reference.go b/pkg/renderer/sgml/footnote_reference.go index 4690fded..383679b5 100644 --- a/pkg/renderer/sgml/footnote_reference.go +++ b/pkg/renderer/sgml/footnote_reference.go @@ -10,7 +10,7 @@ import ( "github.com/pkg/errors" ) -func (r *sgmlRenderer) renderFootnoteReference(note types.FootnoteReference) (string, error) { +func (r *sgmlRenderer) renderFootnoteReference(note *types.FootnoteReference) (string, error) { result := &strings.Builder{} if note.ID != types.InvalidFootnoteReference && !note.Duplicate { // valid case for a footnote with content, with our without an explicit reference @@ -50,7 +50,7 @@ func (r *sgmlRenderer) renderFootnoteReference(note types.FootnoteReference) (st return result.String(), nil } -func (r *sgmlRenderer) renderFootnoteReferencePlainText(note types.FootnoteReference) (string, error) { +func (r *sgmlRenderer) renderFootnoteReferencePlainText(note *types.FootnoteReference) (string, error) { result := &strings.Builder{} if note.ID != types.InvalidFootnoteReference { // valid case for a footnote with content, with our without an explicit reference @@ -70,7 +70,7 @@ func (r *sgmlRenderer) renderFootnoteReferencePlainText(note types.FootnoteRefer return result.String(), nil } -func (r *sgmlRenderer) renderFootnotes(ctx *renderer.Context, notes []types.Footnote) (string, error) { +func (r *sgmlRenderer) renderFootnotes(ctx *renderer.Context, notes []*types.Footnote) (string, error) { // skip if there's no foot note in the doc if len(notes) == 0 { return "", nil @@ -87,7 +87,7 @@ func (r *sgmlRenderer) renderFootnotes(ctx *renderer.Context, notes []types.Foot err := r.footnotes.Execute(result, struct { Context *renderer.Context Content string - Footnotes []types.Footnote + Footnotes []*types.Footnote }{ Context: ctx, Content: string(content.String()), @@ -99,7 +99,7 @@ func (r *sgmlRenderer) renderFootnotes(ctx *renderer.Context, notes []types.Foot return result.String(), nil } -func (r *sgmlRenderer) renderFootnoteItem(ctx *renderer.Context, w io.Writer, item types.Footnote) error { +func (r *sgmlRenderer) renderFootnoteItem(ctx *renderer.Context, w io.Writer, item *types.Footnote) error { content, err := r.renderInlineElements(ctx, item.Elements) if err != nil { diff --git a/pkg/renderer/sgml/html5/article_adoc_test.go b/pkg/renderer/sgml/html5/article_adoc_test.go deleted file mode 100644 index 860ff115..00000000 --- a/pkg/renderer/sgml/html5/article_adoc_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package html5_test - -import ( - "bufio" - "bytes" - "os" - - "github.com/bytesparadise/libasciidoc/pkg/configuration" - "github.com/bytesparadise/libasciidoc/pkg/parser" - "github.com/bytesparadise/libasciidoc/pkg/renderer" - "github.com/bytesparadise/libasciidoc/pkg/renderer/sgml/html5" - - "github.com/davecgh/go-spew/spew" - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint -) - -var _ = Describe("article.adoc", func() { - - It("should render without failure", func() { - f, err := os.Open("article.adoc") - Expect(err).ToNot(HaveOccurred()) - reader := bufio.NewReader(f) - config := configuration.NewConfiguration() - doc, err := parser.ParseDocument(reader, config) - Expect(err).ToNot(HaveOccurred()) - GinkgoT().Logf("actual document: `%s`", spew.Sdump(doc)) - buff := &bytes.Buffer{} - ctx := renderer.NewContext(doc, config) - _, err = html5.Render(ctx, doc, buff) - Expect(err).ToNot(HaveOccurred()) - }) -}) diff --git a/pkg/renderer/sgml/html5/delimited_block_admonition_test.go b/pkg/renderer/sgml/html5/delimited_block_admonition_test.go index 681f316b..9819ea5b 100644 --- a/pkg/renderer/sgml/html5/delimited_block_admonition_test.go +++ b/pkg/renderer/sgml/html5/delimited_block_admonition_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("admonition blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("admonition block with multiple elements alone", func() { source := `[NOTE] @@ -174,7 +174,7 @@ this is an admonition paragraph. This is an admonition block with another paragraph -==== ` +====` expected := `
diff --git a/pkg/renderer/sgml/html5/delimited_block_example_test.go b/pkg/renderer/sgml/html5/delimited_block_example_test.go index f8f1ac30..f737705c 100644 --- a/pkg/renderer/sgml/html5/delimited_block_example_test.go +++ b/pkg/renderer/sgml/html5/delimited_block_example_test.go @@ -11,7 +11,7 @@ import ( var _ = Describe("example blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("example block with multiple elements - case 1", func() { source := `==== diff --git a/pkg/renderer/sgml/html5/delimited_block_fenced_test.go b/pkg/renderer/sgml/html5/delimited_block_fenced_test.go index 247427f2..8118ab7f 100644 --- a/pkg/renderer/sgml/html5/delimited_block_fenced_test.go +++ b/pkg/renderer/sgml/html5/delimited_block_fenced_test.go @@ -35,7 +35,7 @@ here Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("fenced block with id and title", func() { + It("fenced block with id and title and empty end lines", func() { source := "[#id-for-fences]\n.fenced block title\n```\nsome source code\n\nhere\n\n\n\n```" expected := `
fenced block title
@@ -49,7 +49,7 @@ here Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("fenced block with external link inside", func() { + It("fenced block with external link inside amd empty end line", func() { source := "```" + "\n" + "a http://website.com" + "\n" + "and more text on the" + "\n" + diff --git a/pkg/renderer/sgml/html5/delimited_block_listing_test.go b/pkg/renderer/sgml/html5/delimited_block_listing_test.go index 51d45008..e3772e0f 100644 --- a/pkg/renderer/sgml/html5/delimited_block_listing_test.go +++ b/pkg/renderer/sgml/html5/delimited_block_listing_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("listing blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("with no line", func() { source := `---- @@ -23,7 +23,7 @@ var _ = Describe("listing blocks", func() { Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("with multiple lines", func() { + It("with multiple lines and empty end lines", func() { source := `---- some source code diff --git a/pkg/renderer/sgml/html5/delimited_block_literal_test.go b/pkg/renderer/sgml/html5/delimited_block_literal_test.go index 3802ce38..3e217978 100644 --- a/pkg/renderer/sgml/html5/delimited_block_literal_test.go +++ b/pkg/renderer/sgml/html5/delimited_block_literal_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("literal blocks", func() { - Context("literal blocks with spaces indentation", func() { + Context("with spaces indentation", func() { It("literal block from 1-line paragraph with single space", func() { source := ` some literal content` @@ -88,7 +88,7 @@ a normal paragraph.` }) }) - Context("literal blocks with block delimiter", func() { + Context("as block delimiter", func() { It("literal block with delimited and attributes followed by 1-line paragraph", func() { source := `[#ID] @@ -112,19 +112,19 @@ a normal paragraph.` }) - Context("literal blocks with attribute", func() { + Context("with literal attribute", func() { It("literal block from 1-line paragraph with attribute", func() { source := `[literal] literal content - on many lines + on many lines has its heading spaces preserved. a normal paragraph.` expected := `
 literal content
- on many lines
+  on many lines
  has its heading spaces preserved.
diff --git a/pkg/renderer/sgml/html5/delimited_block_markdown_quote_test.go b/pkg/renderer/sgml/html5/delimited_block_markdown_quote_test.go index 2b97b047..8ab0f02e 100644 --- a/pkg/renderer/sgml/html5/delimited_block_markdown_quote_test.go +++ b/pkg/renderer/sgml/html5/delimited_block_markdown_quote_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("markdown-style quote blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("with single marker without author", func() { source := `> some text diff --git a/pkg/renderer/sgml/html5/delimited_block_passthrough_test.go b/pkg/renderer/sgml/html5/delimited_block_passthrough_test.go index dd549e19..eaac8767 100644 --- a/pkg/renderer/sgml/html5/delimited_block_passthrough_test.go +++ b/pkg/renderer/sgml/html5/delimited_block_passthrough_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("passthrough blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("with title", func() { source := `.a title @@ -17,6 +17,21 @@ var _ = Describe("passthrough blocks", func() { _foo_ *bar* +++++` + expected := `_foo_ + +*bar* +` + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + + It("with empty lines around", func() { + source := `++++ + +_foo_ + +*bar* + ++++` expected := `_foo_ @@ -39,16 +54,16 @@ _foo_ }) }) - Context("paragraph blocks", func() { + Context("as paragraph blocks", func() { It("2-line paragraph followed by another paragraph", func() { source := `[pass] -_foo_ -*bar* + another paragraph` - expected := `_foo_ -*bar* + expected := `

another paragraph

diff --git a/pkg/renderer/sgml/html5/delimited_block_quote_test.go b/pkg/renderer/sgml/html5/delimited_block_quote_test.go index 02114e24..90a81928 100644 --- a/pkg/renderer/sgml/html5/delimited_block_quote_test.go +++ b/pkg/renderer/sgml/html5/delimited_block_quote_test.go @@ -9,9 +9,9 @@ import ( var _ = Describe("quote blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { - It("single-line quote with author and title ", func() { + It("with single-line quote and author and title ", func() { source := `[quote, john doe, quote title] ____ some *quote* content @@ -32,7 +32,7 @@ ____` Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("single-line quote with author and title, and ID and title ", func() { + It("with single-line quote and author and title, and ID and title ", func() { source := `[#id-for-quote-block] [quote, john doe, quote title] .title for quote block @@ -55,7 +55,7 @@ ____` Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("multi-line quote with author and title", func() { + It("with multi-line quote and author and title", func() { source := `[quote, john doe, quote title] ____ @@ -89,7 +89,7 @@ ____` Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("multi-line quote with author only and nested listing", func() { + It("with multi-line quote and author only and nested listing", func() { source := `[quote, john doe] ____ * some @@ -128,7 +128,7 @@ ____` Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("single-line quote with title only", func() { + It("with single-line quote and title only", func() { source := `[quote, , quote title] ____ some quote content @@ -147,7 +147,7 @@ ____` Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("multi-line quote without author and title", func() { + It("with multi-line quote without author and title", func() { source := `[quote] ____ lines @@ -169,7 +169,7 @@ are preserved, but not trailing spaces

Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("empty quote without author and title", func() { + It("with empty quote without author and title", func() { source := `[quote] ____ ____` diff --git a/pkg/renderer/sgml/html5/delimited_block_sidebar_test.go b/pkg/renderer/sgml/html5/delimited_block_sidebar_test.go index 9fd1be95..3773f6ff 100644 --- a/pkg/renderer/sgml/html5/delimited_block_sidebar_test.go +++ b/pkg/renderer/sgml/html5/delimited_block_sidebar_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("sidebar blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("sidebar block with paragraph", func() { source := `**** diff --git a/pkg/renderer/sgml/html5/delimited_block_source_test.go b/pkg/renderer/sgml/html5/delimited_block_source_test.go index 590220dd..75c9abce 100644 --- a/pkg/renderer/sgml/html5/delimited_block_source_test.go +++ b/pkg/renderer/sgml/html5/delimited_block_source_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("source blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("with source attribute only", func() { source := `[source] diff --git a/pkg/renderer/sgml/html5/delimited_block_verse_test.go b/pkg/renderer/sgml/html5/delimited_block_verse_test.go index 16463029..4f826cc3 100644 --- a/pkg/renderer/sgml/html5/delimited_block_verse_test.go +++ b/pkg/renderer/sgml/html5/delimited_block_verse_test.go @@ -11,9 +11,9 @@ import ( var _ = Describe("verse blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { - It("single-line verse with author and title ", func() { + It("single-line verse with author and title and empty end line", func() { source := `[verse, john doe, verse title] ____ some *verse* content @@ -49,7 +49,7 @@ ____` Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("multi-line verse with author and title", func() { + It("multi-line verse with author and title and empty end line", func() { source := `[verse, john doe, verse title] ____ - some @@ -104,7 +104,7 @@ ____` Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("multi-line verse without author and title", func() { + It("multi-line verse without author and title and empty end line", func() { source := `[verse] ____ lines diff --git a/pkg/renderer/sgml/html5/document_details_test.go b/pkg/renderer/sgml/html5/document_details_test.go index 51304da5..b011d102 100644 --- a/pkg/renderer/sgml/html5/document_details_test.go +++ b/pkg/renderer/sgml/html5/document_details_test.go @@ -139,7 +139,7 @@ Last updated {{.LastUpdated}} Expect(RenderHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), - configuration.WithAttributes(map[string]string{}), + configuration.WithAttributes(map[string]interface{}{}), )).To(MatchHTMLTemplate(expected, now)) }) @@ -171,7 +171,7 @@ a paragraph` Expect(RenderHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), - configuration.WithAttributes(map[string]string{ + configuration.WithAttributes(map[string]interface{}{ types.AttrNoFooter: "", }), )).To(MatchHTMLTemplate(expected, now)) @@ -207,7 +207,7 @@ Last updated {{.LastUpdated}} Expect(RenderHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), - configuration.WithAttributes(map[string]string{ + configuration.WithAttributes(map[string]interface{}{ types.AttrNoHeader: "", }), )).To(MatchHTMLTemplate(expected, now)) @@ -238,7 +238,7 @@ a paragraph` Expect(RenderHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), - configuration.WithAttributes(map[string]string{ + configuration.WithAttributes(map[string]interface{}{ types.AttrNoHeader: "", types.AttrNoFooter: "", }), diff --git a/pkg/renderer/sgml/html5/file_inclusion_test.go b/pkg/renderer/sgml/html5/file_inclusion_test.go index 2fe3e410..7f1a2d2a 100644 --- a/pkg/renderer/sgml/html5/file_inclusion_test.go +++ b/pkg/renderer/sgml/html5/file_inclusion_test.go @@ -36,12 +36,12 @@ var _ = Describe("file inclusions", func() { Title: "", LastUpdated: lastUpdated.Format(configuration.LastUpdatedFormat), TableOfContents: types.TableOfContents{ - Sections: []types.ToCSection{ + Sections: []*types.ToCSection{ { ID: "_grandchild_title", Level: 1, Title: "grandchild title", - Children: []types.ToCSection{}, + Children: []*types.ToCSection{}, }, }, }, @@ -876,7 +876,7 @@ func helloworld() {

last line of child

-

last line of parent

+

last line of parent <1>

@@ -891,15 +891,17 @@ include::../../../../test/includes/parent-include.adoc[leveloffset=+1] ----` expected := `
-
== parent title
+
:leveloffset: +1
+
+= parent title
 
 first line of parent
 
-== child title
+= child title
 
 first line of child
 
-=== grandchild title
+== grandchild title
 
 first line of grandchild
 
@@ -907,7 +909,9 @@ last line of grandchild
 
 last line of child
 
-last line of parent
+last line of parent (1) + +:leveloffset!:
` diff --git a/pkg/renderer/sgml/html5/front_matter_test.go b/pkg/renderer/sgml/html5/front_matter_test.go new file mode 100644 index 00000000..6a18eee7 --- /dev/null +++ b/pkg/renderer/sgml/html5/front_matter_test.go @@ -0,0 +1,26 @@ +package html5_test + +import ( + . "github.com/bytesparadise/libasciidoc/testsupport" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("documents with front-matter", func() { + + It("should render with front-matter", func() { + source := `--- +description: User Manual +--- + +{description} + ` + expected := `
+

User Manual

+
+` + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + +}) diff --git a/pkg/renderer/sgml/html5/html5.go b/pkg/renderer/sgml/html5/html5.go index a4bbe727..f9ad12c2 100644 --- a/pkg/renderer/sgml/html5/html5.go +++ b/pkg/renderer/sgml/html5/html5.go @@ -1,43 +1,40 @@ package html5 const ( - articleTmpl = "\n" + - "\n" + - "\n" + - "\n" + - "\n" + - "\n" + - "{{ if .Generator }}\n{{ end }}" + - "{{ if .Authors }}\n{{ end }}" + - "{{ if .CSS}}\n{{ end }}" + - "{{ .Title }}\n" + - "\n" + - "\n" + - "{{ if .IncludeHTMLBodyHeader }}{{ .Header }}{{ end }}" + - "
\n" + - "{{ .Content }}" + - "
\n" + - "{{ if .IncludeHTMLBodyFooter }}
\n" + - "
\n" + - "{{ if .RevNumber }}Version {{ .RevNumber }}
\n{{ end }}" + - "Last updated {{ .LastUpdated }}\n" + - "
\n" + - "
\n{{ end }}" + - "\n" + - "\n" + articleTmpl = ` + + + + + +{{ if .Generator }} +{{ end }}{{ if .Authors }} +{{ end }}{{ if .CSS}} +{{ end }}{{ .Title }} + + +{{ if .IncludeHTMLBodyHeader }}{{ .Header }}{{ end }}
+{{ .Content }}
+{{ if .IncludeHTMLBodyFooter }} +{{ end }} + +` - articleHeaderTmpl = "
\n" + - "

{{ .Header }}

\n" + - "{{ if.Details }}{{ .Details }}{{ end }}" + - "
\n" + articleHeaderTmpl = ` +` - manpageHeaderTmpl = "{{ if.IncludeH1 }}
\n" + - "

{{ .Header }} Manual Page

\n{{ end }}" + - "

{{ .Name }}

\n" + - "
\n" + - "{{ .Content }}" + - "
\n" + - "{{ if .IncludeH1 }}
\n{{ end }}" + manpageHeaderTmpl = `{{ if.IncludeH1 }} +{{ end }}` ) diff --git a/pkg/renderer/sgml/html5/html5_test.go b/pkg/renderer/sgml/html5/html5_test.go index c7e523e2..63730b84 100644 --- a/pkg/renderer/sgml/html5/html5_test.go +++ b/pkg/renderer/sgml/html5/html5_test.go @@ -126,7 +126,7 @@ Last updated {{.LastUpdated}} ` Expect(RenderHTML(source, configuration.WithLastUpdated(now), - configuration.WithAttributes(map[string]string{ + configuration.WithAttributes(map[string]interface{}{ types.AttrNoHeader: "", types.AttrNoFooter: "", }), @@ -182,7 +182,7 @@ Last updated {{.LastUpdated}} It("document with custom icon attributes", func() { // given - attrs := map[string]string{ + attrs := map[string]interface{}{ "icons": "font", "source-highlighter": "pygments", } @@ -215,7 +215,7 @@ a note It("document without custom icon attributes", func() { // given - attrs := map[string]string{} + attrs := map[string]interface{}{} source := `[source] ---- foo @@ -376,7 +376,7 @@ Last updated {{.LastUpdated}} ` now := time.Now() Expect(RenderHTML(source, configuration.WithFilename("test.adoc"), - configuration.WithAttributes(map[string]string{ + configuration.WithAttributes(map[string]interface{}{ types.AttrDocType: "manpage", }), configuration.WithCSS("/path/to/style.css"), @@ -494,7 +494,7 @@ Free use of this software is granted under the terms of the MIT License.

` now := time.Now() Expect(RenderHTML(source, configuration.WithFilename("test.adoc"), - configuration.WithAttributes(map[string]string{ + configuration.WithAttributes(map[string]interface{}{ types.AttrDocType: "manpage", }), configuration.WithCSS("/path/to/style.css"), diff --git a/pkg/renderer/sgml/html5/image_test.go b/pkg/renderer/sgml/html5/image_test.go index b8220431..84babb82 100644 --- a/pkg/renderer/sgml/html5/image_test.go +++ b/pkg/renderer/sgml/html5/image_test.go @@ -99,8 +99,9 @@ var _ = Describe("images", func() { It("with suppressed caption", func() { - source := ":figure-caption!:\n" + - ".Image Title\nimage::foo.png[foo image, 600, 400]" + source := `:figure-caption!: +.Image Title +image::foo.png[foo image, 600, 400]` expected := `
foo image diff --git a/pkg/renderer/sgml/html5/index_terms_test.go b/pkg/renderer/sgml/html5/index_terms_test.go index 06875d82..00af1b2b 100644 --- a/pkg/renderer/sgml/html5/index_terms_test.go +++ b/pkg/renderer/sgml/html5/index_terms_test.go @@ -44,18 +44,10 @@ var _ = Describe("concealed index terms", func() { It("concealed index term in single paragraph line", func() { source := `(((index, term))) a paragraph with an index term.` + // paragraph content starts with a `\n` because index terms are not rendered in HTML expected := `
-

a paragraph with an index term.

-
-` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - - It("concealed index term in single paragraph line", func() { - source := `(((index, term))) -a paragraph with an index term.` - expected := `
-

a paragraph with an index term.

+

+a paragraph with an index term.

` Expect(RenderHTML(source)).To(MatchHTML(expected)) diff --git a/pkg/renderer/sgml/html5/labeled_list_test.go b/pkg/renderer/sgml/html5/labeled_list_test.go index 6ea2c8f9..48d7bc0a 100644 --- a/pkg/renderer/sgml/html5/labeled_list_test.go +++ b/pkg/renderer/sgml/html5/labeled_list_test.go @@ -7,9 +7,9 @@ import ( . "github.com/onsi/gomega" //nolint golint ) -var _ = Describe("labeled lists of items", func() { +var _ = Describe("labeled lists", func() { - Context("simple items", func() { + Context("simple elements", func() { It("simple labeled list with id, title, role and a default layout", func() { source := `.mytitle @@ -286,7 +286,7 @@ item 2 Context("labeled lists with continuation", func() { - It("labeled list with paragraph continuation", func() { + It("with paragraph continuation", func() { source := `item 1:: description 1 + foo @@ -311,7 +311,7 @@ item 2:: description 2.` Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("labeled list with blockcontinuation", func() { + It("with block continuation", func() { source := `Item 1:: + ---- @@ -348,7 +348,7 @@ another delimited block Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("labeled list with multiple item continuations", func() { + It("with multiple continuations", func() { source := `Item 1:: content 1 + diff --git a/pkg/renderer/sgml/html5/link_test.go b/pkg/renderer/sgml/html5/link_test.go index 8e2dc58a..81a1dba2 100644 --- a/pkg/renderer/sgml/html5/link_test.go +++ b/pkg/renderer/sgml/html5/link_test.go @@ -1,6 +1,9 @@ package html5_test import ( + "time" + + "github.com/bytesparadise/libasciidoc/pkg/configuration" . "github.com/bytesparadise/libasciidoc/testsupport" . "github.com/onsi/ginkgo" //nolint golint @@ -265,6 +268,56 @@ a link to {scheme}://{path} and https://foo.baz` Context("with document attribute substitutions", func() { + It("with attribute in section 0 title", func() { + source := `= a title to {scheme}://{path} and https://foo.com +:scheme: https +:path: example.com` + expected := ` + + + + + + +a title to https://example.com and https://foo.com + + + +
+
+ + + +` + lastUpdated := time.Now() + Expect(RenderHTML(source, + configuration.WithHeaderFooter(true), + configuration.WithLastUpdated(lastUpdated), + )).To(MatchHTMLTemplate(expected, lastUpdated)) + }) + + It("with attribute in section 1 title", func() { + source := ` +:scheme: https +:path: example.com + +== a title to {scheme}://{path} and https://foo.com +` + expected := `
+

a title to https://example.com and https://foo.com

+
+
+
+` + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + It("relative link with two document attribute substitutions and a reset", func() { source := `:scheme: link :path: foo.bar diff --git a/pkg/renderer/sgml/html5/ordered_list_test.go b/pkg/renderer/sgml/html5/ordered_list_test.go index 718eb7f8..1d72d4e8 100644 --- a/pkg/renderer/sgml/html5/ordered_list_test.go +++ b/pkg/renderer/sgml/html5/ordered_list_test.go @@ -9,7 +9,41 @@ import ( var _ = Describe("ordered lists", func() { - It("ordered list with title and role", func() { + It("with implicit numbering style on a single line", func() { + source := `. item on a single line` + expected := `
+
    +
  1. +

    item on a single line

    +
  2. +
+
+` + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + + It("with implicit numbering style on multiple lines with heading tabs", func() { + // heading tabs should be trimmed + source := `. item + on + multiple + lines +` + expected := `
+
    +
  1. +

    item +on +multiple +lines

    +
  2. +
+
+` + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + + It("with title and role", func() { source := `.title [#myid] [.myrole] @@ -26,7 +60,7 @@ var _ = Describe("ordered lists", func() { Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("ordered list item with explicit start only", func() { + It("with explicit start only", func() { source := `[start=5] . item` expected := `
@@ -40,7 +74,7 @@ var _ = Describe("ordered lists", func() { Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("ordered list item with explicit quoted numbering and start", func() { + It("with explicit quoted numbering and start", func() { source := `["lowerroman", start="5"] . item` expected := `
@@ -72,7 +106,7 @@ var _ = Describe("ordered lists", func() { Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("ordered list with paragraph continuation", func() { + It("with paragraph continuation", func() { source := `. item 1 + foo` @@ -90,7 +124,7 @@ foo` Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("ordered list with delimited block continuation", func() { + It("with delimited block continuation", func() { source := `. item 1 + ---- @@ -112,7 +146,7 @@ foo Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("ordered list with unnumbered items", func() { + It("with unnumbered items", func() { source := `. item 1 .. item 1.1 ... item 1.1.1 diff --git a/pkg/renderer/sgml/html5/paragraph_test.go b/pkg/renderer/sgml/html5/paragraph_test.go index 1f1ede78..c1de80e7 100644 --- a/pkg/renderer/sgml/html5/paragraph_test.go +++ b/pkg/renderer/sgml/html5/paragraph_test.go @@ -194,7 +194,7 @@ another one using attribute substitution: https://github.com[]...

Context("with line break", func() { - It("with explicit line break", func() { + It("at end of line", func() { source := `foo + bar baz` @@ -207,7 +207,7 @@ baz

Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("with paragraph attribute", func() { + It("as paragraph attribute", func() { source := `[%hardbreaks] foo @@ -222,7 +222,7 @@ baz

Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("with document attribute", func() { + It("as document attribute", func() { source := `:hardbreaks: foo bar @@ -476,19 +476,19 @@ I am a verse paragraph.` Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("image block as a verse", func() { - source := `[verse, john doe, verse title] -image::foo.png[]` - expected := `
-
image::foo.png[]
-
-— john doe
-verse title -
-
-` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + // It("image block as a verse", func() { + // source := `[verse, john doe, verse title] + // image::foo.png[]` + // expected := `
+ //
image::foo.png[]
+ //
+ // — john doe
+ // verse title + //
+ //
+ // ` + // Expect(RenderHTML(source)).To(MatchHTML(expected)) + // }) }) Context("quote paragraphs", func() { diff --git a/pkg/renderer/sgml/html5/preamble.go b/pkg/renderer/sgml/html5/preamble.go new file mode 100644 index 00000000..706b39d5 --- /dev/null +++ b/pkg/renderer/sgml/html5/preamble.go @@ -0,0 +1,9 @@ +package html5 + +const ( + preambleTmpl = `{{ if .Wrapper }}
+
+{{ end }}{{ .Content }}{{ if .Wrapper }}
+{{ if .ToC }}{{ .ToC }}{{ end }}
+{{ end }}` +) diff --git a/pkg/renderer/sgml/html5/quoted_string_test.go b/pkg/renderer/sgml/html5/quoted_string_test.go index 39c08af1..1a7e7af5 100644 --- a/pkg/renderer/sgml/html5/quoted_string_test.go +++ b/pkg/renderer/sgml/html5/quoted_string_test.go @@ -9,134 +9,132 @@ import ( var _ = Describe("quoted strings", func() { - Context("quoted strings", func() { - - It("bold content alone", func() { - source := "*bold content*" - expected := `
+ It("bold content alone", func() { + source := "*bold content*" + expected := `

bold content

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("simple single quoted string", func() { - source := "'`curly was single`'" - expected := `
+ It("simple single quoted string", func() { + source := "'`curly was single`'" + expected := `

‘curly was single’

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("simple single quoted unicode", func() { - source := ":unicode:\n\n'`curly was single`'" - expected := "
\n" + - "

\u2018curly was single\u2019

\n" + - "
\n" - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - - It("interior spaces with single quoted string", func() { - source := "'` curly was single `' or so they say" - expected := "
\n" + - "

'` curly was single ’ or so they say

\n" + - "
\n" - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - - It("bold in single quoted string", func() { - source := "'`curly *was* single`'" - expected := `
+ Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + It("simple single quoted unicode", func() { + source := ":unicode:\n\n'`curly was single`'" + expected := "
\n" + + "

\u2018curly was single\u2019

\n" + + "
\n" + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + + It("interior spaces with single quoted string", func() { + source := "'` curly was single `' or so they say" + expected := "
\n" + + "

'` curly was single ’ or so they say

\n" + + "
\n" + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + + It("bold in single quoted string", func() { + source := "'`curly *was* single`'" + expected := `

‘curly was single’

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("italics in single quoted string", func() { - source := "'`curly _was_ single`'" - expected := `
+ It("italics in single quoted string", func() { + source := "'`curly _was_ single`'" + expected := `

‘curly was single’

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) + Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("span in single quoted string", func() { - source := "'`curly [.strikeout]#was#_is_ single`'" - expected := `
+ }) + It("span in single quoted string", func() { + source := "'`curly [.strikeout]#was#_is_ single`'" + expected := `

‘curly wasis single’

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) + Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("curly in monospace string", func() { - source := "'`curly `is` single`'" - expected := `
+ }) + It("curly in monospace string", func() { + source := "'`curly `is` single`'" + expected := `

‘curly is single’

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("curly as monospace string", func() { - source := "'``curly``'" - expected := `
+ Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + It("curly as monospace string", func() { + source := "'``curly``'" + expected := `

curly

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("curly with nested double curly", func() { - source := "'`single\"`double`\"`'" - expected := `
+ It("curly with nested double curly", func() { + source := "'`single\"`double`\"`'" + expected := `

‘single“double”’

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("curly in monospace string", func() { - source := "`'`curly`'`" - expected := `
+ It("curly in monospace string", func() { + source := "`'`curly`'`" + expected := `

‘curly’

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("curly in italics", func() { - source := "_'`curly`'_" - expected := `
+ Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + It("curly in italics", func() { + source := "_'`curly`'_" + expected := `

‘curly’

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) + Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("curly in bold", func() { - source := "*'`curly`'*" - expected := `
+ }) + It("curly in bold", func() { + source := "*'`curly`'*" + expected := `

‘curly’

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("curly in title", func() { - source := "== a '`curly`' episode" - expected := `
+ It("curly in title", func() { + source := "== a '`curly`' episode" + expected := `

a ‘curly’ episode

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("curly in list element", func() { - source := "* a '`curly`' episode" - expected := `
+ It("curly in list element", func() { + source := "* a '`curly`' episode" + expected := `
  • a ‘curly’ episode

    @@ -144,12 +142,12 @@ var _ = Describe("quoted strings", func() {
` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("curly in labeled list", func() { - source := "'`term`':: something '`quoted`'" - expected := `
+ It("curly in labeled list", func() { + source := "'`term`':: something '`quoted`'" + expected := `
‘term’
@@ -158,154 +156,154 @@ var _ = Describe("quoted strings", func() {
` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("curly in link", func() { - source := "https://www.example.com/a['`example`']" - expected := `
+ It("curly in link", func() { + source := "https://www.example.com/a['`example`']" + expected := ` ` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("curly in single quoted link", func() { - source := "https://www.example.com/a[\"an '`example`'\"]" - expected := `
+ Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + It("curly in single quoted link", func() { + source := "https://www.example.com/a[\"an '`example`'\"]" + expected := ` ` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("image in curly", func() { - source := "'`a image:foo.png[]`'" - expected := `
+ It("image in curly", func() { + source := "'`a image:foo.png[]`'" + expected := `

‘a foo

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("icon in curly", func() { - source := ":icons: font\n\n'`a icon:note[]`'" - expected := `
+ It("icon in curly", func() { + source := ":icons: font\n\n'`a icon:note[]`'" + expected := `

‘a

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("simple single quoted string", func() { - source := "\"`curly was single`\"" - expected := `
+ It("simple single quoted string", func() { + source := "\"`curly was single`\"" + expected := `

“curly was single”

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) + Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + }) - It("spaces with double quoted string", func() { - source := "\"` curly was single `\"" - expected := "
\n" + - "

\"` curly was single `\"

\n" + - "
\n" - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("bold in double quoted string", func() { - source := "\"`curly *was* single`\"" - expected := `
+ It("spaces with double quoted string", func() { + source := "\"` curly was single `\"" + expected := "
\n" + + "

\"` curly was single `\"

\n" + + "
\n" + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + It("bold in double quoted string", func() { + source := "\"`curly *was* single`\"" + expected := `

“curly was single”

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) + Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("italics in double quoted string", func() { - source := "\"`curly _was_ single`\"" - expected := `
+ }) + It("italics in double quoted string", func() { + source := "\"`curly _was_ single`\"" + expected := `

“curly was single”

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("span in double quoted string", func() { - source := "\"`curly [.strikeout]#was#_is_ single`\"" - expected := `
+ It("span in double quoted string", func() { + source := "\"`curly [.strikeout]#was#_is_ single`\"" + expected := `

“curly wasis single”

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("double curly in monospace string", func() { - source := "\"`curly `is` single`\"" - expected := `
+ It("double curly in monospace string", func() { + source := "\"`curly `is` single`\"" + expected := `

“curly is single”

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("double curly as monospace string", func() { - source := "\"``curly``\"" - expected := `
+ It("double curly as monospace string", func() { + source := "\"``curly``\"" + expected := `

curly

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("double curly with nested single curly", func() { - source := "\"`double'`single`'`\"" - expected := `
+ Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + It("double curly with nested single curly", func() { + source := "\"`double'`single`'`\"" + expected := `

“double‘single’”

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("double curly in monospace string", func() { - source := "`\"`curly`\"`" - expected := `
+ Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + It("double curly in monospace string", func() { + source := "`\"`curly`\"`" + expected := `

“curly”

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("double curly in italics", func() { - source := "_\"`curly`\"_" - expected := `
+ Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + It("double curly in italics", func() { + source := "_\"`curly`\"_" + expected := `

“curly”

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) + Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("double curly in bold", func() { - source := "*\"`curly`\"*" - expected := `
+ }) + It("double curly in bold", func() { + source := "*\"`curly`\"*" + expected := `

“curly”

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) + Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + }) - It("double curly in title", func() { - source := "== a \"`curly`\" episode" - expected := `
+ It("double curly in title", func() { + source := "== a \"`curly`\" episode" + expected := `

a “curly” episode

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("double in list element", func() { - source := "* a \"`curly`\" episode" - expected := `
+ It("double in list element", func() { + source := "* a \"`curly`\" episode" + expected := `
  • a “curly” episode

    @@ -313,12 +311,12 @@ var _ = Describe("quoted strings", func() {
` - Expect(RenderHTML(source)).To(MatchHTML(expected)) + Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("double curly in labeled list", func() { - source := "\"`term`\":: something \"`quoted`\"" - expected := `
+ }) + It("double curly in labeled list", func() { + source := "\"`term`\":: something \"`quoted`\"" + expected := `
“term”
@@ -327,45 +325,44 @@ var _ = Describe("quoted strings", func() {
` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - // In a link, the quotes are ambiguous, and we default to assuming they are for enclosing - // the link text. Nest them explicitly if this is needed. - It("double curly in link (becomes mono)", func() { - source := "https://www.example.com/a[\"`example`\"]" - expected := `
+ // In a link, the quotes are ambiguous, and we default to assuming they are for enclosing + // the link text. Nest them explicitly if this is needed. + It("double curly in link (becomes mono)", func() { + source := "https://www.example.com/a[\"`example`\"]" + expected := ` ` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - // This is the unambiguous form. - It("curly in double quoted link", func() { - source := "https://www.example.com/a[\"\"`example`\"\"]" - expected := `
+ // This is the unambiguous form. + It("curly in double quoted link", func() { + source := "https://www.example.com/a[\"\"`example`\"\"]" + expected := ` ` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("image in double curly", func() { - source := "\"`a image:foo.png[]`\"" - expected := `
+ Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + It("image in double curly", func() { + source := "\"`a image:foo.png[]`\"" + expected := `

“a foo

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) - It("icon in double curly", func() { - source := ":icons: font\n\n\"`a icon:note[]`\"" - expected := `
+ Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + It("icon in double curly", func() { + source := ":icons: font\n\n\"`a icon:note[]`\"" + expected := `

“a

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) }) }) diff --git a/pkg/renderer/sgml/html5/quoted_text_test.go b/pkg/renderer/sgml/html5/quoted_text_test.go index 2040685a..387e41fa 100644 --- a/pkg/renderer/sgml/html5/quoted_text_test.go +++ b/pkg/renderer/sgml/html5/quoted_text_test.go @@ -365,7 +365,7 @@ content.

source := `[."a "]**bold**` // wrapping quotes are not preserved expected := `
-

bold

+

bold

` Expect(RenderHTML(source)).To(MatchHTML(expected)) @@ -443,12 +443,11 @@ content.

Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - // This is a departure from asciidoctor, as we support quoting the role in first position. - // (Asciidoctor passes it, but does not sanitize it, leading to invalid HTML.) It("quoted role", func() { source := "[.\"something \"]**bold**" + // TODO: do we need to parse SpecialCharacters in inline attributes? expected := `
-

bold

+

bold

` Expect(RenderHTML(source)).To(MatchHTML(expected)) @@ -479,7 +478,7 @@ content.

Context("nested content", func() { It("nested bold quote within bold quote with same punctuation", func() { - + // kinda invalid content, and Asciidoc has the same way of parsing this content source := "*some *nested bold* content*." expected := `

some *nested bold content*.

diff --git a/pkg/renderer/sgml/html5/section.go b/pkg/renderer/sgml/html5/section.go index ada10588..d958adfc 100644 --- a/pkg/renderer/sgml/html5/section.go +++ b/pkg/renderer/sgml/html5/section.go @@ -2,17 +2,11 @@ package html5 // initializes the sgml const ( - preambleTmpl = "{{ if .Wrapper }}
\n" + - "
\n{{ end }}" + - `{{ .Content }}` + - "{{ if .Wrapper }}
\n
\n{{ end }}" - - sectionContentTmpl = "
\n" + - "{{ .Header }}" + - "{{ if eq .Level 1 }}
\n{{ end }}" + - "{{ .Content }}" + - "{{ if eq .Level 1 }}
\n{{ end }}" + - "
\n" - - sectionHeaderTmpl = "{{ .Content }}\n" + sectionContentTmpl = `
+{{ .Header }}{{ if eq .Level 1 }}
+{{ end }}{{ .Content }}{{ if eq .Level 1 }}
+{{ end }}
+` + sectionHeaderTmpl = `{{ .Content }} +` ) diff --git a/pkg/renderer/sgml/html5/table.go b/pkg/renderer/sgml/html5/table.go index c2e243fb..66edee63 100644 --- a/pkg/renderer/sgml/html5/table.go +++ b/pkg/renderer/sgml/html5/table.go @@ -27,7 +27,7 @@ const ( tableRowTmpl = "
\n{{ .Content }}\n" - tableHeaderCellTmpl = "\n" + tableHeaderCellTmpl = "\n" - tableCellTmpl = "\n" + tableCellTmpl = "\n" ) diff --git a/pkg/renderer/sgml/html5/table_of_contents_test.go b/pkg/renderer/sgml/html5/table_of_contents_test.go index 11d3d61d..5a3ee55a 100644 --- a/pkg/renderer/sgml/html5/table_of_contents_test.go +++ b/pkg/renderer/sgml/html5/table_of_contents_test.go @@ -1,7 +1,6 @@ package html5_test import ( - "github.com/bytesparadise/libasciidoc/pkg/types" . "github.com/bytesparadise/libasciidoc/testsupport" . "github.com/onsi/ginkgo" //nolint golint @@ -10,10 +9,12 @@ import ( var _ = Describe("document toc", func() { - Context("document with toc", func() { + Context("in document with header", func() { - It("toc with default level", func() { - source := `= A title + Context("with default placement", func() { + + It("should include with default level", func() { + source := `= A title :toc: A preamble... @@ -32,7 +33,7 @@ A preamble... == Section C` - expected := `
+ expected := `
Table of Contents
  • Section A @@ -84,11 +85,11 @@ A preamble...
` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("toc with custom level", func() { - source := `= A title + It("should include with custom level", func() { + source := `= A title :toc: :toclevels: 4 @@ -110,7 +111,7 @@ A preamble... == Section C` - expected := `
+ expected := `
Table of Contents
  • Section A @@ -173,241 +174,203 @@ A preamble...
` - Expect(RenderHTML(source)).To(MatchHTML(expected)) - }) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) - It("document with no section", func() { - source := `= sect0 + It("should not include when no sections", func() { + source := `= sect0 :toc: level 1 sections not exists.` - expected := `
+ expected := `

level 1 sections not exists.

` - Expect(RenderHTML(source)).To(MatchHTML(expected)) + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) }) - }) -}) -var _ = Describe("table of contents initialization", func() { - - Context("document without section", func() { - - It("should return empty table of contents when doc has no section", func() { - actual := types.Document{ - Attributes: types.Attributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - } - expected := types.TableOfContents{ - Sections: []types.ToCSection{}, - } - Expect(TableOfContents(actual)).To(Equal(expected)) - }) - }) + Context("within preamble", func() { - Context("document with sections", func() { - - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } - sectionATitle := []interface{}{ - types.StringElement{Content: "Section A with link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "redhat.com", - }, - }, - }, - }, - } - sectionAaTitle := []interface{}{ - types.StringElement{Content: "Section A.a "}, - types.FootnoteReference{ - ID: 1, - Ref: "foo", - }, - } - sectionAa1Title := []interface{}{ - types.StringElement{Content: "Section A.a.1"}, - } - sectionBTitle := []interface{}{ - types.StringElement{Content: "Section B"}, - } - document := types.Document{ - Attributes: types.Attributes{}, - ElementReferences: types.ElementReferences{ - "_a_header": doctitle, - "_section_a": sectionATitle, - "_section_a_a": sectionAaTitle, - "_section_b": sectionBTitle, - }, - Footnotes: []types.Footnote{ - { - ID: 1, - Ref: "foo", - }, - }, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", - }, - Level: 0, - Title: doctitle, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - Level: 1, - Title: sectionATitle, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a", - }, - Level: 2, - Title: sectionAaTitle, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a_1", - }, - Level: 3, - Title: sectionAa1Title, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{}, - Lines: [][]interface{}{ - {types.StringElement{Content: "a paragraph"}}, - }, - }, - }, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_b", - }, - Level: 1, - Title: sectionBTitle, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - - It("should return table of contents with section level 1,2,3,2 with default level", func() { - delete(document.Attributes, types.AttrTableOfContentsLevels) - expected := types.TableOfContents{ - Sections: []types.ToCSection{ - { - ID: "_section_a", - Level: 1, - Title: "Section A with link to https://redhat.com", - Children: []types.ToCSection{ - { - - ID: "_section_a_a", - Level: 2, - Title: "Section A.a [1]", - Children: []types.ToCSection{}, - }, - }, - }, - { - ID: "_section_b", - Level: 1, - Title: "Section B", - Children: []types.ToCSection{}, - }, - }, - } - Expect(TableOfContents(document)).To(Equal(expected)) - }) + It("should include with default level", func() { + source := `= A title +:toc: preamble + +A preamble... + +== Section A + +=== Section A.a + +=== Section A.b + +==== Section that shall not be in ToC + +== Section B + +=== Section B.a + +== Section C` + + expected := `
+
+
+

A preamble…​

+
+
+
+
Table of Contents
+ +
+
+
+

Section A

+
+
+

Section A.a

+
+
+

Section A.b

+
+

Section that shall not be in ToC

+
+
+
+
+
+

Section B

+
+
+

Section B.a

+
+
+
+
+

Section C

+
+
+
+` + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + + It("should include with custom level", func() { + source := `= A title +:toc: preamble +:toclevels: 4 + +A preamble... + +== Section A + +=== Section A.a - It("should return table of contents with section level 1,2,3,2 with custom level", func() { - document.Attributes[types.AttrTableOfContentsLevels] = "4" // must be a string - expected := types.TableOfContents{ - Sections: []types.ToCSection{ - { - ID: "_section_a", - Level: 1, - Title: "Section A with link to https://redhat.com", - Children: []types.ToCSection{ - { - - ID: "_section_a_a", - Level: 2, - Title: "Section A.a [1]", - Children: []types.ToCSection{ - { - - ID: "_section_a_a_1", - Level: 3, - Title: "Section A.a.1", - Children: []types.ToCSection{}, - }, - }, - }, - }, - }, - { - ID: "_section_b", - Level: 1, - Title: "Section B", - Children: []types.ToCSection{}, - }, - }, - } - Expect(TableOfContents(document)).To(Equal(expected)) +=== Section A.b + +==== Section A.b.a + +===== Section A.b.a.a + +== Section B + +=== Section B.a + +== Section C` + + expected := `
+
+
+

A preamble…​

+
+
+
+
Table of Contents
+ +
+
+
+

Section A

+
+
+

Section A.a

+
+
+

Section A.b

+
+

Section A.b.a

+
+
Section A.b.a.a
+
+
+
+
+
+
+

Section B

+
+
+

Section B.a

+
+
+
+
+

Section C

+
+
+
+` + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + + It("should not include when no sections", func() { + source := `= sect0 +:toc: preamble + +level 1 sections not exists.` + + expected := `
+

level 1 sections not exists.

+
+` + Expect(RenderHTML(source)).To(MatchHTML(expected)) + + }) }) }) - }) diff --git a/pkg/renderer/sgml/html5/table_test.go b/pkg/renderer/sgml/html5/table_test.go index a37619bb..d22ced52 100644 --- a/pkg/renderer/sgml/html5/table_test.go +++ b/pkg/renderer/sgml/html5/table_test.go @@ -258,7 +258,9 @@ var _ = Describe("tables", func() { }) It("autowidth ", func() { - source := "[%autowidth]\n|===\n|===" + source := `[%autowidth] +|=== +|===` expected := `
{{ .Content }}{{ .Content }}

{{ .Content }}

{{ .Content }}

` @@ -266,7 +268,9 @@ var _ = Describe("tables", func() { }) It("fixed width (number)", func() { - source := "[width=75]\n|===\n|===" + source := `[width=75] +|=== +|===` expected := `
` @@ -274,7 +278,9 @@ var _ = Describe("tables", func() { }) It("fixed width (percent)", func() { - source := "[width=75%]\n|===\n|===" + source := `[width=75%] +|=== +|===` expected := `
` @@ -282,7 +288,9 @@ var _ = Describe("tables", func() { }) It("fixed width (100 percent)", func() { - source := "[width=100%]\n|===\n|===" + source := `[width=100%] +|=== +|===` expected := `
` @@ -290,7 +298,9 @@ var _ = Describe("tables", func() { }) It("fixed width (> 100 percent)", func() { - source := "[width=205]\n|===\n|===" + source := `[width=205] +|=== +|===` expected := `
` @@ -298,7 +308,9 @@ var _ = Describe("tables", func() { }) It("fixed width overrides fit", func() { - source := "[%autowidth,width=25]\n|===\n|===" + source := `[%autowidth,width=25] +|=== +|===` expected := `
` @@ -306,7 +318,9 @@ var _ = Describe("tables", func() { }) It("fixed width overrides fit (> 100 percent)", func() { - source := "[%autowidth,width=205]\n|===\n|===" + source := `[%autowidth,width=205] +|=== +|===` expected := `
` @@ -314,7 +328,9 @@ var _ = Describe("tables", func() { }) It("grid, frames, float, stripes", func() { - source := "[%autowidth,grid=rows,frame=sides,stripes=hover,float=right]\n|===\n|===" + source := `[%autowidth,grid=rows,frame=sides,stripes=hover,float=right] +|=== +|===` expected := `
` @@ -322,7 +338,10 @@ var _ = Describe("tables", func() { }) It("table with cols relative widths", func() { - source := "[cols=\"3,2,5\"]\n|===\n|one|two|three\n|===" + source := `[cols="3,2,5"] +|=== +|one|two|three +|===` expected := `@@ -342,7 +361,12 @@ var _ = Describe("tables", func() { }) It("table with cols relative widths and header", func() { - source := "[cols=\"3,2,5\"]\n|===\n|h1|h2|h3\n\n|one|two|three\n|===" + source := `[cols="3,2,5"] +|=== +|h1|h2|h3 + +|one|two|three +|===` expected := `
@@ -369,7 +393,12 @@ var _ = Describe("tables", func() { }) It("autowidth overrides column widths", func() { - source := "[%autowidth,cols=\"3,2,5\"]\n|===\n|h1|h2|h3\n\n|one|two|three\n|===" + source := `[%autowidth,cols="3,2,5"] +|=== +|h1|h2|h3 + +|one|two|three +|===` expected := `
@@ -396,7 +425,12 @@ var _ = Describe("tables", func() { }) It("column auto-width", func() { - source := "[cols=\"30,~,~\"]\n|===\n|h1|h2|h3\n\n|one|two|three\n|===" + source := `[cols="30,~,~"] +|=== +|h1|h2|h3 + +|one|two|three +|===` expected := `
@@ -423,7 +457,12 @@ var _ = Describe("tables", func() { }) It("columns with repeat", func() { - source := "[cols=\"3*10,2*~\"]\n|===\n|h1|h2|h3|h4|h5\n\n|one|two|three|four|five\n|===" + source := `[cols="3*10,2*~"] +|=== +|h1|h2|h3|h4|h5 + +|one|two|three|four|five +|===` expected := `
@@ -456,9 +495,12 @@ var _ = Describe("tables", func() { }) It("columns with alignment changes", func() { - // source := "[cols=\"2*^.^,<,.>,>\"]\n|===\n|===" + source := `[cols="2*^.^,<,.>,>"] +|=== +|h1|h2|h3|h4|h5 - source := "[cols=\"2*^.^,<,.>,>\"]\n|===\n|h1|h2|h3|h4|h5\n\n|one|two|three|four|five\n|===" +|one|two|three|four|five +|===` expected := `
diff --git a/pkg/renderer/sgml/html5/templates.go b/pkg/renderer/sgml/html5/templates.go index fd02aefc..2105379c 100644 --- a/pkg/renderer/sgml/html5/templates.go +++ b/pkg/renderer/sgml/html5/templates.go @@ -52,7 +52,7 @@ var templates = sgml.Templates{ MarkedText: markedTextTmpl, MonospaceText: monospaceTextTmpl, OrderedList: orderedListTmpl, - OrderedListItem: orderedListItemTmpl, + OrderedListElement: orderedListItemTmpl, PassthroughBlock: passthroughBlock, Paragraph: paragraphTmpl, Preamble: preambleTmpl, @@ -81,7 +81,6 @@ var templates = sgml.Templates{ TocSection: tocSectionTmpl, UnorderedList: unorderedListTmpl, UnorderedListItem: unorderedListItemTmpl, - VerbatimLine: verbatimLineTmpl, VerseBlock: verseBlockTmpl, VerseParagraph: verseParagraphTmpl, } @@ -95,7 +94,7 @@ func init() { // Render renders the document to the output, using a default instance // of the renderer, with default templates. -func Render(ctx *renderer.Context, doc types.Document, output io.Writer) (types.Metadata, error) { +func Render(ctx *renderer.Context, doc *types.Document, output io.Writer) (types.Metadata, error) { return defaultRenderer.Render(ctx, doc, output) } diff --git a/pkg/renderer/sgml/html5/verbatim_line.go b/pkg/renderer/sgml/html5/verbatim_line.go deleted file mode 100644 index 9ce48d29..00000000 --- a/pkg/renderer/sgml/html5/verbatim_line.go +++ /dev/null @@ -1,5 +0,0 @@ -package html5 - -const ( - verbatimLineTmpl = `{{ if .Callouts}}{{ escape .Content }}{{ else }}{{ .Content | escape | trimRight }}{{ end }}{{ range $i, $c := .Callouts }}({{ $c.Ref }}){{ end }}` -) diff --git a/pkg/renderer/sgml/icon.go b/pkg/renderer/sgml/icon.go index 98f1a74e..93298d1a 100644 --- a/pkg/renderer/sgml/icon.go +++ b/pkg/renderer/sgml/icon.go @@ -10,7 +10,7 @@ import ( "github.com/pkg/errors" ) -func (r *sgmlRenderer) renderInlineIcon(ctx *renderer.Context, icon types.Icon) (string, error) { +func (r *sgmlRenderer) renderInlineIcon(ctx *renderer.Context, icon *types.Icon) (string, error) { result := &strings.Builder{} iconStr, err := r.renderIcon(ctx, types.Icon{ @@ -120,7 +120,7 @@ func (r *sgmlRenderer) renderIcon(ctx *renderer.Context, icon types.Icon, admoni func renderIconPath(ctx *renderer.Context, name string) string { // Icon files by default are in {imagesdir}/icons, where {imagesdir} defaults to "./images" dir := ctx.Attributes.GetAsStringWithDefault("iconsdir", - path.Join(ctx.Attributes.GetAsStringWithDefault("imagesdir", "./images"), "icons")) + path.Join(ctx.Attributes.GetAsStringWithDefault(types.AttrImagesDir, "./images"), "icons")) // TODO: perform attribute substitutions here! ext := ctx.Attributes.GetAsStringWithDefault("icontype", "png") diff --git a/pkg/renderer/sgml/image.go b/pkg/renderer/sgml/image.go index 0f941dea..ecdafd96 100644 --- a/pkg/renderer/sgml/image.go +++ b/pkg/renderer/sgml/image.go @@ -9,9 +9,10 @@ import ( "github.com/bytesparadise/libasciidoc/pkg/renderer" "github.com/bytesparadise/libasciidoc/pkg/types" "github.com/pkg/errors" + log "github.com/sirupsen/logrus" ) -func (r *sgmlRenderer) renderImageBlock(ctx *renderer.Context, img types.ImageBlock) (string, error) { +func (r *sgmlRenderer) renderImageBlock(ctx *renderer.Context, img *types.ImageBlock) (string, error) { result := &strings.Builder{} title, err := r.renderElementTitle(img.Attributes) if err != nil { @@ -28,7 +29,11 @@ func (r *sgmlRenderer) renderImageBlock(ctx *renderer.Context, img types.ImageBl if err != nil { return "", errors.Wrap(err, "unable to render image") } else if !found { - if c = ctx.Attributes.GetAsStringWithDefault(types.AttrFigureCaption, "Figure"); c != "" { + c, found, err = ctx.Attributes.GetAsString(types.AttrFigureCaption) + if err != nil { + return "", errors.Wrap(err, "unable to render image") + } + if found && c != "" { // We always append the figure number, unless the caption is disabled. // This is for asciidoctor compatibility. c += " {counter:figure-number}. " @@ -80,12 +85,13 @@ func (r *sgmlRenderer) renderImageBlock(ctx *renderer.Context, img types.ImageBl return result.String(), nil } -func (r *sgmlRenderer) renderInlineImage(ctx *Context, img types.InlineImage) (string, error) { +func (r *sgmlRenderer) renderInlineImage(ctx *Context, img *types.InlineImage) (string, error) { result := &strings.Builder{} roles, err := r.renderImageRoles(ctx, img.Attributes) if err != nil { return "", errors.Wrap(err, "unable to render image") } + href := img.Attributes.GetAsStringWithDefault(types.AttrInlineLink, "") path := img.Location.Stringify() alt, err := r.renderImageAlt(img.Attributes, path) if err != nil { @@ -107,7 +113,7 @@ func (r *sgmlRenderer) renderInlineImage(ctx *Context, img types.InlineImage) (s }{ Title: title, Roles: roles, - Href: img.Attributes.GetAsStringWithDefault(types.AttrInlineLink, ""), + Href: href, Alt: alt, Width: img.Attributes.GetAsStringWithDefault(types.AttrWidth, ""), Height: img.Attributes.GetAsStringWithDefault(types.AttrHeight, ""), @@ -117,7 +123,9 @@ func (r *sgmlRenderer) renderInlineImage(ctx *Context, img types.InlineImage) (s if err != nil { return "", errors.Wrap(err, "unable to render inline image") } - // log.Debugf("rendered inline image: %s", result.Bytes()) + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("rendered inline image: %s", result.String()) + } return result.String(), nil } diff --git a/pkg/renderer/sgml/index_term.go b/pkg/renderer/sgml/index_term.go index a3aed0c1..a0aa172e 100644 --- a/pkg/renderer/sgml/index_term.go +++ b/pkg/renderer/sgml/index_term.go @@ -5,10 +5,10 @@ import ( "github.com/bytesparadise/libasciidoc/pkg/types" ) -func (r *sgmlRenderer) renderIndexTerm(ctx *renderer.Context, t types.IndexTerm) (string, error) { +func (r *sgmlRenderer) renderIndexTerm(ctx *renderer.Context, t *types.IndexTerm) (string, error) { return r.renderInlineElements(ctx, t.Term) } -func (r *sgmlRenderer) renderConcealedIndexTerm(_ types.ConcealedIndexTerm) (string, error) { - return "", nil // do not render +func (r *sgmlRenderer) renderConcealedIndexTerm(_ *types.ConcealedIndexTerm) (string, error) { + return "", nil // do not render in SGML } diff --git a/pkg/renderer/sgml/inline_elements.go b/pkg/renderer/sgml/inline_elements.go index 4ceb4888..edb5b606 100644 --- a/pkg/renderer/sgml/inline_elements.go +++ b/pkg/renderer/sgml/inline_elements.go @@ -7,29 +7,12 @@ import ( "github.com/bytesparadise/libasciidoc/pkg/types" ) -type linesRenderer struct { - render renderFunc -} - -type renderLinesOption func(config *linesRenderer) - -func (r *sgmlRenderer) withVerbatim() renderLinesOption { - return func(config *linesRenderer) { - config.render = r.renderPlainText - } -} - -func (r *sgmlRenderer) renderInlineElements(ctx *renderer.Context, elements []interface{}, options ...renderLinesOption) (string, error) { +func (r *sgmlRenderer) renderInlineElements(ctx *renderer.Context, elements []interface{}, options ...lineRendererOption) (string, error) { if len(elements) == 0 { return "", nil } // log.Debugf("rendering line with %d element(s)...", len(elements)) - lr := linesRenderer{ - render: r.renderElement, - } - for _, apply := range options { - apply(&lr) - } + lr := r.newLineRenderer(options...) // first pass or rendering, using the provided `renderElementFunc`: buf := &strings.Builder{} for i, element := range elements { @@ -38,7 +21,7 @@ func (r *sgmlRenderer) renderInlineElements(ctx *renderer.Context, elements []in return "", err } if i == len(elements)-1 { - if _, ok := element.(types.StringElement); ok { // TODO: only for StringElement? or for any kind of element? + if _, ok := element.(*types.StringElement); ok { // TODO: only for StringElement? or for any kind of element? // trim trailing spaces before returning the line buf.WriteString(strings.TrimRight(string(renderedElement), " ")) } else { diff --git a/pkg/renderer/sgml/labeled_list.go b/pkg/renderer/sgml/labeled_list.go deleted file mode 100644 index c4729ed5..00000000 --- a/pkg/renderer/sgml/labeled_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package sgml - -import ( - "io" - "strings" - - "github.com/bytesparadise/libasciidoc/pkg/renderer" - "github.com/bytesparadise/libasciidoc/pkg/types" - "github.com/pkg/errors" -) - -func (r *sgmlRenderer) renderLabeledList(ctx *renderer.Context, l types.LabeledList) (string, error) { - tmpl, itemTmpl, err := r.getLabeledListTmpl(l) - if err != nil { - return "", errors.Wrap(err, "unable to render labeled list") - } - - content := &strings.Builder{} - cont := false - for _, item := range l.Items { - if cont, err = r.renderLabeledListItem(ctx, itemTmpl, content, cont, item); err != nil { - return "", errors.Wrap(err, "unable to render unordered list") - } - } - roles, err := r.renderElementRoles(ctx, l.Attributes) - if err != nil { - return "", errors.Wrap(err, "unable to render labeled list roles") - } - title, err := r.renderElementTitle(l.Attributes) - if err != nil { - return "", errors.Wrap(err, "unable to render callout list roles") - } - result := &strings.Builder{} - // here we must preserve the HTML tags - err = tmpl.Execute(result, struct { - Context *renderer.Context - ID string - Title string - Roles string - Content string - Items []types.LabeledListItem - }{ - Context: ctx, - ID: r.renderElementID(l.Attributes), - Title: title, - Roles: roles, - Content: string(content.String()), - Items: l.Items, - }) - if err != nil { - return "", errors.Wrap(err, "unable to render labeled list") - } - return result.String(), nil -} - -func (r *sgmlRenderer) getLabeledListTmpl(l types.LabeledList) (*textTemplate, *textTemplate, error) { - if layout, ok := l.Attributes[types.AttrStyle]; ok { - switch layout { - case "qanda": - return r.qAndAList, r.qAndAListItem, nil - case "horizontal": - return r.labeledListHorizontal, r.labeledListHorizontalItem, nil - default: - return nil, nil, errors.Errorf("unsupported labeled list layout: %s", layout) - } - } - return r.labeledList, r.labeledListItem, nil -} - -func (r *sgmlRenderer) renderLabeledListItem(ctx *renderer.Context, tmpl *textTemplate, w io.Writer, continuation bool, item types.LabeledListItem) (bool, error) { - - term, err := r.renderInlineElements(ctx, item.Term) - if err != nil { - return false, errors.Wrap(err, "unable to render labeled list term") - } - content, err := r.renderListElements(ctx, item.Elements) - if err != nil { - return false, errors.Wrap(err, "unable to render labeled list content") - } - err = tmpl.Execute(w, struct { - Context *renderer.Context - Term string - Content string - Continuation bool - }{ - Context: ctx, - Term: string(term), - Continuation: continuation, - Content: string(content), - }) - return content == "", err -} diff --git a/pkg/renderer/sgml/link.go b/pkg/renderer/sgml/link.go index 529e09c5..7b3de9b3 100644 --- a/pkg/renderer/sgml/link.go +++ b/pkg/renderer/sgml/link.go @@ -7,9 +7,10 @@ import ( "github.com/bytesparadise/libasciidoc/pkg/renderer" "github.com/bytesparadise/libasciidoc/pkg/types" "github.com/pkg/errors" + log "github.com/sirupsen/logrus" ) -func (r *sgmlRenderer) renderLink(ctx *renderer.Context, l types.InlineLink) (string, error) { //nolint: unparam +func (r *sgmlRenderer) renderLink(ctx *renderer.Context, l *types.InlineLink) (string, error) { //nolint: unparam result := &strings.Builder{} location := l.Location.Stringify() text := "" @@ -52,6 +53,6 @@ func (r *sgmlRenderer) renderLink(ctx *renderer.Context, l types.InlineLink) (st if err != nil { return "", errors.Wrap(err, "unable to render link") } - // log.Debugf("rendered link: %s", result.String()) + log.Debugf("rendered link: %s", result.String()) return result.String(), nil } diff --git a/pkg/renderer/sgml/list.go b/pkg/renderer/sgml/list.go new file mode 100644 index 00000000..30c3294d --- /dev/null +++ b/pkg/renderer/sgml/list.go @@ -0,0 +1,351 @@ +package sgml + +import ( + "fmt" + "io" + "strings" + + "github.com/bytesparadise/libasciidoc/pkg/renderer" + "github.com/bytesparadise/libasciidoc/pkg/types" + "github.com/pkg/errors" +) + +func (r *sgmlRenderer) renderList(ctx *renderer.Context, l *types.List) (string, error) { + switch l.Kind { + case types.OrderedListKind: + return r.renderOrderedList(ctx, l) + case types.UnorderedListKind: + return r.renderUnorderedList(ctx, l) + case types.LabeledListKind: + return r.renderLabeledList(ctx, l) + case types.CalloutListKind: + return r.renderCalloutList(ctx, l) + default: + return "", fmt.Errorf("unable to render list of kind '%s'", l.Kind) + } +} + +// ------------------------------------------------------- +// Ordered Lists +// ------------------------------------------------------- +func (r *sgmlRenderer) renderOrderedList(ctx *renderer.Context, l *types.List) (string, error) { + result := &strings.Builder{} + content := &strings.Builder{} + + for _, element := range l.Elements { + e, ok := element.(*types.OrderedListElement) + if !ok { + return "", errors.Errorf("unable to render ordered list element of type '%T'", element) + } + if err := r.renderOrderedListElement(ctx, content, e); err != nil { + return "", errors.Wrap(err, "unable to render ordered list") + } + } + roles, err := r.renderElementRoles(ctx, l.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render ordered list roles") + } + style, err := getNumberingStyle(l) + if err != nil { + return "", errors.Wrap(err, "unable to render ordered list roles") + } + title, err := r.renderElementTitle(l.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render callout list roles") + } + err = r.orderedList.Execute(result, struct { + Context *renderer.Context + ID string + Title string + Roles string + Style string + ListStyle string + Start string + Content string + Reversed bool + // Elements []types.ListElement + }{ + ID: r.renderElementID(l.Attributes), + Title: title, + Roles: roles, + Style: style, + ListStyle: r.numberingType(style), + Start: l.Attributes.GetAsStringWithDefault(types.AttrStart, ""), + Content: string(content.String()), + Reversed: l.Attributes.HasOption("reversed"), + // Elements: l.Elements, + }) + if err != nil { + return "", errors.Wrap(err, "unable to render ordered list") + } + return result.String(), nil +} + +func getNumberingStyle(l *types.List) (string, error) { + if s, found, err := l.Attributes.GetAsString(types.AttrStyle); err != nil { + return "", err + } else if found { + return s, nil + } + e, ok := l.Elements[0].(*types.OrderedListElement) + if !ok { + return "", errors.Errorf("unable to render ordered list style based on element of type '%T'", l.Elements[0]) + } + return e.Style, nil +} + +// this numbering style is only really relevant to HTML +func (r *sgmlRenderer) numberingType(style string) string { + switch style { + case types.LowerAlpha: + return `a` + case types.UpperAlpha: + return `A` + case types.LowerRoman: + return `i` + case types.UpperRoman: + return `I` + default: + return "" + } +} + +func (r *sgmlRenderer) renderOrderedListElement(ctx *renderer.Context, w io.Writer, element *types.OrderedListElement) error { + content, err := r.renderListElements(ctx, element.GetElements()) + if err != nil { + return errors.Wrap(err, "unable to render unordered list element content") + } + return r.orderedListItem.Execute(w, struct { + Context *renderer.Context + Content string + }{ + Context: ctx, + Content: string(content), + }) +} + +// ------------------------------------------------------- +// Unordered Lists +// ------------------------------------------------------- +func (r *sgmlRenderer) renderUnorderedList(ctx *renderer.Context, l *types.List) (string, error) { + // make sure nested elements are aware of that their rendering occurs within a list + checkList := false + if len(l.Elements) > 0 { + e, ok := l.Elements[0].(*types.UnorderedListElement) + if !ok { + return "", errors.Errorf("unable to render unordered list element of type '%T'", l.Elements[0]) + } + if e.CheckStyle != types.NoCheck { + checkList = true + } + } + result := &strings.Builder{} + content := &strings.Builder{} + + for _, element := range l.Elements { + if err := r.renderUnorderedListElement(ctx, content, element); err != nil { + return "", errors.Wrap(err, "unable to render unordered list") + } + } + roles, err := r.renderElementRoles(ctx, l.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render unordered list roles") + } + title, err := r.renderElementTitle(l.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render callout list roles") + } + + // here we must preserve the HTML tags + err = r.unorderedList.Execute(result, struct { + Context *renderer.Context + ID string + Title string + Roles string + Style string + Checklist bool + Items []types.ListElement + Content string + }{ + Context: ctx, + ID: r.renderElementID(l.Attributes), + Title: title, + Checklist: checkList, + Items: l.Elements, + Content: string(content.String()), + Roles: roles, + Style: r.renderElementStyle(l.Attributes), + }) + if err != nil { + return "", errors.Wrap(err, "unable to render unordered list") + } + return result.String(), nil +} +func (r *sgmlRenderer) renderUnorderedListElement(ctx *renderer.Context, w io.Writer, element types.ListElement) error { + content, err := r.renderListElements(ctx, element.GetElements()) + if err != nil { + return errors.Wrap(err, "unable to render unordered list element content") + } + return r.unorderedListItem.Execute(w, struct { + Context *renderer.Context + Content string + }{ + Context: ctx, + Content: string(content), + }) +} + +// ------------------------------------------------------- +// Labelled Lists +// ------------------------------------------------------- +func (r *sgmlRenderer) renderLabeledList(ctx *renderer.Context, l *types.List) (string, error) { + tmpl, itemTmpl, err := r.getLabeledListTmpl(l) + if err != nil { + return "", errors.Wrap(err, "unable to render labeled list") + } + + content := &strings.Builder{} + cont := false + for _, element := range l.Elements { + e, ok := element.(*types.LabeledListElement) + if !ok { + return "", errors.Errorf("unable to render labeled list element of type '%T'", element) + } + if cont, err = r.renderLabeledListItem(ctx, itemTmpl, content, cont, e); err != nil { + return "", errors.Wrap(err, "unable to render labeled list") + } + } + roles, err := r.renderElementRoles(ctx, l.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render labeled list roles") + } + title, err := r.renderElementTitle(l.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render labeled list roles") + } + result := &strings.Builder{} + // here we must preserve the HTML tags + err = tmpl.Execute(result, struct { + Context *renderer.Context + ID string + Title string + Roles string + Content string + Items []types.ListElement + }{ + Context: ctx, + ID: r.renderElementID(l.Attributes), + Title: title, + Roles: roles, + Content: string(content.String()), + Items: l.Elements, + }) + if err != nil { + return "", errors.Wrap(err, "unable to render labeled list") + } + return result.String(), nil +} + +func (r *sgmlRenderer) getLabeledListTmpl(l *types.List) (*textTemplate, *textTemplate, error) { + if layout, ok := l.Attributes[types.AttrStyle]; ok { + switch layout { + case "qanda": + return r.qAndAList, r.qAndAListItem, nil + case "horizontal": + return r.labeledListHorizontal, r.labeledListHorizontalItem, nil + default: + return nil, nil, errors.Errorf("unsupported labeled list layout: %s", layout) + } + } + return r.labeledList, r.labeledListItem, nil +} + +func (r *sgmlRenderer) renderLabeledListItem(ctx *renderer.Context, tmpl *textTemplate, w io.Writer, continuation bool, element *types.LabeledListElement) (bool, error) { + + term, err := r.renderInlineElements(ctx, element.Term) + if err != nil { + return false, errors.Wrap(err, "unable to render labeled list term") + } + content, err := r.renderListElements(ctx, element.Elements) + if err != nil { + return false, errors.Wrap(err, "unable to render labeled list content") + } + err = tmpl.Execute(w, struct { + Context *renderer.Context + Term string + Content string + Continuation bool + }{ + Context: ctx, + Term: string(term), + Continuation: continuation, + Content: string(content), + }) + return content == "", err +} + +// ------------------------------------------------------- +// Callout Lists +// ------------------------------------------------------- +func (r *sgmlRenderer) renderCalloutList(ctx *renderer.Context, l *types.List) (string, error) { + result := &strings.Builder{} + content := &strings.Builder{} + + for _, element := range l.Elements { + e, ok := element.(*types.CalloutListElement) + if !ok { + return "", errors.Errorf("unable to render callout list element of type '%T'", element) + } + if err := r.renderCalloutListItem(ctx, content, e); err != nil { + return "", errors.Wrap(err, "unable to render callout list element") + } + } + roles, err := r.renderElementRoles(ctx, l.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render callout list roles") + } + title, err := r.renderElementTitle(l.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render callout list roles") + } + + err = r.calloutList.Execute(result, struct { + Context *renderer.Context + ID string + Title string + Roles string + Content string + Items []types.ListElement + }{ + Context: ctx, + ID: r.renderElementID(l.Attributes), + Title: title, + Roles: roles, + Content: string(content.String()), + Items: l.Elements, + }) + if err != nil { + return "", errors.Wrap(err, "unable to render callout list") + } + return result.String(), nil +} + +func (r *sgmlRenderer) renderCalloutListItem(ctx *renderer.Context, w io.Writer, element *types.CalloutListElement) error { + content, err := r.renderListElements(ctx, element.Elements) + if err != nil { + return errors.Wrap(err, "unable to render callout list element content") + } + err = r.calloutListItem.Execute(w, struct { + Context *renderer.Context + Ref int + Content string + }{ + Context: ctx, + Ref: element.Ref, + Content: string(content), + }) + if err != nil { + return errors.Wrap(err, "unable to render callout list") + } + return nil +} diff --git a/pkg/renderer/sgml/literal_blocks.go b/pkg/renderer/sgml/literal_blocks.go index ddc5d637..f04b44e5 100644 --- a/pkg/renderer/sgml/literal_blocks.go +++ b/pkg/renderer/sgml/literal_blocks.go @@ -7,40 +7,16 @@ import ( "github.com/bytesparadise/libasciidoc/pkg/renderer" "github.com/bytesparadise/libasciidoc/pkg/types" "github.com/pkg/errors" + log "github.com/sirupsen/logrus" ) -func (r *sgmlRenderer) renderLiteralBlock(ctx *renderer.Context, b types.LiteralBlock) (string, error) { - // log.Debugf("rendering literal block with content: %s", b.Lines) - lines := make([]string, len(b.Lines)) - var err error - for i, line := range b.Lines { - if lines[i], err = r.renderLine(ctx, line); err != nil { - return "", errors.Wrap(err, "unable to render literal block") - } - } - if t, found := b.Attributes[types.AttrLiteralBlockType]; found && t == types.LiteralBlockWithSpacesOnFirstLine { - if len(lines) == 1 { - lines = []string{strings.TrimLeft(lines[0], " ")} - } else { - // remove as many spaces as needed on each line - spaceCount := 0 - // first pass to determine the minimum number of spaces to remove - for i, line := range lines { - l := strings.TrimLeft(line, " ") - if i == 0 { - spaceCount = len(line) - len(l) - } else { - spaceCount = int(math.Min(float64(spaceCount), float64(len(line)-len(l)))) - } - } - // log.Debugf("trimming %d space(s) on each line", int(spaceCount)) - // then remove the same number of spaces on each line - spaces := strings.Repeat(" ", spaceCount) - for i, line := range lines { - lines[i] = strings.TrimPrefix(line, spaces) - } - } +func (r *sgmlRenderer) renderLiteralBlock(ctx *renderer.Context, b *types.DelimitedBlock) (string, error) { + log.Debugf("rendering literal block") + elements, err := r.renderElements(ctx, b.Elements) + if err != nil { + return "", err } + roles, err := r.renderElementRoles(ctx, b.Attributes) if err != nil { return "", errors.Wrap(err, "unable to render literal block roles") @@ -62,10 +38,70 @@ func (r *sgmlRenderer) renderLiteralBlock(ctx *renderer.Context, b types.Literal ID: r.renderElementID(b.Attributes), Title: title, Roles: roles, - Content: strings.Join(lines, "\n"), + Content: elements, }) if err != nil { return "", errors.Wrap(err, "unable to render literal block") } return result.String(), nil } + +func (r *sgmlRenderer) renderLiteralParagraph(ctx *renderer.Context, b *types.Paragraph) (string, error) { + log.Debugf("rendering literal paragraph") + content, err := r.renderElements(ctx, b.Elements) + if err != nil { + return "", err + } + if b.Attributes.GetAsStringWithDefault(types.AttrLiteralBlockType, "") == types.LiteralBlockWithSpacesOnFirstLine { + content = trimHeadingSpaces(content) + } + roles, err := r.renderElementRoles(ctx, b.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render literal block roles") + } + title, err := r.renderElementTitle(b.Attributes) + if err != nil { + return "", errors.Wrap(err, "unable to render callout list roles") + } + result := &strings.Builder{} + err = r.literalBlock.Execute(result, struct { + Context *renderer.Context + ID string + Title string + Roles string + Content string + }{ + Context: ctx, + ID: r.renderElementID(b.Attributes), + Title: title, + Roles: roles, + Content: content, + }) + return result.String(), err +} + +func trimHeadingSpaces(content string) string { + lines := strings.Split(content, "\n") + if len(lines) == 1 { + lines = []string{strings.TrimLeft(lines[0], " ")} + } else { + // remove as many spaces as needed on each line + spaceCount := 0 + // first pass to determine the minimum number of spaces to remove + for i, line := range lines { + l := strings.TrimLeft(line, " ") + if i == 0 { + spaceCount = len(line) - len(l) + } else { + spaceCount = int(math.Min(float64(spaceCount), float64(len(line)-len(l)))) + } + } + // log.Debugf("trimming %d space(s) on each line", int(spaceCount)) + // then remove the same number of spaces on each line + spaces := strings.Repeat(" ", spaceCount) + for i, line := range lines { + lines[i] = strings.TrimPrefix(line, spaces) + } + } + return strings.Join(lines, "\n") +} diff --git a/pkg/renderer/sgml/ordered_list.go b/pkg/renderer/sgml/ordered_list.go deleted file mode 100644 index d3bb7922..00000000 --- a/pkg/renderer/sgml/ordered_list.go +++ /dev/null @@ -1,99 +0,0 @@ -package sgml - -import ( - "io" - "strings" - - "github.com/bytesparadise/libasciidoc/pkg/renderer" - "github.com/bytesparadise/libasciidoc/pkg/types" - "github.com/pkg/errors" -) - -func (r *sgmlRenderer) renderOrderedList(ctx *renderer.Context, l types.OrderedList) (string, error) { - result := &strings.Builder{} - content := &strings.Builder{} - - for _, item := range l.Items { - if err := r.renderOrderedListItem(ctx, content, item); err != nil { - return "", errors.Wrap(err, "unable to render unordered list") - } - } - roles, err := r.renderElementRoles(ctx, l.Attributes) - if err != nil { - return "", errors.Wrap(err, "unable to render ordered list roles") - } - style, err := getNumberingStyle(l) - if err != nil { - return "", errors.Wrap(err, "unable to render ordered list roles") - } - title, err := r.renderElementTitle(l.Attributes) - if err != nil { - return "", errors.Wrap(err, "unable to render callout list roles") - } - err = r.orderedList.Execute(result, struct { - Context *renderer.Context - ID string - Title string - Roles string - Style string - ListStyle string - Start string - Content string - Reversed bool - Items []types.OrderedListItem - }{ - ID: r.renderElementID(l.Attributes), - Title: title, - Roles: roles, - Style: style, - ListStyle: r.numberingType(style), - Start: l.Attributes.GetAsStringWithDefault(types.AttrStart, ""), - Content: string(content.String()), - Reversed: l.Attributes.HasOption("reversed"), - Items: l.Items, - }) - if err != nil { - return "", errors.Wrap(err, "unable to render ordered list") - } - return result.String(), nil -} - -func getNumberingStyle(l types.OrderedList) (string, error) { - if s, found, err := l.Attributes.GetAsString(types.AttrStyle); err != nil { - return "", err - } else if found { - return s, nil - } - return l.Items[0].Style, nil -} - -// this numbering style is only really relevant to HTML -func (r *sgmlRenderer) numberingType(style string) string { - switch style { - case types.LowerAlpha: - return `a` - case types.UpperAlpha: - return `A` - case types.LowerRoman: - return `i` - case types.UpperRoman: - return `I` - default: - return "" - } -} - -func (r *sgmlRenderer) renderOrderedListItem(ctx *renderer.Context, w io.Writer, item types.OrderedListItem) error { - - content, err := r.renderListElements(ctx, item.Elements) - if err != nil { - return errors.Wrap(err, "unable to render unordered list item content") - } - return r.orderedListItem.Execute(w, struct { - Context *renderer.Context - Content string - }{ - Context: ctx, - Content: string(content), - }) -} diff --git a/pkg/renderer/sgml/paragraph.go b/pkg/renderer/sgml/paragraph.go index ec3346ca..092f8b9d 100644 --- a/pkg/renderer/sgml/paragraph.go +++ b/pkg/renderer/sgml/paragraph.go @@ -9,37 +9,46 @@ import ( log "github.com/sirupsen/logrus" ) -func (r *sgmlRenderer) renderParagraph(ctx *renderer.Context, p types.Paragraph) (string, error) { - result := &strings.Builder{} - hardbreaks := p.Attributes.HasOption(types.AttrHardBreaks) || - ctx.Attributes.HasOption(types.DocumentAttrHardBreaks) - content, err := r.renderLines(ctx, p.Lines, r.withHardBreaks(hardbreaks)) - if err != nil { - return "", errors.Wrap(err, "unable to render paragraph content") - } +func (r *sgmlRenderer) renderParagraph(ctx *renderer.Context, p *types.Paragraph) (string, error) { + log.Debugf("rendering a regular paragraph with style '%v' and embedded: %t", p.Attributes[types.AttrStyle], (ctx.WithinDelimitedBlock || ctx.WithinList > 0)) if k, ok := p.Attributes[types.AttrStyle].(string); ok { switch k { - case types.Example: + case string(types.Example): return r.renderExampleParagraph(ctx, p) - case types.Listing: + case string(types.Listing): return r.renderListingParagraph(ctx, p) - case types.Source: + case string(types.Source): return r.renderSourceParagraph(ctx, p) - case types.Verse: + case string(types.Verse): return r.renderVerseParagraph(ctx, p) - case types.Quote: + case string(types.Quote): return r.renderQuoteParagraph(ctx, p) + case string(types.Passthrough): + return r.renderPassthroughParagraph(ctx, p) case types.Tip, types.Note, types.Important, types.Warning, types.Caution: return r.renderAdmonitionParagraph(ctx, p) + case types.Literal: + // if t, found := p.Attributes[types.AttrLiteralBlockType]; found && t == types.LiteralBlockWithSpacesOnFirstLine { + // } + return r.renderLiteralParagraph(ctx, p) case "manpage": return r.renderManpageNameParagraph(ctx, p) default: // do nothing, will move to default below } } else if ctx.WithinDelimitedBlock || ctx.WithinList > 0 { - return r.renderParagraphWithinDelimitedBlock(ctx, p) + return r.renderEmbeddedParagraph(ctx, p) } // default case + return r.renderRegularParagraph(ctx, p) +} + +func (r *sgmlRenderer) renderRegularParagraph(ctx *renderer.Context, p *types.Paragraph, opts ...lineRendererOption) (string, error) { + log.Debug("rendering a regular paragraph") + content, err := r.renderParagraphElements(ctx, p, opts...) + if err != nil { + return "", errors.Wrap(err, "unable to render paragraph content") + } roles, err := r.renderElementRoles(ctx, p.Attributes) if err != nil { return "", errors.Wrap(err, "unable to render paragraph roles") @@ -48,7 +57,7 @@ func (r *sgmlRenderer) renderParagraph(ctx *renderer.Context, p types.Paragraph) if err != nil { return "", errors.Wrap(err, "unable to render paragraph roles") } - log.Debug("rendering a standalone paragraph") + result := &strings.Builder{} err = r.paragraph.Execute(result, struct { Context *renderer.Context ID string @@ -66,13 +75,14 @@ func (r *sgmlRenderer) renderParagraph(ctx *renderer.Context, p types.Paragraph) return "", errors.Wrap(err, "unable to render paragraph") } return result.String(), nil + } -func (r *sgmlRenderer) renderManpageNameParagraph(ctx *renderer.Context, p types.Paragraph) (string, error) { +func (r *sgmlRenderer) renderManpageNameParagraph(ctx *renderer.Context, p *types.Paragraph) (string, error) { log.Debug("rendering name section paragraph in manpage...") result := &strings.Builder{} - content, err := r.renderLines(ctx, p.Lines) + content, err := r.renderElements(ctx, p.Elements) if err != nil { return "", errors.Wrap(err, "unable to render quote paragraph lines") } @@ -80,20 +90,18 @@ func (r *sgmlRenderer) renderManpageNameParagraph(ctx *renderer.Context, p types err = r.manpageNameParagraph.Execute(result, struct { Context *renderer.Context Content string - Lines [][]interface{} }{ Context: ctx, Content: string(content), - Lines: p.Lines, }) return result.String(), err } -func (r *sgmlRenderer) renderParagraphWithinDelimitedBlock(ctx *renderer.Context, p types.Paragraph) (string, error) { - // log.Debugf("rendering paragraph with %d line(s) within a delimited block or a list", len(p.Lines)) +func (r *sgmlRenderer) renderEmbeddedParagraph(ctx *renderer.Context, p *types.Paragraph) (string, error) { + log.Debug("rendering paragraph within a delimited block or a list") result := &strings.Builder{} - content, err := r.renderLines(ctx, p.Lines) + content, err := r.renderElements(ctx, p.Elements) if err != nil { return "", errors.Wrap(err, "unable to render delimited block paragraph content") } @@ -108,14 +116,12 @@ func (r *sgmlRenderer) renderParagraphWithinDelimitedBlock(ctx *renderer.Context Title string CheckStyle string Content string - Lines [][]interface{} }{ Context: ctx, ID: r.renderElementID(p.Attributes), Title: title, CheckStyle: renderCheckStyle(p.Attributes[types.AttrCheckStyle]), Content: string(content), - Lines: p.Lines, }) return result.String(), err } @@ -148,76 +154,58 @@ func (r *sgmlRenderer) renderElementTitle(attrs types.Attributes) (string, error return "", nil } -// RenderLinesConfig the config to use when rendering paragraph lines -type RenderLinesConfig struct { +type lineRenderer struct { render renderFunc hardBreaks bool } +func (r *sgmlRenderer) newLineRenderer(opts ...lineRendererOption) *lineRenderer { + lr := &lineRenderer{ + render: r.renderElement, + } + for _, apply := range opts { + apply(lr) + } + return lr +} + // RenderLinesOption an option to configure the rendering -type RenderLinesOption func(c *RenderLinesConfig) +type lineRendererOption func(c *lineRenderer) // WithHardBreaks sets the hard break option -func (r *sgmlRenderer) withHardBreaks(hardBreaks bool) RenderLinesOption { - return func(c *RenderLinesConfig) { - c.hardBreaks = hardBreaks +func withHardBreaks(hardBreaks bool) lineRendererOption { + return func(lr *lineRenderer) { + lr.hardBreaks = hardBreaks } } -// PlainText sets the render func to PlainText instead of SGML -func (r *sgmlRenderer) withPlainText() RenderLinesOption { - return func(c *RenderLinesConfig) { - c.render = r.renderPlainText +// withRenderer sets the render func +func withRenderer(f renderFunc) lineRendererOption { + return func(c *lineRenderer) { + c.render = f } } -// renderLines renders all lines (i.e, all `InlineElements`` - each `InlineElements` being a slice of elements to generate a line) -// and includes an `\n` character in-between, until the last one. -// Trailing spaces are removed for each line. -func (r *sgmlRenderer) renderLines(ctx *renderer.Context, lines [][]interface{}, options ...RenderLinesOption) (string, error) { // renderLineFunc renderFunc, hardbreak bool - linesRenderer := RenderLinesConfig{ - render: r.renderLine, - hardBreaks: false, - } - for _, apply := range options { - apply(&linesRenderer) - } +func (r *sgmlRenderer) renderParagraphElements(ctx *renderer.Context, p *types.Paragraph, opts ...lineRendererOption) (string, error) { + hardbreaks := p.Attributes.HasOption(types.AttrHardBreaks) || ctx.Attributes.HasOption(types.DocumentAttrHardBreaks) + lr := r.newLineRenderer(append(opts, withHardBreaks(hardbreaks))...) buf := &strings.Builder{} - for i, e := range lines { - renderedLine, err := linesRenderer.render(ctx, e) + for _, e := range p.Elements { + renderedElement, err := lr.render(ctx, e) if err != nil { - return "", errors.Wrap(err, "unable to render lines") + return "", errors.Wrap(err, "unable to render paragraph elements") } - if len(renderedLine) > 0 { - if _, err := buf.WriteString(renderedLine); err != nil { - return "", errors.Wrap(err, "unable to render lines") - } - } - - if i < len(lines)-1 && (len(renderedLine) > 0 || ctx.WithinDelimitedBlock) { - // log.Debugf("rendered line is not the last one in the slice") - var err error - if linesRenderer.hardBreaks { - if br, err := r.renderLineBreak(); err != nil { - return "", errors.Wrap(err, "unable to render hardbreak") - } else if _, err = buf.WriteString(br); err != nil { - return "", errors.Wrap(err, "unable to write hardbreak") - } - } - _, err = buf.WriteString("\n") - if err != nil { - return "", errors.Wrap(err, "unable to render lines") - } + if _, err := buf.WriteString(renderedElement); err != nil { + return "", errors.Wrap(err, "unable to render paragraph elements") } } - // log.Debugf("rendered lines: '%s'", buf.String()) - return buf.String(), nil -} - -func (r *sgmlRenderer) renderLine(ctx *renderer.Context, element interface{}) (string, error) { - if elements, ok := element.([]interface{}); ok { - return r.renderInlineElements(ctx, elements) + result := buf.String() + if lr.hardBreaks { // TODO: move within the call to `render`? + linebreak := &strings.Builder{} + if err := r.lineBreak.Execute(linebreak, nil); err != nil { + return "", err + } + result = strings.ReplaceAll(result, "\n", linebreak.String()+"\n") } - - return "", errors.Errorf("invalid type of element for a line: %T", element) + return result, nil } diff --git a/pkg/renderer/sgml/passthrough.go b/pkg/renderer/sgml/passthrough.go index 54e76425..08be24ee 100644 --- a/pkg/renderer/sgml/passthrough.go +++ b/pkg/renderer/sgml/passthrough.go @@ -9,8 +9,16 @@ import ( "github.com/pkg/errors" ) -func (r *sgmlRenderer) renderInlinePassthrough(ctx *renderer.Context, p types.InlinePassthrough) (string, error) { - renderedContent, err := r.renderPassthroughContent(ctx, p) +func (r *sgmlRenderer) renderPassthroughParagraph(ctx *renderer.Context, p *types.Paragraph) (string, error) { + content, err := r.renderPassthroughContent(ctx, p.Elements) + if err != nil { + return "", err + } + return content + "\n", nil +} + +func (r *sgmlRenderer) renderInlinePassthrough(ctx *renderer.Context, p *types.InlinePassthrough) (string, error) { + renderedContent, err := r.renderPassthroughContent(ctx, p.Elements) if err != nil { return "", errors.Wrap(err, "unable to render passthrough") } @@ -26,11 +34,11 @@ func (r *sgmlRenderer) renderInlinePassthrough(ctx *renderer.Context, p types.In } // renderPassthroughMacro renders the passthrough content in its raw from -func (r *sgmlRenderer) renderPassthroughContent(ctx *renderer.Context, p types.InlinePassthrough) (string, error) { +func (r *sgmlRenderer) renderPassthroughContent(ctx *renderer.Context, elements []interface{}) (string, error) { buf := &strings.Builder{} - for _, element := range p.Elements { + for _, element := range elements { switch element := element.(type) { - case types.StringElement: + case *types.StringElement: // "string" elements must be rendered as-is, ie, without any HTML escaping. _, err := buf.WriteString(element.Content) if err != nil { diff --git a/pkg/renderer/sgml/preamble.go b/pkg/renderer/sgml/preamble.go new file mode 100644 index 00000000..e8c3867a --- /dev/null +++ b/pkg/renderer/sgml/preamble.go @@ -0,0 +1,41 @@ +package sgml + +import ( + "strings" + + "github.com/bytesparadise/libasciidoc/pkg/renderer" + "github.com/bytesparadise/libasciidoc/pkg/types" + "github.com/pkg/errors" +) + +func (r *sgmlRenderer) renderPreamble(ctx *renderer.Context, p *types.Preamble) (string, error) { + // log.Debugf("rendering preamble...") + result := &strings.Builder{} + // the
wrapper is only necessary + // if the document has a section 0 + + content, err := r.renderElements(ctx, p.Elements) + if err != nil { + return "", errors.Wrap(err, "error rendering preamble elements") + } + toc, err := r.renderTableOfContents(ctx, p.TableOfContents) + if err != nil { + return "", errors.Wrap(err, "error rendering preamble elements") + } + err = r.preamble.Execute(result, struct { + Context *renderer.Context + Wrapper bool + Content string + ToC string + }{ + Context: ctx, + Wrapper: ctx.HasHeader, + Content: string(content), + ToC: string(toc), + }) + if err != nil { + return "", errors.Wrap(err, "error while rendering preamble") + } + // log.Debugf("rendered preamble: %s", result.Bytes()) + return result.String(), nil +} diff --git a/pkg/renderer/sgml/predefined_attribute.go b/pkg/renderer/sgml/predefined_attribute.go index 2d0cd381..28d7f80c 100644 --- a/pkg/renderer/sgml/predefined_attribute.go +++ b/pkg/renderer/sgml/predefined_attribute.go @@ -7,7 +7,7 @@ import ( "github.com/pkg/errors" ) -func (r *sgmlRenderer) renderPredefinedAttribute(a types.PredefinedAttribute) (string, error) { +func (r *sgmlRenderer) renderPredefinedAttribute(a *types.PredefinedAttribute) (string, error) { result := &strings.Builder{} if err := r.predefinedAttribute.Execute(result, struct { Name string diff --git a/pkg/renderer/sgml/quoted_text.go b/pkg/renderer/sgml/quoted_text.go index dc8ee65f..ae80724b 100644 --- a/pkg/renderer/sgml/quoted_text.go +++ b/pkg/renderer/sgml/quoted_text.go @@ -10,7 +10,7 @@ import ( // TODO: The bold, italic, and monospace items should be refactored to support semantic tags instead. -func (r *sgmlRenderer) renderQuotedText(ctx *renderer.Context, t types.QuotedText) (string, error) { +func (r *sgmlRenderer) renderQuotedText(ctx *renderer.Context, t *types.QuotedText) (string, error) { elementsBuffer := &strings.Builder{} for _, element := range t.Elements { b, err := r.renderElement(ctx, element) diff --git a/pkg/renderer/sgml/renderer.go b/pkg/renderer/sgml/renderer.go index e9a71471..1ac4a079 100644 --- a/pkg/renderer/sgml/renderer.go +++ b/pkg/renderer/sgml/renderer.go @@ -9,6 +9,7 @@ import ( "github.com/bytesparadise/libasciidoc/pkg/configuration" "github.com/bytesparadise/libasciidoc/pkg/renderer" "github.com/bytesparadise/libasciidoc/pkg/types" + "github.com/davecgh/go-spew/spew" "github.com/pkg/errors" log "github.com/sirupsen/logrus" @@ -18,7 +19,7 @@ import ( type Renderer interface { // Render renders a document to the given output stream. - Render(ctx *renderer.Context, doc types.Document, output io.Writer) (types.Metadata, error) + Render(ctx *renderer.Context, doc *types.Document, output io.Writer) (types.Metadata, error) // SetFunction sets the named function. SetFunction(name string, fn interface{}) @@ -42,8 +43,9 @@ func NewRenderer(t Templates) Renderer { "trim": trimBoth, "specialCharacter": specialCharacter, "predefinedAttribute": predefinedAttribute, + "halign": halign, + "valign": valign, } - return r } @@ -106,6 +108,32 @@ func predefinedAttribute(a string) string { return predefinedAttributes[a] } +func halign(v types.HAlign) string { + switch v { + case types.HAlignLeft: + return "halign-left" + case types.HAlignCenter: + return "halign-center" + case types.HAlignRight: + return "halign-right" + default: + return string(v) + } +} + +func valign(v types.VAlign) string { + switch v { + case types.VAlignTop: + return "valign-top" + case types.VAlignMiddle: + return "valign-middle" + case types.VAlignBottom: + return "valign-bottom" + default: + return string(v) + } +} + func (r *sgmlRenderer) SetFunction(name string, fn interface{}) { r.functions[name] = fn } @@ -135,7 +163,10 @@ func (r *sgmlRenderer) newTemplate(name string, tmpl string, err error) (*textTe } // Render renders the given document in HTML and writes the result in the given `writer` -func (r *sgmlRenderer) Render(ctx *renderer.Context, doc types.Document, output io.Writer) (types.Metadata, error) { +func (r *sgmlRenderer) Render(ctx *renderer.Context, doc *types.Document, output io.Writer) (types.Metadata, error) { + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("rendering document of type '%s'\n%s", ctx.Attributes.GetAsStringWithDefault(types.AttrDocType, "article"), spew.Sdump(ctx.Attributes)) + // } // metadata to be returned to the caller var metadata types.Metadata @@ -145,9 +176,7 @@ func (r *sgmlRenderer) Render(ctx *renderer.Context, doc types.Document, output if err != nil { return metadata, err } - if doc.Attributes.Has(types.AttrUnicode) { - ctx.UseUnicode = true - } + renderedTitle, exists, err := r.renderDocumentTitle(ctx, doc) if err != nil { return metadata, errors.Wrapf(err, "unable to render full document") @@ -157,7 +186,7 @@ func (r *sgmlRenderer) Render(ctx *renderer.Context, doc types.Document, output renderedTitle = DefaultTitle } // needs to be set before rendering the content elements - ctx.TableOfContents, err = r.newTableOfContents(ctx, doc) + ctx.TableOfContents, err = r.newTableOfContents(ctx, doc) // TODO: needed?? if err != nil { return metadata, errors.Wrapf(err, "unable to render full document") } @@ -171,14 +200,14 @@ func (r *sgmlRenderer) Render(ctx *renderer.Context, doc types.Document, output return metadata, errors.Wrap(err, "unable to render fenced block content") } if ctx.Config.WrapInHTMLBodyElement { - // log.Debugf("Rendering full document...") + log.Debugf("Rendering full document...") err = r.article.Execute(output, struct { - Generator string - Doctype string - Title string - Authors string - Header string - Role string + Generator string + Doctype string + Title string + Authors string + Header string + // Role string ID string Roles string Content string @@ -189,23 +218,24 @@ func (r *sgmlRenderer) Render(ctx *renderer.Context, doc types.Document, output IncludeHTMLBodyFooter bool }{ Generator: "libasciidoc", // TODO: externalize this value and include the lib version ? - Doctype: doc.Attributes.GetAsStringWithDefault(types.AttrDocType, "article"), + Doctype: ctx.Attributes.GetAsStringWithDefault(types.AttrDocType, "article"), Title: renderedTitle, - Authors: r.renderAuthors(doc), + Authors: r.renderAuthors(ctx, doc), Header: renderedHeader, Roles: roles, ID: r.renderDocumentID(doc), Content: string(renderedContent), //nolint: gosec - RevNumber: doc.Attributes.GetAsStringWithDefault("revnumber", ""), + RevNumber: ctx.Attributes.GetAsStringWithDefault("revnumber", ""), LastUpdated: ctx.Config.LastUpdated.Format(configuration.LastUpdatedFormat), CSS: ctx.Config.CSS, - IncludeHTMLBodyHeader: !doc.Attributes.Has(types.AttrNoHeader), - IncludeHTMLBodyFooter: !doc.Attributes.Has(types.AttrNoFooter), + IncludeHTMLBodyHeader: !ctx.Attributes.Has(types.AttrNoHeader), + IncludeHTMLBodyFooter: !ctx.Attributes.Has(types.AttrNoFooter), }) if err != nil { return metadata, errors.Wrapf(err, "unable to render full document") } } else { + log.Debugf("Rendering document body...") _, err = output.Write([]byte(renderedContent)) if err != nil { return metadata, errors.Wrapf(err, "unable to render full document") @@ -217,8 +247,8 @@ func (r *sgmlRenderer) Render(ctx *renderer.Context, doc types.Document, output // splitAndRender the document with the header elements on one side // and all other elements (table of contents, with preamble, content) on the other side, // then renders the header and other elements -func (r *sgmlRenderer) splitAndRender(ctx *renderer.Context, doc types.Document) (string, string, error) { - switch doc.Attributes.GetAsStringWithDefault(types.AttrDocType, "article") { +func (r *sgmlRenderer) splitAndRender(ctx *renderer.Context, doc *types.Document) (string, string, error) { + switch ctx.Attributes.GetAsStringWithDefault(types.AttrDocType, "article") { case "manpage": return r.splitAndRenderForManpage(ctx, doc) default: @@ -228,50 +258,46 @@ func (r *sgmlRenderer) splitAndRender(ctx *renderer.Context, doc types.Document) // splits the document with the title of the section 0 (if available) on one side // and all other elements (table of contents, with preamble, content) on the other side -func (r *sgmlRenderer) splitAndRenderForArticle(ctx *renderer.Context, doc types.Document) (string, string, error) { - if ctx.Config.WrapInHTMLBodyElement { - if header, found := doc.Header(); found { - renderedHeader, err := r.renderArticleHeader(ctx, header) - if err != nil { - return "", "", err - } - renderedContent, err := r.renderDocumentElements(ctx, header.Elements, doc.Footnotes) - if err != nil { - return "", "", err - } - return renderedHeader, renderedContent, nil - } +func (r *sgmlRenderer) splitAndRenderForArticle(ctx *renderer.Context, doc *types.Document) (string, string, error) { + log.Debugf("rendering article (within HTML/Body: %t)", ctx.Config.WrapInHTMLBodyElement) + // if ctx.Config.WrapInHTMLBodyElement { + header, elements, _ := doc.Header() + r.processHeaderElements(ctx, header) + renderedHeader, err := r.renderDocumentHeader(ctx, header) + if err != nil { + return "", "", err } - renderedContent, err := r.renderDocumentElements(ctx, doc.Elements, doc.Footnotes) + renderedContent, err := r.renderDocumentElements(ctx, elements, doc.TableOfContents, doc.Footnotes) if err != nil { return "", "", err } - return "", renderedContent, nil + return renderedHeader, renderedContent, nil } // splits the document with the header elements on one side // and the other elements (table of contents, with preamble, content) on the other side -func (r *sgmlRenderer) splitAndRenderForManpage(ctx *renderer.Context, doc types.Document) (string, string, error) { - header, _ := doc.Header() - nameSection := header.Elements[0].(types.Section) - +func (r *sgmlRenderer) splitAndRenderForManpage(ctx *renderer.Context, doc *types.Document) (string, string, error) { + log.Debugf("rendering manpage (within HTML/Body: %t)", ctx.Config.WrapInHTMLBodyElement) + header, elements, _ := doc.Header() + r.processHeaderElements(ctx, header) + nameSection := elements[0].(*types.Section) // TODO: enforce if ctx.Config.WrapInHTMLBodyElement { renderedHeader, err := r.renderManpageHeader(ctx, header, nameSection) if err != nil { return "", "", err } - renderedContent, err := r.renderDocumentElements(ctx, header.Elements[1:], doc.Footnotes) + renderedContent, err := r.renderDocumentElements(ctx, elements[1:], doc.TableOfContents, doc.Footnotes) if err != nil { return "", "", err } return renderedHeader, renderedContent, nil } // in that case, we still want to display the name section - renderedHeader, err := r.renderManpageHeader(ctx, types.Section{}, nameSection) + renderedHeader, err := r.renderManpageHeader(ctx, nil, nameSection) if err != nil { return "", "", err } - renderedContent, err := r.renderDocumentElements(ctx, header.Elements[1:], doc.Footnotes) + renderedContent, err := r.renderDocumentElements(ctx, elements[1:], doc.TableOfContents, doc.Footnotes) if err != nil { return "", "", err } @@ -281,40 +307,57 @@ func (r *sgmlRenderer) splitAndRenderForManpage(ctx *renderer.Context, doc types return "", result.String(), nil } -func (r *sgmlRenderer) renderDocumentRoles(ctx *Context, doc types.Document) (string, error) { - if header, found := doc.Header(); found { +func (r *sgmlRenderer) processHeaderElements(ctx *renderer.Context, header *types.DocumentHeader) { + if header == nil { + return + } + // also process header elements in search for Attribute declarations/reset to retain in the context + for _, e := range header.Elements { + switch e := e.(type) { + case *types.AttributeDeclaration: + ctx.Attributes[e.Name] = e.Value + case *types.AttributeReset: + delete(ctx.Attributes, e.Name) + } + } +} + +func (r *sgmlRenderer) renderDocumentRoles(ctx *renderer.Context, doc *types.Document) (string, error) { + if header, _, found := doc.Header(); found { return r.renderElementRoles(ctx, header.Attributes) } return "", nil } -func (r *sgmlRenderer) renderDocumentID(doc types.Document) string { - if header, found := doc.Header(); found { - if header.Attributes.Has(types.AttrCustomID) { - // We only want to emit a document body ID if one was explicitly set - return r.renderElementID(header.Attributes) - } +func (r *sgmlRenderer) renderDocumentID(doc *types.Document) string { + if header, _, found := doc.Header(); found { + // if header.Attributes.Has(types.AttrCustomID) { + // We only want to emit a document body ID if one was explicitly set + return r.renderElementID(header.Attributes) + // } } return "" } -func (r *sgmlRenderer) renderAuthors(doc types.Document) string { - authors, found := doc.Authors() - if !found { - return "" - } - authorStrs := make([]string, len(authors)) - for i, author := range authors { - authorStrs[i] = author.FullName +func (r *sgmlRenderer) renderAuthors(_ *renderer.Context, doc *types.Document) string { // TODO: pass header instead of doc + if h, _, found := doc.Header(); found { + if a := h.Authors(); a != nil { + authorStrs := make([]string, len(a)) + for i, author := range a { + authorStrs[i] = author.FullName() + } + return strings.Join(authorStrs, "; ") + + } } - return strings.Join(authorStrs, "; ") + return "" } // DefaultTitle the default title to render when the document has none const DefaultTitle = "Untitled" -func (r *sgmlRenderer) renderDocumentTitle(ctx *renderer.Context, doc types.Document) (string, bool, error) { - if header, found := doc.Header(); found { +func (r *sgmlRenderer) renderDocumentTitle(ctx *renderer.Context, doc *types.Document) (string, bool, error) { + if header, _, found := doc.Header(); found { // TODO: This feels wrong. The title should not need markup. title, err := r.renderPlainText(ctx, header.Title) if err != nil { @@ -325,8 +368,11 @@ func (r *sgmlRenderer) renderDocumentTitle(ctx *renderer.Context, doc types.Docu return "", false, nil } -func (r *sgmlRenderer) renderArticleHeader(ctx *renderer.Context, header types.Section) (string, error) { - renderedHeader, err := r.renderInlineElements(ctx, header.Title) +func (r *sgmlRenderer) renderDocumentHeader(ctx *renderer.Context, header *types.DocumentHeader) (string, error) { + if header == nil { + return "", nil + } + renderedHeader, err := r.renderDocumentHeaderTitle(ctx, header) if err != nil { return "", err } @@ -334,7 +380,6 @@ func (r *sgmlRenderer) renderArticleHeader(ctx *renderer.Context, header types.S if err != nil { return "", err } - output := &strings.Builder{} err = r.articleHeader.Execute(output, struct { Header string @@ -349,8 +394,16 @@ func (r *sgmlRenderer) renderArticleHeader(ctx *renderer.Context, header types.S return output.String(), nil } -func (r *sgmlRenderer) renderManpageHeader(ctx *renderer.Context, header types.Section, nameSection types.Section) (string, error) { - renderedHeader, err := r.renderInlineElements(ctx, header.Title) +func (r *sgmlRenderer) renderDocumentHeaderTitle(ctx *renderer.Context, header *types.DocumentHeader) (string, error) { + if header == nil { + log.Debug("no header to render") + return "", nil + } + return r.renderInlineElements(ctx, header.Title) +} + +func (r *sgmlRenderer) renderManpageHeader(ctx *renderer.Context, header *types.DocumentHeader, nameSection *types.Section) (string, error) { + renderedHeader, err := r.renderDocumentHeaderTitle(ctx, header) if err != nil { return "", err } @@ -358,11 +411,11 @@ func (r *sgmlRenderer) renderManpageHeader(ctx *renderer.Context, header types.S if err != nil { return "", err } - description := nameSection.Elements[0].(types.Paragraph) // TODO: type check + description := nameSection.Elements[0].(*types.Paragraph) // TODO: type check if description.Attributes == nil { description.Attributes = types.Attributes{} } - description.Attributes.AddNonEmpty(types.AttrStyle, "manpage") + description.Attributes.Set(types.AttrStyle, "manpage") renderedContent, err := r.renderParagraph(ctx, description) if err != nil { return "", err @@ -387,32 +440,32 @@ func (r *sgmlRenderer) renderManpageHeader(ctx *renderer.Context, header types.S // renderDocumentElements renders all document elements, including the footnotes, // but not the HEAD and BODY containers -func (r *sgmlRenderer) renderDocumentElements(ctx *renderer.Context, source []interface{}, footnotes []types.Footnote) (string, error) { - elements := make([]interface{}, 0, len(source)) - for i, e := range source { - switch e := e.(type) { - case types.Preamble: - if !e.HasContent() { // why !HasContent ??? - // retain the preamble - elements = append(elements, e) - continue +func (r *sgmlRenderer) renderDocumentElements(ctx *renderer.Context, source []interface{}, toc *types.TableOfContents, footnotes []*types.Footnote) (string, error) { + var elements []interface{} + if placement, found := ctx.Attributes[types.AttrTableOfContents]; found && toc != nil { + switch placement { + case "preamble": + // look-up the preamble in the source elements + if p := lookupPreamble(source); p != nil { + // insert ToC at the end of the preamble + p.TableOfContents = toc + elements = source + } else { + elements = source } - // retain everything "as-is" - elements = source - case types.Section: - if e.Level == 0 { - // retain the section's elements... - elements = append(elements, e.Elements) - // ... and add the other elements (in case there's another section 0...) - elements = append(elements, source[i+1:]...) - continue - } - // retain everything "as-is" - elements = source + case "", nil: + elements = make([]interface{}, len(source)+1) + elements[0] = toc + copy(elements[1:], source) default: - // retain everything "as-is" - elements = source + return "", fmt.Errorf("unsupported table of contents placement: '%s'", placement) } + } else { + elements = source + } + + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("rendering elements:\n%s", spew.Sdump(elements)) } buff := &strings.Builder{} renderedElements, err := r.renderElements(ctx, elements) @@ -427,3 +480,12 @@ func (r *sgmlRenderer) renderDocumentElements(ctx *renderer.Context, source []in buff.WriteString(renderedFootnotes) return buff.String(), nil } + +func lookupPreamble(elements []interface{}) *types.Preamble { + for _, e := range elements { + if p, ok := e.(*types.Preamble); ok { + return p + } + } + return nil +} diff --git a/pkg/renderer/sgml/section.go b/pkg/renderer/sgml/section.go index 2c1db247..329fcc23 100644 --- a/pkg/renderer/sgml/section.go +++ b/pkg/renderer/sgml/section.go @@ -8,33 +8,7 @@ import ( "github.com/pkg/errors" ) -func (r *sgmlRenderer) renderPreamble(ctx *renderer.Context, p types.Preamble) (string, error) { - // log.Debugf("rendering preamble...") - result := &strings.Builder{} - // the
wrapper is only necessary - // if the document has a section 0 - - content, err := r.renderElements(ctx, p.Elements) - if err != nil { - return "", errors.Wrap(err, "error rendering preamble elements") - } - err = r.preamble.Execute(result, struct { - Context *renderer.Context - Wrapper bool - Content string - }{ - Context: ctx, - Wrapper: ctx.HasHeader, - Content: string(content), - }) - if err != nil { - return "", errors.Wrap(err, "error while rendering preamble") - } - // log.Debugf("rendered preamble: %s", result.Bytes()) - return result.String(), nil -} - -func (r *sgmlRenderer) renderSection(ctx *renderer.Context, s types.Section) (string, error) { +func (r *sgmlRenderer) renderSection(ctx *renderer.Context, s *types.Section) (string, error) { // log.Debugf("rendering section level %d", s.Level) title, err := r.renderSectionTitle(ctx, s) if err != nil { @@ -75,29 +49,22 @@ func (r *sgmlRenderer) renderSection(ctx *renderer.Context, s types.Section) (st return result.String(), nil } -func (r *sgmlRenderer) renderSectionTitle(ctx *renderer.Context, s types.Section) (string, error) { +func (r *sgmlRenderer) renderSectionTitle(ctx *renderer.Context, s *types.Section) (string, error) { result := &strings.Builder{} renderedContent, err := r.renderInlineElements(ctx, s.Title) if err != nil { return "", errors.Wrap(err, "error while rendering sectionTitle content") } - roles, err := r.renderElementRoles(ctx, s.Attributes) - if err != nil { - return "", errors.Wrap(err, "unable to render section content") - } - renderedContentStr := strings.TrimSpace(renderedContent) err = r.sectionHeader.Execute(result, struct { Level int LevelPlusOne int ID string - Roles string Content string }{ Level: s.Level, LevelPlusOne: s.Level + 1, // Level 1 is

. ID: r.renderElementID(s.Attributes), - Roles: roles, Content: renderedContentStr, }) if err != nil { diff --git a/pkg/renderer/sgml/sgml_renderer.go b/pkg/renderer/sgml/sgml_renderer.go index 91d3204c..85871592 100644 --- a/pkg/renderer/sgml/sgml_renderer.go +++ b/pkg/renderer/sgml/sgml_renderer.go @@ -81,7 +81,6 @@ type sgmlRenderer struct { tocSection *textTemplate unorderedList *textTemplate unorderedListItem *textTemplate - verbatimLine *textTemplate verseBlock *textTemplate verseParagraph *textTemplate } @@ -133,7 +132,7 @@ func (r *sgmlRenderer) prepareTemplates() error { r.markedText, err = r.newTemplate("marked-text", tmpls.MarkedText, err) r.monospaceText, err = r.newTemplate("monospace-text", tmpls.MonospaceText, err) r.orderedList, err = r.newTemplate("ordered-list", tmpls.OrderedList, err) - r.orderedListItem, err = r.newTemplate("ordered-list-item", tmpls.OrderedListItem, err) + r.orderedListItem, err = r.newTemplate("ordered-list-item", tmpls.OrderedListElement, err) r.paragraph, err = r.newTemplate("paragraph", tmpls.Paragraph, err) r.passthroughBlock, err = r.newTemplate("passthrough", tmpls.PassthroughBlock, err) r.preamble, err = r.newTemplate("preamble", tmpls.Preamble, err) @@ -162,7 +161,6 @@ func (r *sgmlRenderer) prepareTemplates() error { r.tocSection, err = r.newTemplate("toc-section", tmpls.TocSection, err) r.unorderedList, err = r.newTemplate("unordered-list", tmpls.UnorderedList, err) r.unorderedListItem, err = r.newTemplate("unordered-list-item", tmpls.UnorderedListItem, err) - r.verbatimLine, err = r.newTemplate("verbatim-line", tmpls.VerbatimLine, err) r.verseBlock, err = r.newTemplate("verse", tmpls.VerseBlock, err) r.verseParagraph, err = r.newTemplate("verse-paragraph", tmpls.VerseParagraph, err) }) diff --git a/pkg/renderer/sgml/special_character.go b/pkg/renderer/sgml/special_character.go index 74e18118..e7666ccf 100644 --- a/pkg/renderer/sgml/special_character.go +++ b/pkg/renderer/sgml/special_character.go @@ -7,8 +7,8 @@ import ( "github.com/pkg/errors" ) -func (r *sgmlRenderer) renderSpecialCharacter(ctx *Context, s types.SpecialCharacter) (string, error) { - // log.Debugf("rendering special character...") +func (r *sgmlRenderer) renderSpecialCharacter(ctx *Context, s *types.SpecialCharacter) (string, error) { + // log.Debugf("rendering special character '%s'", s.Name) if !ctx.EncodeSpecialChars { // just return the special character as-is return s.Name, nil diff --git a/pkg/renderer/sgml/string.go b/pkg/renderer/sgml/string.go index 59a11387..6586e769 100644 --- a/pkg/renderer/sgml/string.go +++ b/pkg/renderer/sgml/string.go @@ -27,7 +27,7 @@ var quotes = map[types.QuotedStringKind]struct { }, } -func (r *sgmlRenderer) renderQuotedStringPlain(ctx *renderer.Context, s types.QuotedString) (string, error) { +func (r *sgmlRenderer) renderQuotedStringPlain(ctx *renderer.Context, s *types.QuotedString) (string, error) { buf := &strings.Builder{} b, err := r.renderPlainText(ctx, s.Elements) if err != nil { @@ -39,15 +39,15 @@ func (r *sgmlRenderer) renderQuotedStringPlain(ctx *renderer.Context, s types.Qu return buf.String(), nil } -func (r *sgmlRenderer) renderQuotedString(ctx *renderer.Context, s types.QuotedString) (string, error) { +func (r *sgmlRenderer) renderQuotedString(ctx *renderer.Context, s *types.QuotedString) (string, error) { elements := append([]interface{}{ - types.StringElement{Content: quotes[s.Kind].Open}, + &types.StringElement{Content: quotes[s.Kind].Open}, }, s.Elements...) - elements = append(elements, types.StringElement{Content: quotes[s.Kind].Close}) + elements = append(elements, &types.StringElement{Content: quotes[s.Kind].Close}) return r.renderInlineElements(ctx, elements) } -func (r *sgmlRenderer) renderStringElement(ctx *renderer.Context, str types.StringElement) (string, error) { +func (r *sgmlRenderer) renderStringElement(ctx *renderer.Context, str *types.StringElement) (string, error) { buf := &strings.Builder{} err := r.stringElement.Execute(buf, str.Content) if err != nil { @@ -57,7 +57,7 @@ func (r *sgmlRenderer) renderStringElement(ctx *renderer.Context, str types.Stri // NB: For all SGML flavors we are aware of, the numeric entities from // Unicode are supported. We generally avoid named entities. result := buf.String() - if !ctx.UseUnicode { + if !ctx.UseUnicode() { // convert to entities result = asciiEntify(result) } diff --git a/pkg/renderer/sgml/table.go b/pkg/renderer/sgml/table.go index 71c633cd..41d84c73 100644 --- a/pkg/renderer/sgml/table.go +++ b/pkg/renderer/sgml/table.go @@ -6,10 +6,12 @@ import ( "github.com/bytesparadise/libasciidoc/pkg/renderer" "github.com/bytesparadise/libasciidoc/pkg/types" + "github.com/davecgh/go-spew/spew" "github.com/pkg/errors" + log "github.com/sirupsen/logrus" ) -func (r *sgmlRenderer) renderTable(ctx *renderer.Context, t types.Table) (string, error) { +func (r *sgmlRenderer) renderTable(ctx *renderer.Context, t *types.Table) (string, error) { result := &strings.Builder{} caption := &strings.Builder{} @@ -41,12 +43,15 @@ func (r *sgmlRenderer) renderTable(ctx *renderer.Context, t types.Table) (string } if t.Attributes.Has(types.AttrTitle) { - c, ok, err := t.Attributes.GetAsString(types.AttrCaption) + c, found, err := t.Attributes.GetAsString(types.AttrCaption) if err != nil { return "", err - } else if !ok { - c = ctx.Attributes.GetAsStringWithDefault(types.AttrTableCaption, "Table") - if c != "" { + } else if !found { + c, found, err = ctx.Attributes.GetAsString(types.AttrTableCaption) + if err != nil { + return "", errors.Wrap(err, "unable to render table") + } + if found && c != "" { // We always append the figure number, unless the caption is disabled. // This is for asciidoctor compatibility. c += " {counter:table-number}. " @@ -62,13 +67,15 @@ func (r *sgmlRenderer) renderTable(ctx *renderer.Context, t types.Table) (string } caption.WriteString(c) } - - header, err := r.renderTableHeader(ctx, t.Header, t.Columns) + columns, err := t.Columns() if err != nil { return "", errors.Wrap(err, "failed to render table") } - - body, err := r.renderTableBody(ctx, t) + header, err := r.renderTableHeader(ctx, t.Header, columns) + if err != nil { + return "", errors.Wrap(err, "failed to render table") + } + body, err := r.renderTableBody(ctx, t.Rows, columns) if err != nil { return "", errors.Wrap(err, "failed to render table") } @@ -78,13 +85,12 @@ func (r *sgmlRenderer) renderTable(ctx *renderer.Context, t types.Table) (string } title, err := r.renderElementTitle(t.Attributes) if err != nil { - return "", errors.Wrap(err, "unable to render callout list roles") + return "", errors.Wrap(err, "unable to render table title") } - err = r.table.Execute(result, struct { Context *renderer.Context Title string - Columns []types.TableColumn + Columns []*types.TableColumn TableNumber int Caption string Frame string @@ -99,7 +105,7 @@ func (r *sgmlRenderer) renderTable(ctx *renderer.Context, t types.Table) (string }{ Context: ctx, Title: title, - Columns: t.Columns, + Columns: columns, TableNumber: number, Caption: caption.String(), Roles: roles, @@ -118,11 +124,14 @@ func (r *sgmlRenderer) renderTable(ctx *renderer.Context, t types.Table) (string return result.String(), nil } -func (r *sgmlRenderer) renderTableHeader(ctx *renderer.Context, l types.TableLine, cols []types.TableColumn) (string, error) { +func (r *sgmlRenderer) renderTableHeader(ctx *renderer.Context, h *types.TableRow, cols []*types.TableColumn) (string, error) { + if h == nil { + return "", nil + } result := &strings.Builder{} content := &strings.Builder{} col := 0 - for _, cell := range l.Cells { + for _, cell := range h.Cells { c, err := r.renderTableHeaderCell(ctx, cell, cols[col%len(cols)]) col++ if err != nil { @@ -133,18 +142,18 @@ func (r *sgmlRenderer) renderTableHeader(ctx *renderer.Context, l types.TableLin err := r.tableHeader.Execute(result, struct { Context *renderer.Context Content string - Cells [][]interface{} + Cells []*types.TableCell }{ Context: ctx, Content: content.String(), - Cells: l.Cells, + Cells: h.Cells, }) return result.String(), err } -func (r *sgmlRenderer) renderTableHeaderCell(ctx *renderer.Context, cell []interface{}, col types.TableColumn) (string, error) { +func (r *sgmlRenderer) renderTableHeaderCell(ctx *renderer.Context, cell *types.TableCell, col *types.TableColumn) (string, error) { result := &strings.Builder{} - content, err := r.renderInlineElements(ctx, cell) + content, err := r.renderInlineElements(ctx, cell.Elements) if err != nil { return "", errors.Wrap(err, "unable to render header cell") } @@ -152,58 +161,61 @@ func (r *sgmlRenderer) renderTableHeaderCell(ctx *renderer.Context, cell []inter Context *renderer.Context Content string Cell []interface{} - VAlign string - HAlign string + HAlign types.HAlign + VAlign types.VAlign }{ Context: ctx, Content: content, - Cell: cell, + Cell: cell.Elements, HAlign: col.HAlign, VAlign: col.VAlign, }) return result.String(), err } -func (r *sgmlRenderer) renderTableBody(ctx *renderer.Context, t types.Table) (string, error) { +func (r *sgmlRenderer) renderTableBody(ctx *renderer.Context, rows []*types.TableRow, columns []*types.TableColumn) (string, error) { + if log.IsLevelEnabled(log.DebugLevel) { + log.Debug("rendering table body") + log.Debugf("columns:\n%s", spew.Sdump(columns)) + log.Debugf("rows:\n%s", spew.Sdump(rows)) + } result := &strings.Builder{} content := &strings.Builder{} - for _, row := range t.Lines { - c, err := r.renderTableRow(ctx, row, t.Columns) + for _, row := range rows { + c, err := r.renderTableRow(ctx, row, columns) if err != nil { - return "", errors.Wrap(err, "unable to render header") + return "", errors.Wrap(err, "unable to render body") } content.WriteString(c) } err := r.tableBody.Execute(result, struct { Context *renderer.Context Content string - Rows []types.TableLine - Columns []types.TableColumn + Rows []*types.TableRow + Columns []*types.TableColumn }{ Context: ctx, Content: content.String(), - Rows: t.Lines, - Columns: t.Columns, + Rows: rows, + Columns: columns, }) return result.String(), err } -func (r *sgmlRenderer) renderTableRow(ctx *renderer.Context, l types.TableLine, cols []types.TableColumn) (string, error) { +func (r *sgmlRenderer) renderTableRow(ctx *renderer.Context, l *types.TableRow, cols []*types.TableColumn) (string, error) { result := &strings.Builder{} content := &strings.Builder{} - col := 0 - for _, cell := range l.Cells { - c, err := r.renderTableCell(ctx, cell, cols[col%len(cols)]) - col++ + for i, cell := range l.Cells { + c, err := r.renderTableCell(ctx, cell, cols[i]) if err != nil { - return "", errors.Wrap(err, "unable to render header") + return "", errors.Wrap(err, "unable to render row") } content.WriteString(c) } err := r.tableRow.Execute(result, struct { Context *renderer.Context Content string - Cells [][]interface{} + Cells []*types.TableCell }{ Context: ctx, Content: content.String(), @@ -212,18 +224,21 @@ func (r *sgmlRenderer) renderTableRow(ctx *renderer.Context, l types.TableLine, return result.String(), err } -func (r *sgmlRenderer) renderTableCell(ctx *renderer.Context, cell []interface{}, col types.TableColumn) (string, error) { +func (r *sgmlRenderer) renderTableCell(ctx *renderer.Context, cell *types.TableCell, col *types.TableColumn) (string, error) { result := &strings.Builder{} - content, err := r.renderInlineElements(ctx, cell) + content, err := r.renderInlineElements(ctx, cell.Elements) if err != nil { - return "", errors.Wrap(err, "unable to render header cell") + return "", errors.Wrap(err, "unable to render cell") + } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("rendering cell with content '%s' and def %s", content, spew.Sdump(col)) } err = r.tableCell.Execute(result, struct { Context *renderer.Context Content string - Cell []interface{} - HAlign string - VAlign string + Cell *types.TableCell + HAlign types.HAlign + VAlign types.VAlign }{ Context: ctx, Content: content, diff --git a/pkg/renderer/sgml/table_of_contents.go b/pkg/renderer/sgml/table_of_contents.go index b125d4c6..aaf3285a 100644 --- a/pkg/renderer/sgml/table_of_contents.go +++ b/pkg/renderer/sgml/table_of_contents.go @@ -10,7 +10,10 @@ import ( log "github.com/sirupsen/logrus" ) -func (r *sgmlRenderer) renderTableOfContents(ctx *renderer.Context, toc types.TableOfContents) (string, error) { +func (r *sgmlRenderer) renderTableOfContents(ctx *renderer.Context, toc *types.TableOfContents) (string, error) { + if toc == nil || toc.Sections == nil { + return "", nil + } log.Debug("rendering table of contents...") renderedSections, err := r.renderTableOfContentsSections(ctx, toc.Sections) if err != nil { @@ -29,7 +32,7 @@ func (r *sgmlRenderer) renderTableOfContents(ctx *renderer.Context, toc types.Ta return result.String(), nil } -func (r *sgmlRenderer) renderTableOfContentsSections(ctx *renderer.Context, sections []types.ToCSection) (string, error) { +func (r *sgmlRenderer) renderTableOfContentsSections(ctx *renderer.Context, sections []*types.ToCSection) (string, error) { if len(sections) == 0 { return "", nil } @@ -47,7 +50,7 @@ func (r *sgmlRenderer) renderTableOfContentsSections(ctx *renderer.Context, sect Context *renderer.Context Level int Content string - Sections []types.ToCSection + Sections []*types.ToCSection }{ Context: ctx, Level: sections[0].Level, @@ -61,7 +64,7 @@ func (r *sgmlRenderer) renderTableOfContentsSections(ctx *renderer.Context, sect return resultBuf.String(), nil //nolint: gosec } -func (r *sgmlRenderer) renderTableOfContentsEntry(ctx *renderer.Context, entry types.ToCSection) (string, error) { +func (r *sgmlRenderer) renderTableOfContentsEntry(ctx *renderer.Context, entry *types.ToCSection) (string, error) { resultBuf := &strings.Builder{} content, err := r.renderTableOfContentsSections(ctx, entry.Children) @@ -75,7 +78,7 @@ func (r *sgmlRenderer) renderTableOfContentsEntry(ctx *renderer.Context, entry t ID string Title string Content string - Children []types.ToCSection + Children []*types.ToCSection }{ Context: ctx, Level: entry.Level, @@ -92,10 +95,10 @@ func (r *sgmlRenderer) renderTableOfContentsEntry(ctx *renderer.Context, entry t // newTableOfContents initializes a TableOfContents from the sections // of the given document -func (r *sgmlRenderer) newTableOfContents(ctx *renderer.Context, doc types.Document) (types.TableOfContents, error) { - sections := make([]types.ToCSection, 0, len(doc.Elements)) +func (r *sgmlRenderer) newTableOfContents(ctx *renderer.Context, doc *types.Document) (types.TableOfContents, error) { + sections := make([]*types.ToCSection, 0, len(doc.Elements)) for _, e := range doc.Elements { - if s, ok := e.(types.Section); ok { + if s, ok := e.(*types.Section); ok { tocs, err := r.visitSection(ctx, s, 1) if err != nil { return types.TableOfContents{}, err @@ -108,19 +111,19 @@ func (r *sgmlRenderer) newTableOfContents(ctx *renderer.Context, doc types.Docum }, nil } -func (r *sgmlRenderer) visitSection(ctx *renderer.Context, section types.Section, currentLevel int) ([]types.ToCSection, error) { +func (r *sgmlRenderer) visitSection(ctx *renderer.Context, section *types.Section, currentLevel int) ([]*types.ToCSection, error) { tocLevels, err := getTableOfContentsLevels(ctx) if err != nil { - return []types.ToCSection{}, err + return []*types.ToCSection{}, err } - children := make([]types.ToCSection, 0, len(section.Elements)) + children := make([]*types.ToCSection, 0, len(section.Elements)) // log.Debugf("visiting children section: %t (%d < %d)", currentLevel < tocLevels, currentLevel, tocLevels) if currentLevel <= tocLevels { for _, e := range section.Elements { - if s, ok := e.(types.Section); ok { + if s, ok := e.(*types.Section); ok { tocs, err := r.visitSection(ctx, s, currentLevel+1) if err != nil { - return []types.ToCSection{}, err + return []*types.ToCSection{}, err } children = append(children, tocs...) } @@ -132,10 +135,10 @@ func (r *sgmlRenderer) visitSection(ctx *renderer.Context, section types.Section renderedTitle, err := r.renderPlainText(ctx, section.Title) if err != nil { - return []types.ToCSection{}, err + return []*types.ToCSection{}, err } - return []types.ToCSection{ + return []*types.ToCSection{ { ID: section.Attributes.GetAsStringWithDefault(types.AttrID, ""), Level: section.Level, diff --git a/pkg/renderer/sgml/templates.go b/pkg/renderer/sgml/templates.go index 6af615e0..3cd2ec96 100644 --- a/pkg/renderer/sgml/templates.go +++ b/pkg/renderer/sgml/templates.go @@ -45,7 +45,7 @@ type Templates struct { MarkedText string MonospaceText string OrderedList string - OrderedListItem string + OrderedListElement string Paragraph string PassthroughBlock string Preamble string @@ -74,7 +74,6 @@ type Templates struct { TocSection string UnorderedList string UnorderedListItem string - VerbatimLine string VerseBlock string VerseParagraph string } diff --git a/pkg/renderer/sgml/unordered_list.go b/pkg/renderer/sgml/unordered_list.go deleted file mode 100644 index a1af4958..00000000 --- a/pkg/renderer/sgml/unordered_list.go +++ /dev/null @@ -1,75 +0,0 @@ -package sgml - -import ( - "io" - "strings" - - "github.com/bytesparadise/libasciidoc/pkg/renderer" - "github.com/bytesparadise/libasciidoc/pkg/types" - "github.com/pkg/errors" -) - -func (r *sgmlRenderer) renderUnorderedList(ctx *renderer.Context, l types.UnorderedList) (string, error) { - // make sure nested elements are aware of that their rendering occurs within a list - checkList := false - if len(l.Items) > 0 { - if l.Items[0].CheckStyle != types.NoCheck { - checkList = true - } - } - result := &strings.Builder{} - content := &strings.Builder{} - - for _, item := range l.Items { - if err := r.renderUnorderedListItem(ctx, content, item); err != nil { - return "", errors.Wrap(err, "unable to render unordered list") - } - } - roles, err := r.renderElementRoles(ctx, l.Attributes) - if err != nil { - return "", errors.Wrap(err, "unable to render unordered list roles") - } - title, err := r.renderElementTitle(l.Attributes) - if err != nil { - return "", errors.Wrap(err, "unable to render callout list roles") - } - - // here we must preserve the HTML tags - err = r.unorderedList.Execute(result, struct { - Context *renderer.Context - ID string - Title string - Roles string - Style string - Checklist bool - Items []types.UnorderedListItem - Content string - }{ - Context: ctx, - ID: r.renderElementID(l.Attributes), - Title: title, - Checklist: checkList, - Items: l.Items, - Content: string(content.String()), - Roles: roles, - Style: r.renderElementStyle(l.Attributes), - }) - if err != nil { - return "", errors.Wrap(err, "unable to render unordered list") - } - return result.String(), nil -} -func (r *sgmlRenderer) renderUnorderedListItem(ctx *renderer.Context, w io.Writer, item types.UnorderedListItem) error { - - content, err := r.renderListElements(ctx, item.Elements) - if err != nil { - return errors.Wrap(err, "unable to render unordered list item content") - } - return r.unorderedListItem.Execute(w, struct { - Context *renderer.Context - Content string - }{ - Context: ctx, - Content: string(content), - }) -} diff --git a/pkg/renderer/sgml/user_macro.go b/pkg/renderer/sgml/user_macro.go index 6c634b44..1679afcc 100644 --- a/pkg/renderer/sgml/user_macro.go +++ b/pkg/renderer/sgml/user_macro.go @@ -7,23 +7,21 @@ import ( "github.com/bytesparadise/libasciidoc/pkg/types" ) -func (r *sgmlRenderer) renderUserMacro(ctx *renderer.Context, um types.UserMacro) (string, error) { +func (r *sgmlRenderer) renderUserMacro(ctx *renderer.Context, m *types.UserMacro) (string, error) { buf := &strings.Builder{} - macro, ok := ctx.Config.Macros[um.Name] + macro, ok := ctx.Config.Macros[m.Name] if !ok { - if um.Kind == types.BlockMacro { + if m.Kind == types.BlockMacro { // fallback to paragraph - p, _ := types.NewParagraph([]interface{}{ - []interface{}{ - types.StringElement{Content: um.RawText}, - }, - }, nil) + p, _ := types.NewParagraph( + &types.StringElement{Content: m.RawText}, + ) return r.renderParagraph(ctx, p) } // fallback to render raw text - return um.RawText, nil + return m.RawText, nil } - if err := macro.Execute(buf, um); err != nil { + if err := macro.Execute(buf, m); err != nil { return "", err } return buf.String(), nil diff --git a/pkg/renderer/sgml/verbatim_line.go b/pkg/renderer/sgml/verbatim_line.go deleted file mode 100644 index 787ed62e..00000000 --- a/pkg/renderer/sgml/verbatim_line.go +++ /dev/null @@ -1,15 +0,0 @@ -package sgml - -import ( - "strings" - - "github.com/bytesparadise/libasciidoc/pkg/types" -) - -func (r *sgmlRenderer) renderVerbatimLine(l types.VerbatimLine) (string, error) { - result := &strings.Builder{} - if err := r.verbatimLine.Execute(result, l); err != nil { - return "", err - } - return result.String(), nil -} diff --git a/pkg/renderer/sgml/xhtml5/article.adoc b/pkg/renderer/sgml/xhtml5/article.adoc deleted file mode 100644 index db0acf14..00000000 --- a/pkg/renderer/sgml/xhtml5/article.adoc +++ /dev/null @@ -1,91 +0,0 @@ -= AsciiDoc Article Title -Firstname Lastname -1.0, July 29, 2014, Asciidoctor 1.5 article template -:toc: -:icons: font -:quick-uri: https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/ - -Content entered directly below the header but before the first section heading is called the preamble. - -== First level heading - -This is a paragraph with a *bold* word and an _italicized_ word. - -.Image caption -image::image-file-name.png[I am the image alt text.] - -This is another paragraph.footnote:[I am footnote text and will be displayed at the bottom of the article.] - -=== Second level heading - -.Unordered list title -* list item 1 -** nested list item -*** nested nested list item 1 -*** nested nested list item 2 -* list item 2 - -This is a paragraph. - -.Example block title -==== -Content in an example block is subject to normal substitutions. -==== - -.Sidebar title -**** -Sidebars contain aside text and are subject to normal substitutions. -**** - -==== Third level heading - -[#id-for-listing-block] -.Listing block title ----- -Content in a listing block is subject to verbatim substitutions. -Listing block content is commonly used to preserve code input. ----- - -===== Fourth level heading - -.Table title -|=== -|Column heading 1 |Column heading 2 - -|Column 1, row 1 -|Column 2, row 1 - -|Column 1, row 2 -|Column 2, row 2 -|=== - -====== Fifth level heading - -[quote, firstname lastname, movie title] -____ -I am a block quote or a prose excerpt. -I am subject to normal substitutions. -____ - -[verse, firstname lastname, poem title and more] -____ -I am a verse block. - Indents and endlines are preserved in verse blocks. -____ - -== First level heading - -TIP: There are five admonition labels: Tip, Note, Important, Caution and Warning. - -// I am a comment and won't be rendered. - -. ordered list item -.. nested ordered list item -. ordered list item - -The text at the end of this sentence is cross referenced to <<_third_level_heading,the third level heading>> - -== First level heading - -This is a link to the https://asciidoctor.org/docs/user-manual/[Asciidoctor User Manual]. -This is an attribute reference {quick-uri}[which links this text to the Asciidoctor Quick Reference Guide]. diff --git a/pkg/renderer/sgml/xhtml5/article_adoc_test.go b/pkg/renderer/sgml/xhtml5/article_adoc_test.go deleted file mode 100644 index cc159fd2..00000000 --- a/pkg/renderer/sgml/xhtml5/article_adoc_test.go +++ /dev/null @@ -1,33 +0,0 @@ -package xhtml5_test - -import ( - "bufio" - "bytes" - "os" - - "github.com/bytesparadise/libasciidoc/pkg/renderer/sgml/xhtml5" - - "github.com/bytesparadise/libasciidoc/pkg/configuration" - "github.com/bytesparadise/libasciidoc/pkg/parser" - "github.com/bytesparadise/libasciidoc/pkg/renderer" - "github.com/davecgh/go-spew/spew" - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint -) - -var _ = Describe("article.adoc", func() { - - It("should render without failure", func() { - f, err := os.Open("article.adoc") - Expect(err).ToNot(HaveOccurred()) - reader := bufio.NewReader(f) - config := configuration.NewConfiguration() - doc, err := parser.ParseDocument(reader, config) - Expect(err).ToNot(HaveOccurred()) - GinkgoT().Logf("actual document: `%s`", spew.Sdump(doc)) - buff := &bytes.Buffer{} - ctx := renderer.NewContext(doc, config) - _, err = xhtml5.Render(ctx, doc, buff) - Expect(err).ToNot(HaveOccurred()) - }) -}) diff --git a/pkg/renderer/sgml/xhtml5/delimited_block_admonition_test.go b/pkg/renderer/sgml/xhtml5/delimited_block_admonition_test.go index 25a997c1..7fa65403 100644 --- a/pkg/renderer/sgml/xhtml5/delimited_block_admonition_test.go +++ b/pkg/renderer/sgml/xhtml5/delimited_block_admonition_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("admonition blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("admonition block with multiple elements alone", func() { source := `[NOTE] diff --git a/pkg/renderer/sgml/xhtml5/delimited_block_example_test.go b/pkg/renderer/sgml/xhtml5/delimited_block_example_test.go index 9b0a3710..e404304e 100644 --- a/pkg/renderer/sgml/xhtml5/delimited_block_example_test.go +++ b/pkg/renderer/sgml/xhtml5/delimited_block_example_test.go @@ -11,7 +11,7 @@ import ( var _ = Describe("example blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("example block with multiple elements - case 1", func() { source := `==== diff --git a/pkg/renderer/sgml/xhtml5/delimited_block_fenced_test.go b/pkg/renderer/sgml/xhtml5/delimited_block_fenced_test.go index b690c18b..e2a9d4d8 100644 --- a/pkg/renderer/sgml/xhtml5/delimited_block_fenced_test.go +++ b/pkg/renderer/sgml/xhtml5/delimited_block_fenced_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("fenced blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("fenced block with surrounding empty lines", func() { source := "```\n\nsome source code \n\nhere \n\n\n\n```" diff --git a/pkg/renderer/sgml/xhtml5/delimited_block_literal_test.go b/pkg/renderer/sgml/xhtml5/delimited_block_literal_test.go index 5d9ae569..a8ef2417 100644 --- a/pkg/renderer/sgml/xhtml5/delimited_block_literal_test.go +++ b/pkg/renderer/sgml/xhtml5/delimited_block_literal_test.go @@ -117,7 +117,7 @@ a normal paragraph.` It("literal block from 1-line paragraph with attribute", func() { source := `[literal] literal content - on many lines + on many lines has its heading spaces preserved. a normal paragraph.` @@ -125,7 +125,7 @@ a normal paragraph.` expected := `
 literal content
- on many lines
+  on many lines
  has its heading spaces preserved.
diff --git a/pkg/renderer/sgml/xhtml5/delimited_block_markdown_quote_test.go b/pkg/renderer/sgml/xhtml5/delimited_block_markdown_quote_test.go index 8030e943..3c6e20f7 100644 --- a/pkg/renderer/sgml/xhtml5/delimited_block_markdown_quote_test.go +++ b/pkg/renderer/sgml/xhtml5/delimited_block_markdown_quote_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("markdown-style quote blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("with single marker without author", func() { source := `> some text diff --git a/pkg/renderer/sgml/xhtml5/delimited_block_passthrough_test.go b/pkg/renderer/sgml/xhtml5/delimited_block_passthrough_test.go index 45778f81..d71f0065 100644 --- a/pkg/renderer/sgml/xhtml5/delimited_block_passthrough_test.go +++ b/pkg/renderer/sgml/xhtml5/delimited_block_passthrough_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("passthrough blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("with title", func() { source := `.a title diff --git a/pkg/renderer/sgml/xhtml5/delimited_block_quote_test.go b/pkg/renderer/sgml/xhtml5/delimited_block_quote_test.go index c6d4c563..a344758f 100644 --- a/pkg/renderer/sgml/xhtml5/delimited_block_quote_test.go +++ b/pkg/renderer/sgml/xhtml5/delimited_block_quote_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("quote blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("single-line quote with author and title ", func() { source := `[quote, john doe, quote title] diff --git a/pkg/renderer/sgml/xhtml5/delimited_block_sidebar_test.go b/pkg/renderer/sgml/xhtml5/delimited_block_sidebar_test.go index 8227f7ac..1e87a25d 100644 --- a/pkg/renderer/sgml/xhtml5/delimited_block_sidebar_test.go +++ b/pkg/renderer/sgml/xhtml5/delimited_block_sidebar_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("sidebar blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("sidebar block with paragraph", func() { source := `**** diff --git a/pkg/renderer/sgml/xhtml5/delimited_block_source_test.go b/pkg/renderer/sgml/xhtml5/delimited_block_source_test.go index df7587cf..90633219 100644 --- a/pkg/renderer/sgml/xhtml5/delimited_block_source_test.go +++ b/pkg/renderer/sgml/xhtml5/delimited_block_source_test.go @@ -9,7 +9,7 @@ import ( var _ = Describe("source blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("with source attribute only", func() { source := `[source] diff --git a/pkg/renderer/sgml/xhtml5/delimited_block_verse_test.go b/pkg/renderer/sgml/xhtml5/delimited_block_verse_test.go index 95093e41..2775bb71 100644 --- a/pkg/renderer/sgml/xhtml5/delimited_block_verse_test.go +++ b/pkg/renderer/sgml/xhtml5/delimited_block_verse_test.go @@ -11,7 +11,7 @@ import ( var _ = Describe("verse blocks", func() { - Context("delimited blocks", func() { + Context("as delimited blocks", func() { It("single-line verse with author and title ", func() { source := `[verse, john doe, verse title] diff --git a/pkg/renderer/sgml/xhtml5/document_details_test.go b/pkg/renderer/sgml/xhtml5/document_details_test.go index c7d6da31..727f38c3 100644 --- a/pkg/renderer/sgml/xhtml5/document_details_test.go +++ b/pkg/renderer/sgml/xhtml5/document_details_test.go @@ -139,7 +139,7 @@ Last updated {{.LastUpdated}} Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), - configuration.WithAttributes(map[string]string{}), + configuration.WithAttributes(map[string]interface{}{}), )).To(MatchHTMLTemplate(expected, now)) }) @@ -171,7 +171,7 @@ a paragraph` Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), - configuration.WithAttributes(map[string]string{ + configuration.WithAttributes(map[string]interface{}{ types.AttrNoFooter: "", }), )).To(MatchHTMLTemplate(expected, now)) @@ -215,7 +215,7 @@ a paragraph` Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), - configuration.WithAttributes(map[string]string{ + configuration.WithAttributes(map[string]interface{}{ types.AttrNoFooter: "", }), )).To(MatchHTMLTemplate(expected, now)) @@ -259,7 +259,7 @@ a paragraph` Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), - configuration.WithAttributes(map[string]string{ + configuration.WithAttributes(map[string]interface{}{ types.AttrNoFooter: "", }), )).To(MatchHTMLTemplate(expected, now)) @@ -295,7 +295,7 @@ Last updated {{.LastUpdated}} Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), - configuration.WithAttributes(map[string]string{ + configuration.WithAttributes(map[string]interface{}{ types.AttrNoHeader: "", }), )).To(MatchHTMLTemplate(expected, now)) @@ -326,7 +326,7 @@ a paragraph` Expect(RenderXHTML(source, configuration.WithHeaderFooter(true), configuration.WithLastUpdated(now), - configuration.WithAttributes(map[string]string{ + configuration.WithAttributes(map[string]interface{}{ types.AttrNoHeader: "", types.AttrNoFooter: "", }), diff --git a/pkg/renderer/sgml/xhtml5/file_inclusion_test.go b/pkg/renderer/sgml/xhtml5/file_inclusion_test.go index fd1fc274..c2cabe8e 100644 --- a/pkg/renderer/sgml/xhtml5/file_inclusion_test.go +++ b/pkg/renderer/sgml/xhtml5/file_inclusion_test.go @@ -36,12 +36,12 @@ var _ = Describe("file inclusions", func() { Title: "", LastUpdated: lastUpdated.Format(configuration.LastUpdatedFormat), TableOfContents: types.TableOfContents{ - Sections: []types.ToCSection{ + Sections: []*types.ToCSection{ { ID: "_grandchild_title", Level: 1, Title: "grandchild title", - Children: []types.ToCSection{}, + Children: []*types.ToCSection{}, }, }, }, @@ -874,7 +874,7 @@ func helloworld() {

last line of child

-

last line of parent

+

last line of parent <1>

@@ -889,15 +889,17 @@ include::../../../../test/includes/parent-include.adoc[leveloffset=+1] ----` expected := `
-
== parent title
+
:leveloffset: +1
+
+= parent title
 
 first line of parent
 
-== child title
+= child title
 
 first line of child
 
-=== grandchild title
+== grandchild title
 
 first line of grandchild
 
@@ -905,7 +907,9 @@ last line of grandchild
 
 last line of child
 
-last line of parent
+last line of parent (1) + +:leveloffset!:
` diff --git a/pkg/renderer/sgml/xhtml5/index_terms_test.go b/pkg/renderer/sgml/xhtml5/index_terms_test.go index e9be9bad..d8d94c3d 100644 --- a/pkg/renderer/sgml/xhtml5/index_terms_test.go +++ b/pkg/renderer/sgml/xhtml5/index_terms_test.go @@ -45,7 +45,8 @@ var _ = Describe("concealed index terms", func() { source := `(((index, term))) a paragraph with an index term.` expected := `
-

a paragraph with an index term.

+

+a paragraph with an index term.

` Expect(RenderXHTML(source)).To(MatchHTML(expected)) @@ -55,7 +56,8 @@ a paragraph with an index term.` source := `(((index, term))) a paragraph with an index term.` expected := `
-

a paragraph with an index term.

+

+a paragraph with an index term.

` Expect(RenderXHTML(source)).To(MatchHTML(expected)) diff --git a/pkg/renderer/sgml/xhtml5/paragraph_test.go b/pkg/renderer/sgml/xhtml5/paragraph_test.go index ba870e1f..e4940937 100644 --- a/pkg/renderer/sgml/xhtml5/paragraph_test.go +++ b/pkg/renderer/sgml/xhtml5/paragraph_test.go @@ -376,19 +376,19 @@ I am a verse paragraph.` Expect(RenderXHTML(source)).To(MatchHTML(expected)) }) - It("image block as a verse", func() { - source := `[verse, john doe, verse title] -image::foo.png[]` - expected := `
-
image::foo.png[]
-
-— john doe
-verse title -
-
-` - Expect(RenderXHTML(source)).To(MatchHTML(expected)) - }) + // It("image block as a verse", func() { + // source := `[verse, john doe, verse title] + // image::foo.png[]` + // expected := `
+ //
image::foo.png[]
+ //
+ // — john doe
+ // verse title + //
+ //
+ // ` + // Expect(RenderXHTML(source)).To(MatchHTML(expected)) + // }) }) Context("quote paragraphs", func() { diff --git a/pkg/renderer/sgml/xhtml5/quoted_text_test.go b/pkg/renderer/sgml/xhtml5/quoted_text_test.go index f27a57ca..15099784 100644 --- a/pkg/renderer/sgml/xhtml5/quoted_text_test.go +++ b/pkg/renderer/sgml/xhtml5/quoted_text_test.go @@ -236,12 +236,11 @@ var _ = Describe("quoted texts", func() { Expect(RenderXHTML(source)).To(MatchHTML(expected)) }) - // This is a departure from asciidoctor, as we support quoting the role in first position. - // (Asciidoctor passes it, but does not sanitize it, leading to invalid HTML.) It("quoted role", func() { - source := "[\"something \"]**bold**" + source := `["something "]**bold**` + // TODO: parse SpecialCharacters and sanitize the output expected := `
-

bold

+

bold

` Expect(RenderXHTML(source)).To(MatchHTML(expected)) @@ -271,7 +270,7 @@ var _ = Describe("quoted texts", func() { Context("nested content", func() { It("nested bold quote within bold quote with same punctuation", func() { - + // kinda invalid content, and Asciidoc has the same way of parsing this content source := "*some *nested bold* content*." expected := `

some *nested bold content*.

diff --git a/pkg/renderer/sgml/xhtml5/suite_test.go b/pkg/renderer/sgml/xhtml5/suite_test.go index 9e03bad9..6f4067aa 100644 --- a/pkg/renderer/sgml/xhtml5/suite_test.go +++ b/pkg/renderer/sgml/xhtml5/suite_test.go @@ -2,12 +2,13 @@ package xhtml5_test import ( "bytes" + "strings" + "github.com/bytesparadise/libasciidoc" "github.com/bytesparadise/libasciidoc/pkg/configuration" . "github.com/onsi/ginkgo" //nolint golint . "github.com/onsi/gomega" //nolint golint log "github.com/sirupsen/logrus" - "strings" "testing" @@ -16,7 +17,7 @@ import ( func RenderXHTML(actual string, settings ...configuration.Setting) (string, error) { config := configuration.NewConfiguration(settings...) - configuration.WithBackEnd("xhtml5")(&config) + configuration.WithBackEnd("xhtml5")(config) contentReader := strings.NewReader(actual) resultWriter := bytes.NewBuffer(nil) @@ -31,14 +32,12 @@ func RenderXHTML(actual string, settings ...configuration.Setting) (string, erro } // RenderXHTML5Title renders the HTML body using the given source -func RenderXHTML5Title(actual string, options ...configuration.Setting) (string, error) { - config := configuration.NewConfiguration(configuration.WithBackEnd("xhtml5")) - for _, set := range options { - set(&config) - } +func RenderXHTML5Title(actual string) (string, error) { contentReader := strings.NewReader(actual) resultWriter := bytes.NewBuffer(nil) - metadata, err := libasciidoc.Convert(contentReader, resultWriter, config) + metadata, err := libasciidoc.Convert(contentReader, + resultWriter, + configuration.NewConfiguration(configuration.WithBackEnd("xhtml5"))) if err != nil { return "", err } diff --git a/pkg/renderer/sgml/xhtml5/table_of_contents_test.go b/pkg/renderer/sgml/xhtml5/table_of_contents_test.go index 2f9dc4ed..f10b83bf 100644 --- a/pkg/renderer/sgml/xhtml5/table_of_contents_test.go +++ b/pkg/renderer/sgml/xhtml5/table_of_contents_test.go @@ -1,7 +1,6 @@ package xhtml5_test import ( - "github.com/bytesparadise/libasciidoc/pkg/types" . "github.com/bytesparadise/libasciidoc/testsupport" . "github.com/onsi/ginkgo" //nolint golint @@ -192,222 +191,222 @@ level 1 sections not exists.` }) }) -var _ = Describe("table of contents initialization", func() { - - Context("document without section", func() { - - It("should return empty table of contents when doc has no section", func() { - actual := types.Document{ - Attributes: types.Attributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - } - expected := types.TableOfContents{ - Sections: []types.ToCSection{}, - } - Expect(TableOfContents(actual)).To(Equal(expected)) - }) - }) - - Context("document with sections", func() { - - doctitle := []interface{}{ - types.StringElement{Content: "a header"}, - } - sectionATitle := []interface{}{ - types.StringElement{Content: "Section A with link to "}, - types.InlineLink{ - Location: types.Location{ - Scheme: "https://", - Path: []interface{}{ - types.StringElement{ - Content: "redhat.com", - }, - }, - }, - }, - } - sectionAaTitle := []interface{}{ - types.StringElement{Content: "Section A.a "}, - types.FootnoteReference{ - ID: 1, - Ref: "foo", - }, - } - sectionAa1Title := []interface{}{ - types.StringElement{Content: "Section A.a.1"}, - } - sectionBTitle := []interface{}{ - types.StringElement{Content: "Section B"}, - } - document := types.Document{ - Attributes: types.Attributes{}, - ElementReferences: types.ElementReferences{ - "_a_header": doctitle, - "_section_a": sectionATitle, - "_section_a_a": sectionAaTitle, - "_section_b": sectionBTitle, - }, - Footnotes: []types.Footnote{ - { - ID: 1, - Ref: "foo", - }, - }, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_a_header", - }, - Level: 0, - Title: doctitle, - Elements: []interface{}{ - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a", - }, - Level: 1, - Title: sectionATitle, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a", - }, - Level: 2, - Title: sectionAaTitle, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_a_a_1", - }, - Level: 3, - Title: sectionAa1Title, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{}, - Lines: [][]interface{}{ - {types.StringElement{Content: "a paragraph"}}, - }, - }, - }, - }, - }, - }, - }, - }, - types.Section{ - Attributes: types.Attributes{ - types.AttrID: "_section_b", - }, - Level: 1, - Title: sectionBTitle, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a paragraph"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - - It("should return table of contents with section level 1,2,3,2 with default level", func() { - delete(document.Attributes, types.AttrTableOfContentsLevels) - expected := types.TableOfContents{ - Sections: []types.ToCSection{ - { - ID: "_section_a", - Level: 1, - Title: "Section A with link to https://redhat.com", - Children: []types.ToCSection{ - { - - ID: "_section_a_a", - Level: 2, - Title: "Section A.a [1]", - Children: []types.ToCSection{}, - }, - }, - }, - { - ID: "_section_b", - Level: 1, - Title: "Section B", - Children: []types.ToCSection{}, - }, - }, - } - Expect(TableOfContents(document)).To(Equal(expected)) - }) - - It("should return table of contents with section level 1,2,3,2 with custom level", func() { - document.Attributes[types.AttrTableOfContentsLevels] = "4" // must be a string - expected := types.TableOfContents{ - Sections: []types.ToCSection{ - { - ID: "_section_a", - Level: 1, - Title: "Section A with link to https://redhat.com", - Children: []types.ToCSection{ - { - - ID: "_section_a_a", - Level: 2, - Title: "Section A.a [1]", - Children: []types.ToCSection{ - { - - ID: "_section_a_a_1", - Level: 3, - Title: "Section A.a.1", - Children: []types.ToCSection{}, - }, - }, - }, - }, - }, - { - ID: "_section_b", - Level: 1, - Title: "Section B", - Children: []types.ToCSection{}, - }, - }, - } - Expect(TableOfContents(document)).To(Equal(expected)) - }) - }) - -}) +// var _ = Describe("table of contents initialization", func() { + +// Context("document without section", func() { + +// It("should return empty table of contents when doc has no section", func() { +// actual := &types.Document{ +// Attributes: types.Attributes{}, +// ElementReferences: types.ElementReferences{}, +// Footnotes: []*types.Footnote{}, +// Elements: []interface{}{ +// types.Paragraph{ +// Attributes: types.Attributes{}, +// Lines: [][]interface{}{ +// { +// &types.StringElement{Content: "a paragraph"}, +// }, +// }, +// }, +// }, +// } +// expected := types.TableOfContents{ +// Sections: []*types.ToCSection{}, +// } +// Expect(TableOfContents(actual)).To(Equal(expected)) +// }) +// }) + +// Context("document with sections", func() { + +// doctitle := []interface{}{ +// &types.StringElement{Content: "a header"}, +// } +// sectionATitle := []interface{}{ +// &types.StringElement{Content: "Section A with link to "}, +// &types.InlineLink{ +// Location: &types.Location{ +// Scheme: "https://", +// Path: []interface{}{ +// &types.StringElement{ +// Content: "redhat.com", +// }, +// }, +// }, +// }, +// } +// sectionAaTitle := []interface{}{ +// &types.StringElement{Content: "Section A.a "}, +// &types.FootnoteReference{ +// ID: 1, +// Ref: "foo", +// }, +// } +// sectionAa1Title := []interface{}{ +// &types.StringElement{Content: "Section A.a.1"}, +// } +// sectionBTitle := []interface{}{ +// &types.StringElement{Content: "Section B"}, +// } +// document := &types.Document{ +// Attributes: types.Attributes{}, +// ElementReferences: types.ElementReferences{ +// "_a_header": doctitle, +// "_section_a": sectionATitle, +// "_section_a_a": sectionAaTitle, +// "_section_b": sectionBTitle, +// }, +// Footnotes: []*types.Footnote{ +// { +// ID: 1, +// Ref: "foo", +// }, +// }, +// Elements: []interface{}{ +// types.Section{ +// Attributes: types.Attributes{ +// types.AttrID: "_a_header", +// }, +// Level: 0, +// Title: doctitle, +// Elements: []interface{}{ +// types.Section{ +// Attributes: types.Attributes{ +// types.AttrID: "_section_a", +// }, +// Level: 1, +// Title: sectionATitle, +// Elements: []interface{}{ +// types.Paragraph{ +// Attributes: types.Attributes{}, +// Lines: [][]interface{}{ +// { +// &types.StringElement{Content: "a paragraph"}, +// }, +// }, +// }, +// types.Section{ +// Attributes: types.Attributes{ +// types.AttrID: "_section_a_a", +// }, +// Level: 2, +// Title: sectionAaTitle, +// Elements: []interface{}{ +// types.Paragraph{ +// Attributes: types.Attributes{}, +// Lines: [][]interface{}{ +// { +// &types.StringElement{Content: "a paragraph"}, +// }, +// }, +// }, +// types.Section{ +// Attributes: types.Attributes{ +// types.AttrID: "_section_a_a_1", +// }, +// Level: 3, +// Title: sectionAa1Title, +// Elements: []interface{}{ +// types.Paragraph{ +// Attributes: types.Attributes{}, +// Lines: [][]interface{}{ +// {types.StringElement{Content: "a paragraph"}}, +// }, +// }, +// }, +// }, +// }, +// }, +// }, +// }, +// types.Section{ +// Attributes: types.Attributes{ +// types.AttrID: "_section_b", +// }, +// Level: 1, +// Title: sectionBTitle, +// Elements: []interface{}{ +// types.Paragraph{ +// Attributes: types.Attributes{}, +// Lines: [][]interface{}{ +// { +// &types.StringElement{Content: "a paragraph"}, +// }, +// }, +// }, +// }, +// }, +// }, +// }, +// }, +// } + +// It("should return table of contents with section level 1,2,3,2 with default level", func() { +// delete(document.Attributes, types.AttrTableOfContentsLevels) +// expected := types.TableOfContents{ +// Sections: []*types.ToCSection{ +// { +// ID: "_section_a", +// Level: 1, +// Title: "Section A with link to https://redhat.com", +// Children: []*types.ToCSection{ +// { + +// ID: "_section_a_a", +// Level: 2, +// Title: "Section A.a [1]", +// Children: []*types.ToCSection{}, +// }, +// }, +// }, +// { +// ID: "_section_b", +// Level: 1, +// Title: "Section B", +// Children: []*types.ToCSection{}, +// }, +// }, +// } +// Expect(TableOfContents(document)).To(Equal(expected)) +// }) + +// It("should return table of contents with section level 1,2,3,2 with custom level", func() { +// document.Attributes[types.AttrTableOfContentsLevels] = "4" // must be a string +// expected := types.TableOfContents{ +// Sections: []*types.ToCSection{ +// { +// ID: "_section_a", +// Level: 1, +// Title: "Section A with link to https://redhat.com", +// Children: []*types.ToCSection{ +// { + +// ID: "_section_a_a", +// Level: 2, +// Title: "Section A.a [1]", +// Children: []*types.ToCSection{ +// { + +// ID: "_section_a_a_1", +// Level: 3, +// Title: "Section A.a.1", +// Children: []*types.ToCSection{}, +// }, +// }, +// }, +// }, +// }, +// { +// ID: "_section_b", +// Level: 1, +// Title: "Section B", +// Children: []*types.ToCSection{}, +// }, +// }, +// } +// Expect(TableOfContents(document)).To(Equal(expected)) +// }) +// }) + +// }) diff --git a/pkg/renderer/sgml/xhtml5/templates.go b/pkg/renderer/sgml/xhtml5/templates.go index 9e9577f8..3bfe6f04 100644 --- a/pkg/renderer/sgml/xhtml5/templates.go +++ b/pkg/renderer/sgml/xhtml5/templates.go @@ -40,7 +40,7 @@ func init() { // Render renders the document to the output, using a default instance // of the renderer, with default templates. -func Render(ctx *renderer.Context, doc types.Document, output io.Writer) (types.Metadata, error) { +func Render(ctx *renderer.Context, doc *types.Document, output io.Writer) (types.Metadata, error) { return defaultRenderer.Render(ctx, doc, output) } diff --git a/pkg/renderer/sgml/xhtml5/xhtml5_test.go b/pkg/renderer/sgml/xhtml5/xhtml5_test.go index aea2fd5b..d044faee 100644 --- a/pkg/renderer/sgml/xhtml5/xhtml5_test.go +++ b/pkg/renderer/sgml/xhtml5/xhtml5_test.go @@ -133,7 +133,7 @@ Last updated {{.LastUpdated}} It("document with custom icon attributes", func() { // given - attrs := map[string]string{ + attrs := map[string]interface{}{ "icons": "font", "source-highlighter": "pygments", } @@ -166,7 +166,7 @@ a note It("document without custom icon attributes", func() { // given - attrs := map[string]string{} + attrs := map[string]interface{}{} source := `[source] ---- foo @@ -328,7 +328,7 @@ Last updated {{.LastUpdated}} ` now := time.Now() Expect(RenderXHTML(source, configuration.WithFilename("test.adoc"), - configuration.WithAttributes(map[string]string{ + configuration.WithAttributes(map[string]interface{}{ types.AttrDocType: "manpage", }), configuration.WithCSS("/path/to/style.css"), @@ -446,7 +446,7 @@ Free use of this software is granted under the terms of the MIT License.

` now := time.Now() Expect(RenderXHTML(source, configuration.WithFilename("test.adoc"), - configuration.WithAttributes(map[string]string{ + configuration.WithAttributes(map[string]interface{}{ types.AttrDocType: "manpage", }), configuration.WithCSS("/path/to/style.css"), diff --git a/pkg/types/attributes.go b/pkg/types/attributes.go index 430248de..76a92b9c 100644 --- a/pkg/types/attributes.go +++ b/pkg/types/attributes.go @@ -117,6 +117,8 @@ const ( AttrFloat = "float" // AttrCols the table columns attribute AttrCols = "cols" + // AttrAutowidth the `autowidth` attribute on a table + AttrAutowidth = "autowidth" // AttrPositionalPrefix positional parameter prefix (DEPRECATED - use `AttrPositionalIndex`) AttrPositionalPrefix = "@" // AttrPositionalIndex positional parameter index @@ -147,6 +149,10 @@ const ( AttrWarningCaption = "warning-caption" // AttrSubstitutions the "subs" attribute to configure substitutions on delimited blocks and paragraphs AttrSubstitutions = "subs" + // AttrImagesDir the `imagesdir` attribute + AttrImagesDir = "imagesdir" + // AttrXRefLabel the label of a cross reference + AttrXRefLabel = "xrefLabel" ) // Attribute is a key/value pair wrapper @@ -168,43 +174,66 @@ func NewAttributes(attributes ...interface{}) (Attributes, error) { positionalIndex := 0 for _, attr := range attributes { switch attr := attr.(type) { - case PositionalAttribute: + case *PositionalAttribute: positionalIndex++ attr.Index = positionalIndex result.Set(attr.Key(), attr.Value) - case Attribute: + case *Attribute: result.Set(attr.Key, attr.Value) - case Attributes: // when an there were multiple attributes, eg: `[quote,author,title]` - result.SetAll(attr) - case nil: - // ignore default: return nil, fmt.Errorf("unexpected type of attribute: '%[1]T' (%[1]v)", attr) } } - if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("initialized attributes:") - spew.Fdump(log.StandardLogger().Out, result) + return result, nil +} + +func (a Attributes) Clone() Attributes { + result := Attributes{} + for k, v := range a { + result[k] = v + } + return result +} +func MergeAttributes(attributes ...interface{}) (Attributes, error) { + if len(attributes) == 0 { + return nil, nil + } + result := Attributes{} + for _, attr := range attributes { + switch attr := attr.(type) { + case *Attribute: + result.Set(attr.Key, attr.Value) + case Attributes: // when an there were multiple attributes, eg: `[quote,author,title]` + result.AddAll(attr) + default: + return nil, fmt.Errorf("unexpected type of attribute: '%[1]T' (%[1]v)", attr) + } } return result, nil } -func toAttributes(attrs interface{}) Attributes { - if attrs, ok := attrs.(Attributes); ok { - return attrs +// NilIfEmpty returns `nil` if this `attributes` is empty +func (a Attributes) AddAll(others Attributes) Attributes { + if others == nil { + return a } - return nil + if a == nil { + a = Attributes{} + } + for k, v := range others { + a.Set(k, v) + } + return a } func toAttributesWithMapping(attrs interface{}, mapping map[string]string) Attributes { // if log.IsLevelEnabled(log.DebugLevel) { - // log.Debug("processing attributes with mapping on") - // spew.Fdump(log.StandardLogger().Out, attrs) + // log.Debugf("processing attributes with mapping on\n%s", spew.Sdump(attrs)) // } if attrs, ok := attrs.(Attributes); ok { for source, target := range mapping { if v, exists := attrs[source]; exists { - if v != nil { + if v != nil && v != "" { // nil and empty values are discarded (ie, not mapped to target key) // (a bit hack-ish) make sure that `roles` is an `[]interface{}` if it came from a positional (1) attribute if source == AttrPositional1 && target == AttrRoles { v = []interface{}{v} @@ -212,8 +241,8 @@ func toAttributesWithMapping(attrs interface{}, mapping map[string]string) Attri // do not override if already exists if _, exists := attrs[target]; !exists { - // if key == value, replace value with `true`, so we don't have something - // like `linenums=linenums` + // if key == value, replace value with `true`, + // so we don't have something such as `linenums=linenums` if target == v { attrs[target] = true } else { @@ -224,92 +253,18 @@ func toAttributesWithMapping(attrs interface{}, mapping map[string]string) Attri delete(attrs, source) } } - // if log.IsLevelEnabled(log.DebugLevel) { - // log.Debug("processed attributes with mapping:") - // spew.Fdump(log.StandardLogger().Out, attrs) - // } if len(attrs) == 0 { return nil } return attrs } - return nil } -// // NewAttributeGroup initializes an AttributeGroup -// // We always pass in an array of Attributes. Special handling for certain attributes: -// // -// // AttrID - these are strings, the first occurrence of this wins, and we set AttrCustomID -// // AttrRoles - these are strings, we append them into an array -// // AttrOptions - comma separated list, we split and put into a map -// func NewAttributeGroup(attributes ...interface{}) (Attributes, error) { -// if len(attributes) == 0 { -// return nil, nil -// } -// result := Attributes{} -// for _, item := range attributes { -// if item == nil { -// continue -// } -// var attrs Attributes -// var err error -// switch item := item.(type) { -// case Attribute: -// attrs = Attributes{ -// item.Key: item.Value, -// } -// case Attributes: -// attrs = item -// case []interface{}: -// attrs, err = NewAttributeGroup(item...) -// if err != nil { -// return nil, err -// } -// default: -// return nil, fmt.Errorf("unexpected type of attributes: %T", item) -// } -// for k, v := range attrs { -// switch k { -// case AttrID: -// // The first ID set wins. -// result[AttrID] = v -// case AttrRoles: -// result.append(AttrRoles, v) -// case AttrOptions, AttrOpts: // TODO handle the split in the `NewOptionAttribute` func -// if !result.Has(AttrOptions) { -// result[AttrOptions] = map[string]bool{} -// } -// m := result[AttrOptions].(map[string]bool) -// switch v := v.(type) { -// case string: -// for _, o := range strings.Split(v, ",") { -// m[o] = true -// } -// case map[string]bool: -// for o := range v { -// m[o] = v[o] -// } -// } -// default: -// result[k] = v -// } -// } -// } -// if len(result) == 0 { -// return nil, nil // don't retain groups with no attribute -// } -// if log.IsLevelEnabled(log.DebugLevel) { -// log.Debug("new attribute group:") -// spew.Fdump(log.StandardLogger().Out, result) -// } -// return result, nil -// } - // HasAttributeWithValue checks that there is an entry for the given key/value pair func HasAttributeWithValue(attributes interface{}, key string, value interface{}) bool { switch a := attributes.(type) { - case Attribute: + case *Attribute: if a.Key == key && a.Value == value { return true } @@ -332,10 +287,6 @@ func HasAttributeWithValue(attributes interface{}, key string, value interface{} // HasNotAttribute checks that there is no entry for the given key func HasNotAttribute(attributes interface{}, key string) bool { switch a := attributes.(type) { - case Attribute: - if a.Key == key { - return false - } case Attributes: if _, ok := a[key]; ok { return false @@ -357,78 +308,67 @@ type PositionalAttribute struct { Value interface{} } -// Key returns the "temporary" key, based on the attribute index. -func (a PositionalAttribute) Key() string { - return AttrPositionalIndex + strconv.Itoa(a.Index) -} - // NewPositionalAttribute returns a new attribute who key is the position in the group -func NewPositionalAttribute(value interface{}) (PositionalAttribute, error) { - result := PositionalAttribute{ +func NewPositionalAttribute(value interface{}) (*PositionalAttribute, error) { + return &PositionalAttribute{ Value: value, - } - if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("new positional attribute:") - spew.Fdump(log.StandardLogger().Out, result) - } - return result, nil + }, nil +} + +// Key returns the "temporary" key, based on the attribute index. +func (a *PositionalAttribute) Key() string { + return AttrPositionalIndex + strconv.Itoa(a.Index) } // NewOptionAttribute sets a boolean option. -func NewOptionAttribute(options interface{}) (Attribute, error) { - return Attribute{ +func NewOptionAttribute(options interface{}) (*Attribute, error) { + return &Attribute{ Key: AttrOption, Value: Reduce(options), }, nil } // NewNamedAttribute a named (or positional) element -func NewNamedAttribute(key string, value interface{}) (Attribute, error) { +func NewNamedAttribute(key string, value interface{}) (*Attribute, error) { value = Reduce(value) if key == AttrOpts { // Handle the alias key = AttrOptions } - if log.IsLevelEnabled(log.DebugLevel) { - // log.Debugf("new named attribute '%s':", key) - spew.Fdump(log.StandardLogger().Out, value) - } - return Attribute{ + return &Attribute{ Key: key, Value: value, }, nil } // NewInlineIDAttribute initializes a new attribute map with a single entry for the ID using the given value -func NewInlineIDAttribute(id string) (Attribute, error) { - // log.Debugf("initializing a new inline ElementID with ID=%s", id) - return Attribute{ +func NewInlineIDAttribute(id string) (*Attribute, error) { + return &Attribute{ Key: AttrID, Value: id, }, nil } // NewTitleAttribute initializes a new attribute map with a single entry for the title using the given value -func NewTitleAttribute(title interface{}) (Attribute, error) { +func NewTitleAttribute(title interface{}) (*Attribute, error) { // log.Debugf("initializing a new Title attribute with content=%v", title) - return Attribute{ + return &Attribute{ Key: AttrTitle, Value: title, }, nil } // NewRoleAttribute initializes a new attribute map with a single entry for the title using the given value -func NewRoleAttribute(role interface{}) (Attribute, error) { +func NewRoleAttribute(role interface{}) (*Attribute, error) { role = Reduce(role) - return Attribute{ + return &Attribute{ Key: AttrRole, Value: role, }, nil } // NewIDAttribute initializes a new attribute map with a single entry for the ID using the given value -func NewIDAttribute(id interface{}) (Attribute, error) { - // log.Debugf("initializing a new ID attribute with ID='%v'", id) - return Attribute{ +func NewIDAttribute(id interface{}) (*Attribute, error) { + return &Attribute{ Key: AttrID, Value: id, }, nil @@ -436,27 +376,30 @@ func NewIDAttribute(id interface{}) (Attribute, error) { // Set adds the given attribute to the current ones // with some `key` replacements/grouping (Role->Roles and Option->Options) +// returns the new `Attributes` if the current instance was `nil` func (a Attributes) Set(key string, value interface{}) Attributes { - // log.Debugf("setting attribute %s=%v", key, value) + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("setting attribute %s=%s", key, spew.Sdump(value)) + } if a == nil { a = Attributes{} } switch key { case AttrRole: if roles, ok := a[AttrRoles].([]interface{}); ok { - // log.Debugf("appending role to existin one(s): %v", value) + log.Debugf("appending role to existing ones: %v", value) a[AttrRoles] = append(roles, value) } else { - // log.Debugf("setting first role: %v (%T)", value, a[AttrRoles]) + log.Debugf("setting first role: %v", value) a[AttrRoles] = []interface{}{value} } case AttrRoles: if r, ok := value.([]interface{}); ok { // value should be an []interface{} if roles, ok := a[AttrRoles].([]interface{}); ok { - // log.Debugf("appending role to existin one(s): %v", value) + log.Debugf("appending role to existing ones: %v", value) a[AttrRoles] = append(roles, r...) } else { - // log.Debugf("setting first role: %v (%T)", value, a[AttrRoles]) + log.Debugf("overridding roles: %v -> %v", a[AttrRoles], r) a[AttrRoles] = r } } @@ -469,18 +412,13 @@ func (a Attributes) Set(key string, value interface{}) Attributes { default: a[key] = value } - if log.IsLevelEnabled(log.DebugLevel) { - spew.Fdump(log.StandardLogger().Out, a) - - } return a } // SetAll adds the given attributes to the current ones func (a Attributes) SetAll(attr interface{}) Attributes { - log.Debug("setting attributes") switch attr := attr.(type) { - case Attribute: + case *Attribute: if a == nil { a = Attributes{} } @@ -537,6 +475,20 @@ func (a Attributes) GetAsString(key string) (string, bool, error) { return "", false, nil } +// GetAsIntWithDefault gets the int value for the given key , +// or default if none was found, +func (a Attributes) GetAsIntWithDefault(key string, defaultValue int) int { + switch v := a[key].(type) { + case int: + return v + case string: + if result, err := strconv.Atoi(v); err == nil { + return result + } + } + return defaultValue +} + func asString(v interface{}) (string, error) { switch v := v.(type) { case string: @@ -575,39 +527,3 @@ func (a Attributes) GetAsStringWithDefault(key, defaultValue string) string { } return defaultValue } - -// GetAsBool returns the value of the key as a bool, or `false` if the key did not exist -// or if its value was not a bool -func (a Attributes) GetAsBool(key string) bool { - if v, ok := a[key]; ok { - if v, ok := v.(bool); ok { - return v - } - } - return false -} - -// AddNonEmpty adds the given attribute if its value is non-nil and non-empty -// TODO: raise a warning if there was already a name/value -func (a Attributes) AddNonEmpty(key string, value interface{}) { - // do not add nil or empty values - if value == "" { - return - } - a[key] = value -} - -// Positionals returns all positional attributes, ie, the values for the keys in the form of `positional-` -func (a Attributes) Positionals() [][]interface{} { - result := make([][]interface{}, 0, len(a)) - i := 0 - for { - i++ - if arg, ok := a["positional-"+strconv.Itoa(i)].([]interface{}); ok { - result = append(result, arg) - continue - } - break - } - return result -} diff --git a/pkg/types/document_attributes_overrides.go b/pkg/types/document_attributes_overrides.go deleted file mode 100644 index d5a7592f..00000000 --- a/pkg/types/document_attributes_overrides.go +++ /dev/null @@ -1,66 +0,0 @@ -package types - -// AttributesWithOverrides the document attributes with some overrides provided by the CLI (for example) -type AttributesWithOverrides struct { - Content map[string]interface{} - Overrides map[string]string - Counters map[string]interface{} -} - -// All returns all attributes, or `nil` if there is none -func (a AttributesWithOverrides) All() Attributes { - if len(a.Content) == 0 && len(a.Overrides) == 0 { - return nil - } - result := Attributes{} - for k, v := range a.Content { - result[k] = v - } - for k, v := range a.Overrides { - result[k] = v - } - return result -} - -// Set sets the given attribute -func (a AttributesWithOverrides) Set(key string, value interface{}) { - a.Content[key] = value -} - -// Add adds the given attributes -func (a AttributesWithOverrides) Add(attrs map[string]interface{}) { - for k, v := range attrs { - a.Content[k] = v - } -} - -// GetAsString gets the string value for the given key (+ `true`), -// or empty string (+ `false`) if none was found -func (a AttributesWithOverrides) GetAsString(key string) (string, bool) { - // if value is overridden - if value, found := a.Overrides[key]; found { - return value, true - } - // if value is reset - if _, found := a.Overrides["!"+key]; found { - return "", false - } - if value, found := a.Content[key].(string); found { - return value, true - } - // TODO: raise a warning if there was no entry found - return "", false -} - -// GetAsStringWithDefault gets the string value for the given key, -// or returns the given default value -func (a AttributesWithOverrides) GetAsStringWithDefault(key, defaultValue string) string { - if value, found := a.Overrides[key]; found { - return value - } - if value, found := a.Content[key].(string); found { - return value - } - // TODO: raise a warning if there was no entry found - return defaultValue -} diff --git a/pkg/types/document_attributes_overrides_test.go b/pkg/types/document_attributes_overrides_test.go deleted file mode 100644 index 3286c2d0..00000000 --- a/pkg/types/document_attributes_overrides_test.go +++ /dev/null @@ -1,63 +0,0 @@ -package types_test - -import ( - "github.com/bytesparadise/libasciidoc/pkg/types" - - . "github.com/onsi/ginkgo/extensions/table" - . "github.com/onsi/gomega" //nolint golint -) - -var _ = DescribeTable("document attribute overrides", - func(key string, expectedValue string, expectedFound bool) { - // given - attributes := types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "normal": "ok", - "override": "ok, too", - }, - Overrides: map[string]string{ - "foo": "cheesecake", - "!bar": "", - "baz": "", - "override": "overridden", - }, - } - // when - value, found := attributes.GetAsString(key) - // then - Expect(found).To(Equal(expectedFound)) - Expect(value).To(Equal(expectedValue)) - }, - Entry("normal", "normal", "ok", true), - Entry("override", "override", "overridden", true), // entry is overridden - Entry("foo", "foo", "cheesecake", true), - Entry("!bar", "bar", "", false), // entry is reset - Entry("baz", "baz", "", true), // entry exists but its value is empty -) - -var _ = DescribeTable("document attribute overrides with default", - func(key string, expectedValue string) { - // given - attributes := types.AttributesWithOverrides{ - Content: map[string]interface{}{ - "normal": "ok", - "override": "ok, too", - }, - Overrides: map[string]string{ - "foo": "cheesecake", - "!bar": "", - "baz": "", - "override": "overridden", - }, - } - // when - value := attributes.GetAsStringWithDefault(key, "default") - // then - Expect(value).To(Equal(expectedValue)) - }, - Entry("normal", "normal", "ok"), - Entry("override", "override", "overridden"), // entry is overridden - Entry("foo", "foo", "cheesecake"), - Entry("!bar", "bar", "default"), // entry is reset, default is returned - Entry("baz", "baz", ""), // entry exists but its value is empty -) diff --git a/pkg/types/non_alphanumeric_replacement_test.go b/pkg/types/non_alphanumeric_replacement_test.go index 4c5a9760..f1af5a27 100644 --- a/pkg/types/non_alphanumeric_replacement_test.go +++ b/pkg/types/non_alphanumeric_replacement_test.go @@ -11,35 +11,35 @@ var _ = Describe("normalizing string", func() { It("hello", func() { source := []interface{}{ - types.StringElement{Content: "hello"}, + &types.StringElement{Content: "hello"}, } Expect(types.ReplaceNonAlphanumerics(source, "_")).To(Equal("hello")) }) It("héllo with an accent", func() { source := []interface{}{ - types.StringElement{Content: " héllo 1.2 and 3 Spaces"}, + &types.StringElement{Content: " héllo 1.2 and 3 Spaces"}, } Expect(types.ReplaceNonAlphanumerics(source, "_")).To(Equal("héllo_1_2_and_3_spaces")) }) It("a an accent and a swedish character", func() { source := []interface{}{ - types.StringElement{Content: `A à ⌘`}, + &types.StringElement{Content: `A à ⌘`}, } Expect(types.ReplaceNonAlphanumerics(source, "_")).To(Equal("a_à")) }) It("AŁA", func() { source := []interface{}{ - types.StringElement{Content: `AŁA 0.1 ?`}, + &types.StringElement{Content: `AŁA 0.1 ?`}, } Expect(types.ReplaceNonAlphanumerics(source, "_")).To(Equal("ała_0_1")) }) It("it's 2 spaces, here !", func() { source := []interface{}{ - types.StringElement{Content: `it's 2 spaces, here !`}, + &types.StringElement{Content: `it's 2 spaces, here !`}, } Expect(types.ReplaceNonAlphanumerics(source, "_")).To(Equal("it_s_2_spaces_here")) }) @@ -47,11 +47,11 @@ var _ = Describe("normalizing string", func() { It("content with markup", func() { // == a section title, with *bold content* source := []interface{}{ - types.StringElement{Content: "a section title, with"}, - types.QuotedText{ + &types.StringElement{Content: "a section title, with"}, + &types.QuotedText{ Kind: types.SingleQuoteBold, Elements: []interface{}{ - types.StringElement{Content: "bold content"}, + &types.StringElement{Content: "bold content"}, }, }, } @@ -61,13 +61,13 @@ var _ = Describe("normalizing string", func() { It("content with link", func() { // == a section title, with *bold content* source := []interface{}{ - types.StringElement{Content: "link to "}, - types.InlineLink{ + &types.StringElement{Content: "link to "}, + &types.InlineLink{ Attributes: types.Attributes{}, - Location: types.Location{ + Location: &types.Location{ Scheme: "https://", Path: []interface{}{ - types.StringElement{ + &types.StringElement{ Content: "foo.bar", }, }, diff --git a/pkg/types/non_alphanumerics_replacement.go b/pkg/types/non_alphanumerics_replacement.go index 559f627f..10328302 100644 --- a/pkg/types/non_alphanumerics_replacement.go +++ b/pkg/types/non_alphanumerics_replacement.go @@ -12,7 +12,7 @@ func ReplaceNonAlphanumerics(elements []interface{}, replacement string) (string buf := &strings.Builder{} for _, element := range elements { switch element := element.(type) { - case QuotedText: + case *QuotedText: r, err := ReplaceNonAlphanumerics(element.Elements, replacement) if err != nil { return "", err @@ -21,7 +21,7 @@ func ReplaceNonAlphanumerics(elements []interface{}, replacement string) (string buf.WriteString(replacement) } buf.WriteString(r) - case StringElement: + case *StringElement: r, err := replaceNonAlphanumerics(element.Content, replacement) if err != nil { return "", err @@ -30,7 +30,7 @@ func ReplaceNonAlphanumerics(elements []interface{}, replacement string) (string buf.WriteString(replacement) } buf.WriteString(r) - case InlineLink: + case *InlineLink: r, err := replaceNonAlphanumerics(element.Location.Stringify(), replacement) if err != nil { return "", err @@ -39,7 +39,7 @@ func ReplaceNonAlphanumerics(elements []interface{}, replacement string) (string buf.WriteString(replacement) } buf.WriteString(r) - case Icon: + case *Icon: s := element.Attributes.GetAsStringWithDefault(AttrImageAlt, element.Class) r, err := replaceNonAlphanumerics(s, replacement) if err != nil { diff --git a/pkg/types/table.go b/pkg/types/table.go deleted file mode 100644 index 2eddb2db..00000000 --- a/pkg/types/table.go +++ /dev/null @@ -1,277 +0,0 @@ -package types - -import ( - "fmt" - "math" - "strconv" - "strings" - - "github.com/pkg/errors" -) - -// ------------------------------------------ -// Tables -// ------------------------------------------ - -// TableColumn a table column -type TableColumn struct { - widthVal float64 // internally used number, will be 0 for automatic, cleared post processing - Width string // percentage or relative (0 for automatic) - HAlign string // left, right, or center - VAlign string // top, bottom, or middle - Style string // Single character -} - -var defaultColumn = TableColumn{ - widthVal: 1, - HAlign: "left", - VAlign: "top", -} - -// Table the structure for the tables -type Table struct { - Attributes Attributes - Header TableLine - Columns []TableColumn - Lines []TableLine -} - -// parseNum like atoi, but stops on non-digit character (and only unsigned) -func (t Table) parseNum(c string) (int, string) { - n := 0 - for c != "" && c[0] >= '0' && c[0] <= '9' { - n *= 10 - n += int(c[0] - '0') - c = c[1:] - } - return n, c -} - -func (t Table) parseColumnsAttr() ([]TableColumn, error) { - attr, ok, err := t.Attributes.GetAsString(AttrCols) - if err != nil { - return nil, err - } - if !ok { - return nil, nil - } - var cols []TableColumn - - for _, c := range strings.Split(attr, ",") { - c = strings.TrimSpace(c) - n := 0 - repeat := 1 - n, c = t.parseNum(c) - col := defaultColumn - if c == "" { - // If this was a number by itself, consider it a Width - col.widthVal = float64(n) - cols = append(cols, col) - continue - } - - if c[0] == '*' { - repeat = n - c = c[1:] - } else if n != 0 { - return nil, fmt.Errorf("bad column repeat (expected '*', got %s)", c) - } - - // Horizontal alignment - if c != "" { - switch c[0] { - case '<': - col.HAlign = "left" - c = c[1:] - case '>': - col.HAlign = "right" - c = c[1:] - case '^': - col.HAlign = "center" - c = c[1:] - } - } - - // Vertical alignment - if len(c) >= 2 && c[0] == '.' { - switch c[1] { - case '<': - col.VAlign = "top" - c = c[2:] - case '>': - col.VAlign = "bottom" - c = c[2:] - case '^': - col.VAlign = "middle" - c = c[2:] - default: - return nil, errors.New("bad column vertical alignment") - } - } - - // Width - if c != "" && c[0] == '~' { - col.widthVal = 0 // Auto-width - c = c[1:] - } else if c != "" && c[0] >= '0' && c[0] <= '9' { - n, c = t.parseNum(c) - col.widthVal = float64(n) - } - - // Style - must be the last item - switch c { - case "": // nothing left (no explicit style) - case "a", "e", "h", "l", "m", "s", "v": - col.Style = c - case "d": - col.Style = "" // leave default unset - default: - return nil, fmt.Errorf("bad column specification (%s unparsed)", c) - } - - for repeat > 0 { - cols = append(cols, col) - repeat-- - } - } - - return cols, nil -} - -func (t Table) processColumnWidths() ([]TableColumn, error) { - - widths := make([]float64, len(t.Columns)) - cols := make([]TableColumn, 0, len(t.Columns)) - - // Autowidth table uses full autowidth on all columns. - if !t.Attributes.HasOption("autowidth") { - - percent := false - total := 0.0 - for i, c := range t.Columns { - if c.widthVal == 0 { - percent = true - } - widths[i] = c.widthVal - total += c.widthVal - } - - if percent { - // Zero or more fixed percentages. - // At least one column automatically expanding to fill remainder. - if total > 100 { - return nil, fmt.Errorf("total widths (%f) cannot exceed 100%%", total) - } - } else { - // Relative widths, we have to calculate as percentages. - used := 0.0 - for i, v := range widths { - if i == len(widths)-1 { - // Last column uses remainder -- addresses rounding errors. - // (Also, faster, simpler math.) - v = 100 - used - } else { - // This rounds to nearest .001 percent. This allows us to - // use %.6g format in templates without precision loss. - v = v * 1000000 / total - v = math.Round(v) - v /= 10000 - } - used += v - widths[i] = v - } - } - } - - // This is a little more complex because we use pass by value. - for i, c := range t.Columns { - if widths[i] != 0 { - c.Width = strconv.FormatFloat(widths[i], 'g', 6, 64) - } - c.widthVal = 0 - cols = append(cols, c) - } - return cols, nil -} - -// NewTable initializes a new table with the given lines and attributes -func NewTable(header interface{}, lines []interface{}, attributes interface{}) (Table, error) { - t := Table{ - Attributes: toAttributes(attributes), - } - - var err error - if t.Columns, err = t.parseColumnsAttr(); err != nil { - return Table{}, errors.Wrap(err, "failed to initialize a Table element") - } - - if header, ok := header.(TableLine); ok { - t.Header = header - if t.Columns == nil { - // columns determined by our cell count here - for i := 0; i < len(header.Cells); i++ { - t.Columns = append(t.Columns, defaultColumn) - } - } - } - // need to regroup columns of all lines, they dispatch on lines - cells := make([][]interface{}, 0, len(lines)) - for _, l := range lines { - if l, ok := l.(TableLine); ok { - // if no header line was set, inspect the first line to determine the number of columns per line - if t.Columns == nil { - for i := 0; i < len(l.Cells); i++ { - t.Columns = append(t.Columns, defaultColumn) - } - } - cells = append(cells, l.Cells...) - } - } - - // Calculate the actual widths now - if t.Columns, err = t.processColumnWidths(); err != nil { - return Table{}, errors.Wrap(err, "failed to initialize a Table element") - } - - t.Lines = make([]TableLine, 0, len(cells)) - if len(lines) > 0 { - // log.Debugf("buffered %d columns for the table", len(cells)) - l := TableLine{ - Cells: make([][]interface{}, len(t.Columns)), - } - for i, c := range cells { - // log.Debugf("adding cell with content '%v' in table line at offset %d", c, i%len(t.Columns)) - l.Cells[i%len(t.Columns)] = c - if (i+1)%len(t.Columns) == 0 { // switch to next line - // log.Debugf("adding line with content '%v' in table", l) - t.Lines = append(t.Lines, l) - l = TableLine{ - Cells: make([][]interface{}, len(t.Columns)), - } - } - } - } - // log.Debugf("initialized a new table with %d line(s)", len(lines)) - return t, nil -} - -// TableLine a table line is made of columns, each column being a group of []interface{} (to support quoted text, etc.) -type TableLine struct { - Cells [][]interface{} -} - -// NewTableLine initializes a new TableLine with the given columns -func NewTableLine(columns []interface{}) (TableLine, error) { - c := make([][]interface{}, 0, len(columns)) - for _, column := range columns { - if e, ok := column.([]interface{}); ok { - c = append(c, e) - } else { - return TableLine{}, errors.Errorf("unsupported element of type %T", column) - } - } - // log.Debugf("initialized a new table line with %d columns", len(c)) - return TableLine{ - Cells: c, - }, nil -} diff --git a/pkg/types/types.go b/pkg/types/types.go index 85503a45..6a1fe472 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -9,101 +9,19 @@ import ( "github.com/davecgh/go-spew/spew" "github.com/pkg/errors" - "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus" - yaml "gopkg.in/yaml.v2" + "gopkg.in/yaml.v2" ) -// RawDocument document with a front-matter and raw blocks (will be refined in subsequent processing phases) -type RawDocument struct { - FrontMatter FrontMatter - Elements []interface{} -} - -// NewRawDocument initializes a new `RawDocument` from the given lines -func NewRawDocument(frontMatter interface{}, elements []interface{}) (RawDocument, error) { - // log.Debugf("new RawDocument with %d block element(s)", len(elements)) - result := RawDocument{ - Elements: elements, - } - if fm, ok := frontMatter.(FrontMatter); ok { - result.FrontMatter = fm - } - return result, nil -} - -// Attributes returns the document attributes on the top-level section -// and all the document attribute declarations at the top of the document only. -func (d RawDocument) Attributes() Attributes { - result := Attributes{} -elements: - for _, b := range d.Elements { - switch b := b.(type) { - case Section: - if b.Level == 0 { - // also, expand document authors and revision - if authors, ok := b.Attributes[AttrAuthors].([]DocumentAuthor); ok { - // move to the Document attributes - result.SetAll(expandAuthors(authors)) - delete(b.Attributes, AttrAuthors) - } - // also, expand document authors and revision - if revision, ok := b.Attributes[AttrRevision].(DocumentRevision); ok { - // move to the Document attributes - result.SetAll(expandRevision(revision)) - delete(b.Attributes, AttrRevision) - } - continue // allow to continue if the section is level 0 - } - break elements // otherwise, just stop - case AttributeDeclaration: - result.Set(b.Name, b.Value) - default: - break elements - } - } - // log.Debugf("document attributes: %+v", result) - return result -} - -// RawSection a document section (when processing file inclusions) -// We only care about the level here -type RawSection struct { - Level int - Title string - RawText string -} - // NewRawSection returns a new RawSection -func NewRawSection(level int, title string) (RawSection, error) { +func NewRawSection(level int, title []interface{}) (*Section, error) { // log.Debugf("new rawsection: '%s' (%d)", title, level) - return RawSection{ + return &Section{ Level: level, Title: title, }, nil } -var _ Stringer = RawSection{} - -// Stringify returns the string representation of this section, as it existed in the source document -func (s RawSection) Stringify() string { - return strings.Repeat("=", s.Level+1) + " " + s.Title -} - -// ------------------------------------------ -// Lines -// ------------------------------------------ - -// NewRawLine returns a new slice containing a single StringElement with the given content -func NewRawLine(content string) ([]interface{}, error) { - // log.Debugf("new line: '%v'", content) - return []interface{}{ - StringElement{ - Content: content, - }, - }, nil -} - // ------------------------------------------ // common interfaces // ------------------------------------------ @@ -113,95 +31,65 @@ type Stringer interface { Stringify() string } -// WithPlaceholdersInElements interface for all blocks in which elements can -// be substituted with placeholders while applying the substitutions -type WithPlaceholdersInElements interface { - RestoreElements(placeholders map[string]interface{}) interface{} -} - -// WithPlaceholdersInAttributes interface for all blocks in which attribute content can -// be substituted with placeholders while applying the substitutions -type WithPlaceholdersInAttributes interface { - RestoreAttributes(placeholders map[string]interface{}) interface{} -} - -// WithPlaceholdersInLocation interface for all blocks in which location elements can -// be substituted with placeholders while applying the substitutions -type WithPlaceholdersInLocation interface { - RestoreLocation(placeholders map[string]interface{}) interface{} -} - // RawText interface for the elements that can provide the raw text representation of this element // as it was (supposedly) written in the source document type RawText interface { RawText() (string, error) } -// ------------------------------------------ -// Substitution support -// ------------------------------------------ - -// WithCustomSubstitutions base interface for types on which custom substitutions apply -type WithCustomSubstitutions interface { - SubstitutionsToApply() ([]string, error) - DefaultSubstitutions() []string +// BlockWithAttributes base interface for types on which attributes can be substituted +type BlockWithAttributes interface { + GetAttributes() Attributes + AddAttributes(Attributes) + SetAttributes(Attributes) } -// WithAttributesToSubstitute base interface for types on which attributes can be substituted -type WithAttributesToSubstitute interface { - AttributesToSubstitute() Attributes - ReplaceAttributes(Attributes) interface{} +type WithElementAddition interface { + AddElement(interface{}) error } -// WithElementsToSubstitute interface for types on which elements can be substituted -type WithElementsToSubstitute interface { - ElementsToSubstitute() []interface{} - ReplaceElements([]interface{}) interface{} +type WithConditionalElementAddition interface { + WithElementAddition + CanAddElement(interface{}) bool } - -// WithLineSubstitution interface for types on which lines can be substituted -type WithLineSubstitution interface { - WithCustomSubstitutions - LinesToSubstitute() [][]interface{} - SubstituteLines([][]interface{}) interface{} +type BlockWithElements interface { + BlockWithAttributes + GetElements() []interface{} + SetElements([]interface{}) error } -// WithNestedElementSubstitution a block in which nested elements can be substituted -type WithNestedElementSubstitution interface { - WithCustomSubstitutions - WithElementsToSubstitute +type BlockWithLocation interface { + BlockWithAttributes + GetLocation() *Location + SetLocation(*Location) // TODO: unused? } -var defaultSubstitutionsForBlockElements = []string{ - "inline_passthrough", - "specialcharacters", - "quotes", - "attributes", - "replacements", - "macros", - "post_replacements", +// ------------------------------------------ +// Substitution support +// ------------------------------------------ + +// DocumentFragment a single fragment of document +type DocumentFragment struct { + Elements []interface{} + Error error } -var defaultExampleBlockSubstitutions = defaultSubstitutionsForBlockElements -var defaultQuoteBlockSubstitutions = defaultSubstitutionsForBlockElements -var defaultSidebarBlockSubstitutions = defaultSubstitutionsForBlockElements -var defaultVerseBlockSubstitutions = defaultSubstitutionsForBlockElements // even though it's a block of lines, not a block of blocks -var defaultParagraphSubstitutions = defaultSubstitutionsForBlockElements // even though it's a block of lines, not a block of blocks -// blocks of lines -var defaultSubstitutionsForBlockLines = []string{ - "callouts", // must be executed before "specialcharacters" - "specialcharacters", +func NewDocumentFragment(elements ...interface{}) DocumentFragment { + return DocumentFragment{ + Elements: elements, + } } -var defaultFencedBlockSubstitutions = defaultSubstitutionsForBlockLines -var defaultListingBlockSubstitutions = defaultSubstitutionsForBlockLines -var defaultLiteralBlockSubstitutions = defaultSubstitutionsForBlockLines -// other blocks -var defaultPassthroughBlockSubstitutions = []string{} +func NewErrorFragment(err error) DocumentFragment { + return DocumentFragment{ + Error: err, + } +} // ------------------------------------------ // Draft Document: document in which // all substitutions have been applied +// DEPRECATED // ------------------------------------------ // DraftDocument the linear-level structure for a document @@ -217,30 +105,39 @@ type DraftDocument struct { // Document the top-level structure for a document type Document struct { - Attributes Attributes + // Attributes Attributes // DEPRECATED Elements []interface{} // TODO: rename to `Blocks`? ElementReferences ElementReferences - Footnotes []Footnote -} - -// Authors retrieves the document authors from the document header, or empty array if no author was found -func (d Document) Authors() ([]DocumentAuthor, bool) { - if authors, ok := d.Attributes[AttrAuthors].([]DocumentAuthor); ok { - return authors, true - } - return []DocumentAuthor{}, false + Footnotes []*Footnote + TableOfContents *TableOfContents } // Header returns the header, i.e., the section with level 0 if it found as the first element of the document // For manpage documents, this also includes the first section (`Name` along with its first paragraph) -func (d Document) Header() (Section, bool) { +func (d *Document) Header() (*DocumentHeader, []interface{}, bool) { // TODO: remove `bool` return value? (consistency with other funcs) if len(d.Elements) == 0 { - return Section{}, false + log.Debug("no header for empty doc") + return nil, nil, false + } + elements := make([]interface{}, 0, len(d.Elements)) + for i, e := range d.Elements { + if h, ok := e.(*DocumentHeader); ok { + elements = append(elements, d.Elements[i+1:]...) + return h, elements, true + } + elements = append(elements, e) } - if section, ok := d.Elements[0].(Section); ok && section.Level == 0 { - return section, true + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("no header in document: %T", d.Elements[0]) } - return Section{}, false + return nil, elements, false +} + +var _ WithElementAddition = &Document{} + +func (d *Document) AddElement(element interface{}) error { + d.Elements = append(d.Elements, element) + return nil } // ------------------------------------------ @@ -252,13 +149,20 @@ type Metadata struct { Title string LastUpdated string TableOfContents TableOfContents - Authors []DocumentAuthor + Authors []*DocumentAuthor Revision DocumentRevision } +func NewTableOfContents(maxDepth int) *TableOfContents { + return &TableOfContents{ + maxDepth: maxDepth, + } +} + // TableOfContents the table of contents type TableOfContents struct { - Sections []ToCSection + maxDepth int + Sections []*ToCSection } // ToCSection a section in the table of contents @@ -266,7 +170,43 @@ type ToCSection struct { ID string Level int Title string // the title as it was rendered in HTML - Children []ToCSection + Children []*ToCSection +} + +// Add adds a ToCSection associated with the given Section +func (t *TableOfContents) Add(s *Section) { + if s.Level > t.maxDepth { + log.Debugf("skipping section with level %d (> %d)", s.Level, t.maxDepth) + // skip for elements with a too low level in the hierarchy + return + } + ts := &ToCSection{ + ID: s.GetAttributes().GetAsStringWithDefault(AttrID, ""), + Level: s.Level, + Title: stringify(s.Title), + } + // lookup the last child at the given section's level + if len(t.Sections) == 0 { + t.Sections = []*ToCSection{ts} + return + } else if s.Level == t.Sections[0].Level { + // add at top level + t.Sections = append(t.Sections, ts) + return + } + // look-up parent for the ts, starting with the last section at root level + parent := t.Sections[len(t.Sections)-1] + for { + if len(parent.Children) == 0 || + parent.Children[0].Level == s.Level { + // (first) child level matches section level + // or no child beneath current parent + break + } + // move to last child of current parent + parent = parent.Children[len(parent.Children)-1] + } + parent.Children = append(parent.Children, ts) } // ------------------------------------------ @@ -279,22 +219,119 @@ type DocumentElement interface { } // ------------------------------------------ -// Document Author +// Document Header // ------------------------------------------ -// DocumentAuthor a document author -type DocumentAuthor struct { - FullName string - Email string +type DocumentHeader struct { + Title []interface{} + Attributes Attributes + Elements []interface{} +} + +func NewDocumentHeader(title []interface{}, info interface{}, extraAttrs []interface{}) (*DocumentHeader, error) { + header := &DocumentHeader{ + Title: title, + } + elements := make([]interface{}, 0, 2+len(extraAttrs)) // estimated max capacity + if info, ok := info.(*DocumentInformation); ok { + if len(info.Authors) > 0 { + // header.Authors = info.Authors + elements = append(elements, &AttributeDeclaration{ + Name: AttrAuthors, + Value: info.Authors, + }) + } + if info.Revision != nil { + // header.Elements = append(header.Elements, info.Revision.Expand()...) + elements = append(elements, &AttributeDeclaration{ + Name: AttrRevision, + Value: info.Revision, + }) + } + + } + elements = append(elements, extraAttrs...) + if len(elements) > 0 { + header.Elements = elements + } + return header, nil +} + +func (h *DocumentHeader) Authors() DocumentAuthors { + for _, e := range h.Elements { + if e, ok := e.(*AttributeDeclaration); ok && e.Name == AttrAuthors { + if authors, ok := e.Value.(DocumentAuthors); ok { + return authors + } + } + } + return nil +} + +func (h *DocumentHeader) Revision() *DocumentRevision { + for _, e := range h.Elements { + if e, ok := e.(*AttributeDeclaration); ok && e.Name == AttrRevision { + if revision, ok := e.Value.(*DocumentRevision); ok { + return revision + } + } + } + return nil +} + +var _ BlockWithAttributes = &DocumentHeader{} + +func (h *DocumentHeader) GetAttributes() Attributes { + return h.Attributes +} + +// AddAttributes adds the attributes of this CalloutListElement +func (h *DocumentHeader) AddAttributes(attributes Attributes) { + h.Attributes = h.Attributes.AddAll(attributes) +} + +// ReplaceAttributes replaces the attributes in this section +func (h *DocumentHeader) SetAttributes(attributes Attributes) { + h.Attributes = attributes + if _, exists := h.Attributes[AttrID]; exists { + // needed to track custom ID during rendering + h.Attributes[AttrCustomID] = true + } +} + +type DocumentInformation struct { + Authors DocumentAuthors + Revision *DocumentRevision +} + +func NewDocumentInformation(authors DocumentAuthors, revision interface{}) (*DocumentInformation, error) { + if log.IsLevelEnabled(log.DebugLevel) { + log.Debug("new document info") + log.Debugf("authors: %s", spew.Sdump(authors)) + log.Debugf("revision: %s", spew.Sdump(revision)) + } + info := &DocumentInformation{ + Authors: authors, + } + if revision, ok := revision.(*DocumentRevision); ok { + info.Revision = revision + } + return info, nil } +// ------------------------------------------ +// Document Author +// ------------------------------------------ + +type DocumentAuthors []*DocumentAuthor + // NewDocumentAuthors converts the given authors into an array of `DocumentAuthor` -func NewDocumentAuthors(authors []interface{}) ([]DocumentAuthor, error) { +func NewDocumentAuthors(authors ...interface{}) (DocumentAuthors, error) { // log.Debugf("new array of document authors from `%+v`", authors) - result := make([]DocumentAuthor, len(authors)) + result := make([]*DocumentAuthor, len(authors)) for i, author := range authors { switch author := author.(type) { - case DocumentAuthor: + case *DocumentAuthor: result[i] = author default: return nil, errors.Errorf("unexpected type of author: %T", author) @@ -303,18 +340,110 @@ func NewDocumentAuthors(authors []interface{}) ([]DocumentAuthor, error) { return result, nil } +// Expand returns a map of attributes for the given authors. +// those attributes can be used in attribute substitutions in the document +func (authors DocumentAuthors) Expand() Attributes { + result := Attributes{} + result[AttrAuthors] = []*DocumentAuthor(authors) + for i, author := range authors { + result[key("author", i)] = author.FullName() + result[key("authorinitials", i)] = author.Initials() + result[key("firstname", i)] = author.FirstName + if author.MiddleName != "" { + result[key("middlename", i)] = author.MiddleName + } + if author.LastName != "" { + result[key("lastname", i)] = author.LastName + } + if author.Email != "" { + result[key("email", i)] = author.Email + } + } + // result = append(result, NewAttributeDeclaration(AttrAuthors, authors)) + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("authors: %s", spew.Sdump(result)) + } + return result +} + +func key(k string, i int) string { + if i == 0 { + return k + } + return k + "_" + strconv.Itoa(i+1) +} + +func initial(s string) string { + if len(s) > 0 { + return s[0:1] + } + return "" +} + +// DocumentAuthor a document author +type DocumentAuthor struct { + *DocumentAuthorFullName + Email string +} + // NewDocumentAuthor initializes a new DocumentAuthor -func NewDocumentAuthor(fullName, email interface{}) (DocumentAuthor, error) { - author := DocumentAuthor{} - if fullName, ok := fullName.(string); ok { - author.FullName = fullName +func NewDocumentAuthor(fullName, email interface{}) (*DocumentAuthor, error) { + author := &DocumentAuthor{} + if fullName, ok := fullName.(*DocumentAuthorFullName); ok { + author.DocumentAuthorFullName = fullName } if email, ok := email.(string); ok { - author.Email = email + author.Email = strings.TrimSpace(email) } return author, nil } +type DocumentAuthorFullName struct { + FirstName string + MiddleName string + LastName string +} + +func NewDocumentAuthorFullName(part1 string, part2, part3 interface{}) (*DocumentAuthorFullName, error) { + result := &DocumentAuthorFullName{ + FirstName: strings.ReplaceAll(part1, "_", " "), + } + // if part 3 is defined, then it's the last name + if lastName, ok := part3.(string); ok { + result.LastName = strings.TrimSpace(strings.ReplaceAll(lastName, "_", " ")) + if middleName, ok := part2.(string); ok { + result.MiddleName = strings.ReplaceAll(middleName, "_", " ") + } + + } else if lastName, ok := part2.(string); ok { + // otherwise, let's use part2 as the last name (and skip the middle name) + result.LastName = strings.ReplaceAll(lastName, "_", " ") + } + return result, nil +} + +func (n *DocumentAuthorFullName) FullName() string { + result := &strings.Builder{} + result.WriteString(n.FirstName) + if n.MiddleName != "" { + result.WriteString(" ") + result.WriteString(n.MiddleName) + } + if n.LastName != "" { + result.WriteString(" ") + result.WriteString(n.LastName) + } + return result.String() +} + +func (n *DocumentAuthorFullName) Initials() string { + return strings.Join([]string{ + initial(n.FirstName), + initial(n.MiddleName), + initial(n.LastName), + }, "") +} + // ------------------------------------------ // Document Revision // ------------------------------------------ @@ -327,7 +456,7 @@ type DocumentRevision struct { } // NewDocumentRevision intializes a new DocumentRevision -func NewDocumentRevision(revnumber, revdate, revremark interface{}) (DocumentRevision, error) { +func NewDocumentRevision(revnumber, revdate, revremark interface{}) (*DocumentRevision, error) { // log.Debugf("initializing document revision with revnumber=%v, revdate=%v, revremark=%v", revnumber, revdate, revremark) // remove the "v" prefix and trim spaces var number, date, remark string @@ -357,12 +486,29 @@ func NewDocumentRevision(revnumber, revdate, revremark interface{}) (DocumentRev return strings.TrimSpace(s) }) } - result := DocumentRevision{ + return &DocumentRevision{ Revnumber: number, Revdate: date, Revremark: remark, + }, nil +} + +// Expand returns a map of attributes for the given revision. +// those attributes can be used in attribute substitutions in the document +func (r *DocumentRevision) Expand() Attributes { + result := Attributes{} + result[AttrRevision] = r + if r.Revnumber != "" { + result["revnumber"] = r.Revnumber } - return result, nil + if r.Revdate != "" { + result["revdate"] = r.Revdate + } + if r.Revremark != "" { + result["revremark"] = r.Revremark + } + // log.Debugf("revision: %v", result) + return result } // ------------------------------------------ @@ -376,67 +522,22 @@ type AttributeDeclaration struct { } // NewAttributeDeclaration initializes a new AttributeDeclaration with the given name and optional value -func NewAttributeDeclaration(name string, value interface{}) (AttributeDeclaration, error) { - if log.IsLevelEnabled(log.DebugLevel) { - // log.Debugf("new AttributeDeclaration: '%s'", name) - spew.Fdump(log.StandardLogger().Out, value) - } - return AttributeDeclaration{ +func NewAttributeDeclaration(name string, value interface{}) *AttributeDeclaration { + return &AttributeDeclaration{ Name: name, Value: value, - }, nil -} - -var _ Stringer = AttributeDeclaration{} - -// Stringify returns the string representation of this attribute declaration, as it existed in the source document -func (a AttributeDeclaration) Stringify() string { - result := strings.Builder{} - result.WriteString(":" + a.Name + ":") - switch v := a.Value.(type) { - case string: - result.WriteString(" " + v) - case []interface{}: - result.WriteString(" ") - for _, e := range v { - switch e := e.(type) { - case StringElement: - result.WriteString(e.Content) - case AttributeSubstitution: - result.WriteString("{" + e.Name + "}") - } - } - } - return result.String() -} - -var _ WithElementsToSubstitute = AttributeDeclaration{} - -// ElementsToSubstitute returns this section's title so that substitutions can be applied onto its elements -func (a AttributeDeclaration) ElementsToSubstitute() []interface{} { - switch v := a.Value.(type) { - case []interface{}: - return v - default: - return []interface{}{v} } } -// ReplaceElements replaces the elements in this section -func (a AttributeDeclaration) ReplaceElements(value []interface{}) interface{} { - a.Value = Reduce(value, strings.TrimSpace) - return a -} - // AttributeReset the type for AttributeReset type AttributeReset struct { Name string } // NewAttributeReset initializes a new Document Attribute Resets. -func NewAttributeReset(attrName string) (AttributeReset, error) { - // log.Debugf("new AttributeReset: '%s'", attrName) - return AttributeReset{Name: attrName}, nil +func NewAttributeReset(attrName string) (*AttributeReset, error) { + log.Debugf("new AttributeReset: '%s'", attrName) + return &AttributeReset{Name: attrName}, nil } // AttributeSubstitution the type for AttributeSubstitution @@ -444,10 +545,19 @@ type AttributeSubstitution struct { Name string } -var _ RawText = AttributeSubstitution{} +// NewAttributeSubstitution initializes a new Attribute Substitutions +func NewAttributeSubstitution(name string) (interface{}, error) { + if isPrefedinedAttribute(name) { + return &PredefinedAttribute{Name: name}, nil + } + // log.Debugf("new AttributeSubstitution: '%s'", name) + return &AttributeSubstitution{Name: name}, nil +} + +var _ RawText = &AttributeSubstitution{} // RawText returns the raw text representation of this element as it was (supposedly) written in the source document -func (s AttributeSubstitution) RawText() (string, error) { +func (s *AttributeSubstitution) RawText() (string, error) { return "{" + s.Name + "}", nil } @@ -455,15 +565,6 @@ func (s AttributeSubstitution) RawText() (string, error) { // uses a predefined attribute type PredefinedAttribute AttributeSubstitution -// NewAttributeSubstitution initializes a new Attribute Substitutions -func NewAttributeSubstitution(name string) (interface{}, error) { - if isPrefedinedAttribute(name) { - return PredefinedAttribute{Name: name}, nil - } - // log.Debugf("new AttributeSubstitution: '%s'", name) - return AttributeSubstitution{Name: name}, nil -} - // CounterSubstitution is a counter, that may increment when it is substituted. // If Increment is set, then it will increment before being expanded. type CounterSubstitution struct { @@ -484,397 +585,372 @@ func NewCounterSubstitution(name string, hidden bool, val interface{}) (CounterS }, nil } -// StandaloneAttributes are attributes at the end of -// a delimited block or at the end of the doc, ie, not -// associated with any block. They shall be ignored/discarded -// in the final document -type StandaloneAttributes Attributes - -// NewStandaloneAttributes returns a new StandaloneAttributes element -func NewStandaloneAttributes(attributes interface{}) (StandaloneAttributes, error) { - log.Debug("new standalone attributes") - return StandaloneAttributes(toAttributes(attributes)), nil -} - // ------------------------------------------ -// Element kinds +// Preamble // ------------------------------------------ -const ( - // Fenced a fenced block - Fenced = "fenced" - // Listing a listing block - Listing = "listing" - // Example an example block - Example = "example" - // Comment a comment block - Comment = "comment" - // Quote a quote block - Quote = "quote" - // MarkdownQuote a quote block in the Markdown style - MarkdownQuote = "markdown-quote" - // Verse a verse block - Verse = "verse" - // Sidebar a sidebar block - Sidebar = "sidebar" - // Literal a literal block - Literal = "literal" - // Source a source block - Source = "source" - // Passthrough a passthrough block - Passthrough = "pass" +// Preamble the structure for document Preamble +type Preamble struct { + Elements []interface{} + TableOfContents *TableOfContents +} - // AttrSourceBlockOption the option set on a source block, using the `source%