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..0c607b22 100644 --- a/cmd/libasciidoc/root_cmd.go +++ b/cmd/libasciidoc/root_cmd.go @@ -119,8 +119,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/go.mk b/make/go.mk index 4363a0a0..30f1b184 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 +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; @@ -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..92b70b94 100644 --- a/make/test.mk +++ b/make/test.mk @@ -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 deleted file mode 100644 index e9d714be..00000000 --- a/pkg/parser/document_processing.go +++ /dev/null @@ -1,84 +0,0 @@ -package parser - -import ( - "fmt" - "io" - - "github.com/bytesparadise/libasciidoc/pkg/configuration" - "github.com/bytesparadise/libasciidoc/pkg/types" - "github.com/davecgh/go-spew/spew" - 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 - } - - 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) - if err != nil { - return types.Document{}, 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 - } - // 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) - } - 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..e7838895 --- /dev/null +++ b/pkg/parser/document_processing__aggregate.go @@ -0,0 +1,238 @@ +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(attrs) > 0 { + // root.Attributes = attrs + // } + 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 lookupPreamble(doc *types.Document) *types.Preamble { +// if _, _, exists := doc.Header(); !exists { +// log.Debug("skipping preamble: no header in doc") +// return nil +// } +// for _, e := range doc.Elements { +// switch e := e.(type) { +// case *types.Preamble: +// return e +// case *types.Section: +// return nil // not found +// default: +// // continue +// } +// } +// 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 + } + // switch ctx.attributes.GetAsStringWithDefault(types.AttrTableOfContents, "") { + // case "preamble": + // preamble := lookupPreamble(doc) + // if preamble == nil { + // log.Warn("cannot insert table of contents: no preamble") + // return + // } + // preamble.Elements = append(preamble.Elements, toc) + // default: + // if header, found := doc.Header(); found { + // // insert as last element in header + // header.Elements = append(header.Elements, toc) + // } else { + // // insert as first element of doc + // elements := make([]interface{}, len(doc.Elements)+1) + // elements[0] = toc + // copy(elements[1:], doc.Elements) + // doc.Elements = elements + // } + // } + +} 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_substitutions.go b/pkg/parser/document_processing__apply_substitutions.go new file mode 100644 index 00000000..0a11576b --- /dev/null +++ b/pkg/parser/document_processing__apply_substitutions.go @@ -0,0 +1,1332 @@ +package parser + +import ( + "bytes" + "fmt" + "strconv" + "strings" + + "github.com/bytesparadise/libasciidoc/pkg/types" + "github.com/davecgh/go-spew/spew" + + "github.com/pkg/errors" + log "github.com/sirupsen/logrus" +) + +// 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, 1) + 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 +} + +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 + } + // stats := &Stats{} + opts := append(ctx.Opts, + GlobalStore(types.AttrImagesDir, ctx.attributes.get(types.AttrImagesDir)), + GlobalStore(usermacrosKey, ctx.userMacros), + // Debug(true), + // Statistics(stats, "NoMatch"), + ) + + 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) + } + } + 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 +} + +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 + } +} + +// 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) + } + } + title, err := newHeaderSubstitution().processElements(ctx, header.Title, opts...) + if err != nil { + return 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") + } + } + } + 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, " ") + } + } + 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 + } + } + case *types.Table: + if b.Header != nil { + if err = s.processBlockWithElements(ctx, b.Header, opts...); err != nil { + return err + } + } + } + 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 + } + // 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 + } + // 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, "-"))) + } + default: + s, err := newSubstitution(sub) + if err != nil { + return nil, err + } + result = append(result, s) + } + } + + // 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 +} + +// 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 +} + +func isIncrementalSubstitution(sub string) bool { + return strings.HasPrefix(sub, "+") || + strings.HasPrefix(sub, "-") || + strings.HasSuffix(sub, "+") +} + +func (s substitutions) processBlockWithElements(ctx *ParseContext, block types.BlockWithElements, opts ...Option) error { + elements, err := s.processElements(ctx, block.GetElements(), opts...) + if err != nil { + return err + } + 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 + } + } + 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 + } +} + +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" +) + +type substitution struct { + entrypoint substitutionRule + rules map[substitutionKind]bool + // hasAttributeSubstitutions bool // TODO: replace with a key in the parser's store +} + +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 (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, + }, + } +} + +func newElementAttributesSubstitution() *substitution { + return &substitution{ + entrypoint: ElementAttributesGroup, + rules: map[substitutionKind]bool{ + InlinePassthroughs: true, + Attributes: true, + Quotes: true, + SpecialCharacters: true, // TODO: is it needed? + }, + } +} + +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, + }, + } +} + +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, + }, + } +} + +func newNoneSubstitution() *substitution { + return &substitution{ + entrypoint: NoneGroup, + rules: map[substitutionKind]bool{}, + } +} + +func newQuotesSubstitution() *substitution { + return &substitution{ + entrypoint: QuotesGroup, + rules: map[substitutionKind]bool{ + Quotes: true, + }, + } +} + +func newReplacementsSubstitution() *substitution { + return &substitution{ + entrypoint: ReplacementsGroup, + rules: map[substitutionKind]bool{ + Replacements: true, + }, + } +} + +func newPostReplacementsSubstitution() *substitution { + return &substitution{ + entrypoint: PostReplacementsGroup, + rules: map[substitutionKind]bool{ + PostReplacements: true, + }, + } +} + +func newSpecialCharsSubstitution() *substitution { + return &substitution{ + entrypoint: SpecialcharactersGroup, + rules: map[substitutionKind]bool{ + SpecialCharacters: true, + }, + } +} + +func newVerbatimSubstitution() *substitution { + return &substitution{ + entrypoint: VerbatimGroup, + rules: map[substitutionKind]bool{ + SpecialCharacters: true, + Callouts: true, + }, + } +} + +func newTableColumnsAttrSubstitution() *substitution { + return &substitution{ + entrypoint: "TableColumnsAttribute", + } +} + +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("remaining rules: %s", spew.Sdump(rules)) + // } + s.rules = rules +} + +func (s *substitution) hasEnablements() bool { + return len(s.rules) > 0 +} + +func (s *substitution) processAttributes(ctx *ParseContext, element types.BlockWithAttributes, opts ...Option) error { + if log.IsLevelEnabled(log.DebugLevel) { + log. + WithField("entrypoint", s.entrypoint). + // WithField("hasAttributeSubstitutions", s.hasAttributeSubstitutions). + 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 + } + 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 +} + +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 + } + // 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("content has attribute substitutions: %t", found) + } + if found { + elements = types.Merge(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 + } + } + } + return elements, nil +} + +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 + } + // opts = append(opts) + 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 + } + e.SetAttributes(attrs) + } + } + + // 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 placeholders.restore(result) +} + +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) + } + 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...) + } + if err := s.processBlockWithElements(ctx, e, opts...); err != nil { + return err + } + case types.BlockWithLocation: + if err := s.processElementWithLocation(ctx, e, opts...); err != nil { + return err + } + 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 nil +} + +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 (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 (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.Debugf("parsing attributes with group '%s' on %s", s.entrypoint, spew.Sdump(attributes)) + // } + 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 + } + 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 + } + } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("parsed attributes with rule '%s': %s", s.entrypoint, spew.Sdump(attributes)) + } + return attributes, nil +} + +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) + } + 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 +} + +// 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 + 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.Debugf("replaced attribute refs: %s", spew.Sdump(b.GetAttributes())) + // } + return found, nil +} + +// 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 []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: + 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 + } + found = found || f + // replace AttributeSubstitutions on nested elements + elements, f, err := replaceAttributeRefsInElements(ctx, e.GetElements()) + if err != nil { + 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) + } + return e, found, nil + case types.BlockWithLocation: + found := false + // replace AttributeSubstitutions on attributes + f, err := replaceAttributeRefsInAttributes(ctx, e) + if err != nil { + return nil, false, 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 + } +} + +func replaceAttributeRefsInLocation(ctx *ParseContext, b types.BlockWithLocation) (bool, error) { + path, found, err := replaceAttributeRefsInElements(ctx, b.GetLocation().Path) + if err != nil { + return false, err + } + b.GetLocation().Path = path + return found, nil +} + +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.counters[c.Name] = c.Value + counter = c.Value + increment = false + } + switch counter := counter.(type) { + case int: + if increment { + counter++ + } + ctx.counters[c.Name] = counter + if c.Hidden { + // return empty string facilitates merging + return &types.StringElement{Content: ""}, true, nil + } + return &types.StringElement{ + Content: strconv.Itoa(counter), + }, true, nil + case rune: + if increment { + counter++ + } + ctx.counters[c.Name] = counter + if c.Hidden { + // return empty string facilitates merging + return &types.StringElement{Content: ""}, true, nil + } + return &types.StringElement{ + Content: string(counter), + }, true, nil + default: + 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) + // case types.SingleLineComment: + // // replace with placeholder + // p := placeholders.add(element) + // result.WriteString(p.String()) + 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) unsetCurrentSubstitution() { +// log.Debug("unsetting current subsitution kind") +// delete(c.state, substitutionsKey) +// } + +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 +} + +// // called when an attribute substitution occurred +// // TODO: find a better name for this method +// func (c *current) flagAttributeSubstitutions() error { +// s, found := c.lookupCurrentSubstitution() +// if !found { +// log.Debug("no substitution found?") +// return nil +// } +// s.hasAttributeSubstitutions = true +// log.Debug("flagged attribute substitutions") +// // // also, disable all subsitutions post `attributes` (`macros`, etc.) +// // for s := range phase.enablements { +// // switch s { +// // case Quotes, Replacements, Macros, PostReplacements: // TODO: avoid hard-coded entries +// // phase.enablements[s] = false // disabled +// // } +// // } +// return nil +// } + +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 new file mode 100644 index 00000000..5576bd54 --- /dev/null +++ b/pkg/parser/document_processing__apply_substitutions_test.go @@ -0,0 +1,109 @@ +package parser + +import ( + "github.com/bytesparadise/libasciidoc/pkg/types" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("new substitutions", func() { + + Context("listing block", func() { + + It("default subs", func() { + b := &types.DelimitedBlock{ + Kind: types.Listing, + } + Expect(newSubstitutions(b)).To(Equal(substitutions{ + { + entrypoint: "VerbatimGroup", + rules: map[substitutionKind]bool{ + SpecialCharacters: true, + Callouts: true, + }, + }, + })) + }) + Context("incremental subs", func() { + + It("-callouts", func() { + b := &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "-callouts", + }, + } + Expect(newSubstitutions(b)).To(Equal(substitutions{ + { + entrypoint: "VerbatimGroup", + rules: map[substitutionKind]bool{ + SpecialCharacters: true, + }, + }, + })) + }) + + It("-specialchars", func() { + b := &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "-specialchars", + }, + } + Expect(newSubstitutions(b)).To(Equal(substitutions{ + { + entrypoint: "VerbatimGroup", + rules: map[substitutionKind]bool{ + Callouts: true, + }, + }, + })) + }) + }) + + Context("absolute subs", func() { + + It("macros", func() { + b := &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "macros", + }, + } + Expect(newSubstitutions(b)).To(Equal(substitutions{ + { + entrypoint: "MacrosGroup", + rules: map[substitutionKind]bool{ + Macros: true, + }, + }, + })) + }) + }) + + Context("mixing subs", func() { + + It("macros,+quotes,-quotes", func() { + b := &types.DelimitedBlock{ + Kind: types.Listing, + Attributes: types.Attributes{ + types.AttrSubstitutions: "macros,+quotes,-quotes", + }, + } + Expect(newSubstitutions(b)).To(Equal(substitutions{ + { + entrypoint: "MacrosGroup", + rules: map[substitutionKind]bool{ + Macros: true, + }, + }, + { + entrypoint: "QuotesGroup", + rules: map[substitutionKind]bool{}, // TODO: remove substitution entry when `rules` is empty + }, + })) + }) + }) + }) +}) diff --git a/pkg/parser/document_processing__arrange_lists.go b/pkg/parser/document_processing__arrange_lists.go new file mode 100644 index 00000000..fd1a0bd0 --- /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, 1) + 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..00ce50df --- /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, 10) + 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_elements.go b/pkg/parser/document_processing__filter_elements.go new file mode 100644 index 00000000..9eb8de52 --- /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, 1) + 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__include_files.go b/pkg/parser/document_processing__include_files.go new file mode 100644 index 00000000..770ac6ac --- /dev/null +++ b/pkg/parser/document_processing__include_files.go @@ -0,0 +1,543 @@ +package parser + +import ( + "bufio" + "bytes" + "fmt" + "io" + "os" + "path/filepath" + "strconv" + "strings" + + "github.com/bytesparadise/libasciidoc/pkg/types" + + "github.com/davecgh/go-spew/spew" + "github.com/pkg/errors" + log "github.com/sirupsen/logrus" +) + +func IncludeFiles(ctx *ParseContext, done <-chan interface{}, fragmentStream <-chan types.DocumentFragment) <-chan types.DocumentFragment { + resultStream := make(chan types.DocumentFragment, 1) + 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 +} + +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 + } + result = append(result, f.Elements...) + case *types.DelimitedBlock: + f := includeFiles(ctx.WithinDelimitedBlock(e), e.Elements, done) + if f.Error != nil { + return f + } + e.Elements = f.Elements + result = append(result, e) + default: + result = append(result, element) + } + } + return types.NewDocumentFragment(result...) +} + +// 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) + } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("including content of '%s' with offsets %v", e.Location.Stringify(), ctx.levelOffsets) + } + 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...) + } + // and recursively... + return includeFiles(ctx, elements, done) +} + +// func send(fragment types.DocumentFragment, done <-chan interface{}, fragmentStream chan<- types.DocumentFragment) bool { +// log.Debug("sending content...") +// select { +// case <-done: +// log.WithField("pipeline_task", "include_files").Debug("received 'done' signal") +// return false +// case fragmentStream <- fragment: +// return true +// } +// } + +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.filename) + f, absPath, closeFile, err := open(filepath.Join(currentDir, path)) + if err != nil { + // log.Error(err) + 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.Debugf("parsing file to %s", incl.RawText) + } + 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 { + log.Error(err) + return nil, errors.Wrapf(err, "Unresolved directive in %s - %s", ctx.filename, incl.RawText) + } + } 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 { + 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 { + log.Error(err) + return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) + } + } + if err := scanner.Err(); err != nil { + log.Error(err) + return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) + } + // 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) { + 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 + 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 { + log.Error(err) + return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) + } + if strings.HasPrefix(lvl, "+") || strings.HasPrefix(lvl, "-") { + ctx.levelOffsets = append(ctx.levelOffsets, relativeOffset(offset)) + } else { + ctx.levelOffsets = []*levelOffset{absoluteOffset(offset)} + } + } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("content of '%s':\n%s", absPath, content.String()) + } + return content, nil +} + +// func includeFiles(filename string, f types.DocumentFragment) []types.DocumentFragment { + +// fragmentStream := make(chan types.DocumentFragment, 1) + +// // skip if the incoming fragment already contains an error +// if f.Error != nil { +// fragmentStream <- f +// } +// // incl.Location.Path = substituteAttributes(incl.Location.Path, s.attributes) +// path := incl.Location.Stringify() +// currentDir := filepath.Dir(filename) +// f, absPath, done, err := open(filepath.Join(currentDir, path)) +// defer done() +// if err != nil { +// return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) +// } +// content := bytes.NewBuffer(nil) +// scanner := bufio.NewScanner(bufio.NewReader(f)) +// if log.IsLevelEnabled(log.DebugLevel) { +// log.Debugf("parsing file to %s", incl.RawText) +// } +// if lr, ok, err := lineRanges(incl); err != nil { +// log.WithError(err).Error("error occurred while checking if file inclusion has line ranges") +// return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) +// } else if ok { +// if err := readWithinLines(scanner, content, lr); err != nil { +// log.WithError(err).Error("error occurred while reading file within line ranges") +// return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) +// } +// } else if tr, ok, err := tagRanges(incl); err != nil { +// log.WithError(err).Error("error occurred while checking if file inclusion has tag ranges") +// return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) +// } else if ok { +// if err := readWithinTags(path, scanner, content, tr); err != nil { +// log.WithError(err).Error("error occurred while reading file within tag ranges") +// return nil, err // keep the underlying error here +// } +// } else { +// if err := readAll(scanner, content); err != nil { +// log.WithError(err).Error("error occurred while reading file") +// return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) +// } +// } +// if err := scanner.Err(); err != nil { +// return nil, errors.Errorf("Unresolved directive in %s - %s", ctx.filename, incl.RawText) +// } +// // if the file to include is not an Asciidoc document, just return the content as "raw lines" +// if !IsAsciidoc(absPath) { +// return []interface{}{ +// types.RawLine(content.Bytes()), +// }, nil +// } +// // parse the content, and returns the corresponding elements +// lvl, found, err := incl.Attributes.GetAsString(types.AttrLevelOffset) +// if err != nil { +// return nil, err +// } +// if found { +// offset, err := strconv.Atoi(lvl) +// if err != nil { +// return nil, errors.Wrap(err, "unable to read file to include") +// } +// if strings.HasPrefix(lvl, "+") || strings.HasPrefix(lvl, "-") { +// ctx.levelOffsets = append(ctx.levelOffsets, relativeOffset(offset)) +// } else { +// ctx.levelOffsets = []levelOffset{absoluteOffset(offset)} + +// } +// } +// actualFilename := filename +// defer func() { +// // restore actual filename after exiting +// filename = actualFilename +// }() +// filename = absPath +// // now, let's parse this content and process nested file inclusions (recursively) +// return parseDocumentFragments(ctx, content, opts...) +// } + +type levelOffsets []*levelOffset + +func (l levelOffsets) apply(s *types.Section) { + for _, offset := range l { + offset.apply(s) + } +} + +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) (types.LineRanges, bool, error) { + lineRanges, exists, err := incl.Attributes.GetAsString(types.AttrLineRanges) + if err != nil { + return types.LineRanges{}, false, err + } + if exists { + lr, err := Parse("", []byte(lineRanges), Entrypoint("LineRanges")) + if err != nil { + return types.LineRanges{}, false, err + } + 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, 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) (types.TagRanges, bool, error) { + tagRanges, exists, err := incl.Attributes.GetAsString(types.AttrTagRanges) + if err != nil { + return types.TagRanges{}, false, err + } + if exists { + log.Debugf("tag ranges to include: %v", spew.Sdump(tagRanges)) + tr, err := Parse("", []byte(tagRanges), Entrypoint("TagRanges")) + if err != nil { + return types.TagRanges{}, false, err + } + return types.NewTagRanges(tr), true, nil + } + 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() { + line++ + // parse the line in search for the `tag::[]` or `end:[]` macros + l, err := Parse("", scanner.Bytes(), Entrypoint("IncludedFileLine")) + if err != nil { + return err + } + fl, ok := l.(types.IncludedFileLine) + if !ok { + return errors.Errorf("unexpected type of parsed line in file to include: %T", l) + } + // skip if the line has tags + if fl.HasTag() { + continue + } + // TODO: stop reading if current line above highest range + if lineRanges.Match(line) { + _, err := content.Write(scanner.Bytes()) + if err != nil { + return err + } + _, err = content.WriteString("\n") + if err != nil { + return err + } + } + } + return nil +} + +func readWithinTags(path string, scanner *bufio.Scanner, content *bytes.Buffer, expectedRanges types.TagRanges) error { + // log.Debugf("limiting to tag ranges: %v", expectedRanges) + currentRanges := make(map[string]*types.CurrentTagRange, len(expectedRanges)) // ensure capacity + lineNumber := 0 + for scanner.Scan() { + lineNumber++ + line := scanner.Bytes() + // parse the line in search for the `tag::[]` or `end:[]` macros + l, err := Parse("", line, Entrypoint("IncludedFileLine")) + if err != nil { + return err + } + fl, ok := l.(types.IncludedFileLine) + if !ok { + return errors.Errorf("unexpected type of parsed line in file to include: %T", l) + } + // check if a start or end tag was found in the line + if startTag, ok := fl.GetStartTag(); ok { + currentRanges[startTag.Value] = &types.CurrentTagRange{ + StartLine: lineNumber, + EndLine: -1, + } + } + if endTag, ok := fl.GetEndTag(); ok { + currentRanges[endTag.Value].EndLine = lineNumber + } + if expectedRanges.Match(lineNumber, currentRanges) && !fl.HasTag() { + _, err := content.Write(scanner.Bytes()) + if err != nil { + return err + } + _, err = content.WriteString("\n") + if err != nil { + return err + } + } + } + // after the file has been processed, let's check if all tags were "found" + for _, tag := range expectedRanges { + // log.Debugf("checking if tag '%s' was found...", tag.Name) + switch tag.Name { + case "*", "**": + continue + default: + if tr, found := currentRanges[tag.Name]; !found { + 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) + } + } + } + return nil +} + +func readAll(scanner *bufio.Scanner, content *bytes.Buffer) error { + for scanner.Scan() { + // parse the line in search for the `tag::[]` or `end:[]` macros + l, err := Parse("", scanner.Bytes(), Entrypoint("IncludedFileLine")) + if err != nil { + return err + } + fl, ok := l.(types.IncludedFileLine) + if !ok { + return errors.Errorf("unexpected type of parsed line in file to include: %T", l) + } + // skip if the line has tags + if fl.HasTag() { + continue + } + _, err = content.Write(scanner.Bytes()) + if err != nil { + return err + } + _, err = content.WriteString("\n") + if err != nil { + return err + } + } + return nil +} + +func open(path string) (*os.File, string, func(), error) { + wd, err := os.Getwd() + if err != nil { + return nil, "", func() {}, err + } + absPath, err := filepath.Abs(path) + if 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 + log.WithError(err).Error("failed to restore previous working directory") + } + }, err + } + dir := filepath.Dir(absPath) + 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 + log.WithError(err).Error("failed to restore previous working directory") + } + }, err + } + // read the file per-se + // log.Debugf("opening '%s'", absPath) + f, err := os.Open(absPath) + if err != nil { + return nil, absPath, func() { + // log.Debugf("restoring current working dir to: %s", wd) + if err := os.Chdir(wd); err != nil { // restore the previous working directory + log.WithError(err).Error("failed to restore previous working directory") + } + }, err + } + return f, absPath, func() { + // log.Debugf("restoring current working dir to: %s", wd) + if err := os.Chdir(wd); err != nil { // restore the previous working directory + log.WithError(err).Error("failed to restore previous working directory") + } + if err := f.Close(); err != nil { + log.WithError(err).Errorf("failed to close file '%s'", absPath) + } + }, nil +} + +// IsAsciidoc returns true if the file to include is an asciidoc file (based on the file location extension) +func IsAsciidoc(path string) bool { + ext := filepath.Ext(path) + return ext == ".asciidoc" || ext == ".adoc" || ext == ".ad" || ext == ".asc" || ext == ".txt" +} diff --git a/pkg/parser/document_processing__include_files_test.go b/pkg/parser/document_processing__include_files_test.go new file mode 100644 index 00000000..e8fc6161 --- /dev/null +++ b/pkg/parser/document_processing__include_files_test.go @@ -0,0 +1,1488 @@ +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 + log "github.com/sirupsen/logrus" +) + +var _ = Describe("file inclusions", func() { + + Context("in final documents", 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.Document{ + Elements: []interface{}{ + &types.DocumentHeader{ + Title: []interface{}{ + &types.StringElement{ + Content: "Chapter A", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", + }, + }, + }, + }, + } + 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 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", + }, + Level: 1, // offset by +1 + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", + }, + }, + }, + }, + }, + }, + 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 include file with attribute in path", func() { + source := `:includedir: ../../test/includes + +include::{includedir}/chapter-a.adoc[]` + 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", + }, + }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + It("should not further process with non-asciidoc files", func() { + source := `:includedir: ../../test/includes + +include::{includedir}/include.foo[]` + 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.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: `include::hello_world.go.txt[]`, + }, + }, + }, + }, + } + // 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[]` + title := []interface{}{ + &types.StringElement{ + Content: "grandchild title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_grandchild_title", + }, + Level: 1, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "first line of grandchild", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of grandchild", + }, + }, + }, + }, + }, + }, + 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]` + title := []interface{}{ + &types.StringElement{ + Content: "grandchild title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_grandchild_title", + }, + Level: 2, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "first line of grandchild", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of grandchild", + }, + }, + }, + }, + }, + }, + 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]` + title := []interface{}{ + &types.StringElement{ + Content: "grandchild title", + }, + } + expected := &types.Document{ + Elements: []interface{}{ + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_grandchild_title", + }, + Level: 0, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "first line of grandchild", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of grandchild", + }, + }, + }, + }, + }, + }, + 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]` + 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", + }, + 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.Paragraph{ + Elements: []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: 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 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.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", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + 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]` + 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", + }, + 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.Paragraph{ + Elements: []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: 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", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + 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", + }, + }, + }, + }, + } + 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`, + }, + }, + }, + }, + } + 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.Callout{ + Ref: 1, + }, + &types.StringElement{ + Content: "\n\n:leveloffset!:", + }, + }, + }, + &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, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + 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.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "first line of parent", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "= child title", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "first line of child", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "== grandchild title", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "first line of grandchild", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of grandchild", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of child", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of parent ", + }, + &types.SpecialCharacter{ + Name: "<", + }, + &types.StringElement{ + Content: "1", + }, + &types.SpecialCharacter{ + Name: ">", + }, + }, + }, + &types.AttributeReset{ + Name: "leveloffset", + }, + }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + Context("with line ranges", func() { + + Context("unquoted", func() { + + 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", + }, + }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + 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", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", + }, + }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + 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.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "content", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + 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", + }, + }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + }) + + Context("quoted", func() { + + 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", + }, + }, + }, + }, + } + 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 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", + }, + }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + 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{}{ + &types.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "content", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + 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.AttributeDeclaration{ + Name: types.AttrAuthors, + Value: types.DocumentAuthors{ + { + DocumentAuthorFullName: &types.DocumentAuthorFullName{ + FirstName: "content", + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + It("with invalid 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 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{ + 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)) + }) + }) + }) + + 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", + }, + Level: 1, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", + }, + }, + }, + }, + }, + }, + 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 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.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "end", + }, + }, + }, + }, + } + 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("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("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", + }, + Level: 1, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "end", + }, + }, + }, + }, + }, + }, + ElementReferences: types.ElementReferences{ + "_section_1": title, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + Context("permutations", func() { + + 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", + }, + Level: 1, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "end", + }, + }, + }, + }, + }, + }, + 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 regions + 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, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", + }, + }, + }, + }, + }, + }, + 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 regions + 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, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "content", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "end", + }, + }, + }, + }, + }, + }, + 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 `doc` but `content` + 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)) + }) + + 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", + }, + Level: 1, + Title: title, + }, + }, + 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 lines but `content` + 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, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "end", + }, + }, + }, + }, + }, + }, + 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=**;!*]` // excludes all regions + expected := &types.Document{ + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "end", + }, + }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + }) + }) + + Context("with missing file to include", func() { + + // var reset func() + + // BeforeEach(func() { + // _, reset = ConfigureLogger(log.ErrorLevel, DiscardStdout()) + // }) + + // AfterEach(func() { + // defer reset() + // }) + + 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 := 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() { + 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]")) + }) + }) + + 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 + +include::{includedir}/grandchild-include.adoc[]` + 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", + }, + &types.Section{ + Attributes: types.Attributes{ + types.AttrID: "_grandchild_title", + }, + Level: 1, + Title: title, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "first line of grandchild", + }, + }, + }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "last line of grandchild", + }, + }, + }, + }, + }, + }, + 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 + +---- +include::{includedir}/grandchild-include.adoc[] +----` + 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(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + }) + + Context("inclusion of non-asciidoc file", func() { + + It("include go file without any range in listing block", func() { + + source := `---- +include::../../test/includes/hello_world.go.txt[] +----` + expected := &types.Document{ + Elements: []interface{}{ + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: `package includes + +import "fmt" + +func helloworld() { + fmt.Println("hello, world!") +}`, + }, + }, + }, + }, + } + Expect(ParseDocument(source, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + + It("include go file with a simple range in listing block", func() { + + 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, configuration.WithFilename("test.adoc"))).To(MatchDocument(expected)) + }) + }) + }) +}) diff --git a/pkg/parser/document_processing__insert_preamble_test.go b/pkg/parser/document_processing__insert_preamble_test.go new file mode 100644 index 00000000..4080e270 --- /dev/null +++ b/pkg/parser/document_processing__insert_preamble_test.go @@ -0,0 +1,172 @@ +package parser + +import ( + "github.com/bytesparadise/libasciidoc/pkg/types" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/gomega" //nolint golint +) + +var _ = Describe("insert preambles", 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{} + + 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("should insert preamble with 1 paragraph and blankline", func() { + // given + doc := &types.Document{ + Elements: []interface{}{ + header, + paragraph, + blankline, + sectionA, + sectionB, + }, + } + expected := &types.Document{ + Elements: []interface{}{ + header, + &types.Preamble{ + Elements: []interface{}{ + paragraph, + blankline, + }, + }, + sectionA, + sectionB, + }, + } + // when + insertPreamble(doc) + // then + Expect(doc).To(Equal(expected)) + }) + + It("should insert preamble with 2 paragraphs and blanklines", func() { + // given + doc := &types.Document{ + Elements: []interface{}{ + header, + paragraph, + blankline, + anotherParagraph, + blankline, + sectionA, + sectionB, + }, + } + expected := &types.Document{ + Elements: []interface{}{ + header, + &types.Preamble{ + Elements: []interface{}{ + paragraph, + blankline, + anotherParagraph, + blankline, + }, + }, + sectionA, + sectionB, + }, + } + // 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..9d0db237 --- /dev/null +++ b/pkg/parser/document_processing__parse_fragments.go @@ -0,0 +1,116 @@ +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, 1) + 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)) + } + // if err != nil { + // break parsing + // } + 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__root.go b/pkg/parser/document_processing__root.go new file mode 100644 index 00000000..9bb53743 --- /dev/null +++ b/pkg/parser/document_processing__root.go @@ -0,0 +1,44 @@ +package parser + +import ( + "io" + + "github.com/bytesparadise/libasciidoc/pkg/configuration" + "github.com/bytesparadise/libasciidoc/pkg/types" + "github.com/davecgh/go-spew/spew" + log "github.com/sirupsen/logrus" +) + +// 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 nil, err + } + if len(footnotes.Notes) > 0 { + doc.Footnotes = footnotes.Notes + } + if log.IsLevelEnabled(log.DebugLevel) { + log.Debugf("parsed document:\n%s", spew.Sdump(doc)) + } + return doc, nil +} diff --git a/pkg/parser/document_processing__split_header.go b/pkg/parser/document_processing__split_header.go new file mode 100644 index 00000000..ae02ceb3 --- /dev/null +++ b/pkg/parser/document_processing__split_header.go @@ -0,0 +1,46 @@ +package parser + +// func SplitHeader(done <-chan interface{}, fragmentStream <-chan types.DocumentFragment) <-chan types.DocumentFragment { +// resultStream := make(chan types.DocumentFragment, 1) +// go func() { +// defer close(resultStream) +// for fragment := range fragmentStream { +// for _, f := range splitHeader(fragment) { +// select { +// case <-done: +// log.WithField("pipeline_task", "split_header").Debug("received 'done' signal") +// return +// case resultStream <- f: +// } +// } +// } +// log.WithField("pipeline_task", "split_header").Debug("done") +// }() +// return resultStream +// } + +// func splitHeader(f types.DocumentFragment) []types.DocumentFragment { +// if err := f.Error; err != nil { +// log.Debugf("skipping element splitting because of fragment with error: %v", f.Error) +// return []types.DocumentFragment{f} +// } +// result := make([]types.DocumentFragment, 0, len(f.Elements)) +// for _, element := range f.Elements { +// switch e := element.(type) { +// case *types.DocumentHeader: +// result = append(result, types.NewDocumentFragment(e.Section)) +// // if e.Authors != nil { +// // result = append(result, types.NewDocumentFragment(e.Authors)) +// // } +// // if e.Revision != nil { +// // result = append(result, types.NewDocumentFragment(e.Revision)) +// // } +// for _, a := range e.Attributes { +// result = append(result, types.NewDocumentFragment(a)) +// } +// default: +// result = append(result, types.NewDocumentFragment(e)) +// } +// } +// return result +// } 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..1db0d3ea 100644 --- a/pkg/parser/document_processing_apply_substitutions.go +++ b/pkg/parser/document_processing_apply_substitutions.go @@ -1,719 +1,710 @@ package parser -import ( - "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 -// ---------------------------------------------------------------------------- - -// 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{}{}, - } - // 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()) - - 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 - } - return types.DraftDocument{ - Attributes: attrs.All(), - FrontMatter: rawDoc.FrontMatter, - Elements: elements, - }, nil -} - -type substitutionContext struct { - attributes types.AttributesWithOverrides - config configuration.Configuration -} - -// 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 - } - if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("applying substitutions on:") - spew.Fdump(log.StandardLogger().Out, elements) - } - 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 - } - 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 - } - 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 - } - elements, err := applySubstitutionsOnLines(ctx, e.LinesToSubstitute(), subs) - if err != nil { - return nil, 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 != nil { - return nil, err - } - result[i] = e - case types.ContinuedListItemElement: - r, err := applySubstitutions(ctx, []interface{}{e.Element}) - 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 - } - 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 { - return nil, err - } - result[i] = e - } - } - if log.IsLevelEnabled(log.DebugLevel) { - log.Debug("applied substitutions:") - spew.Fdump(log.StandardLogger().Out, result) - } - return result, nil -} - -// ---------------------------------------------------------------------------- -// Delimited Block substitutions -// ---------------------------------------------------------------------------- - -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 substitutionsFor(block types.WithCustomSubstitutions) ([]elementsSubstitution, error) { - subs := make(funcs, 0, len(substitutions)) - subsitutionsToApply, err := block.SubstitutionsToApply() - if err != nil { - return nil, 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) - } - } - result := make([]elementsSubstitution, 0, len(subs)) - for _, s := range subs { - if f, exists := substitutions[s]; exists { - result = append(result, f) - } - } - result = append(result, splitLines) - return result, nil -} - -type funcs []string - -func (f funcs) append(others ...string) funcs { - return append(f, others...) -} - -func (f funcs) prepend(other string) funcs { - return append(funcs{other}, f...) -} - -func (f funcs) remove(other string) funcs { - for i, s := range f { - if s == other { - return append(f[:i], f[i+1:]...) - } - } - // 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 - } - } - 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 - } - } - 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) - } - if len(b.Lines) == 0 { // no more line to parse after extracting the author - b.Lines = nil - return b, nil - } - // 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 - } - } - return b, nil -} - -func extractMarkdownQuoteAttribution(lines [][]interface{}) ([][]interface{}, string) { - // first, check if last line is an attribution (author) - if len(lines) == 0 { - return lines, "" - } - 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 - } - } - return lines, "" -} - -// ---------------------------------------------------------------------------- -// Section substitutions -// ---------------------------------------------------------------------------- - -// 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, - } - var err error - for _, sub := range subs { - if elements, err = sub(ctx, elements); err != nil { - return types.Section{}, err - } - } - s.Title = elements[0] - if s, err = s.ResolveID(ctx.attributes); err != nil { - return types.Section{}, err - } - // if log.IsLevelEnabled(log.DebugLevel) { - // // log.Debugf("section after substitution:") - // spew.Fdump(log.StandardLogger().Out, s) - // } - return s, nil -} - -// ---------------------------------------------------------------------------- -// Location substitutions -// ---------------------------------------------------------------------------- - -// 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 - } - } - l.Path = elements[0] - l = l.WithPathPrefix(ctx.attributes.GetAsStringWithDefault("imagesdir", "")) - return l, 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? - 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) - } - // 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 - } - } - 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 - } -} - -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...) - if err != nil { - return nil, err - } - result = append(result, elmts...) - default: - result = append(result, element) - } - } - 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 - } - return []interface{}{result}, nil -} - -// 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 - } - for i, e := range elements { - // - if e, ok := e.(types.ElementPlaceHolder); ok { - elements[i] = placeholders.elements[e.Ref] - } - // 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 e, ok := e.(types.WithPlaceholdersInAttributes); ok { - elements[i] = e.RestoreAttributes(placeholders.elements) - } - if e, ok := e.(types.WithPlaceholdersInLocation); ok { - elements[i] = e.RestoreLocation(placeholders.elements) - } - } - return elements -} - -type placeholders struct { - seq int - 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), - } - -} - -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") - } - } - // if log.IsLevelEnabled(log.DebugLevel) { - // log.Debug("serialized lines:") - // spew.Fdump(log.StandardLogger().Out, result.String()) - // } - 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 - } - } - default: - pendingLine = append(pendingLine, element) - } - } - // 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 -} - -// ---------------------------------------------------------------------------- -// 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 - } - return result, 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 - } - 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) - } - } - } - // if log.IsLevelEnabled(log.DebugLevel) { - // log.Debug("applied substitutions on attributes") - // spew.Fdump(log.StandardLogger().Out, attributes) - // } - 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 -} - -func applyAttributeSubstitutionsOnElement(ctx substitutionContext, element interface{}) (interface{}, error) { - var err error - 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 types.CounterSubstitution: - if element, err = applyCounterSubstitution(ctx, e); err != nil { - return nil, err - } - case types.WithElementsToSubstitute: - elmts, err := applyAttributeSubstitutionsOnElements(ctx, e.ElementsToSubstitute()) - if err != nil { - return nil, err - } - element = e.ReplaceElements(types.Merge(elmts)) - case types.WithLineSubstitution: - lines, err := applyAttributeSubstitutionsOnLines(ctx, e.LinesToSubstitute()) - if err != nil { - return nil, err - } - element = e.SubstituteLines(lines) - case types.ContinuedListItemElement: - if e.Element, err = applyAttributeSubstitutionsOnElement(ctx, e.Element); err != nil { - return nil, err - } - } - // also, retain the attribute declaration value (if applicable) - if e, ok := element.(types.AttributeDeclaration); ok { - ctx.attributes.Set(e.Name, e.Value) - } - return element, 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] - if counter == nil { - counter = 0 - } - increment := true - if c.Value != nil { - ctx.attributes.Counters[c.Name] = c.Value - counter = c.Value - increment = false - } - switch counter := counter.(type) { - case int: - if increment { - counter++ - } - ctx.attributes.Counters[c.Name] = counter - if c.Hidden { - // return empty string facilitates merging - return types.StringElement{Content: ""}, nil - } - return types.StringElement{ - Content: strconv.Itoa(counter), - }, nil - case rune: - if increment { - counter++ - } - ctx.attributes.Counters[c.Name] = counter - if c.Hidden { - // return empty string facilitates merging - return types.StringElement{Content: ""}, nil - } - return types.StringElement{ - Content: string(counter), - }, nil - - default: - return nil, fmt.Errorf("invalid counter type %T", counter) - } -} +// // ---------------------------------------------------------------------------- +// // Substitutions +// // ---------------------------------------------------------------------------- + +// // 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.DocumentFragments, config *configuration.Configuration) (types.DraftDocument, error) { +// // ctx := newSubstitutionContext(config) +// // // also, add all front-matter key/values +// // ctx.attributes.Add(rawDoc.FrontMatter.Content) +// // // also, add all AttributeDeclaration at the top of the document +// // ctx.attributes.Add(rawDoc.Attributes()) + +// // elements, err := applySubstitutions(ctx, rawDoc.Elements) +// // if err != nil { +// // return types.DraftDocument{}, err +// // } +// // if len(elements) == 0 { +// // elements = nil // avoid carrying empty slice +// // } +// return types.DraftDocument{ +// // Attributes: ctx.attributes.All(), +// // FrontMatter: rawDoc.FrontMatter, +// // Elements: elements, +// }, nil +// } + +// type substitutionContextDeprecated struct { +// attributes types.AttributesWithOverrides // TODO: replace with types.Attributes? +// config configuration.Configuration +// } + +// func newSubstitutionContextDeprecated(config *configuration.Configuration) substitutionContextDeprecated { +// return substitutionContextDeprecated{ +// attributes: types.AttributesWithOverrides{ +// Content: types.Attributes{}, +// Overrides: config.AttributeOverrides, +// Counters: map[string]interface{}{}, +// }, +// config: config, +// } +// } + +// // applySubstitutions applies the substitutions on paragraphs and delimited blocks (including when in continued list elements) +// func applySubstitutions(ctx substitutionContextDeprecated, elements []interface{}) ([]interface{}, error) { +// if len(elements) == 0 { +// return nil, nil +// } +// if log.IsLevelEnabled(log.DebugLevel) { +// log.Debug("applying substitutions on:") +// spew.Fdump(log.StandardLogger().Out, elements) +// } +// 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.GetAttributes()) +// if err != nil { +// return nil, err +// } +// 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 +// } +// 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 +// } +// elements, err := applySubstitutionsOnLines(ctx, e.LinesToSubstitute(), subs) +// if err != nil { +// return nil, 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 != nil { +// return nil, err +// } +// result[i] = e +// case types.ContinuedListItemElement: +// r, err := applySubstitutions(ctx, []interface{}{e.Element}) +// 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 +// } +// 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 { +// return nil, err +// } +// result[i] = e +// } +// } +// if log.IsLevelEnabled(log.DebugLevel) { +// log.Debug("applied substitutions:") +// spew.Fdump(log.StandardLogger().Out, result) +// } +// return result, nil +// } + +// // ---------------------------------------------------------------------------- +// // Delimited Block substitutions +// // ---------------------------------------------------------------------------- + +// 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 substitutionsFor(block types.WithCustomSubstitutions) ([]elementsSubstitution, error) { +// subs := make(funcs, 0, len(substitutions)) +// subsitutionsToApply, err := block.SubstitutionsToApply() +// if err != nil { +// return nil, 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) +// } +// } +// result := make([]elementsSubstitution, 0, len(subs)) +// for _, s := range subs { +// if f, exists := substitutions[s]; exists { +// result = append(result, f) +// } +// } +// result = append(result, splitLines) +// return result, nil +// } + +// type funcs []string + +// func (f funcs) append(others ...string) funcs { +// return append(f, others...) +// } + +// func (f funcs) prepend(other string) funcs { +// return append(funcs{other}, f...) +// } + +// func (f funcs) remove(other string) funcs { +// for i, s := range f { +// if s == other { +// return append(f[:i], f[i+1:]...) +// } +// } +// // unchanged +// return f +// } + +// func applySubstitutionsOnElements(ctx substitutionContextDeprecated, 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 +// } +// } +// return elements, nil +// } + +// func applySubstitutionsOnLines(ctx substitutionContextDeprecated, lines [][]interface{}, subs []elementsSubstitution) ([][]interface{}, error) { +// var err error +// for _, sub := range subs { +// if lines, err = sub(ctx, lines); err != nil { +// return nil, err +// } +// } +// return lines, nil +// } + +// func applySubstitutionsOnMarkdownQuoteBlock(ctx substitutionContextDeprecated, 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) +// } +// if len(b.Lines) == 0 { // no more line to parse after extracting the author +// b.Lines = nil +// return b, nil +// } +// // 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 +// } +// } +// return b, nil +// } + +// func extractMarkdownQuoteAttribution(lines [][]interface{}) ([][]interface{}, string) { +// // first, check if last line is an attribution (author) +// if len(lines) == 0 { +// return lines, "" +// } +// 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 +// } +// } +// return lines, "" +// } + +// // ---------------------------------------------------------------------------- +// // Section substitutions +// // ---------------------------------------------------------------------------- + +// // applies the elements and attributes substitutions on the given section title. +// func applySubstitutionsOnSection(ctx substitutionContextDeprecated, 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, +// } +// var err error +// for _, sub := range subs { +// if elements, err = sub(ctx, elements); err != nil { +// return types.Section{}, err +// } +// } +// s.Title = elements[0] +// if s, err = s.ResolveID(ctx.attributes); err != nil { +// return types.Section{}, err +// } +// // if log.IsLevelEnabled(log.DebugLevel) { +// // // log.Debugf("section after substitution:") +// // spew.Fdump(log.StandardLogger().Out, s) +// // } +// return s, nil +// } + +// // ---------------------------------------------------------------------------- +// // Location substitutions +// // ---------------------------------------------------------------------------- + +// // applies the elements and attributes substitutions on the given image block. +// func applySubstitutionsOnLocation(ctx substitutionContextDeprecated, 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 +// } +// } +// l.Path = elements[0] +// l = l.WithPathPrefix(ctx.attributes.GetAsStringWithDefault(types.AttrImagesDir, "")) +// return l, nil +// } + +// // ---------------------------------------------------------------------------- +// // Individual substitution funcs +// // ---------------------------------------------------------------------------- + +// // includes a call to `elementsSubstitution` with some post-processing on the result +// var substituteAttributes = func(ctx substitutionContextDeprecated, lines [][]interface{}) ([][]interface{}, error) { +// lines, err := newElementsSubstitution("AttributeSubs")(ctx, lines) // TODO: add a `substituteAttributes` var? +// 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) +// } +// // 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 substitutionContextDeprecated, lines [][]interface{}) ([][]interface{}, error) + +// func newElementsSubstitution(rule string) elementsSubstitution { +// return func(ctx substitutionContextDeprecated, 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(types.AttrImagesDir, ctx.attributes.GetAsStringWithDefault(types.AttrImagesDir, "")) +// 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 +// } +// } +// 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 +// } +// } + +// func parserPlaceHolderElements(elements []interface{}, opts ...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, opts...) +// if err != nil { +// return nil, err +// } +// result = append(result, elmts...) +// default: +// result = append(result, element) +// } +// } +// return result, nil +// } + +// func parseContent(filename string, content string, opts ...Option) ([]interface{}, error) { +// result, err := ParseReader(filename, strings.NewReader(content), opts...) +// if err != nil { +// return nil, errors.Wrapf(err, "unable to parse '%s'", content) +// } +// if result, ok := result.([]interface{}); ok { +// return types.Merge(result), nil +// } +// return []interface{}{result}, nil +// } + +// // 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 +// } +// for i, e := range elements { +// // +// if e, ok := e.(types.ElementPlaceHolder); ok { +// elements[i] = placeholders.elements[e.Ref] +// } +// // 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 e, ok := e.(types.WithPlaceholdersInAttributes); ok { +// elements[i] = e.RestoreAttributes(placeholders.elements) +// } +// if e, ok := e.(types.WithPlaceholdersInLocation); ok { +// elements[i] = e.RestoreLocation(placeholders.elements) +// } +// } +// return elements +// } + +// type placeholders struct { +// seq int +// 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), +// } + +// } + +// 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") +// } +// } +// // if log.IsLevelEnabled(log.DebugLevel) { +// // log.Debug("serialized lines:") +// // spew.Fdump(log.StandardLogger().Out, result.String()) +// // } +// return result.String() +// } + +// func splitLines(_ substitutionContextDeprecated, 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 +// } +// } +// default: +// pendingLine = append(pendingLine, element) +// } +// } +// // 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 +// } + +// // ---------------------------------------------------------------------------- +// // Attribute substitutions +// // ---------------------------------------------------------------------------- + +// func applyAttributeSubstitutionsOnElements(ctx substitutionContextDeprecated, 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 +// } +// return result, nil +// } + +// func applyAttributeSubstitutionsOnAttributes(ctx substitutionContextDeprecated, 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 +// } +// 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) +// } +// } +// } +// // if log.IsLevelEnabled(log.DebugLevel) { +// // log.Debug("applied substitutions on attributes") +// // spew.Fdump(log.StandardLogger().Out, attributes) +// // } +// return attributes, nil +// } + +// func applyAttributeSubstitutionsOnLines(ctx substitutionContextDeprecated, 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 +// } + +// func applyAttributeSubstitutionsOnElement(ctx substitutionContextDeprecated, element interface{}) (interface{}, error) { +// var err error +// 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 types.CounterSubstitution: +// if element, err = applyCounterSubstitution(ctx, e); err != nil { +// return nil, err +// } +// case types.WithElementsToSubstitute: +// elmts, err := applyAttributeSubstitutionsOnElements(ctx, e.ElementsToSubstitute()) +// if err != nil { +// return nil, err +// } +// element = e.ReplaceElements(types.Merge(elmts)) +// case types.WithLineSubstitution: +// lines, err := applyAttributeSubstitutionsOnLines(ctx, e.LinesToSubstitute()) +// if err != nil { +// return nil, err +// } +// element = e.SubstituteLines(lines) +// case types.ContinuedListItemElement: +// if e.Element, err = applyAttributeSubstitutionsOnElement(ctx, e.Element); err != nil { +// return nil, err +// } +// } +// // also, retain the attribute declaration value (if applicable) +// if e, ok := element.(types.AttributeDeclaration); ok { +// ctx.attributes.Set(e.Name, e.Value) +// } +// return element, 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 substitutionContextDeprecated, c types.CounterSubstitution) (interface{}, error) { +// counter := ctx.attributes.Counters[c.Name] +// if counter == nil { +// counter = 0 +// } +// increment := true +// if c.Value != nil { +// ctx.attributes.Counters[c.Name] = c.Value +// counter = c.Value +// increment = false +// } +// switch counter := counter.(type) { +// case int: +// if increment { +// counter++ +// } +// ctx.attributes.Counters[c.Name] = counter +// if c.Hidden { +// // return empty string facilitates merging +// return &types.StringElement{Content: ""}, nil +// } +// return &types.StringElement{ +// Content: strconv.Itoa(counter), +// }, nil +// case rune: +// if increment { +// counter++ +// } +// ctx.attributes.Counters[c.Name] = counter +// if c.Hidden { +// // return empty string facilitates merging +// return &types.StringElement{Content: ""}, nil +// } +// return &types.StringElement{ +// Content: string(counter), +// }, nil + +// default: +// return nil, fmt.Errorf("invalid counter type %T", counter) +// } +// } diff --git a/pkg/parser/document_processing_apply_substitutions_test.go b/pkg/parser/document_processing_apply_substitutions_test.go index 145c1018..a6480b71 100644 --- a/pkg/parser/document_processing_apply_substitutions_test.go +++ b/pkg/parser/document_processing_apply_substitutions_test.go @@ -1,1058 +1,1053 @@ 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 - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint -) +// var _ = Describe("document substitutions", func() { -var _ = Describe("document substitutions", func() { +// Context("paragraphs", func() { - Context("paragraphs", 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 := substitutionContextDeprecated{ +// 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 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 := substitutionContextDeprecated{ +// 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 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.", +// }, +// }, +// }, +// }, +// } +// ctx := substitutionContextDeprecated{ +// attributes: types.AttributesWithOverrides{ +// Content: map[string]interface{}{}, +// Overrides: map[string]string{}, +// }, +// config: configuration.NewConfiguration(), +// } +// // when +// result, err := applySubstitutions(ctx, elements) - 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.", - }, - }, - }, - }, - } - 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.", +// }, +// }, +// }, +// }, +// })) +// }) - // 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 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 := substitutionContextDeprecated{ +// attributes: types.AttributesWithOverrides{ +// Content: map[string]interface{}{}, +// Overrides: map[string]string{}, +// }, +// config: configuration.NewConfiguration(), +// } +// // when +// result, err := applySubstitutions(ctx, elements) - 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.", +// }, +// }, +// }, +// }, +// })) +// }) - // 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 := substitutionContextDeprecated{ +// 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 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{ +// Attributes: types.Attributes{ +// types.AttrTitle: []interface{}{ +// &types.StringElement{ +// Content: "a ", +// }, +// types.AttributeSubstitution{ +// Name: "title", +// }, +// }, +// }, +// Lines: [][]interface{}{ +// { +// &types.StringElement{ +// Content: "a paragraph with title '", +// }, +// types.AttributeSubstitution{ +// Name: "title", +// }, +// &types.StringElement{ +// Content: "'", +// }, +// }, +// }, +// }, +// } +// ctx := substitutionContextDeprecated{ +// 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'", +// }, +// }, +// }, +// }, +// })) +// }) +// }) - It("should substitute title attribute", func() { - // given - elements := []interface{}{ - types.Paragraph{ - Attributes: types.Attributes{ - types.AttrTitle: []interface{}{ - types.StringElement{ - Content: "a ", - }, - types.AttributeSubstitution{ - Name: "title", - }, - }, - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "a paragraph with title '", - }, - types.AttributeSubstitution{ - Name: "title", - }, - types.StringElement{ - Content: "'", - }, - }, - }, - }, - } - 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() { - 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 := substitutionContextDeprecated{ +// 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{ +// Attributes: types.Attributes{ +// "title": "TITLE", +// }, +// Lines: [][]interface{}{ +// { +// &types.StringElement{ +// Content: "some content.", +// }, +// }, +// }, +// }, +// })) +// }) - 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{ - Attributes: types.Attributes{ - "title": "TITLE", - }, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "some content.", - }, - }, - }, - }, - })) - }) +// 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 := substitutionContextDeprecated{ +// 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.", +// }, +// }, +// }, +// }, +// })) +// }) - 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("image blocks", func() { +// It("should substitute inline attribute", func() { +// elements := []interface{}{ +// &types.ImageBlock{ +// Attributes: types.Attributes{ +// types.AttrImageAlt: []interface{}{ +// types.AttributeSubstitution{ +// Name: "alt", +// }, +// }, +// }, +// Location: &types.Location{ +// Path: []interface{}{ +// &types.StringElement{Content: "foo.png"}, +// }, +// }, +// }, +// } +// ctx := substitutionContextDeprecated{ +// 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 +// }, +// Location: &types.Location{ +// Path: []interface{}{ +// &types.StringElement{Content: "foo.png"}, +// }, +// }, +// }, +// })) +// }) - It("should substitute inline attribute", func() { - elements := []interface{}{ - types.ImageBlock{ - 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 - }, - Location: types.Location{ - Path: []interface{}{ - types.StringElement{Content: "foo.png"}, - }, - }, - }, - })) - }) +// It("should substitute inline attribute", func() { +// elements := []interface{}{ +// &types.ImageBlock{ +// Location: &types.Location{ +// Path: []interface{}{ +// types.AttributeSubstitution{ +// Name: "path", +// }, +// }, +// }, +// }, +// } +// ctx := substitutionContextDeprecated{ +// 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"}, +// }, +// }, +// }, +// })) +// }) - 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("list items", func() { +// It("should replace with new StringElement in ordered list item", func() { +// // given +// elements := []interface{}{ +// types.OrderedListElement{ +// Elements: []interface{}{ +// types.Paragraph{ +// Lines: [][]interface{}{ +// { +// types.AttributeSubstitution{ +// Name: "foo", +// }, +// &types.StringElement{ +// Content: " and more content.", +// }, +// }, +// }, +// }, +// }, +// }, +// } +// ctx := substitutionContextDeprecated{ +// 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.OrderedListElement{ +// Elements: []interface{}{ +// types.Paragraph{ +// Lines: [][]interface{}{ +// { +// &types.StringElement{ +// Content: "bar and more content.", +// }, +// }, +// }, +// }, +// }, +// }, +// })) +// }) - 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 := substitutionContextDeprecated{ +// 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 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 := substitutionContextDeprecated{ +// 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.", +// }, +// }, +// }, +// }, +// }, +// }, +// })) +// }) +// }) - 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("as delimited blocks", func() { - 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 := substitutionContextDeprecated{ +// 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.", +// }, +// }, +// }, +// }, +// }, +// }, +// })) +// }) +// }) - 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() { - 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 := substitutionContextDeprecated{ +// 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", +// }, +// }, +// }, +// }, +// })) +// }) +// }) - 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() { - 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 := substitutionContextDeprecated{ +// 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.", +// }, +// }, +// }, +// }, +// })) +// }) +// }) - 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() { - Context("counters", func() { +// It("should start at one", func() { +// // given +// elements := []interface{}{ +// types.CounterSubstitution{ +// Name: "foo", +// }, +// } +// ctx := substitutionContextDeprecated{ +// 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 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 := substitutionContextDeprecated{ +// 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"}, +// })) +// }) +// }) - 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() { - 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", +// }, +// }, +// }, +// types.Paragraph{ +// Lines: [][]interface{}{ +// { +// types.AttributeSubstitution{ +// Name: "abc", +// }, +// }, +// }, +// }, +// } +// ctx := substitutionContextDeprecated{ +// 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", +// }, +// }, +// }, +// }, +// })) +// }) - 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", - }, - }, - }, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.AttributeSubstitution{ - Name: "abc", - }, - }, - }, - }, - } - 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", - }, - }, - }, - }, - })) - }) +// }) +// }) - }) -}) +// var _ = Describe("substitution funcs", func() { -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 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 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 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 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 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 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"})) - }) -}) +// 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_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_footnotes.go b/pkg/parser/document_processing_footnotes.go index e3a89ae6..4f176405 100644 --- a/pkg/parser/document_processing_footnotes.go +++ b/pkg/parser/document_processing_footnotes.go @@ -1,19 +1,14 @@ 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() -} +// // 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 _, block := range blocks { +// if c, ok := block.(types.WithFootnotes); ok { +// 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 index a36f2364..afc2d562 100644 --- a/pkg/parser/document_processing_footnotes_test.go +++ b/pkg/parser/document_processing_footnotes_test.go @@ -1,121 +1,117 @@ package parser -import ( - "github.com/bytesparadise/libasciidoc/pkg/types" +// import ( +// . "github.com/onsi/ginkgo" //nolint golint +// . "github.com/onsi/gomega" //nolint golint +// ) - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint -) +// var _ = Describe("footnotes", func() { -var _ = Describe("footnotes", func() { +// It("should replace footnotes with footnote references", 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.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.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)) +// }) - 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 deleted file mode 100644 index 6f5abe4c..00000000 --- a/pkg/parser/document_processing_include_files.go +++ /dev/null @@ -1,402 +0,0 @@ -package parser - -import ( - "bufio" - "bytes" - "fmt" - "io" - "os" - "path/filepath" - "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...) -} - -// 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) - } - // 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.Write(includedLines) - default: - return nil, fmt.Errorf("unexpected type of line: '%T'", line) - } - } - 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) -} - -func relativeOffset(offset int) levelOffset { - return levelOffset{ - absolute: false, - value: offset, - apply: func(s *types.RawSection) { - s.Level += offset - }, - } -} - -func absoluteOffset(offset int) levelOffset { - return levelOffset{ - absolute: true, - value: offset, - apply: func(s *types.RawSection) { - s.Level = offset - }, - } -} - -// 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 - } - f.Location.Path = elements[0] - return f, nil -} - -func parseFileToInclude(ctx substitutionContext, incl types.FileInclusion, levelOffsets []levelOffset, options ...Option) ([]byte, error) { - incl, err := applySubstitutionsOnFileInclusion(ctx, incl) - if err != nil { - return nil, err - } - path := incl.Location.Stringify() - currentDir := filepath.Dir(ctx.config.Filename) - f, absPath, done, err := open(filepath.Join(currentDir, path)) - defer done() - if err != nil { - return nil, fmt.Errorf("Unresolved directive in %s - %s", ctx.config.Filename, incl.RawText) - } - 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) - } - if lr, ok := lineRanges(incl, ctx.config); ok { - if err := readWithinLines(scanner, content, lr); err != nil { - return nil, fmt.Errorf("Unresolved directive in %s - %s", ctx.config.Filename, incl.RawText) - } - } else if tr, ok := tagRanges(incl, ctx.config); ok { - if err := readWithinTags(path, scanner, content, tr); err != nil { - return nil, err // keep the underlying error here - } - } else { - if err := readAll(scanner, content); err != nil { - return nil, fmt.Errorf("Unresolved directive in %s - %s", ctx.config.Filename, incl.RawText) - } - } - if err := scanner.Err(); err != nil { - return nil, fmt.Errorf("Unresolved directive in %s - %s", ctx.config.Filename, incl.RawText) - } - // just include the file content if the file to include is not an Asciidoc document. - if !IsAsciidoc(absPath) { - return content.Bytes(), nil - } - // 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 err != nil { - return nil, errors.Wrap(err, "unable to read file to include") - } - if strings.HasPrefix(l, "+") || strings.HasPrefix(l, "-") { - levelOffsets = append(levelOffsets, relativeOffset(offset)) - } else { - levelOffsets = []levelOffset{absoluteOffset(offset)} - - } - } - - 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...) -} - -// 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) { - 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 - } - 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.NewLineRanges(lr), true - } - return types.LineRanges{}, false -} - -// 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) { - 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 - } - log.Debugf("tag ranges to include: %v", spew.Sdump(tagRanges)) - if exists { - 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.NewTagRanges(tr), true - } - return types.TagRanges{}, false -} - -func readWithinLines(scanner *bufio.Scanner, content *bytes.Buffer, lineRanges types.LineRanges) error { - line := 0 - for scanner.Scan() { - line++ - // parse the line in search for the `tag::[]` or `end:[]` macros - l, err := Parse("", scanner.Bytes(), Entrypoint("IncludedFileLine")) - if err != nil { - return err - } - fl, ok := l.(types.IncludedFileLine) - if !ok { - return errors.Errorf("unexpected type of parsed line in file to include: %T", l) - } - // skip if the line has tags - if fl.HasTag() { - continue - } - // TODO: stop reading if current line above highest range - if lineRanges.Match(line) { - _, err := content.Write(scanner.Bytes()) - if err != nil { - return err - } - _, err = content.WriteString("\n") - if err != nil { - return err - } - } - } - return nil -} - -func readWithinTags(path string, scanner *bufio.Scanner, content *bytes.Buffer, expectedRanges types.TagRanges) error { - // log.Debugf("limiting to tag ranges: %v", expectedRanges) - currentRanges := make(map[string]*types.CurrentTagRange, len(expectedRanges)) // ensure capacity - lineNumber := 0 - for scanner.Scan() { - lineNumber++ - line := scanner.Bytes() - // parse the line in search for the `tag::[]` or `end:[]` macros - l, err := Parse("", line, Entrypoint("IncludedFileLine")) - if err != nil { - return err - } - fl, ok := l.(types.IncludedFileLine) - if !ok { - return errors.Errorf("unexpected type of parsed line in file to include: %T", l) - } - // check if a start or end tag was found in the line - if startTag, ok := fl.GetStartTag(); ok { - currentRanges[startTag.Value] = &types.CurrentTagRange{ - StartLine: lineNumber, - EndLine: -1, - } - } - if endTag, ok := fl.GetEndTag(); ok { - currentRanges[endTag.Value].EndLine = lineNumber - } - if expectedRanges.Match(lineNumber, currentRanges) && !fl.HasTag() { - _, err := content.Write(scanner.Bytes()) - if err != nil { - return err - } - _, err = content.WriteString("\n") - if err != nil { - return err - } - } - } - // after the file has been processed, let's check if all tags were "found" - for _, tag := range expectedRanges { - // log.Debugf("checking if tag '%s' was found...", tag.Name) - switch tag.Name { - case "*", "**": - continue - default: - if tr, found := currentRanges[tag.Name]; !found { - return fmt.Errorf("tag '%s' not found in include file: %s", tag.Name, path) - } else if tr.EndLine == -1 { - log.Warnf("detected unclosed tag '%s' starting at line %d of include file: %s", tag.Name, tr.StartLine, path) - } - } - } - return nil -} - -func readAll(scanner *bufio.Scanner, content *bytes.Buffer) error { - for scanner.Scan() { - // parse the line in search for the `tag::[]` or `end:[]` macros - l, err := Parse("", scanner.Bytes(), Entrypoint("IncludedFileLine")) - if err != nil { - return err - } - fl, ok := l.(types.IncludedFileLine) - if !ok { - return errors.Errorf("unexpected type of parsed line in file to include: %T", l) - } - // skip if the line has tags - if fl.HasTag() { - continue - } - _, err = content.Write(scanner.Bytes()) - if err != nil { - return err - } - _, err = content.WriteString("\n") - if err != nil { - return err - } - } - return nil -} - -func open(path string) (*os.File, string, func(), error) { - wd, err := os.Getwd() - if err != nil { - return nil, "", func() {}, err - } - absPath, err := filepath.Abs(path) - if 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 - log.WithError(err).Error("failed to restore previous working directory") - } - }, err - } - dir := filepath.Dir(absPath) - err = os.Chdir(dir) - if 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 - log.WithError(err).Error("failed to restore previous working directory") - } - }, err - } - // read the file per-se - // log.Debugf("opening '%s'", absPath) - f, err := os.Open(absPath) - if err != nil { - return nil, absPath, func() { - // log.Debugf("restoring current working dir to: %s", wd) - if err := os.Chdir(wd); err != nil { // restore the previous working directory - log.WithError(err).Error("failed to restore previous working directory") - } - }, err - } - return f, absPath, func() { - // log.Debugf("restoring current working dir to: %s", wd) - if err := os.Chdir(wd); err != nil { // restore the previous working directory - log.WithError(err).Error("failed to restore previous working directory") - } - if err := f.Close(); err != nil { - log.WithError(err).Errorf("failed to close file '%s'", absPath) - } - }, nil -} - -// IsAsciidoc returns true if the file to include is an asciidoc file (based on the file location extension) -func IsAsciidoc(path string) bool { - ext := filepath.Ext(path) - return ext == ".asciidoc" || ext == ".adoc" || ext == ".ad" || ext == ".asc" || ext == ".txt" -} diff --git a/pkg/parser/document_processing_include_files_test.go b/pkg/parser/document_processing_include_files_test.go deleted file mode 100644 index 0279920b..00000000 --- a/pkg/parser/document_processing_include_files_test.go +++ /dev/null @@ -1,1987 +0,0 @@ -package parser_test - -import ( - "strings" - - "github.com/bytesparadise/libasciidoc/pkg/parser" - "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)) - }) - - 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", - }, - }, - }, - }, - }, - } - 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", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(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{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) - - It("should not include section 0 when attribute found", 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", - }, - }, - }, - }, - }, - } - result, err := ParseRawDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchRawDocument(expected)) - }) - - 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*", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]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' - }) - - 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{}{}, - }, - 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", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source, WithFilename("test.adoc"))).To(MatchRawDocument(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{}{}, - }, - 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", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source, WithFilename("test.adoc"))).To(MatchRawDocument(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{}{}, - }, - 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", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source, WithFilename("test.adoc"))).To(MatchRawDocument(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{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of parent", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]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.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of grandchild", - }, - }, - }, - }, - 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.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of parent", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source, WithFilename("test.adoc"))).To(MatchRawDocument(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{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "first line of parent", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]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", - }, - }, - 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 set to `4` because it was its parent was offset by 3... - 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", - }, - }, - }, - }, - 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", - }, - }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of child", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of parent", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source, WithFilename("test.adoc"))).To(MatchRawDocument(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{ - Content: "= parent title", - }, - }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ - Content: "first line of parent", - }, - }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ - Content: "= child title", - }, - }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ - Content: "first line of child", - }, - }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ - Content: "== grandchild title", - }, - }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ - Content: "first line of grandchild", - }, - }, - { - types.StringElement{ - Content: "", - }, - }, - { - types.StringElement{ - Content: "last line of grandchild", - }, - }, - { - types.StringElement{ - Content: "", - }, - }, - { - 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.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of grandchild", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of child", - }, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "last line of parent", - }, - }, - }, - }, - }, - }, - }, - } - result, err := ParseRawDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchRawDocument(expected)) - }) - - Context("with line ranges", func() { - - Context("with unquoted line ranges", 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", - }, - }, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(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", - }, - }, - 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", - }, - }, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(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", - }, - }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(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", - }, - }, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) - }) - - Context("with quoted line ranges", 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", - }, - }, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(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", - }, - }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(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", - }, - }, - 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{ - { - FullName: "content", - }, - }, - }, - Title: []interface{}{ - types.StringElement{ - Content: "Chapter A", - }, - }, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(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", - }, - }, - Elements: []interface{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "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)) - }) - }) - }) - - Context("with tag ranges", func() { - - It("file inclusion with single tag", func() { - logs, reset := ConfigureLogger(log.WarnLevel) - defer reset() - source := `include::../../test/includes/tag-include.adoc[tag=section]` - expected := types.RawDocument{ - Elements: []interface{}{ - types.Section{ - Level: 1, - Title: []interface{}{ - types.StringElement{ - Content: "Section 1", - }, - }, - Elements: []interface{}{}, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - // verify no error/warning in logs - Expect(logs).ToNot(ContainAnyMessageWithLevels(log.ErrorLevel, log.WarnLevel)) - }) - - 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{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]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)) - }) - - 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", - }, - }, - }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]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", - )) - }) - - 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("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{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, - }, - }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "end", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) - - 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{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, - }, - }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "end", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(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{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, - }, - }, - }, - types.BlankLine{}, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(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{}{}, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "content", - }, - }, - }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "end", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(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{}{}, - }, - types.BlankLine{}, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(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{}{}, - }, - types.BlankLine{}, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(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{}{}, - }, - types.BlankLine{}, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "end", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(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", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) - }) - }) - - 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]")) - }) - - 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]")) - }) - - 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]")) - }) - - 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]")) - }) - - 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 := `---- -include::{includedir}/unknown.adoc[leveloffset=+1] -----` - _, err := ParseRawDocument(source) - Expect(err).To(MatchError("Unresolved directive in test.adoc - include::{includedir}/unknown.adoc[leveloffset=+1]")) - }) - }) - - 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 - -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", - }, - }, - }, - }, - }, - } - 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.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", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source, WithFilename("tmp/foo.adoc"))).To(MatchRawDocument(expected)) - }) - - 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", - }, - }, - }, - }, - }, - } - Expect(ParseRawDocument(source)).To(MatchRawDocument(expected)) - }) - }) - - Context("inclusion of non-asciidoc file", func() { - - It("include go file without any range", func() { - - 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)) - }) - - It("include go file with a simple range", func() { - - source := `---- -include::../../test/includes/hello_world.go.txt[lines=1] -----` - expected := types.RawDocument{ - Elements: []interface{}{ - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: `package includes`, - }, - }, - }, - }, - }, - } - result, err := ParseRawDocument(source) - Expect(err).NotTo(HaveOccurred()) - Expect(result).To(MatchRawDocument(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("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", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - }) -}) diff --git a/pkg/parser/document_processing_include_toc_placeholder.go b/pkg/parser/document_processing_include_toc_placeholder.go index 4c8c011b..113234c5 100644 --- a/pkg/parser/document_processing_include_toc_placeholder.go +++ b/pkg/parser/document_processing_include_toc_placeholder.go @@ -1,66 +1,61 @@ 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 +// } -// 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 +// } -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 +// } -// 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 -} +// // 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 index 58bf3e5b..8dcac3e0 100644 --- a/pkg/parser/document_processing_include_toc_placeholder_test.go +++ b/pkg/parser/document_processing_include_toc_placeholder_test.go @@ -1,251 +1,248 @@ package parser -import ( - "github.com/bytesparadise/libasciidoc/pkg/types" +// import ( +// "github.com/bytesparadise/libasciidoc/pkg/types" - . "github.com/onsi/ginkgo" //nolint golint - . "github.com/onsi/gomega" //nolint golint -) +// . "github.com/onsi/ginkgo" //nolint golint +// . "github.com/onsi/gomega" //nolint golint +// ) -var _ = Describe("include table of contents", func() { +// 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{} +// // reusable elements +// doctitle := []interface{}{ +// &types.StringElement{Content: "A Title"}, +// } +// preamble := &types.Preamble{ +// Elements: []interface{}{ +// &types.BlankLine{}, +// &types.Paragraph{ +// Elements: []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{}{}, +// } - 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 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{}{ +// &types.TableOfContents{}, +// 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 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{}{ +// &types.TableOfContents{}, +// 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 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{}{ +// &types.TableOfContents{}, +// 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 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, +// &types.TableOfContents{}, +// 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 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, +// &types.TableOfContents{}, +// 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)) - }) +// 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, +// &types.TableOfContents{}, +// }, +// }, +// }, +// } +// 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 deleted file mode 100644 index 6e9e857c..00000000 --- a/pkg/parser/document_processing_insert_preamble_test.go +++ /dev/null @@ -1,246 +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("preambles", func() { - - sectionATitle := []interface{}{ - types.StringElement{Content: "Section A"}, - } - - sectionBTitle := []interface{}{ - types.StringElement{Content: "Section B"}, - } - - 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, - }, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "a short paragraph"}, - }, - }, - }, - types.BlankLine{}, - types.Paragraph{ - Lines: [][]interface{}{ - { - types.StringElement{Content: "another short paragraph"}, - }, - }, - }, - }, - } - Expect(includePreamble(source)).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, - }, - 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{}{}, - }, - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrTitle: "foo", - }, - ElementReferences: types.ElementReferences{ - "_section_a": sectionATitle, - "_section_b": sectionBTitle, - }, - Elements: []interface{}{ - types.Preamble{ - 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{}{}, - }, - }, - } - Expect(includePreamble(source)).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, - }, - 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{}{}, - }, - }, - } - expected := types.Document{ - Attributes: types.Attributes{ - types.AttrTitle: "foo", - }, - ElementReferences: types.ElementReferences{ - "_section_a": sectionATitle, - "_section_b": sectionBTitle, - }, - Elements: []interface{}{ - 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", - }, - Elements: []interface{}{}, - }, - }, - } - Expect(includePreamble(source)).To(Equal(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..264e065d 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", }, }, }, @@ -65,19 +62,12 @@ a paragraph` It("spaces before keyword", func() { 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.StringElement{ - Content: "a paragraph", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "[ link=http://foo.bar]\na paragraph", }, }, }, @@ -89,19 +79,12 @@ a paragraph` It("unbalanced brackets", func() { 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.StringElement{ - Content: "a paragraph", - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "[link=http://foo.bar\na paragraph", }, }, }, @@ -119,17 +102,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 +122,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 +145,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 +162,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 +185,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 +208,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 +236,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 +259,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 +279,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 +298,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 +322,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 +352,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..f8488795 --- /dev/null +++ b/pkg/parser/line_break_test.go @@ -0,0 +1,57 @@ +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{ + // Attributes: types.Attributes{ + // "author": "Xavier", + // }, + 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..3733a204 100644 --- a/pkg/parser/ordered_list_test.go +++ b/pkg/parser/ordered_list_test.go @@ -10,761 +10,37 @@ import ( var _ = Describe("ordered lists", func() { - Context("draft documents", func() { + Context("in 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"}, - }, - }, - }, - } - - 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{}, + // same single element in the list for each test in this context + elements := []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "element", }, - } - 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)) - }) + Context("ordered list element alone", func() { - 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{ + It("with implicit numbering style on a single line", func() { + source := `. element on a single line` + expected := &types.Document{ 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"}, + &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", + }, + }, }, }, }, @@ -772,74 +48,29 @@ b. item 2.a` }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - }) - - Context("list item continuation", func() { - It("ordered list with item continuation - case 1", func() { - source := `. foo -+ ----- -a delimited block ----- -+ ----- -another delimited block ----- -. bar + 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.DraftDocument{ + expected := &types.Document{ 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", + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: []interface{}{ + &types.Paragraph{ + Elements: []interface{}{ + &types.StringElement{ + Content: "element\non\nmultiple\nlines", // spaces are trimmed + }, }, }, }, @@ -848,102 +79,35 @@ another delimited block }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list with item continuation - case 2", func() { - source := `. {blank} -+ ----- -print("one") ----- -. {blank} -+ ----- -print("two") -----` - expected := types.DraftDocument{ + It("with implicit numbering style", func() { + source := `. element` + expected := &types.Document{ 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\")", - }, - }, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ + Style: types.Arabic, + Elements: elements, }, }, }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + Expect(ParseDocument(source)).To(MatchDocument(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"}, - }, - }, - }, - } - - It("ordered list item with implicit numbering style", func() { - source := `.. item` - expected := types.Document{ + It("with unnecessary level and numbering style adjustments", func() { + source := `.. element` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.LowerAlpha, Elements: elements, }, @@ -954,14 +118,14 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list item with arabic numbering style", func() { - source := `1. item` - expected := types.Document{ + It("with arabic numbering style", func() { + source := `1. element` + 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: elements, }, @@ -972,14 +136,14 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list item with lower alpha numbering style", func() { - source := `b. item` - expected := types.Document{ + It("with lower alpha numbering style", func() { + source := `b. element` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.LowerAlpha, Elements: elements, }, @@ -990,15 +154,14 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list item with upper alpha numbering style", func() { - source := `B. item` - expected := types.Document{ + It("with upper alpha numbering style", func() { + source := `B. element` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.UpperAlpha, Elements: elements, }, @@ -1009,14 +172,14 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list item with lower roman numbering style", func() { - source := `i) item` - expected := types.Document{ + It("with lower roman numbering style", func() { + source := `i) element` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.LowerRoman, Elements: elements, }, @@ -1027,240 +190,37 @@ print("two") Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("ordered list item with upper roman numbering style", func() { - source := `I) item` - expected := types.Document{ + It("with upper roman numbering style", func() { + source := `I) element` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + &types.List{ + Kind: types.OrderedListKind, + Elements: []types.ListElement{ + &types.OrderedListElement{ Style: types.UpperRoman, - Elements: elements, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("ordered list item with predefined attribute", func() { - source := `. {amp}` - expected := types.Document{ - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.PredefinedAttribute{Name: "amp"}, - }, - }, - }, - }, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("ordered list item with explicit numbering style", func() { - source := `[lowerroman] -. item -. item` - 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 - Elements: elements, - }, - }, - }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - - It("ordered list item with explicit start only", func() { - source := `[start=5] -. item` - expected := types.Document{ - Elements: []interface{}{ - types.OrderedList{ - Attributes: types.Attributes{ - "start": "5", - }, - Items: []types.OrderedListItem{ - { - Level: 1, - Style: types.Arabic, - Elements: elements, - }, - }, - }, - }, - } - 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{ - 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 - Elements: elements, - }, - }, - }, - }, - } - 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{ - 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", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, + Elements: elements, }, - { - Level: 1, + }, + }, + }, + } + 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{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", - }, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.PredefinedAttribute{Name: "amp"}, }, }, }, @@ -1272,126 +232,43 @@ 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 explicit start only", func() { + source := `[start=5] +. element` + expected := &types.Document{ Elements: []interface{}{ - types.OrderedList{ + &types.List{ + Kind: types.OrderedListKind, Attributes: types.Attributes{ - types.AttrTitle: "Ordered, max nesting", + "start": "5", }, - 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", - }, - }, - }, - }, - }, - }, - }, - }, - }, + 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, }, }, }, @@ -1399,40 +276,36 @@ print("two") } 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` - - expected := types.Document{ - Elements: []interface{}{ - types.OrderedList{ - Items: []types.OrderedListItem{ - { - Level: 1, + ... element 1.1.1 + ... element 1.1.2 + .. element 1.2 + . element 2 + .. element 2.1` + + 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 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,42 @@ 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.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "print(\"one\")", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "print(\"one\")", }, }, }, }, }, - { - Level: 1, + &types.OrderedListElement{ Style: types.Arabic, Elements: []interface{}{ - types.Paragraph{ - Lines: [][]interface{}{ - { - types.PredefinedAttribute{Name: "blank"}, - }, + &types.Paragraph{ + Elements: []interface{}{ + &types.PredefinedAttribute{Name: "blank"}, }, }, - types.ListingBlock{ - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "print(\"two\")", - }, + &types.DelimitedBlock{ + Kind: types.Listing, + Elements: []interface{}{ + &types.StringElement{ + Content: "print(\"two\")", }, }, }, 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..870157d4 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -23,98 +23,72 @@ import ( 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{}{ + &labeledExpr{ + pos: position{line: 22, col: 5, offset: 448}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 22, col: 16, offset: 459}, + expr: &ruleRefExpr{ + pos: position{line: 22, col: 17, offset: 460}, + name: "BlockAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 23, col: 5, offset: 482}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 24, col: 9, offset: 500}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1055, col: 5, offset: 33693}, + run: (*parser).callonDocumentFragment8, + expr: &seqExpr{ + pos: position{line: 1055, col: 5, offset: 33693}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 1055, col: 5, offset: 33693}, + run: (*parser).callonDocumentFragment10, }, - }, - &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}, + &labeledExpr{ + pos: position{line: 1058, col: 5, offset: 33751}, + label: "frontmatter", expr: &actionExpr{ - pos: position{line: 194, col: 30, offset: 6206}, - run: (*parser).callonRawSource17, + pos: position{line: 1064, col: 20, offset: 33908}, + run: (*parser).callonDocumentFragment12, expr: &seqExpr{ - pos: position{line: 194, col: 30, offset: 6206}, + pos: position{line: 1064, col: 20, offset: 33908}, exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 194, col: 30, offset: 6206}, + &litMatcher{ + pos: position{line: 1068, col: 30, offset: 34080}, + val: "---", + ignoreCase: false, + want: "\"---\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1068, col: 36, offset: 34086}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonRawSource22, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment18, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -123,123 +97,118 @@ var g = &grammar{ }, }, }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment25, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, &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).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: 1064, col: 45, offset: 33933}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 1064, col: 53, offset: 33941}, + expr: &actionExpr{ + pos: position{line: 1070, col: 27, offset: 34124}, + run: (*parser).callonDocumentFragment29, + expr: &zeroOrMoreExpr{ + pos: position{line: 1070, col: 27, offset: 34124}, + expr: &oneOrMoreExpr{ + pos: position{line: 1070, col: 28, offset: 34125}, expr: &seqExpr{ - pos: position{line: 221, col: 25, offset: 7126}, + pos: position{line: 1070, col: 29, offset: 34126}, 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).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, + ¬Expr{ + pos: position{line: 1070, col: 29, offset: 34126}, + expr: &seqExpr{ + pos: position{line: 1068, col: 30, offset: 34080}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1068, col: 30, offset: 34080}, + val: "---", + ignoreCase: false, + want: "\"---\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1068, col: 36, offset: 34086}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment39, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, }, }, }, - }, - }, - }, - &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{}{ + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\":\"", + want: "\"\\n\"", }, - &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, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment46, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -247,509 +216,788 @@ var g = &grammar{ }, }, }, + &anyMatcher{ + line: 1070, col: 55, offset: 34152, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1068, col: 30, offset: 34080}, + val: "---", + ignoreCase: false, + want: "\"---\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1068, col: 36, offset: 34086}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment53, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment60, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 835, col: 5, offset: 26265}, + run: (*parser).callonDocumentFragment62, + expr: &seqExpr{ + pos: position{line: 835, col: 5, offset: 26265}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 835, col: 5, offset: 26265}, + run: (*parser).callonDocumentFragment64, + }, + &zeroOrMoreExpr{ + pos: position{line: 838, col: 5, offset: 26326}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonDocumentFragment66, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment74, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment81, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 839, col: 5, offset: 26376}, + label: "title", + expr: &actionExpr{ + pos: position{line: 853, col: 5, offset: 26909}, + run: (*parser).callonDocumentFragment84, + expr: &seqExpr{ + pos: position{line: 853, col: 5, offset: 26909}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 853, col: 5, offset: 26909}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonDocumentFragment87, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 853, col: 16, offset: 26920}, + label: "title", + expr: &actionExpr{ + pos: position{line: 2368, col: 20, offset: 79760}, + run: (*parser).callonDocumentFragment91, + expr: &zeroOrMoreExpr{ + pos: position{line: 2368, col: 20, offset: 79760}, + expr: &charClassMatcher{ + pos: position{line: 2368, col: 20, offset: 79760}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment99, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 840, col: 5, offset: 26400}, + label: "info", + expr: &zeroOrOneExpr{ + pos: position{line: 840, col: 10, offset: 26405}, + expr: &actionExpr{ + pos: position{line: 858, col: 5, offset: 27017}, + run: (*parser).callonDocumentFragment103, + expr: &seqExpr{ + pos: position{line: 858, col: 5, offset: 27017}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 858, col: 5, offset: 27017}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonDocumentFragment106, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment114, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, &litMatcher{ - pos: position{line: 221, col: 78, offset: 7179}, - val: "}", + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - want: "\"}\"", + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment121, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 859, col: 5, offset: 27032}, + expr: &choiceExpr{ + pos: position{line: 859, col: 6, offset: 27033}, + alternatives: []interface{}{ &actionExpr{ - pos: position{line: 225, col: 25, offset: 7281}, - run: (*parser).callonRawSource52, + pos: position{line: 2604, col: 22, offset: 86659}, + run: (*parser).callonDocumentFragment125, expr: &seqExpr{ - pos: position{line: 225, col: 25, offset: 7281}, + pos: position{line: 2604, col: 22, offset: 86659}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 225, col: 25, offset: 7281}, - val: "{counter2:", + pos: position{line: 2609, col: 31, offset: 86880}, + val: "//", ignoreCase: false, - want: "\"{counter2:\"", + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2609, col: 36, offset: 86885}, + expr: &litMatcher{ + pos: position{line: 2609, col: 37, offset: 86886}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, }, &labeledExpr{ - pos: position{line: 225, col: 38, offset: 7294}, - label: "name", + pos: position{line: 2604, col: 49, offset: 86686}, + label: "content", 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, - }, - }, + pos: position{line: 2611, col: 29, offset: 86921}, + run: (*parser).callonDocumentFragment131, + expr: &zeroOrMoreExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + expr: &charClassMatcher{ + pos: position{line: 2611, col: 29, offset: 86921}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, - &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, - }, - }, - }, - }, - }, - }, - }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment139, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &litMatcher{ - pos: position{line: 225, col: 79, offset: 7335}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, }, }, }, &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonRawSource74, + pos: position{line: 569, col: 5, offset: 18198}, + run: (*parser).callonDocumentFragment141, expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, + pos: position{line: 569, col: 5, offset: 18198}, exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 569, col: 5, offset: 18198}, + run: (*parser).callonDocumentFragment143, + }, &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", + pos: position{line: 541, col: 26, offset: 17536}, + val: "////", ignoreCase: false, - want: "\"{\"", + want: "\"////\"", }, - &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", - 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")}, + &zeroOrMoreExpr{ + pos: position{line: 541, col: 33, offset: 17543}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment148, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\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, - }, + want: "\"\\t\"", }, }, }, }, }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment155, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 574, col: 5, offset: 18381}, + run: (*parser).callonDocumentFragment157, + }, + &labeledExpr{ + pos: position{line: 579, col: 5, offset: 18582}, + label: "content", + expr: &zeroOrMoreExpr{ + pos: position{line: 590, col: 5, offset: 18906}, + expr: &actionExpr{ + pos: position{line: 590, col: 6, offset: 18907}, + run: (*parser).callonDocumentFragment160, + expr: &seqExpr{ + pos: position{line: 590, col: 6, offset: 18907}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 590, col: 6, offset: 18907}, + expr: &choiceExpr{ + pos: position{line: 587, col: 29, offset: 18849}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 541, col: 26, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 541, col: 26, offset: 17536}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 541, col: 33, offset: 17543}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment169, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment176, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 591, col: 5, offset: 18937}, + label: "line", + expr: &actionExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + run: (*parser).callonDocumentFragment181, + expr: &seqExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 558, col: 5, offset: 17893}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &labeledExpr{ + pos: position{line: 559, col: 5, offset: 17966}, + label: "content", + expr: &actionExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + run: (*parser).callonDocumentFragment187, + expr: &zeroOrMoreExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + expr: &charClassMatcher{ + pos: position{line: 559, col: 14, offset: 17975}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment195, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &zeroOrOneExpr{ + pos: position{line: 580, col: 5, offset: 18616}, + expr: &choiceExpr{ + pos: position{line: 587, col: 29, offset: 18849}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 541, col: 26, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 541, col: 26, offset: 17536}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 541, col: 33, offset: 17543}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment204, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment211, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, }, }, }, }, - &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: "\"{\"", - }, - }, }, }, }, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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\"", - }, - }, - }, - }, - }, - &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, - }, - }, - }, - }, - }, - }, - }, - &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, - }, - }, - }, - &labeledExpr{ - pos: position{line: 42, col: 17, offset: 1082}, - label: "content", - expr: &actionExpr{ - pos: position{line: 42, col: 26, offset: 1091}, - run: (*parser).callonRawSource119, - 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}, + &labeledExpr{ + pos: position{line: 860, col: 5, offset: 27107}, + label: "authors", + expr: &actionExpr{ + pos: position{line: 866, col: 20, offset: 27357}, + run: (*parser).callonDocumentFragment216, expr: &seqExpr{ - pos: position{line: 111, col: 26, offset: 3293}, + pos: position{line: 866, col: 20, offset: 27357}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 111, col: 26, offset: 3293}, - val: "---", - ignoreCase: false, - want: "\"---\"", - }, &zeroOrMoreExpr{ - pos: position{line: 111, col: 32, offset: 3299}, + pos: position{line: 866, col: 20, offset: 27357}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonRawDocument30, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment221, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -758,284 +1006,658 @@ 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, + &labeledExpr{ + pos: position{line: 866, col: 27, offset: 27364}, + label: "authors", + expr: &choiceExpr{ + pos: position{line: 866, col: 36, offset: 27373}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 870, col: 30, offset: 27493}, + run: (*parser).callonDocumentFragment225, + expr: &seqExpr{ + pos: position{line: 870, col: 30, offset: 27493}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 870, col: 30, offset: 27493}, + expr: &litMatcher{ + pos: position{line: 870, col: 31, offset: 27494}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + &labeledExpr{ + pos: position{line: 870, col: 35, offset: 27498}, + label: "authors", + expr: &oneOrMoreExpr{ + pos: position{line: 870, col: 44, offset: 27507}, + expr: &actionExpr{ + pos: position{line: 879, col: 5, offset: 27739}, + run: (*parser).callonDocumentFragment231, + expr: &seqExpr{ + pos: position{line: 879, col: 5, offset: 27739}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 879, col: 5, offset: 27739}, + label: "fullName", + expr: &zeroOrOneExpr{ + pos: position{line: 879, col: 14, offset: 27748}, + expr: &actionExpr{ + pos: position{line: 890, col: 5, offset: 28128}, + run: (*parser).callonDocumentFragment235, + expr: &seqExpr{ + pos: position{line: 890, col: 5, offset: 28128}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 890, col: 5, offset: 28128}, + label: "part1", + expr: &actionExpr{ + pos: position{line: 890, col: 12, offset: 28135}, + run: (*parser).callonDocumentFragment238, + expr: &oneOrMoreExpr{ + pos: position{line: 890, col: 12, offset: 28135}, + expr: &charClassMatcher{ + pos: position{line: 890, col: 12, offset: 28135}, + val: "[^<;\\r\\n ]", + chars: []rune{'<', ';', '\r', '\n', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 893, col: 5, offset: 28215}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment244, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 894, col: 5, offset: 28226}, + label: "part2", + expr: &zeroOrOneExpr{ + pos: position{line: 894, col: 11, offset: 28232}, + expr: &actionExpr{ + pos: position{line: 894, col: 12, offset: 28233}, + run: (*parser).callonDocumentFragment248, + expr: &oneOrMoreExpr{ + pos: position{line: 894, col: 12, offset: 28233}, + expr: &charClassMatcher{ + pos: position{line: 894, col: 12, offset: 28233}, + val: "[^<;\\r\\n ]", + chars: []rune{'<', ';', '\r', '\n', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 897, col: 5, offset: 28314}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment254, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 898, col: 5, offset: 28325}, + label: "part3", + expr: &zeroOrOneExpr{ + pos: position{line: 898, col: 11, offset: 28331}, + expr: &actionExpr{ + pos: position{line: 898, col: 12, offset: 28332}, + run: (*parser).callonDocumentFragment258, + expr: &oneOrMoreExpr{ + pos: position{line: 898, col: 12, offset: 28332}, + expr: &charClassMatcher{ + pos: position{line: 898, col: 12, offset: 28332}, + val: "[^<;\\r\\n]", + chars: []rune{'<', ';', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 901, col: 5, offset: 28411}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment264, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 879, col: 40, offset: 27774}, + label: "email", + expr: &zeroOrOneExpr{ + pos: position{line: 879, col: 46, offset: 27780}, + expr: &actionExpr{ + pos: position{line: 907, col: 5, offset: 28533}, + run: (*parser).callonDocumentFragment268, + expr: &seqExpr{ + pos: position{line: 907, col: 5, offset: 28533}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 907, col: 5, offset: 28533}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &litMatcher{ + pos: position{line: 908, col: 5, offset: 28543}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 909, col: 5, offset: 28552}, + label: "email", + expr: &actionExpr{ + pos: position{line: 909, col: 12, offset: 28559}, + run: (*parser).callonDocumentFragment275, + expr: &oneOrMoreExpr{ + pos: position{line: 909, col: 13, offset: 28560}, + expr: &charClassMatcher{ + pos: position{line: 909, col: 13, offset: 28560}, + val: "[^>\\r\\n]", + chars: []rune{'>', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 912, col: 5, offset: 28620}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 879, col: 69, offset: 27803}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment282, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &zeroOrOneExpr{ + pos: position{line: 879, col: 76, offset: 27810}, + expr: &litMatcher{ + pos: position{line: 879, col: 76, offset: 27810}, + val: ";", + ignoreCase: false, + want: "\";\"", + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 879, col: 81, offset: 27815}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment289, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 880, col: 5, offset: 27827}, + run: (*parser).callonDocumentFragment291, + }, + }, + }, + }, + }, + }, + }, + }, }, - }, - }, - }, - }, - }, - }, - &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{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - ¬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, + &actionExpr{ + pos: position{line: 874, col: 33, offset: 27625}, + run: (*parser).callonDocumentFragment292, + expr: &seqExpr{ + pos: position{line: 874, col: 33, offset: 27625}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 874, col: 33, offset: 27625}, + val: ":author:", + ignoreCase: false, + want: "\":author:\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 874, col: 44, offset: 27636}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment298, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 874, col: 51, offset: 27643}, + label: "author", + expr: &actionExpr{ + pos: position{line: 879, col: 5, offset: 27739}, + run: (*parser).callonDocumentFragment301, + expr: &seqExpr{ + pos: position{line: 879, col: 5, offset: 27739}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 879, col: 5, offset: 27739}, + label: "fullName", + expr: &zeroOrOneExpr{ + pos: position{line: 879, col: 14, offset: 27748}, + expr: &actionExpr{ + pos: position{line: 890, col: 5, offset: 28128}, + run: (*parser).callonDocumentFragment305, + expr: &seqExpr{ + pos: position{line: 890, col: 5, offset: 28128}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 890, col: 5, offset: 28128}, + label: "part1", + expr: &actionExpr{ + pos: position{line: 890, col: 12, offset: 28135}, + run: (*parser).callonDocumentFragment308, + expr: &oneOrMoreExpr{ + pos: position{line: 890, col: 12, offset: 28135}, + expr: &charClassMatcher{ + pos: position{line: 890, col: 12, offset: 28135}, + val: "[^<;\\r\\n ]", + chars: []rune{'<', ';', '\r', '\n', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 893, col: 5, offset: 28215}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment314, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 894, col: 5, offset: 28226}, + label: "part2", + expr: &zeroOrOneExpr{ + pos: position{line: 894, col: 11, offset: 28232}, + expr: &actionExpr{ + pos: position{line: 894, col: 12, offset: 28233}, + run: (*parser).callonDocumentFragment318, + expr: &oneOrMoreExpr{ + pos: position{line: 894, col: 12, offset: 28233}, + expr: &charClassMatcher{ + pos: position{line: 894, col: 12, offset: 28233}, + val: "[^<;\\r\\n ]", + chars: []rune{'<', ';', '\r', '\n', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 897, col: 5, offset: 28314}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment324, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 898, col: 5, offset: 28325}, + label: "part3", + expr: &zeroOrOneExpr{ + pos: position{line: 898, col: 11, offset: 28331}, + expr: &actionExpr{ + pos: position{line: 898, col: 12, offset: 28332}, + run: (*parser).callonDocumentFragment328, + expr: &oneOrMoreExpr{ + pos: position{line: 898, col: 12, offset: 28332}, + expr: &charClassMatcher{ + pos: position{line: 898, col: 12, offset: 28332}, + val: "[^<;\\r\\n]", + chars: []rune{'<', ';', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 901, col: 5, offset: 28411}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment334, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 879, col: 40, offset: 27774}, + label: "email", + expr: &zeroOrOneExpr{ + pos: position{line: 879, col: 46, offset: 27780}, + expr: &actionExpr{ + pos: position{line: 907, col: 5, offset: 28533}, + run: (*parser).callonDocumentFragment338, + expr: &seqExpr{ + pos: position{line: 907, col: 5, offset: 28533}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 907, col: 5, offset: 28533}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &litMatcher{ + pos: position{line: 908, col: 5, offset: 28543}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 909, col: 5, offset: 28552}, + label: "email", + expr: &actionExpr{ + pos: position{line: 909, col: 12, offset: 28559}, + run: (*parser).callonDocumentFragment345, + expr: &oneOrMoreExpr{ + pos: position{line: 909, col: 13, offset: 28560}, + expr: &charClassMatcher{ + pos: position{line: 909, col: 13, offset: 28560}, + val: "[^>\\r\\n]", + chars: []rune{'>', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 912, col: 5, offset: 28620}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 879, col: 69, offset: 27803}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment352, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &zeroOrOneExpr{ + pos: position{line: 879, col: 76, offset: 27810}, + expr: &litMatcher{ + pos: position{line: 879, col: 76, offset: 27810}, + val: ";", + ignoreCase: false, + want: "\";\"", + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 879, col: 81, offset: 27815}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment359, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 880, col: 5, offset: 27827}, + run: (*parser).callonDocumentFragment361, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, - &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: "\" \"", + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, - &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\"", - }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment367, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -1044,122 +1666,118 @@ 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, - }, + &zeroOrMoreExpr{ + pos: position{line: 861, col: 5, offset: 27138}, + expr: &choiceExpr{ + pos: position{line: 861, col: 6, offset: 27139}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + run: (*parser).callonDocumentFragment371, + expr: &seqExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2609, col: 31, offset: 86880}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2609, col: 36, offset: 86885}, + expr: &litMatcher{ + pos: position{line: 2609, col: 37, offset: 86886}, + 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: 2604, col: 49, offset: 86686}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + run: (*parser).callonDocumentFragment377, + expr: &zeroOrMoreExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + expr: &charClassMatcher{ + pos: position{line: 2611, col: 29, offset: 86921}, + 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")}, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - inverted: false, + want: "\"\\n\"", }, - }, - &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: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment385, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, }, }, - &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}, + }, + &actionExpr{ + pos: position{line: 569, col: 5, offset: 18198}, + run: (*parser).callonDocumentFragment387, + expr: &seqExpr{ + pos: position{line: 569, col: 5, offset: 18198}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 569, col: 5, offset: 18198}, + run: (*parser).callonDocumentFragment389, + }, + &litMatcher{ + pos: position{line: 541, col: 26, offset: 17536}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 541, col: 33, offset: 17543}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks65, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment394, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -1167,309 +1785,330 @@ var g = &grammar{ }, }, }, - &litMatcher{ - pos: position{line: 995, col: 20, offset: 32707}, - val: "+", - ignoreCase: false, - want: "\"+\"", + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment401, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, - &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", - ignoreCase: false, - want: "\"\\t\"", + }, + &andCodeExpr{ + pos: position{line: 574, col: 5, offset: 18381}, + run: (*parser).callonDocumentFragment403, + }, + &labeledExpr{ + pos: position{line: 579, col: 5, offset: 18582}, + label: "content", + expr: &zeroOrMoreExpr{ + pos: position{line: 590, col: 5, offset: 18906}, + expr: &actionExpr{ + pos: position{line: 590, col: 6, offset: 18907}, + run: (*parser).callonDocumentFragment406, + expr: &seqExpr{ + pos: position{line: 590, col: 6, offset: 18907}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 590, col: 6, offset: 18907}, + expr: &choiceExpr{ + pos: position{line: 587, col: 29, offset: 18849}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 541, col: 26, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 541, col: 26, offset: 17536}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 541, col: 33, offset: 17543}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment415, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment422, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 591, col: 5, offset: 18937}, + label: "line", + expr: &actionExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + run: (*parser).callonDocumentFragment427, + expr: &seqExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 558, col: 5, offset: 17893}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &labeledExpr{ + pos: position{line: 559, col: 5, offset: 17966}, + label: "content", + expr: &actionExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + run: (*parser).callonDocumentFragment433, + expr: &zeroOrMoreExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + expr: &charClassMatcher{ + pos: position{line: 559, col: 14, offset: 17975}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment441, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, }, }, }, }, }, - &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, + }, + &zeroOrOneExpr{ + pos: position{line: 580, col: 5, offset: 18616}, + expr: &choiceExpr{ + pos: position{line: 587, col: 29, offset: 18849}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 541, col: 26, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 541, col: 26, offset: 17536}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 541, col: 33, offset: 17543}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment450, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment457, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, }, }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, }, }, }, - &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, - }, - }, - }, - }, - &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, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &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: "]]", - 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).callonDocumentBlocks107, - 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: 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}, + &labeledExpr{ + pos: position{line: 862, col: 5, offset: 27213}, + label: "revision", + expr: &zeroOrOneExpr{ + pos: position{line: 862, col: 14, offset: 27222}, + expr: &actionExpr{ + pos: position{line: 918, col: 21, offset: 28809}, + run: (*parser).callonDocumentFragment463, expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 918, col: 21, offset: 28809}, 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: 918, col: 21, offset: 28809}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks130, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment468, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -1478,286 +2117,259 @@ 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, - }, - }, + ¬Expr{ + pos: position{line: 918, col: 28, offset: 28816}, + expr: &litMatcher{ + pos: position{line: 918, col: 29, offset: 28817}, + val: ":", + ignoreCase: false, + want: "\":\"", }, }, - }, - }, - }, - &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, - 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).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'}, - 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).callonDocumentBlocks162, - expr: &seqExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1912, col: 28, offset: 68226}, + &labeledExpr{ + pos: position{line: 918, col: 33, offset: 28821}, + label: "revision", expr: &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, + pos: position{line: 919, col: 9, offset: 28840}, 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\"", + &actionExpr{ + pos: position{line: 919, col: 10, offset: 28841}, + run: (*parser).callonDocumentFragment474, + expr: &seqExpr{ + pos: position{line: 919, col: 10, offset: 28841}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 919, col: 10, offset: 28841}, + label: "revnumber", + expr: &choiceExpr{ + pos: position{line: 928, col: 27, offset: 29358}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 928, col: 27, offset: 29358}, + run: (*parser).callonDocumentFragment478, + expr: &seqExpr{ + pos: position{line: 928, col: 27, offset: 29358}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 928, col: 27, offset: 29358}, + val: "v", + ignoreCase: true, + want: "\"v\"i", + }, + &actionExpr{ + pos: position{line: 2870, col: 10, offset: 94910}, + run: (*parser).callonDocumentFragment481, + expr: &charClassMatcher{ + pos: position{line: 2870, col: 10, offset: 94910}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 928, col: 39, offset: 29370}, + expr: &charClassMatcher{ + pos: position{line: 928, col: 39, offset: 29370}, + val: "[^:,\\r\\n]", + chars: []rune{':', ',', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 930, col: 5, offset: 29418}, + run: (*parser).callonDocumentFragment485, + expr: &seqExpr{ + pos: position{line: 930, col: 5, offset: 29418}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 930, col: 5, offset: 29418}, + expr: &litMatcher{ + pos: position{line: 930, col: 5, offset: 29418}, + val: "v", + ignoreCase: true, + want: "\"v\"i", + }, + }, + &actionExpr{ + pos: position{line: 2870, col: 10, offset: 94910}, + run: (*parser).callonDocumentFragment489, + expr: &charClassMatcher{ + pos: position{line: 2870, col: 10, offset: 94910}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 930, col: 18, offset: 29431}, + expr: &charClassMatcher{ + pos: position{line: 930, col: 18, offset: 29431}, + val: "[^:,\\r\\n]", + chars: []rune{':', ',', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 930, col: 29, offset: 29442}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment496, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 930, col: 36, offset: 29449}, + expr: &litMatcher{ + pos: position{line: 930, col: 37, offset: 29450}, + 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", + &zeroOrOneExpr{ + pos: position{line: 919, col: 45, offset: 28876}, + expr: &litMatcher{ + pos: position{line: 919, col: 45, offset: 28876}, + 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: 919, col: 50, offset: 28881}, + label: "revdate", + expr: &zeroOrOneExpr{ + pos: position{line: 919, col: 58, offset: 28889}, + expr: &actionExpr{ + pos: position{line: 934, col: 25, offset: 29514}, + run: (*parser).callonDocumentFragment504, + expr: &oneOrMoreExpr{ + pos: position{line: 934, col: 25, offset: 29514}, + expr: &charClassMatcher{ + pos: position{line: 934, col: 25, offset: 29514}, + val: "[^:\\r\\n]", + chars: []rune{':', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &zeroOrOneExpr{ + pos: position{line: 919, col: 82, offset: 28913}, + expr: &litMatcher{ + pos: position{line: 919, col: 82, offset: 28913}, + 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: 919, col: 87, offset: 28918}, + label: "revremark", + expr: &zeroOrOneExpr{ + pos: position{line: 919, col: 97, offset: 28928}, + expr: &actionExpr{ + pos: position{line: 938, col: 27, offset: 29586}, + run: (*parser).callonDocumentFragment511, + expr: &oneOrMoreExpr{ + pos: position{line: 938, col: 27, offset: 29586}, + expr: &charClassMatcher{ + pos: position{line: 938, col: 27, offset: 29586}, + 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, - }, - }, - }, - }, - }, - &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, + &actionExpr{ + pos: position{line: 921, col: 15, offset: 29046}, + run: (*parser).callonDocumentFragment514, + expr: &seqExpr{ + pos: position{line: 921, col: 15, offset: 29046}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 921, col: 15, offset: 29046}, + label: "revdate", + expr: &actionExpr{ + pos: position{line: 934, col: 25, offset: 29514}, + run: (*parser).callonDocumentFragment517, + expr: &oneOrMoreExpr{ + pos: position{line: 934, col: 25, offset: 29514}, + expr: &charClassMatcher{ + pos: position{line: 934, col: 25, offset: 29514}, + 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).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'}, + &zeroOrOneExpr{ + pos: position{line: 921, col: 46, offset: 29077}, + expr: &litMatcher{ + pos: position{line: 921, col: 46, offset: 29077}, + 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, + &labeledExpr{ + pos: position{line: 921, col: 51, offset: 29082}, + label: "revremark", + expr: &zeroOrOneExpr{ + pos: position{line: 921, col: 61, offset: 29092}, + expr: &actionExpr{ + pos: position{line: 938, col: 27, offset: 29586}, + run: (*parser).callonDocumentFragment524, + expr: &oneOrMoreExpr{ + pos: position{line: 938, col: 27, offset: 29586}, + expr: &charClassMatcher{ + pos: position{line: 938, col: 27, offset: 29586}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, }, }, }, @@ -1766,77 +2378,40 @@ var g = &grammar{ }, }, }, - }, - }, - }, - }, - }, - &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}, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks201, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment532, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + 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: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, }, }, }, @@ -1846,205 +2421,471 @@ var g = &grammar{ }, }, }, - }, - &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}, + &labeledExpr{ + pos: position{line: 841, col: 5, offset: 26430}, + label: "extraAttrs", + expr: &zeroOrMoreExpr{ + pos: position{line: 841, col: 16, offset: 26441}, + expr: &choiceExpr{ + pos: position{line: 841, col: 17, offset: 26442}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 108, col: 5, offset: 3008}, + run: (*parser).callonDocumentFragment537, + expr: &seqExpr{ + pos: position{line: 108, col: 5, offset: 3008}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 108, col: 5, offset: 3008}, 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}, + &labeledExpr{ + pos: position{line: 108, col: 9, offset: 3012}, + label: "name", expr: &actionExpr{ - pos: position{line: 138, col: 19, offset: 4246}, - run: (*parser).callonDocumentBlocks224, + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDocumentFragment541, expr: &seqExpr{ - pos: position{line: 138, col: 19, offset: 4246}, + pos: position{line: 118, col: 18, offset: 3399}, exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, &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", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, - &labeledExpr{ - pos: position{line: 138, col: 26, offset: 4253}, - label: "fullname", - expr: &actionExpr{ - pos: position{line: 143, col: 23, offset: 4491}, - run: (*parser).callonDocumentBlocks232, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 108, col: 30, offset: 3033}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 109, col: 5, offset: 3042}, + label: "value", + expr: &zeroOrOneExpr{ + pos: position{line: 109, col: 11, offset: 3048}, + expr: &actionExpr{ + pos: position{line: 123, col: 5, offset: 3500}, + run: (*parser).callonDocumentFragment549, + expr: &seqExpr{ + pos: position{line: 123, col: 5, offset: 3500}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonDocumentFragment551, expr: &oneOrMoreExpr{ - pos: position{line: 143, col: 23, offset: 4491}, + pos: position{line: 2882, col: 11, offset: 95109}, expr: &charClassMatcher{ - pos: position{line: 143, col: 23, offset: 4491}, - val: "[^<;\\r\\n]", - chars: []rune{'<', ';', '\r', '\n'}, + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, ignoreCase: false, - inverted: true, + inverted: false, }, }, }, - }, - &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, - 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).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, + &labeledExpr{ + pos: position{line: 123, col: 12, offset: 3507}, + label: "elements", + expr: &zeroOrMoreExpr{ + pos: position{line: 123, col: 21, offset: 3516}, + expr: &actionExpr{ + pos: position{line: 127, col: 37, offset: 3675}, + run: (*parser).callonDocumentFragment556, + expr: &seqExpr{ + pos: position{line: 127, col: 37, offset: 3675}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 127, col: 37, offset: 3675}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment564, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 128, col: 5, offset: 3685}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 129, col: 9, offset: 3703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 129, col: 10, offset: 3704}, + run: (*parser).callonDocumentFragment568, + expr: &oneOrMoreExpr{ + pos: position{line: 129, col: 10, offset: 3704}, + expr: &charClassMatcher{ + pos: position{line: 129, col: 10, offset: 3704}, + val: "[^\\r\\n{]", + chars: []rune{'\r', '\n', '{'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDocumentFragment571, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDocumentFragment573, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonDocumentFragment576, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDocumentFragment580, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDocumentFragment587, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDocumentFragment592, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDocumentFragment594, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonDocumentFragment598, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDocumentFragment602, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDocumentFragment609, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDocumentFragment614, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDocumentFragment616, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonDocumentFragment620, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDocumentFragment624, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 133, col: 12, offset: 3832}, + run: (*parser).callonDocumentFragment630, + expr: &litMatcher{ + pos: position{line: 133, col: 12, offset: 3832}, + 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: " ", - 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\"", }, }, }, @@ -2054,403 +2895,259 @@ 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}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks267, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment637, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\r\"", }, }, }, }, }, - &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, - }, - }, + }, + }, + &actionExpr{ + pos: position{line: 140, col: 19, offset: 3987}, + run: (*parser).callonDocumentFragment639, + expr: &seqExpr{ + pos: position{line: 140, col: 19, offset: 3987}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 140, col: 19, offset: 3987}, + val: ":!", + ignoreCase: false, + want: "\":!\"", + }, + &labeledExpr{ + pos: position{line: 140, col: 24, offset: 3992}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDocumentFragment643, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, - }, - &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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, - &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\"", - }, - }, - }, - }, + }, + }, + }, + &litMatcher{ + pos: position{line: 140, col: 45, offset: 4013}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 140, col: 49, offset: 4017}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", }, - &zeroOrOneExpr{ - pos: position{line: 138, col: 92, offset: 4319}, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment652, expr: &litMatcher{ - pos: position{line: 138, col: 92, offset: 4319}, - val: ";", + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", 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\"", - }, - }, - }, + 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, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment659, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &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}, - 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\"", }, }, }, }, }, &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonDocumentBlocks317, + pos: position{line: 142, col: 5, offset: 4084}, + run: (*parser).callonDocumentFragment661, expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, + pos: position{line: 142, col: 5, offset: 4084}, 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\"", - }, - }, - }, + &litMatcher{ + pos: position{line: 142, col: 5, offset: 4084}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 142, col: 9, offset: 4088}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDocumentFragment665, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 1916, col: 45, offset: 68340}, - val: "//", + pos: position{line: 142, col: 30, offset: 4109}, + val: "!:", ignoreCase: false, - want: "\"//\"", + 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'}, + &zeroOrMoreExpr{ + pos: position{line: 142, col: 35, offset: 4114}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - inverted: true, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment674, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, }, }, }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment681, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -2460,580 +3157,537 @@ var g = &grammar{ }, }, }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonDocumentFragment683, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment691, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, &actionExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, - run: (*parser).callonDocumentBlocks342, - 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).callonDocumentBlocks348, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment698, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 108, col: 5, offset: 3008}, + run: (*parser).callonDocumentFragment700, + expr: &seqExpr{ + pos: position{line: 108, col: 5, offset: 3008}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 108, col: 5, offset: 3008}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 108, col: 9, offset: 3012}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDocumentFragment704, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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'}, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 108, col: 30, offset: 3033}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 109, col: 5, offset: 3042}, + label: "value", + expr: &zeroOrOneExpr{ + pos: position{line: 109, col: 11, offset: 3048}, + expr: &actionExpr{ + pos: position{line: 123, col: 5, offset: 3500}, + run: (*parser).callonDocumentFragment712, + expr: &seqExpr{ + pos: position{line: 123, col: 5, offset: 3500}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonDocumentFragment714, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + 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: 123, col: 12, offset: 3507}, + label: "elements", expr: &zeroOrMoreExpr{ - pos: position{line: 1912, col: 27, offset: 68225}, + pos: position{line: 123, col: 21, offset: 3516}, expr: &actionExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - run: (*parser).callonDocumentBlocks357, + pos: position{line: 127, col: 37, offset: 3675}, + run: (*parser).callonDocumentFragment719, expr: &seqExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, + pos: position{line: 127, col: 37, offset: 3675}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1912, col: 28, offset: 68226}, + pos: position{line: 127, col: 37, offset: 3675}, expr: &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, + pos: position{line: 2893, col: 8, offset: 95335}, 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\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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}, + pos: position{line: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2890, col: 9, offset: 95286, }, }, - }, - }, - }, - &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, - }, - }, - }, - &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, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, - }, - }, - }, - }, - }, - }, - }, - }, - &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).callonDocumentBlocks396, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment727, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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: 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", + pos: position{line: 128, col: 5, offset: 3685}, + label: "element", expr: &choiceExpr{ - pos: position{line: 165, col: 27, offset: 5350}, + pos: position{line: 129, col: 9, offset: 3703}, 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, - }, - }, - &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, - }, - }, + pos: position{line: 129, col: 10, offset: 3704}, + run: (*parser).callonDocumentFragment731, + expr: &oneOrMoreExpr{ + pos: position{line: 129, col: 10, offset: 3704}, + expr: &charClassMatcher{ + pos: position{line: 129, col: 10, offset: 3704}, + val: "[^\\r\\n{]", + chars: []rune{'\r', '\n', '{'}, + ignoreCase: false, + inverted: true, }, }, }, &actionExpr{ - pos: position{line: 167, col: 5, offset: 5410}, - run: (*parser).callonDocumentBlocks429, + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDocumentFragment734, expr: &seqExpr{ - pos: position{line: 167, col: 5, offset: 5410}, + pos: position{line: 449, col: 5, offset: 14443}, 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, - expr: &charClassMatcher{ - pos: position{line: 2263, col: 10, offset: 79843}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - 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, - }, + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDocumentFragment736, }, - &zeroOrMoreExpr{ - pos: position{line: 167, col: 29, offset: 5434}, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 452, col: 14, offset: 14516}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonDocumentFragment739, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDocumentFragment743, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDocumentFragment750, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDocumentFragment755, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDocumentFragment757, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlocks440, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonDocumentFragment761, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDocumentFragment765, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDocumentFragment772, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDocumentFragment777, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDocumentFragment779, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonDocumentFragment783, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDocumentFragment787, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, }, }, }, }, }, - &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'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - }, - }, - &zeroOrOneExpr{ - pos: position{line: 156, col: 82, offset: 4905}, - expr: &litMatcher{ - pos: position{line: 156, col: 82, offset: 4905}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - }, - &labeledExpr{ - pos: position{line: 156, col: 87, offset: 4910}, - label: "revremark", - expr: &zeroOrOneExpr{ - pos: position{line: 156, col: 97, offset: 4920}, - expr: &actionExpr{ - pos: position{line: 175, col: 27, offset: 5578}, - run: (*parser).callonDocumentBlocks455, - 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, - }, - }, - }, - }, - }, - }, - }, - }, - &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, - }, - }, - }, - }, - &zeroOrOneExpr{ - pos: position{line: 158, col: 46, offset: 5069}, - expr: &litMatcher{ - pos: position{line: 158, col: 46, offset: 5069}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - }, - &labeledExpr{ - pos: position{line: 158, col: 51, offset: 5074}, - label: "revremark", - expr: &zeroOrOneExpr{ - pos: position{line: 158, col: 61, offset: 5084}, - 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'}, + &actionExpr{ + pos: position{line: 133, col: 12, offset: 3832}, + run: (*parser).callonDocumentFragment793, + expr: &litMatcher{ + pos: position{line: 133, col: 12, offset: 3832}, + val: "{", ignoreCase: false, - inverted: true, + want: "\"{\"", }, }, }, @@ -3045,30 +3699,39 @@ 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, - }, - }, - }, - }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment800, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -3076,274 +3739,514 @@ var g = &grammar{ }, }, }, - }, - }, - }, - &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, + pos: position{line: 140, col: 19, offset: 3987}, + run: (*parser).callonDocumentFragment802, expr: &seqExpr{ - pos: position{line: 920, col: 5, offset: 29951}, + pos: position{line: 140, col: 19, offset: 3987}, exprs: []interface{}{ - ¬CodeExpr{ - pos: position{line: 920, col: 5, offset: 29951}, - run: (*parser).callonDocumentBlock15, + &litMatcher{ + pos: position{line: 140, col: 19, offset: 3987}, + val: ":!", + ignoreCase: false, + want: "\":!\"", }, &labeledExpr{ - pos: position{line: 923, col: 5, offset: 30081}, - label: "firstLine", + pos: position{line: 140, col: 24, offset: 3992}, + label: "name", expr: &actionExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - run: (*parser).callonDocumentBlock17, + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDocumentFragment806, expr: &seqExpr{ - pos: position{line: 929, col: 5, offset: 30339}, + pos: position{line: 118, col: 18, offset: 3399}, 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, - }, - }, - &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).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}, - 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, - }, - }, - }, - }, + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 140, col: 45, offset: 4013}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 140, col: 49, offset: 4017}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment815, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment822, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 142, col: 5, offset: 4084}, + run: (*parser).callonDocumentFragment824, + expr: &seqExpr{ + pos: position{line: 142, col: 5, offset: 4084}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 142, col: 5, offset: 4084}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 142, col: 9, offset: 4088}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDocumentFragment828, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 142, col: 30, offset: 4109}, + val: "!:", + ignoreCase: false, + want: "\"!:\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 142, col: 35, offset: 4114}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment837, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment844, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 29, col: 11, offset: 623}, + name: "DelimitedBlock", + }, + &actionExpr{ + pos: position{line: 2353, col: 5, offset: 79294}, + run: (*parser).callonDocumentFragment847, + expr: &seqExpr{ + pos: position{line: 2353, col: 5, offset: 79294}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2353, col: 5, offset: 79294}, + run: (*parser).callonDocumentFragment849, + }, + &labeledExpr{ + pos: position{line: 2356, col: 5, offset: 79357}, + label: "level", + expr: &actionExpr{ + pos: position{line: 2356, col: 12, offset: 79364}, + run: (*parser).callonDocumentFragment851, + expr: &oneOrMoreExpr{ + pos: position{line: 2356, col: 12, offset: 79364}, + expr: &litMatcher{ + pos: position{line: 2356, col: 13, offset: 79365}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 2360, col: 5, offset: 79473}, + run: (*parser).callonDocumentFragment854, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonDocumentFragment855, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2364, col: 12, offset: 79632}, + label: "title", + expr: &actionExpr{ + pos: position{line: 2368, col: 20, offset: 79760}, + run: (*parser).callonDocumentFragment859, + expr: &zeroOrMoreExpr{ + pos: position{line: 2368, col: 20, offset: 79760}, + expr: &charClassMatcher{ + pos: position{line: 2368, col: 20, offset: 79760}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment867, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2755, col: 18, offset: 91083}, + run: (*parser).callonDocumentFragment869, + expr: &seqExpr{ + pos: position{line: 2755, col: 18, offset: 91083}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2755, col: 19, offset: 91084}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2755, col: 19, offset: 91084}, + val: "***", + ignoreCase: false, + want: "\"***\"", + }, + &litMatcher{ + pos: position{line: 2755, col: 27, offset: 91092}, + val: "* * *", + ignoreCase: false, + want: "\"* * *\"", + }, + &litMatcher{ + pos: position{line: 2755, col: 37, offset: 91102}, + val: "---", + ignoreCase: false, + want: "\"---\"", + }, + &litMatcher{ + pos: position{line: 2755, col: 45, offset: 91110}, + val: "- - -", + ignoreCase: false, + want: "\"- - -\"", + }, + &litMatcher{ + pos: position{line: 2755, col: 55, offset: 91120}, + val: "___", + ignoreCase: false, + want: "\"___\"", + }, + &litMatcher{ + pos: position{line: 2755, col: 63, offset: 91128}, + val: "_ _ _", + ignoreCase: false, + want: "\"_ _ _\"", + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 32, col: 11, offset: 795}, + name: "ListElements", + }, + &ruleRefExpr{ + pos: position{line: 33, col: 11, offset: 818}, + name: "ImageBlock", + }, + &ruleRefExpr{ + pos: position{line: 34, col: 11, offset: 839}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 2654, col: 5, offset: 88215}, + run: (*parser).callonDocumentFragment883, + expr: &seqExpr{ + pos: position{line: 2654, col: 5, offset: 88215}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2661, col: 19, offset: 88391}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2661, col: 26, offset: 88398}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment889, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment896, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, &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}, + pos: position{line: 2655, col: 5, offset: 88239}, + label: "header", + expr: &zeroOrOneExpr{ + pos: position{line: 2655, col: 12, offset: 88246}, + expr: &actionExpr{ + pos: position{line: 2669, col: 5, offset: 88558}, + run: (*parser).callonDocumentFragment900, + expr: &seqExpr{ + pos: position{line: 2669, col: 5, offset: 88558}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2669, col: 5, offset: 88558}, + label: "cells", + expr: &oneOrMoreExpr{ + pos: position{line: 2669, col: 11, offset: 88564}, + expr: &actionExpr{ + pos: position{line: 2675, col: 5, offset: 88681}, + run: (*parser).callonDocumentFragment904, expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 2675, col: 5, offset: 88681}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + pos: position{line: 2675, col: 5, offset: 88681}, + val: "|", ignoreCase: false, - want: "\"////\"", + want: "\"|\"", }, &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + pos: position{line: 2675, col: 9, offset: 88685}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock60, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment910, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -3352,26 +4255,31 @@ 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, + &labeledExpr{ + pos: position{line: 2676, col: 5, offset: 88697}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 2676, col: 14, offset: 88706}, + expr: &actionExpr{ + pos: position{line: 2708, col: 5, offset: 89494}, + run: (*parser).callonDocumentFragment914, + expr: &labeledExpr{ + pos: position{line: 2708, col: 5, offset: 89494}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2708, col: 14, offset: 89503}, + run: (*parser).callonDocumentFragment916, + expr: &oneOrMoreExpr{ + pos: position{line: 2708, col: 14, offset: 89503}, + expr: &charClassMatcher{ + pos: position{line: 2708, col: 14, offset: 89503}, + val: "[^\\r\\n|]", + chars: []rune{'\r', '\n', '|'}, + ignoreCase: false, + inverted: true, + }, + }, + }, }, }, }, @@ -3379,115 +4287,168 @@ var g = &grammar{ }, }, }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"//\"", + want: "\"\\n\"", }, - &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, - }, - }, - }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + 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, - }, - }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment924, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - }, - &actionExpr{ - pos: position{line: 903, col: 21, offset: 29486}, - run: (*parser).callonDocumentBlock77, - 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")}, + &oneOrMoreExpr{ + pos: position{line: 2670, col: 5, offset: 88586}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonDocumentFragment927, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment935, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", ignoreCase: false, - inverted: false, + want: "\"\\t\"", }, }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment942, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", ignoreCase: false, - want: "\"....\"", + want: "\"\\r\"", }, }, }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2656, col: 5, offset: 88265}, + label: "rows", + expr: &zeroOrMoreExpr{ + pos: position{line: 2656, col: 10, offset: 88270}, + expr: &choiceExpr{ + pos: position{line: 2680, col: 13, offset: 88803}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2690, col: 5, offset: 89022}, + run: (*parser).callonDocumentFragment947, + expr: &seqExpr{ + pos: position{line: 2690, col: 5, offset: 89022}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2690, col: 5, offset: 89022}, + expr: &choiceExpr{ + pos: position{line: 2665, col: 22, offset: 88471}, + alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1839, col: 25, offset: 65436}, + pos: position{line: 2661, col: 19, offset: 88391}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", + pos: position{line: 2661, col: 19, offset: 88391}, + val: "|===", ignoreCase: false, - want: "\"```\"", + want: "\"|===\"", }, &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, + pos: position{line: 2661, col: 26, offset: 88398}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock90, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment956, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -3497,174 +4458,534 @@ var g = &grammar{ }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment963, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, }, }, - &seqExpr{ - pos: position{line: 1856, col: 26, offset: 66120}, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2691, col: 5, offset: 89045}, + label: "cells", + expr: &oneOrMoreExpr{ + pos: position{line: 2691, col: 11, offset: 89051}, + expr: &actionExpr{ + pos: position{line: 2691, col: 12, offset: 89052}, + run: (*parser).callonDocumentFragment969, + expr: &seqExpr{ + pos: position{line: 2691, col: 12, offset: 89052}, 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", + &labeledExpr{ + pos: position{line: 2691, col: 12, offset: 89052}, + label: "cell", + expr: &actionExpr{ + pos: position{line: 2700, col: 5, offset: 89293}, + run: (*parser).callonDocumentFragment972, + expr: &seqExpr{ + pos: position{line: 2700, col: 5, offset: 89293}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2700, col: 5, offset: 89293}, + expr: &choiceExpr{ + pos: position{line: 2665, col: 22, offset: 88471}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2661, col: 19, offset: 88391}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2661, col: 19, offset: 88391}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2661, col: 26, offset: 88398}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment981, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment988, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2701, col: 5, offset: 89316}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonDocumentFragment993, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment1001, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1008, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2702, col: 5, offset: 89331}, + val: "|", ignoreCase: false, - want: "\"\\t\"", + want: "\"|\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2702, col: 9, offset: 89335}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment1014, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2702, col: 16, offset: 89342}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 2702, col: 25, offset: 89351}, + expr: &actionExpr{ + pos: position{line: 2708, col: 5, offset: 89494}, + run: (*parser).callonDocumentFragment1018, + expr: &labeledExpr{ + pos: position{line: 2708, col: 5, offset: 89494}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2708, col: 14, offset: 89503}, + run: (*parser).callonDocumentFragment1020, + expr: &oneOrMoreExpr{ + pos: position{line: 2708, col: 14, offset: 89503}, + expr: &charClassMatcher{ + pos: position{line: 2708, col: 14, offset: 89503}, + val: "[^\\r\\n|]", + chars: []rune{'\r', '\n', '|'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, }, }, }, }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1028, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, }, }, - &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: 2694, col: 6, offset: 89114}, + alternatives: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2694, col: 6, offset: 89114}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonDocumentFragment1032, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment1040, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock114, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1047, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\r\"", }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + }, + }, + }, + &andExpr{ + pos: position{line: 2694, col: 19, offset: 89127}, + expr: &choiceExpr{ + pos: position{line: 2665, col: 22, offset: 88471}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2661, col: 19, offset: 88391}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2661, col: 19, offset: 88391}, + 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: 2661, col: 26, offset: 88398}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment1056, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1063, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2683, col: 5, offset: 88870}, + run: (*parser).callonDocumentFragment1067, + expr: &seqExpr{ + pos: position{line: 2683, col: 5, offset: 88870}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2683, col: 5, offset: 88870}, + expr: &choiceExpr{ + pos: position{line: 2665, col: 22, offset: 88471}, + alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 2661, col: 19, offset: 88391}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + pos: position{line: 2661, col: 19, offset: 88391}, + val: "|===", ignoreCase: false, - want: "\"////\"", + want: "\"|===\"", }, &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + pos: position{line: 2661, col: 26, offset: 88398}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock126, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment1076, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -3674,56 +4995,242 @@ var g = &grammar{ }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1083, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, }, }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2684, col: 5, offset: 88893}, + label: "cells", + expr: &oneOrMoreExpr{ + pos: position{line: 2684, col: 11, offset: 88899}, + expr: &actionExpr{ + pos: position{line: 2700, col: 5, offset: 89293}, + run: (*parser).callonDocumentFragment1089, + expr: &seqExpr{ + pos: position{line: 2700, col: 5, offset: 89293}, exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2700, col: 5, offset: 89293}, + expr: &choiceExpr{ + pos: position{line: 2665, col: 22, offset: 88471}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2661, col: 19, offset: 88391}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2661, col: 19, offset: 88391}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2661, col: 26, offset: 88398}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment1098, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1105, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2701, col: 5, offset: 89316}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonDocumentFragment1110, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment1118, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1125, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", + pos: position{line: 2702, col: 5, offset: 89331}, + val: "|", ignoreCase: false, - want: "\"____\"", + want: "\"|\"", }, &zeroOrMoreExpr{ - pos: position{line: 1736, col: 31, offset: 61962}, + pos: position{line: 2702, col: 9, offset: 89335}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock138, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment1131, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -3732,145 +5239,143 @@ 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, + &labeledExpr{ + pos: position{line: 2702, col: 16, offset: 89342}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 2702, col: 25, offset: 89351}, + expr: &actionExpr{ + pos: position{line: 2708, col: 5, offset: 89494}, + run: (*parser).callonDocumentFragment1135, + expr: &labeledExpr{ + pos: position{line: 2708, col: 5, offset: 89494}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2708, col: 14, offset: 89503}, + run: (*parser).callonDocumentFragment1137, + expr: &oneOrMoreExpr{ + pos: position{line: 2708, col: 14, offset: 89503}, + expr: &charClassMatcher{ + pos: position{line: 2708, col: 14, offset: 89503}, + val: "[^\\r\\n|]", + chars: []rune{'\r', '\n', '|'}, + 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).callonDocumentBlock150, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1145, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 2685, col: 5, offset: 88920}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonDocumentFragment1148, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2878, col: 10, offset: 95044}, + 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment1156, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, - }, - &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).callonDocumentBlock162, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1163, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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\"", }, }, }, @@ -3879,121 +5384,163 @@ 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).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, - }, - }, - }, + }, + }, + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2665, col: 22, offset: 88471}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2661, col: 19, offset: 88391}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2661, col: 19, offset: 88391}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2661, col: 26, offset: 88398}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment1171, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonDocumentBlock178, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1178, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, }, }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, }, }, }, &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonDocumentBlock179, + pos: position{line: 2604, col: 22, offset: 86659}, + run: (*parser).callonDocumentFragment1182, expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, + pos: position{line: 2604, col: 22, offset: 86659}, exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2609, col: 31, offset: 86880}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, ¬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: 2609, col: 36, offset: 86885}, + expr: &litMatcher{ + pos: position{line: 2609, col: 37, offset: 86886}, + 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: " ", + &labeledExpr{ + pos: position{line: 2604, col: 49, offset: 86686}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + run: (*parser).callonDocumentFragment1188, + expr: &zeroOrMoreExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + expr: &charClassMatcher{ + pos: position{line: 2611, col: 29, offset: 86921}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, 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\"", - }, + inverted: true, }, }, }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1196, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -4002,148 +5549,294 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 492, col: 5, offset: 15613}, - run: (*parser).callonDocumentBlock194, + pos: position{line: 1593, col: 5, offset: 52905}, + run: (*parser).callonDocumentFragment1198, expr: &seqExpr{ - pos: position{line: 492, col: 5, offset: 15613}, + pos: position{line: 1593, col: 5, offset: 52905}, 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}, + pos: position{line: 1593, col: 5, offset: 52905}, + label: "kind", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 92, col: 19, offset: 2545}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &actionExpr{ + pos: position{line: 92, col: 19, offset: 2545}, + run: (*parser).callonDocumentFragment1202, + expr: &litMatcher{ + pos: position{line: 92, col: 19, offset: 2545}, + val: "TIP", + ignoreCase: false, + want: "\"TIP\"", + }, }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock204, + pos: position{line: 94, col: 5, offset: 2583}, + run: (*parser).callonDocumentFragment1204, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 94, col: 5, offset: 2583}, + val: "NOTE", ignoreCase: false, - want: "\"\\t\"", + want: "\"NOTE\"", + }, + }, + &actionExpr{ + pos: position{line: 96, col: 5, offset: 2623}, + run: (*parser).callonDocumentFragment1206, + expr: &litMatcher{ + pos: position{line: 96, col: 5, offset: 2623}, + val: "IMPORTANT", + ignoreCase: false, + want: "\"IMPORTANT\"", + }, + }, + &actionExpr{ + pos: position{line: 98, col: 5, offset: 2673}, + run: (*parser).callonDocumentFragment1208, + expr: &litMatcher{ + pos: position{line: 98, col: 5, offset: 2673}, + val: "WARNING", + ignoreCase: false, + want: "\"WARNING\"", + }, + }, + &actionExpr{ + pos: position{line: 100, col: 5, offset: 2719}, + run: (*parser).callonDocumentFragment1210, + expr: &litMatcher{ + pos: position{line: 100, col: 5, offset: 2719}, + val: "CAUTION", + ignoreCase: false, + want: "\"CAUTION\"", }, }, }, }, }, + &litMatcher{ + pos: position{line: 1593, col: 27, offset: 52927}, + val: ": ", + ignoreCase: false, + want: "\": \"", + }, &labeledExpr{ - pos: position{line: 500, col: 12, offset: 15871}, - label: "title", + pos: position{line: 1594, col: 5, offset: 52937}, + label: "firstLine", 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, - }, - }, + pos: position{line: 1605, col: 5, offset: 53281}, + run: (*parser).callonDocumentFragment1214, + expr: &seqExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + run: (*parser).callonDocumentFragment1217, + expr: &oneOrMoreExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + expr: &charClassMatcher{ + pos: position{line: 1605, col: 14, offset: 53290}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, + }, + }, + &andCodeExpr{ + pos: position{line: 1608, col: 5, offset: 53347}, + run: (*parser).callonDocumentFragment1220, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ ¬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, - }, + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1226, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1595, col: 5, offset: 52971}, + label: "otherLines", + expr: &zeroOrMoreExpr{ + pos: position{line: 1595, col: 16, offset: 52982}, + expr: &actionExpr{ + pos: position{line: 1596, col: 9, offset: 52992}, + run: (*parser).callonDocumentFragment1230, + expr: &seqExpr{ + pos: position{line: 1596, col: 9, offset: 52992}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1596, col: 9, offset: 52992}, + expr: &seqExpr{ + pos: position{line: 1343, col: 34, offset: 44869}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1343, col: 34, offset: 44869}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1343, col: 38, offset: 44873}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment1238, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, + }, + }, + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 237, col: 33, offset: 7620}, - val: "]]", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"]]\"", + want: "\"\\n\"", }, - &zeroOrMoreExpr{ - pos: position{line: 237, col: 38, offset: 7625}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1243, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1597, col: 9, offset: 53031}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 1597, col: 15, offset: 53037}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + run: (*parser).callonDocumentFragment1247, + expr: &seqExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2609, col: 31, offset: 86880}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2609, col: 36, offset: 86885}, + expr: &litMatcher{ + pos: position{line: 2609, col: 37, offset: 86886}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + }, + &labeledExpr{ + pos: position{line: 2604, col: 49, offset: 86686}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + run: (*parser).callonDocumentFragment1253, + expr: &zeroOrMoreExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + expr: &charClassMatcher{ + pos: position{line: 2611, col: 29, offset: 86921}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock227, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1261, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\r\"", }, }, }, @@ -4151,267 +5844,166 @@ var g = &grammar{ }, }, }, - }, - }, - &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}, + &actionExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + run: (*parser).callonDocumentFragment1263, + expr: &seqExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + run: (*parser).callonDocumentFragment1266, + expr: &oneOrMoreExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, 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: 1605, col: 14, offset: 53290}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, 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, - }, - }, - }, + inverted: true, }, }, }, }, - }, - &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, - }, - }, - }, - }, - }, - }, + &andCodeExpr{ + pos: position{line: 1608, col: 5, offset: 53347}, + run: (*parser).callonDocumentFragment1269, }, - }, - &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\"", - }, - }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, &litMatcher{ - pos: position{line: 995, col: 20, offset: 32707}, - val: "+", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", 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, - }, - }, - }, - }, + 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: " ", + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - want: "\" \"", + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock271, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1275, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &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, - }, - }, + want: "\"\\r\"", }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, }, }, }, - &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, - }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1616, col: 5, offset: 53511}, + run: (*parser).callonDocumentFragment1277, + expr: &seqExpr{ + pos: position{line: 1616, col: 5, offset: 53511}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1616, col: 5, offset: 53511}, + label: "firstLine", + expr: &actionExpr{ + pos: position{line: 1623, col: 5, offset: 53796}, + run: (*parser).callonDocumentFragment1280, + expr: &seqExpr{ + pos: position{line: 1623, col: 5, offset: 53796}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1623, col: 5, offset: 53796}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1623, col: 14, offset: 53805}, + run: (*parser).callonDocumentFragment1283, + expr: &seqExpr{ + pos: position{line: 1623, col: 14, offset: 53805}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonDocumentFragment1285, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, }, }, }, + &oneOrMoreExpr{ + pos: position{line: 1623, col: 21, offset: 53812}, + expr: &charClassMatcher{ + pos: position{line: 1623, col: 21, offset: 53812}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1626, col: 5, offset: 53869}, + run: (*parser).callonDocumentFragment1290, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1296, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -4421,65 +6013,146 @@ var g = &grammar{ }, }, &labeledExpr{ - pos: position{line: 500, col: 34, offset: 15893}, - label: "id", + pos: position{line: 1617, col: 5, offset: 53552}, + label: "otherLines", 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{}{ - &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).callonDocumentBlock289, - expr: &oneOrMoreExpr{ - pos: position{line: 2259, col: 7, offset: 79709}, - expr: &charClassMatcher{ - pos: position{line: 2259, col: 7, offset: 79709}, - val: "[^[]<>,]", - chars: []rune{'[', ']', '<', '>', ','}, + pos: position{line: 1617, col: 16, offset: 53563}, + expr: &choiceExpr{ + pos: position{line: 1617, col: 17, offset: 53564}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + run: (*parser).callonDocumentFragment1301, + expr: &seqExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2609, col: 31, offset: 86880}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2609, col: 36, offset: 86885}, + expr: &litMatcher{ + pos: position{line: 2609, col: 37, offset: 86886}, + val: "//", ignoreCase: false, - inverted: true, + want: "\"//\"", + }, + }, + &labeledExpr{ + pos: position{line: 2604, col: 49, offset: 86686}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + run: (*parser).callonDocumentFragment1307, + expr: &zeroOrMoreExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + expr: &charClassMatcher{ + pos: position{line: 2611, col: 29, offset: 86921}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1315, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, }, - &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: 1605, col: 5, offset: 53281}, + run: (*parser).callonDocumentFragment1317, + expr: &seqExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + run: (*parser).callonDocumentFragment1320, + expr: &oneOrMoreExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + expr: &charClassMatcher{ + pos: position{line: 1605, col: 14, offset: 53290}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock296, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &andCodeExpr{ + pos: position{line: 1608, col: 5, offset: 53347}, + run: (*parser).callonDocumentFragment1323, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1329, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, @@ -4490,337 +6163,165 @@ 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, - }, - }, - }, - }, }, }, }, &ruleRefExpr{ - pos: position{line: 79, col: 11, offset: 2316}, - name: "DelimitedBlock", - }, - &ruleRefExpr{ - pos: position{line: 80, col: 11, offset: 2341}, - name: "ImageBlock", + pos: position{line: 39, col: 11, offset: 964}, + name: "UserMacroBlock", }, &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonDocumentBlock305, + pos: position{line: 1580, col: 5, offset: 52535}, + run: (*parser).callonDocumentFragment1332, expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, + pos: position{line: 1580, col: 5, offset: 52535}, 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}, + &labeledExpr{ + pos: position{line: 1580, col: 5, offset: 52535}, + label: "firstLine", + expr: &actionExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + run: (*parser).callonDocumentFragment1335, + expr: &seqExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + run: (*parser).callonDocumentFragment1338, + expr: &oneOrMoreExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + expr: &charClassMatcher{ + pos: position{line: 1605, col: 14, offset: 53290}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1608, col: 5, offset: 53347}, + run: (*parser).callonDocumentFragment1341, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock313, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1347, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + 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, - }, - }, - }, - }, - }, - }, - }, - &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).callonDocumentBlock322, - 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: 82, col: 11, offset: 2390}, - name: "Table", - }, - &actionExpr{ - pos: position{line: 1632, col: 18, offset: 58455}, - run: (*parser).callonDocumentBlock331, - 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: 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", - }, - &actionExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - run: (*parser).callonDocumentBlock349, - expr: &seqExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 2116, col: 5, offset: 74964}, - run: (*parser).callonDocumentBlock351, - }, &labeledExpr{ - pos: position{line: 2120, col: 5, offset: 75117}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 2120, col: 11, offset: 75123}, + pos: position{line: 1581, col: 5, offset: 52569}, + label: "otherLines", + expr: &zeroOrMoreExpr{ + pos: position{line: 1581, col: 16, offset: 52580}, expr: &actionExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, - run: (*parser).callonDocumentBlock354, + pos: position{line: 1582, col: 9, offset: 52590}, + run: (*parser).callonDocumentFragment1351, expr: &seqExpr{ - pos: position{line: 2128, col: 25, offset: 75365}, + pos: position{line: 1582, col: 9, offset: 52590}, 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, + pos: position{line: 1582, col: 9, offset: 52590}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + ¬Expr{ + pos: position{line: 1583, col: 9, offset: 52603}, + expr: &seqExpr{ + pos: position{line: 1343, col: 34, offset: 44869}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1343, col: 34, offset: 44869}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1343, col: 38, offset: 44873}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + 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: " ", + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDocumentFragment1362, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\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\"", - }, + 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'}, + }, + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1367, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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\"", }, }, }, @@ -4829,223 +6330,143 @@ 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}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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).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}, + pos: position{line: 1584, col: 9, offset: 52642}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 1584, col: 15, offset: 52648}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + run: (*parser).callonDocumentFragment1371, + expr: &seqExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2609, col: 31, offset: 86880}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2609, col: 36, offset: 86885}, + expr: &litMatcher{ + pos: position{line: 2609, col: 37, offset: 86886}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + }, + &labeledExpr{ + pos: position{line: 2604, col: 49, offset: 86686}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + run: (*parser).callonDocumentFragment1377, + expr: &zeroOrMoreExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + expr: &charClassMatcher{ + pos: position{line: 2611, col: 29, offset: 86921}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDocumentBlock394, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1385, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", ignoreCase: false, - want: "\"\\t\"", + 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, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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, + &actionExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + run: (*parser).callonDocumentFragment1387, expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, + pos: position{line: 1605, col: 5, offset: 53281}, 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: 1605, col: 5, offset: 53281}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + run: (*parser).callonDocumentFragment1390, + expr: &oneOrMoreExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + expr: &charClassMatcher{ + pos: position{line: 1605, col: 14, offset: 53290}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, ignoreCase: false, - want: "\" \"", - }, - &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\"", - }, + inverted: true, }, }, }, }, + &andCodeExpr{ + pos: position{line: 1608, col: 5, offset: 53347}, + run: (*parser).callonDocumentFragment1393, + }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragment1399, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -5054,48 +6475,6 @@ 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).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, - }, - }, - }, - }, }, }, }, @@ -5106,206 +6485,97 @@ 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\"", - }, + }, + }, + }, + }, + }, + }, + }, + { + name: "DocumentFragmentWithinVerbatimBlock", + pos: position{line: 51, col: 1, offset: 1366}, + expr: &actionExpr{ + pos: position{line: 52, col: 5, offset: 1409}, + run: (*parser).callonDocumentFragmentWithinVerbatimBlock1, + expr: &seqExpr{ + pos: position{line: 52, col: 5, offset: 1409}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 52, col: 5, offset: 1409}, + label: "elements", + expr: &zeroOrMoreExpr{ + pos: position{line: 52, col: 14, offset: 1418}, + expr: &choiceExpr{ + pos: position{line: 53, col: 9, offset: 1428}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 53, col: 9, offset: 1428}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 60, col: 5, offset: 1525}, + run: (*parser).callonDocumentFragmentWithinVerbatimBlock7, + expr: &seqExpr{ + pos: position{line: 60, col: 5, offset: 1525}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 60, col: 5, offset: 1525}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, }, - }, - &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", + &labeledExpr{ + pos: position{line: 61, col: 5, offset: 1534}, + label: "content", + expr: &actionExpr{ + pos: position{line: 61, col: 14, offset: 1543}, + run: (*parser).callonDocumentFragmentWithinVerbatimBlock13, expr: &zeroOrMoreExpr{ - pos: position{line: 2103, col: 50, offset: 74565}, - expr: &actionExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - run: (*parser).callonDocumentBlock447, - 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).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: "....", - 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, - }, - }, - }, - }, - }, - }, + pos: position{line: 61, col: 14, offset: 1543}, + expr: &charClassMatcher{ + pos: position{line: 61, col: 14, offset: 1543}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, - }, - &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, - }, - }, - }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDocumentFragmentWithinVerbatimBlock21, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, @@ -5313,397 +6583,499 @@ var g = &grammar{ }, }, }, - &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{'_'}, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + { + name: "DelimitedBlockElements", + pos: position{line: 70, col: 1, offset: 1734}, + expr: &actionExpr{ + pos: position{line: 71, col: 5, offset: 1765}, + run: (*parser).callonDelimitedBlockElements1, + expr: &seqExpr{ + pos: position{line: 71, col: 5, offset: 1765}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 71, col: 5, offset: 1765}, + label: "elements", + expr: &zeroOrMoreExpr{ + pos: position{line: 71, col: 14, offset: 1774}, + expr: &choiceExpr{ + pos: position{line: 72, col: 9, offset: 1784}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonDelimitedBlockElements6, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonDelimitedBlockElements10, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", 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: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, - &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}, + }, + }, + &ruleRefExpr{ + pos: position{line: 73, col: 11, offset: 1846}, + name: "DocumentFragment", + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + { + name: "BlockAttributes", + pos: position{line: 149, col: 1, offset: 4389}, + expr: &actionExpr{ + pos: position{line: 150, col: 5, offset: 4412}, + run: (*parser).callonBlockAttributes1, + expr: &labeledExpr{ + pos: position{line: 150, col: 5, offset: 4412}, + label: "attributes", + expr: &oneOrMoreExpr{ + pos: position{line: 150, col: 16, offset: 4423}, + expr: &choiceExpr{ + pos: position{line: 152, col: 9, offset: 4490}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 152, col: 10, offset: 4491}, + run: (*parser).callonBlockAttributes5, + expr: &seqExpr{ + pos: position{line: 152, col: 10, offset: 4491}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 152, col: 10, offset: 4491}, + label: "anchor", + expr: &actionExpr{ + pos: position{line: 184, col: 4, offset: 5334}, + run: (*parser).callonBlockAttributes8, + expr: &seqExpr{ + pos: position{line: 184, col: 4, offset: 5334}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 184, col: 4, offset: 5334}, + val: "[[", + ignoreCase: false, + want: "\"[[\"", + }, + &labeledExpr{ + pos: position{line: 185, col: 5, offset: 5344}, + label: "id", + expr: &actionExpr{ + pos: position{line: 186, col: 9, offset: 5357}, + run: (*parser).callonBlockAttributes12, + expr: &labeledExpr{ + pos: position{line: 186, col: 9, offset: 5357}, label: "elements", - expr: &zeroOrMoreExpr{ - pos: position{line: 194, col: 46, offset: 6222}, + expr: &oneOrMoreExpr{ + pos: position{line: 186, col: 18, offset: 5366}, expr: &choiceExpr{ - pos: position{line: 195, col: 5, offset: 6228}, + pos: position{line: 187, col: 13, offset: 5380}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 195, col: 6, offset: 6229}, - run: (*parser).callonDocumentBlock498, + pos: position{line: 187, col: 14, offset: 5381}, + run: (*parser).callonBlockAttributes16, expr: &oneOrMoreExpr{ - pos: position{line: 195, col: 6, offset: 6229}, + pos: position{line: 187, col: 14, offset: 5381}, expr: &charClassMatcher{ - pos: position{line: 195, col: 6, offset: 6229}, - val: "[^\\r\\n{]", - chars: []rune{'\r', '\n', '{'}, + pos: position{line: 187, col: 14, offset: 5381}, + val: "[^=\\r\\n�{]]", + chars: []rune{'=', '\r', '\n', '�', '{', ']'}, ignoreCase: false, inverted: true, }, }, }, &actionExpr{ - pos: position{line: 221, col: 25, offset: 7126}, - run: (*parser).callonDocumentBlock501, + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonBlockAttributes19, expr: &seqExpr{ - pos: position{line: 221, col: 25, offset: 7126}, + pos: position{line: 947, col: 23, offset: 29896}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 221, col: 25, offset: 7126}, - val: "{counter:", + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", ignoreCase: false, - want: "\"{counter:\"", + want: "\"�\"", }, &labeledExpr{ - pos: position{line: 221, col: 37, offset: 7138}, - label: "name", + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", 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")}, - 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).callonDocumentBlock512, - 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).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'}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - }, - }, + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonBlockAttributes23, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, }, &litMatcher{ - pos: position{line: 221, col: 78, offset: 7179}, - val: "}", + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", ignoreCase: false, - want: "\"}\"", + want: "\"�\"", }, }, }, }, &actionExpr{ - pos: position{line: 225, col: 25, offset: 7281}, - run: (*parser).callonDocumentBlock523, + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonBlockAttributes27, expr: &seqExpr{ - pos: position{line: 225, col: 25, offset: 7281}, + pos: position{line: 449, col: 5, offset: 14443}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 225, col: 25, offset: 7281}, - val: "{counter2:", - ignoreCase: false, - want: "\"{counter2:\"", + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonBlockAttributes29, }, &labeledExpr{ - pos: position{line: 225, col: 38, offset: 7294}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonDocumentBlock527, - 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: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonBlockAttributes32, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonBlockAttributes36, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonBlockAttributes43, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonBlockAttributes48, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonBlockAttributes50, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + 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).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'}, - ignoreCase: false, - inverted: false, - }, - }, - &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]", + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonBlockAttributes54, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonBlockAttributes58, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonBlockAttributes65, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonBlockAttributes70, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonBlockAttributes72, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + 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).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: "\"{\"", - }, - &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, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonBlockAttributes76, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonBlockAttributes80, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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).callonDocumentBlock555, + pos: position{line: 192, col: 16, offset: 5617}, + run: (*parser).callonBlockAttributes86, expr: &litMatcher{ - pos: position{line: 199, col: 6, offset: 6337}, + pos: position{line: 192, col: 16, offset: 5617}, val: "{", ignoreCase: false, want: "\"{\"", @@ -5715,974 +7087,490 @@ 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: 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, - }, - }, - }, - }, - }, - }, - &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: 198, col: 5, offset: 5803}, + 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", - 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: "\"]]\"", }, }, }, }, }, - }, - }, - &actionExpr{ - pos: position{line: 208, col: 5, offset: 6619}, - run: (*parser).callonDocumentBlock582, - 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).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, - }, - }, - }, - }, - }, - }, - &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).callonDocumentBlock595, - 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}, + &zeroOrMoreExpr{ + pos: position{line: 152, col: 35, offset: 4516}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2878, col: 10, offset: 95044}, + 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonBlockAttributes92, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, - }, - }, - &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}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonBlockAttributes99, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, }, }, - &ruleRefExpr{ - pos: position{line: 92, col: 11, offset: 2665}, - name: "UserMacroBlock", - }, - &actionExpr{ - pos: position{line: 879, col: 6, offset: 28334}, - run: (*parser).callonDocumentBlock610, - 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).callonDocumentBlock614, - 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).callonDocumentBlock616, - 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).callonDocumentBlock618, - 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).callonDocumentBlock620, - 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).callonDocumentBlock622, - expr: &litMatcher{ - pos: position{line: 864, col: 5, offset: 27906}, - val: "CAUTION", - ignoreCase: false, - want: "\"CAUTION\"", - }, + }, + &actionExpr{ + pos: position{line: 156, col: 12, offset: 4637}, + run: (*parser).callonBlockAttributes101, + expr: &seqExpr{ + pos: position{line: 156, col: 12, offset: 4637}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 156, col: 12, offset: 4637}, + label: "title", + expr: &actionExpr{ + pos: position{line: 203, col: 19, offset: 5922}, + run: (*parser).callonBlockAttributes104, + expr: &seqExpr{ + pos: position{line: 203, col: 19, offset: 5922}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 203, col: 19, offset: 5922}, + val: ".", + ignoreCase: false, + 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}, - expr: &choiceExpr{ - pos: position{line: 879, col: 37, offset: 28365}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonDocumentBlock628, + &labeledExpr{ + pos: position{line: 203, col: 23, offset: 5926}, + label: "title", + expr: &actionExpr{ + pos: position{line: 204, col: 5, offset: 5938}, + run: (*parser).callonBlockAttributes108, expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, + pos: position{line: 204, col: 5, offset: 5938}, 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, - }, - }, - }, - }, - }, + pos: position{line: 204, col: 5, offset: 5938}, + expr: &charClassMatcher{ + pos: position{line: 204, col: 6, offset: 5939}, + val: "[. ]", + chars: []rune{'.', ' '}, + 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).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, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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).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}, + pos: position{line: 205, col: 5, offset: 6051}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 205, col: 14, offset: 6060}, + expr: &choiceExpr{ + pos: position{line: 206, col: 9, offset: 6070}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 206, col: 10, offset: 6071}, + run: (*parser).callonBlockAttributes115, + expr: &oneOrMoreExpr{ + pos: position{line: 206, col: 10, offset: 6071}, expr: &charClassMatcher{ - pos: position{line: 2213, col: 13, offset: 78116}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + pos: position{line: 206, col: 10, offset: 6071}, + val: "[^\\r\\n�{]", + chars: []rune{'\r', '\n', '�', '{'}, 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).callonDocumentBlock666, - 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: 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", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonBlockAttributes118, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + 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: 945, col: 32, offset: 29864}, + 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: 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\"", + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonBlockAttributes122, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + 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: 945, col: 32, offset: 29864}, + 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).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, - }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonBlockAttributes126, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonBlockAttributes128, }, - }, - }, - }, - }, - &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\"", + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonBlockAttributes131, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonBlockAttributes135, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonBlockAttributes142, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonBlockAttributes147, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonBlockAttributes149, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonBlockAttributes153, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonBlockAttributes157, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonBlockAttributes164, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonBlockAttributes169, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonBlockAttributes171, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonBlockAttributes175, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonBlockAttributes179, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", + &actionExpr{ + pos: position{line: 211, col: 12, offset: 6230}, + run: (*parser).callonBlockAttributes185, + expr: &litMatcher{ + pos: position{line: 211, col: 12, offset: 6230}, + 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, - }, - }, - }, + 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).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, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", - expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonDocumentBlock746, - 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).callonDocumentBlock754, - }, }, }, }, @@ -6691,637 +7579,1577 @@ var g = &grammar{ }, }, }, + &zeroOrMoreExpr{ + pos: position{line: 156, col: 35, offset: 4660}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonBlockAttributes190, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonBlockAttributes197, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, }, }, - &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: "\"> \"", + }, + &actionExpr{ + pos: position{line: 160, col: 12, offset: 4751}, + run: (*parser).callonBlockAttributes199, + expr: &seqExpr{ + pos: position{line: 160, col: 12, offset: 4751}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 160, col: 12, offset: 4751}, + label: "attributes", + expr: &ruleRefExpr{ + pos: position{line: 160, col: 24, offset: 4763}, + name: "LongHandAttributes", }, - &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, - }, - }, - }, - &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).callonDocumentBlock771, - 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, - }, - }, - }, - }, - }, - }, - }, - }, - &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, - }, - }, - }, - &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'}, - 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: 160, col: 44, offset: 4783}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonBlockAttributes206, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonBlockAttributes213, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, }, }, - &actionExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - run: (*parser).callonDocumentBlock795, - expr: &seqExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - run: (*parser).callonDocumentBlock797, + }, + }, + }, + }, + }, + }, + }, + { + name: "InlineAttributes", + pos: position{line: 168, col: 1, offset: 4968}, + expr: &actionExpr{ + pos: position{line: 169, col: 5, offset: 4992}, + run: (*parser).callonInlineAttributes1, + expr: &seqExpr{ + pos: position{line: 169, col: 5, offset: 4992}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 169, col: 5, offset: 4992}, + val: "[", + ignoreCase: false, + want: "\"[\"", + }, + &labeledExpr{ + pos: position{line: 170, col: 5, offset: 5000}, + label: "attributes", + expr: &zeroOrMoreExpr{ + pos: position{line: 170, col: 16, offset: 5011}, + expr: &actionExpr{ + pos: position{line: 171, col: 9, offset: 5021}, + run: (*parser).callonInlineAttributes6, + expr: &seqExpr{ + pos: position{line: 172, col: 13, offset: 5035}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 172, col: 13, offset: 5035}, + expr: &litMatcher{ + pos: position{line: 172, col: 14, offset: 5036}, + val: "]", + ignoreCase: false, + want: "\"]\"", }, - &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: "\"....\"", - }, + }, + &labeledExpr{ + pos: position{line: 173, col: 13, offset: 5068}, + label: "attribute", + expr: &choiceExpr{ + pos: position{line: 173, col: 24, offset: 5079}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 173, col: 24, offset: 5079}, + name: "PositionalAttribute", + }, + &ruleRefExpr{ + pos: position{line: 173, col: 46, offset: 5101}, + name: "NamedAttribute", + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 178, col: 5, offset: 5184}, + val: "]", + ignoreCase: false, + want: "\"]\"", + }, + }, + }, + }, + }, + { + name: "LongHandAttributes", + pos: position{line: 222, col: 1, offset: 6630}, + expr: &actionExpr{ + pos: position{line: 223, col: 5, offset: 6656}, + run: (*parser).callonLongHandAttributes1, + expr: &seqExpr{ + pos: position{line: 223, col: 5, offset: 6656}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 223, col: 5, offset: 6656}, + val: "[", + ignoreCase: false, + want: "\"[\"", + }, + ¬Expr{ + pos: position{line: 223, col: 9, offset: 6660}, + expr: &litMatcher{ + pos: position{line: 223, col: 10, offset: 6661}, + val: "[", + ignoreCase: false, + want: "\"[\"", + }, + }, + &labeledExpr{ + pos: position{line: 225, col: 5, offset: 6831}, + label: "firstPositionalAttributes", + expr: &zeroOrOneExpr{ + pos: position{line: 225, col: 31, offset: 6857}, + expr: &actionExpr{ + pos: position{line: 241, col: 5, offset: 7512}, + run: (*parser).callonLongHandAttributes8, + expr: &seqExpr{ + pos: position{line: 241, col: 5, offset: 7512}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 241, col: 5, offset: 7512}, + label: "main", + expr: &zeroOrOneExpr{ + pos: position{line: 241, col: 10, offset: 7517}, + expr: &actionExpr{ + pos: position{line: 273, col: 23, offset: 8327}, + run: (*parser).callonLongHandAttributes12, + expr: &labeledExpr{ + pos: position{line: 273, col: 23, offset: 8327}, + label: "value", + expr: &choiceExpr{ + pos: position{line: 289, col: 5, offset: 8806}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 344, col: 5, offset: 10767}, + run: (*parser).callonLongHandAttributes15, + expr: &seqExpr{ + pos: position{line: 344, col: 5, offset: 10767}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 344, col: 5, offset: 10767}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + ¬Expr{ + pos: position{line: 344, col: 9, offset: 10771}, + expr: &litMatcher{ + pos: position{line: 344, col: 10, offset: 10772}, + 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).callonDocumentBlock813, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &labeledExpr{ + pos: position{line: 345, col: 5, offset: 10851}, + label: "content", + expr: &actionExpr{ + pos: position{line: 356, col: 5, offset: 11114}, + run: (*parser).callonLongHandAttributes21, + expr: &labeledExpr{ + pos: position{line: 356, col: 5, offset: 11114}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 356, col: 14, offset: 11123}, + expr: &choiceExpr{ + pos: position{line: 357, col: 9, offset: 11133}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonLongHandAttributes25, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - want: "\"\\t\"", + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes29, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes31, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes33, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonLongHandAttributes36, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes40, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes47, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes52, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes54, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonLongHandAttributes58, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes62, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes69, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes74, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes76, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonLongHandAttributes80, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes84, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 360, col: 12, offset: 11202}, + run: (*parser).callonLongHandAttributes90, + expr: &litMatcher{ + pos: position{line: 360, col: 12, offset: 11202}, + val: "\\'", + ignoreCase: false, + want: "\"\\\\'\"", + }, + }, + &litMatcher{ + pos: position{line: 363, col: 13, offset: 11304}, + val: "'`", + ignoreCase: false, + want: "\"'`\"", + }, + &litMatcher{ + pos: position{line: 363, col: 20, offset: 11311}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &actionExpr{ + pos: position{line: 363, col: 27, offset: 11318}, + run: (*parser).callonLongHandAttributes94, + expr: &litMatcher{ + pos: position{line: 363, col: 27, offset: 11318}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &actionExpr{ + pos: position{line: 366, col: 12, offset: 11478}, + run: (*parser).callonLongHandAttributes96, + expr: &oneOrMoreExpr{ + pos: position{line: 366, col: 12, offset: 11478}, + expr: &charClassMatcher{ + pos: position{line: 366, col: 12, offset: 11478}, + 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, }, }, }, }, }, }, - &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, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 346, col: 5, offset: 10902}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 374, col: 5, offset: 11713}, + run: (*parser).callonLongHandAttributes100, + expr: &seqExpr{ + pos: position{line: 374, col: 5, offset: 11713}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 374, col: 5, offset: 11713}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + ¬Expr{ + pos: position{line: 374, col: 10, offset: 11718}, + expr: &litMatcher{ + pos: position{line: 374, col: 11, offset: 11719}, + 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).callonDocumentBlock837, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &labeledExpr{ + pos: position{line: 375, col: 5, offset: 11798}, + label: "content", + expr: &actionExpr{ + pos: position{line: 385, col: 5, offset: 12078}, + run: (*parser).callonLongHandAttributes106, + expr: &labeledExpr{ + pos: position{line: 385, col: 5, offset: 12078}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 385, col: 14, offset: 12087}, + expr: &choiceExpr{ + pos: position{line: 386, col: 9, offset: 12097}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonLongHandAttributes110, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - want: "\"\\t\"", + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes114, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes116, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes118, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonLongHandAttributes121, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes125, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes132, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes137, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes139, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonLongHandAttributes143, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes147, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes154, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes159, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes161, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonLongHandAttributes165, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes169, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 389, col: 12, offset: 12166}, + run: (*parser).callonLongHandAttributes175, + expr: &litMatcher{ + pos: position{line: 389, col: 12, offset: 12166}, + val: "\\\"", + ignoreCase: false, + want: "\"\\\\\\\"\"", + }, + }, + &litMatcher{ + pos: position{line: 392, col: 13, offset: 12268}, + val: "\"`", + ignoreCase: false, + want: "\"\\\"`\"", + }, + &litMatcher{ + pos: position{line: 392, col: 21, offset: 12276}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + &litMatcher{ + pos: position{line: 392, col: 29, offset: 12284}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + &actionExpr{ + pos: position{line: 392, col: 35, offset: 12290}, + run: (*parser).callonLongHandAttributes180, + expr: &litMatcher{ + pos: position{line: 392, col: 35, offset: 12290}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &actionExpr{ + pos: position{line: 395, col: 12, offset: 12473}, + run: (*parser).callonLongHandAttributes182, + expr: &oneOrMoreExpr{ + pos: position{line: 395, col: 12, offset: 12473}, + expr: &charClassMatcher{ + pos: position{line: 395, col: 12, offset: 12473}, + 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, }, }, }, }, }, }, - &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\"", + &litMatcher{ + pos: position{line: 376, col: 5, offset: 11849}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + &andExpr{ + pos: position{line: 376, col: 10, offset: 11854}, + expr: ¬Expr{ + pos: position{line: 376, col: 12, offset: 11856}, + expr: &seqExpr{ + pos: position{line: 376, col: 14, offset: 11858}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 376, col: 14, offset: 11858}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes192, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + 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: 376, col: 21, offset: 11865}, + 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).callonDocumentBlock861, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + }, + }, + &actionExpr{ + pos: position{line: 291, col: 7, offset: 8880}, + run: (*parser).callonLongHandAttributes195, + expr: &seqExpr{ + pos: position{line: 291, col: 7, offset: 8880}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 291, col: 7, offset: 8880}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 291, col: 16, offset: 8889}, + expr: &choiceExpr{ + pos: position{line: 294, col: 9, offset: 9071}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 294, col: 10, offset: 9072}, + run: (*parser).callonLongHandAttributes200, + expr: &oneOrMoreExpr{ + pos: position{line: 294, col: 10, offset: 9072}, + expr: &charClassMatcher{ + pos: position{line: 294, col: 10, offset: 9072}, + 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: 947, col: 23, offset: 29896}, + run: (*parser).callonLongHandAttributes203, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonLongHandAttributes207, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + 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).callonDocumentBlock873, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes211, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes213, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonLongHandAttributes216, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes220, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes227, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes232, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes234, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonLongHandAttributes238, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes242, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes249, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes254, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes256, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonLongHandAttributes260, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes264, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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: 300, col: 12, offset: 9260}, + run: (*parser).callonLongHandAttributes270, + expr: &litMatcher{ + pos: position{line: 300, col: 12, offset: 9260}, + 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{}{ - &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\"", + &andExpr{ + pos: position{line: 303, col: 8, offset: 9343}, + expr: ¬Expr{ + pos: position{line: 303, col: 10, offset: 9345}, + expr: &seqExpr{ + pos: position{line: 303, col: 12, offset: 9347}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 303, col: 12, offset: 9347}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes278, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + 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: 303, col: 19, offset: 9354}, + val: "=", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"=\"", }, }, }, @@ -7330,630 +9158,4081 @@ 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).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, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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).callonDocumentBlock901, - }, }, }, }, }, }, }, - }, - }, - &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, - 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).callonDocumentBlock914, - 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: 244, col: 5, offset: 7557}, + label: "extras", + expr: &zeroOrMoreExpr{ + pos: position{line: 244, col: 12, offset: 7564}, + expr: &actionExpr{ + pos: position{line: 245, col: 9, offset: 7575}, + run: (*parser).callonLongHandAttributes283, + expr: &seqExpr{ + pos: position{line: 245, col: 9, offset: 7575}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 245, col: 9, offset: 7575}, + expr: &litMatcher{ + pos: position{line: 245, col: 10, offset: 7576}, + 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, - }, - }, - }, + 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: 245, col: 14, offset: 7580}, + expr: &litMatcher{ + pos: position{line: 245, col: 15, offset: 7581}, + val: "]", + ignoreCase: false, + want: "\"]\"", }, }, - }, - }, - &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}, - 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}, + &labeledExpr{ + pos: position{line: 246, col: 9, offset: 7593}, + label: "extra", + expr: &choiceExpr{ + pos: position{line: 247, col: 13, offset: 7613}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 269, col: 25, offset: 8223}, + run: (*parser).callonLongHandAttributes291, + expr: &seqExpr{ + pos: position{line: 269, col: 25, offset: 8223}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1839, col: 25, offset: 65436}, - val: "```", + pos: position{line: 269, col: 25, offset: 8223}, + val: "#", ignoreCase: false, - want: "\"```\"", + want: "\"#\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1839, col: 31, offset: 65442}, + &labeledExpr{ + pos: position{line: 269, col: 29, offset: 8227}, + label: "id", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 289, col: 5, offset: 8806}, alternatives: []interface{}{ - &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\"", + pos: position{line: 344, col: 5, offset: 10767}, + run: (*parser).callonLongHandAttributes296, + expr: &seqExpr{ + pos: position{line: 344, col: 5, offset: 10767}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 344, col: 5, offset: 10767}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + ¬Expr{ + pos: position{line: 344, col: 9, offset: 10771}, + expr: &litMatcher{ + pos: position{line: 344, col: 10, offset: 10772}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 345, col: 5, offset: 10851}, + label: "content", + expr: &actionExpr{ + pos: position{line: 356, col: 5, offset: 11114}, + run: (*parser).callonLongHandAttributes302, + expr: &labeledExpr{ + pos: position{line: 356, col: 5, offset: 11114}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 356, col: 14, offset: 11123}, + expr: &choiceExpr{ + pos: position{line: 357, col: 9, offset: 11133}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonLongHandAttributes306, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes310, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes312, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes314, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonLongHandAttributes317, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes321, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes328, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes333, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes335, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonLongHandAttributes339, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes343, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes350, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes355, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes357, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonLongHandAttributes361, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes365, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 360, col: 12, offset: 11202}, + run: (*parser).callonLongHandAttributes371, + expr: &litMatcher{ + pos: position{line: 360, col: 12, offset: 11202}, + val: "\\'", + ignoreCase: false, + want: "\"\\\\'\"", + }, + }, + &litMatcher{ + pos: position{line: 363, col: 13, offset: 11304}, + val: "'`", + ignoreCase: false, + want: "\"'`\"", + }, + &litMatcher{ + pos: position{line: 363, col: 20, offset: 11311}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &actionExpr{ + pos: position{line: 363, col: 27, offset: 11318}, + run: (*parser).callonLongHandAttributes375, + expr: &litMatcher{ + pos: position{line: 363, col: 27, offset: 11318}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &actionExpr{ + pos: position{line: 366, col: 12, offset: 11478}, + run: (*parser).callonLongHandAttributes377, + expr: &oneOrMoreExpr{ + pos: position{line: 366, col: 12, offset: 11478}, + expr: &charClassMatcher{ + pos: position{line: 366, col: 12, offset: 11478}, + val: "[^\\r\\n\\\\\\ ]", + chars: []rune{'\r', '\n', '\\', '\'', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 346, col: 5, offset: 10902}, + 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: 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\"", + pos: position{line: 374, col: 5, offset: 11713}, + run: (*parser).callonLongHandAttributes381, + expr: &seqExpr{ + pos: position{line: 374, col: 5, offset: 11713}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 374, col: 5, offset: 11713}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + ¬Expr{ + pos: position{line: 374, col: 10, offset: 11718}, + expr: &litMatcher{ + pos: position{line: 374, col: 11, offset: 11719}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 375, col: 5, offset: 11798}, + label: "content", + expr: &actionExpr{ + pos: position{line: 385, col: 5, offset: 12078}, + run: (*parser).callonLongHandAttributes387, + expr: &labeledExpr{ + pos: position{line: 385, col: 5, offset: 12078}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 385, col: 14, offset: 12087}, + expr: &choiceExpr{ + pos: position{line: 386, col: 9, offset: 12097}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonLongHandAttributes391, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes395, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes397, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes399, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonLongHandAttributes402, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes406, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes413, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes418, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes420, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonLongHandAttributes424, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes428, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes435, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes440, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes442, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonLongHandAttributes446, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes450, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 389, col: 12, offset: 12166}, + run: (*parser).callonLongHandAttributes456, + expr: &litMatcher{ + pos: position{line: 389, col: 12, offset: 12166}, + val: "\\\"", + ignoreCase: false, + want: "\"\\\\\\\"\"", + }, + }, + &litMatcher{ + pos: position{line: 392, col: 13, offset: 12268}, + val: "\"`", + ignoreCase: false, + want: "\"\\\"`\"", + }, + &litMatcher{ + pos: position{line: 392, col: 21, offset: 12276}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + &litMatcher{ + pos: position{line: 392, col: 29, offset: 12284}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + &actionExpr{ + pos: position{line: 392, col: 35, offset: 12290}, + run: (*parser).callonLongHandAttributes461, + expr: &litMatcher{ + pos: position{line: 392, col: 35, offset: 12290}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &actionExpr{ + pos: position{line: 395, col: 12, offset: 12473}, + run: (*parser).callonLongHandAttributes463, + expr: &oneOrMoreExpr{ + pos: position{line: 395, col: 12, offset: 12473}, + expr: &charClassMatcher{ + pos: position{line: 395, col: 12, offset: 12473}, + val: "[^\\r\\n\\\\\"` ]", + chars: []rune{'\r', '\n', '\\', '"', '`', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 376, col: 5, offset: 11849}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + &andExpr{ + pos: position{line: 376, col: 10, offset: 11854}, + expr: ¬Expr{ + pos: position{line: 376, col: 12, offset: 11856}, + expr: &seqExpr{ + pos: position{line: 376, col: 14, offset: 11858}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 376, col: 14, offset: 11858}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes473, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 376, col: 21, offset: 11865}, + 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: 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).callonDocumentBlock968, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 291, col: 7, offset: 8880}, + run: (*parser).callonLongHandAttributes476, + expr: &seqExpr{ + pos: position{line: 291, col: 7, offset: 8880}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 291, col: 7, offset: 8880}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 291, col: 16, offset: 8889}, + expr: &choiceExpr{ + pos: position{line: 294, col: 9, offset: 9071}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 294, col: 10, offset: 9072}, + run: (*parser).callonLongHandAttributes481, + expr: &oneOrMoreExpr{ + pos: position{line: 294, col: 10, offset: 9072}, + expr: &charClassMatcher{ + pos: position{line: 294, col: 10, offset: 9072}, + val: "[^,=.%# \\r\\n�{]]", + chars: []rune{',', '=', '.', '%', '#', ' ', '\r', '\n', '�', '{', ']'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonLongHandAttributes484, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonLongHandAttributes488, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes492, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes494, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonLongHandAttributes497, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes501, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes508, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes513, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes515, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonLongHandAttributes519, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes523, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes530, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes535, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes537, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonLongHandAttributes541, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes545, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 300, col: 12, offset: 9260}, + run: (*parser).callonLongHandAttributes551, + expr: &litMatcher{ + pos: position{line: 300, col: 12, offset: 9260}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 303, col: 8, offset: 9343}, + expr: ¬Expr{ + pos: position{line: 303, col: 10, offset: 9345}, + expr: &seqExpr{ + pos: position{line: 303, col: 12, offset: 9347}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 303, col: 12, offset: 9347}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes559, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 303, col: 19, offset: 9354}, + 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}, + }, + &actionExpr{ + pos: position{line: 283, col: 29, offset: 8649}, + run: (*parser).callonLongHandAttributes562, + expr: &seqExpr{ + pos: position{line: 283, col: 29, offset: 8649}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + pos: position{line: 283, col: 29, offset: 8649}, + val: "%", ignoreCase: false, - want: "\"////\"", + want: "\"%\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + &labeledExpr{ + pos: position{line: 283, col: 33, offset: 8653}, + label: "option", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 289, col: 5, offset: 8806}, alternatives: []interface{}{ - &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\"", + pos: position{line: 344, col: 5, offset: 10767}, + run: (*parser).callonLongHandAttributes567, + expr: &seqExpr{ + pos: position{line: 344, col: 5, offset: 10767}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 344, col: 5, offset: 10767}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + ¬Expr{ + pos: position{line: 344, col: 9, offset: 10771}, + expr: &litMatcher{ + pos: position{line: 344, col: 10, offset: 10772}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 345, col: 5, offset: 10851}, + label: "content", + expr: &actionExpr{ + pos: position{line: 356, col: 5, offset: 11114}, + run: (*parser).callonLongHandAttributes573, + expr: &labeledExpr{ + pos: position{line: 356, col: 5, offset: 11114}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 356, col: 14, offset: 11123}, + expr: &choiceExpr{ + pos: position{line: 357, col: 9, offset: 11133}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonLongHandAttributes577, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes581, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes583, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes585, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonLongHandAttributes588, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes592, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes599, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes604, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes606, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonLongHandAttributes610, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes614, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes621, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes626, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes628, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonLongHandAttributes632, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes636, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 360, col: 12, offset: 11202}, + run: (*parser).callonLongHandAttributes642, + expr: &litMatcher{ + pos: position{line: 360, col: 12, offset: 11202}, + val: "\\'", + ignoreCase: false, + want: "\"\\\\'\"", + }, + }, + &litMatcher{ + pos: position{line: 363, col: 13, offset: 11304}, + val: "'`", + ignoreCase: false, + want: "\"'`\"", + }, + &litMatcher{ + pos: position{line: 363, col: 20, offset: 11311}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &actionExpr{ + pos: position{line: 363, col: 27, offset: 11318}, + run: (*parser).callonLongHandAttributes646, + expr: &litMatcher{ + pos: position{line: 363, col: 27, offset: 11318}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &actionExpr{ + pos: position{line: 366, col: 12, offset: 11478}, + run: (*parser).callonLongHandAttributes648, + expr: &oneOrMoreExpr{ + pos: position{line: 366, col: 12, offset: 11478}, + expr: &charClassMatcher{ + pos: position{line: 366, col: 12, offset: 11478}, + val: "[^\\r\\n\\\\\\ ]", + chars: []rune{'\r', '\n', '\\', '\'', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 346, col: 5, offset: 10902}, + 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: 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", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 374, col: 5, offset: 11713}, + run: (*parser).callonLongHandAttributes652, + expr: &seqExpr{ + pos: position{line: 374, col: 5, offset: 11713}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 374, col: 5, offset: 11713}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + ¬Expr{ + pos: position{line: 374, col: 10, offset: 11718}, + expr: &litMatcher{ + pos: position{line: 374, col: 11, offset: 11719}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 375, col: 5, offset: 11798}, + label: "content", + expr: &actionExpr{ + pos: position{line: 385, col: 5, offset: 12078}, + run: (*parser).callonLongHandAttributes658, + expr: &labeledExpr{ + pos: position{line: 385, col: 5, offset: 12078}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 385, col: 14, offset: 12087}, + expr: &choiceExpr{ + pos: position{line: 386, col: 9, offset: 12097}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonLongHandAttributes662, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes666, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes668, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes670, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonLongHandAttributes673, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes677, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes684, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes689, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes691, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonLongHandAttributes695, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes699, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes706, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes711, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes713, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonLongHandAttributes717, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes721, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 389, col: 12, offset: 12166}, + run: (*parser).callonLongHandAttributes727, + expr: &litMatcher{ + pos: position{line: 389, col: 12, offset: 12166}, + val: "\\\"", + ignoreCase: false, + want: "\"\\\\\\\"\"", + }, + }, + &litMatcher{ + pos: position{line: 392, col: 13, offset: 12268}, + val: "\"`", + ignoreCase: false, + want: "\"\\\"`\"", + }, + &litMatcher{ + pos: position{line: 392, col: 21, offset: 12276}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + &litMatcher{ + pos: position{line: 392, col: 29, offset: 12284}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + &actionExpr{ + pos: position{line: 392, col: 35, offset: 12290}, + run: (*parser).callonLongHandAttributes732, + expr: &litMatcher{ + pos: position{line: 392, col: 35, offset: 12290}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &actionExpr{ + pos: position{line: 395, col: 12, offset: 12473}, + run: (*parser).callonLongHandAttributes734, + expr: &oneOrMoreExpr{ + pos: position{line: 395, col: 12, offset: 12473}, + expr: &charClassMatcher{ + pos: position{line: 395, col: 12, offset: 12473}, + val: "[^\\r\\n\\\\\"` ]", + chars: []rune{'\r', '\n', '\\', '"', '`', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 376, col: 5, offset: 11849}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + &andExpr{ + pos: position{line: 376, col: 10, offset: 11854}, + expr: ¬Expr{ + pos: position{line: 376, col: 12, offset: 11856}, + expr: &seqExpr{ + pos: position{line: 376, col: 14, offset: 11858}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 376, col: 14, offset: 11858}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes744, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 376, col: 21, offset: 11865}, + 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: 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).callonDocumentBlock1004, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 291, col: 7, offset: 8880}, + run: (*parser).callonLongHandAttributes747, + expr: &seqExpr{ + pos: position{line: 291, col: 7, offset: 8880}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 291, col: 7, offset: 8880}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 291, col: 16, offset: 8889}, + expr: &choiceExpr{ + pos: position{line: 294, col: 9, offset: 9071}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 294, col: 10, offset: 9072}, + run: (*parser).callonLongHandAttributes752, + expr: &oneOrMoreExpr{ + pos: position{line: 294, col: 10, offset: 9072}, + expr: &charClassMatcher{ + pos: position{line: 294, col: 10, offset: 9072}, + val: "[^,=.%# \\r\\n�{]]", + chars: []rune{',', '=', '.', '%', '#', ' ', '\r', '\n', '�', '{', ']'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonLongHandAttributes755, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonLongHandAttributes759, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes763, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes765, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonLongHandAttributes768, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes772, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes779, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes784, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes786, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonLongHandAttributes790, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes794, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes801, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes806, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes808, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonLongHandAttributes812, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes816, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 300, col: 12, offset: 9260}, + run: (*parser).callonLongHandAttributes822, + expr: &litMatcher{ + pos: position{line: 300, col: 12, offset: 9260}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 303, col: 8, offset: 9343}, + expr: ¬Expr{ + pos: position{line: 303, col: 10, offset: 9345}, + expr: &seqExpr{ + pos: position{line: 303, col: 12, offset: 9347}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 303, col: 12, offset: 9347}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes830, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 303, col: 19, offset: 9354}, + 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: 1889, col: 30, offset: 67449}, + }, + &actionExpr{ + pos: position{line: 278, col: 30, offset: 8489}, + run: (*parser).callonLongHandAttributes833, + expr: &seqExpr{ + pos: position{line: 278, col: 30, offset: 8489}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", + pos: position{line: 278, col: 30, offset: 8489}, + val: ".", ignoreCase: false, - want: "\"++++\"", + want: "\".\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1889, col: 37, offset: 67456}, + &labeledExpr{ + pos: position{line: 278, col: 34, offset: 8493}, + label: "role", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 289, col: 5, offset: 8806}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &actionExpr{ + pos: position{line: 344, col: 5, offset: 10767}, + run: (*parser).callonLongHandAttributes838, + expr: &seqExpr{ + pos: position{line: 344, col: 5, offset: 10767}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 344, col: 5, offset: 10767}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + ¬Expr{ + pos: position{line: 344, col: 9, offset: 10771}, + expr: &litMatcher{ + pos: position{line: 344, col: 10, offset: 10772}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 345, col: 5, offset: 10851}, + label: "content", + expr: &actionExpr{ + pos: position{line: 356, col: 5, offset: 11114}, + run: (*parser).callonLongHandAttributes844, + expr: &labeledExpr{ + pos: position{line: 356, col: 5, offset: 11114}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 356, col: 14, offset: 11123}, + expr: &choiceExpr{ + pos: position{line: 357, col: 9, offset: 11133}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonLongHandAttributes848, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes852, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes854, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes856, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonLongHandAttributes859, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes863, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes870, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes875, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes877, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonLongHandAttributes881, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes885, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes892, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes897, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes899, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonLongHandAttributes903, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes907, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 360, col: 12, offset: 11202}, + run: (*parser).callonLongHandAttributes913, + expr: &litMatcher{ + pos: position{line: 360, col: 12, offset: 11202}, + val: "\\'", + ignoreCase: false, + want: "\"\\\\'\"", + }, + }, + &litMatcher{ + pos: position{line: 363, col: 13, offset: 11304}, + val: "'`", + ignoreCase: false, + want: "\"'`\"", + }, + &litMatcher{ + pos: position{line: 363, col: 20, offset: 11311}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &actionExpr{ + pos: position{line: 363, col: 27, offset: 11318}, + run: (*parser).callonLongHandAttributes917, + expr: &litMatcher{ + pos: position{line: 363, col: 27, offset: 11318}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &actionExpr{ + pos: position{line: 366, col: 12, offset: 11478}, + run: (*parser).callonLongHandAttributes919, + expr: &oneOrMoreExpr{ + pos: position{line: 366, col: 12, offset: 11478}, + expr: &charClassMatcher{ + pos: position{line: 366, col: 12, offset: 11478}, + val: "[^\\r\\n\\\\\\ ]", + chars: []rune{'\r', '\n', '\\', '\'', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 346, col: 5, offset: 10902}, + 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\"", + pos: position{line: 374, col: 5, offset: 11713}, + run: (*parser).callonLongHandAttributes923, + expr: &seqExpr{ + pos: position{line: 374, col: 5, offset: 11713}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 374, col: 5, offset: 11713}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + ¬Expr{ + pos: position{line: 374, col: 10, offset: 11718}, + expr: &litMatcher{ + pos: position{line: 374, col: 11, offset: 11719}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &labeledExpr{ + pos: position{line: 375, col: 5, offset: 11798}, + label: "content", + expr: &actionExpr{ + pos: position{line: 385, col: 5, offset: 12078}, + run: (*parser).callonLongHandAttributes929, + expr: &labeledExpr{ + pos: position{line: 385, col: 5, offset: 12078}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 385, col: 14, offset: 12087}, + expr: &choiceExpr{ + pos: position{line: 386, col: 9, offset: 12097}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonLongHandAttributes933, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes937, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes939, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes941, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonLongHandAttributes944, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes948, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes955, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes960, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes962, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonLongHandAttributes966, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes970, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes977, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes982, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes984, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonLongHandAttributes988, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes992, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 389, col: 12, offset: 12166}, + run: (*parser).callonLongHandAttributes998, + expr: &litMatcher{ + pos: position{line: 389, col: 12, offset: 12166}, + val: "\\\"", + ignoreCase: false, + want: "\"\\\\\\\"\"", + }, + }, + &litMatcher{ + pos: position{line: 392, col: 13, offset: 12268}, + val: "\"`", + ignoreCase: false, + want: "\"\\\"`\"", + }, + &litMatcher{ + pos: position{line: 392, col: 21, offset: 12276}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + &litMatcher{ + pos: position{line: 392, col: 29, offset: 12284}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + &actionExpr{ + pos: position{line: 392, col: 35, offset: 12290}, + run: (*parser).callonLongHandAttributes1003, + expr: &litMatcher{ + pos: position{line: 392, col: 35, offset: 12290}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &actionExpr{ + pos: position{line: 395, col: 12, offset: 12473}, + run: (*parser).callonLongHandAttributes1005, + expr: &oneOrMoreExpr{ + pos: position{line: 395, col: 12, offset: 12473}, + expr: &charClassMatcher{ + pos: position{line: 395, col: 12, offset: 12473}, + val: "[^\\r\\n\\\\\"` ]", + chars: []rune{'\r', '\n', '\\', '"', '`', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 376, col: 5, offset: 11849}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + &andExpr{ + pos: position{line: 376, col: 10, offset: 11854}, + expr: ¬Expr{ + pos: position{line: 376, col: 12, offset: 11856}, + expr: &seqExpr{ + pos: position{line: 376, col: 14, offset: 11858}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 376, col: 14, offset: 11858}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes1015, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 376, col: 21, offset: 11865}, + 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: 291, col: 7, offset: 8880}, + run: (*parser).callonLongHandAttributes1018, + expr: &seqExpr{ + pos: position{line: 291, col: 7, offset: 8880}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 291, col: 7, offset: 8880}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 291, col: 16, offset: 8889}, + expr: &choiceExpr{ + pos: position{line: 294, col: 9, offset: 9071}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 294, col: 10, offset: 9072}, + run: (*parser).callonLongHandAttributes1023, + expr: &oneOrMoreExpr{ + pos: position{line: 294, col: 10, offset: 9072}, + expr: &charClassMatcher{ + pos: position{line: 294, col: 10, offset: 9072}, + val: "[^,=.%# \\r\\n�{]]", + chars: []rune{',', '=', '.', '%', '#', ' ', '\r', '\n', '�', '{', ']'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonLongHandAttributes1026, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonLongHandAttributes1030, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes1034, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonLongHandAttributes1036, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonLongHandAttributes1039, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes1043, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes1050, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes1055, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes1057, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonLongHandAttributes1061, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes1065, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonLongHandAttributes1072, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonLongHandAttributes1077, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonLongHandAttributes1079, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonLongHandAttributes1083, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonLongHandAttributes1087, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 300, col: 12, offset: 9260}, + run: (*parser).callonLongHandAttributes1093, + expr: &litMatcher{ + pos: position{line: 300, col: 12, offset: 9260}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 303, col: 8, offset: 9343}, + expr: ¬Expr{ + pos: position{line: 303, col: 10, offset: 9345}, + expr: &seqExpr{ + pos: position{line: 303, col: 12, offset: 9347}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 303, col: 12, offset: 9347}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes1101, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 303, col: 19, offset: 9354}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, + }, + }, + }, + }, + }, }, }, }, @@ -7963,276 +13242,192 @@ 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).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, - }, - }, - }, + }, + }, + }, + }, + }, + }, + &zeroOrOneExpr{ + pos: position{line: 252, col: 8, offset: 7764}, + expr: &seqExpr{ + pos: position{line: 252, col: 9, offset: 7765}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 252, col: 9, offset: 7765}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 252, col: 13, offset: 7769}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonLongHandAttributes1110, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonDocumentBlock1032, - }, }, }, }, }, }, }, + &andCodeExpr{ + pos: position{line: 253, col: 5, offset: 7783}, + run: (*parser).callonLongHandAttributes1112, + }, }, }, - &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, - }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 226, col: 5, offset: 6890}, + label: "otherAttributes", + expr: &zeroOrMoreExpr{ + pos: position{line: 226, col: 21, offset: 6906}, + expr: &choiceExpr{ + pos: position{line: 226, col: 22, offset: 6907}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 226, col: 22, offset: 6907}, + name: "PositionalAttribute", + }, + &ruleRefExpr{ + pos: position{line: 226, col: 44, offset: 6929}, + name: "NamedAttribute", }, }, }, }, }, + &litMatcher{ + pos: position{line: 227, col: 5, offset: 6950}, + val: "]", + ignoreCase: false, + want: "\"]\"", + }, }, }, }, }, { - name: "BlockAttributes", - pos: position{line: 248, col: 1, offset: 8058}, - expr: &actionExpr{ - pos: position{line: 249, col: 5, offset: 8082}, - run: (*parser).callonBlockAttributes1, - expr: &labeledExpr{ - pos: position{line: 249, col: 5, offset: 8082}, - label: "attributes", - expr: &oneOrMoreExpr{ - pos: position{line: 249, col: 16, offset: 8093}, - expr: &choiceExpr{ - pos: position{line: 251, col: 9, offset: 8160}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 251, col: 10, offset: 8161}, - run: (*parser).callonBlockAttributes5, - expr: &seqExpr{ - pos: position{line: 251, col: 10, offset: 8161}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 251, col: 10, offset: 8161}, - label: "anchor", - expr: &actionExpr{ - pos: position{line: 275, col: 4, offset: 8843}, - run: (*parser).callonBlockAttributes8, - expr: &seqExpr{ - pos: position{line: 275, col: 4, offset: 8843}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 275, col: 4, offset: 8843}, - val: "[[", - ignoreCase: false, - want: "\"[[\"", - }, - &labeledExpr{ - pos: position{line: 276, col: 5, offset: 8853}, - label: "id", - expr: &actionExpr{ - pos: position{line: 277, col: 9, offset: 8866}, - run: (*parser).callonBlockAttributes12, - expr: &labeledExpr{ - pos: position{line: 277, col: 9, offset: 8866}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 277, col: 18, offset: 8875}, - expr: &choiceExpr{ - pos: position{line: 278, col: 13, offset: 8889}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 278, col: 14, offset: 8890}, - run: (*parser).callonBlockAttributes16, - expr: &oneOrMoreExpr{ - pos: position{line: 278, col: 14, offset: 8890}, - expr: &charClassMatcher{ - pos: position{line: 278, col: 14, offset: 8890}, - val: "[^=\\r\\n�{]]", - chars: []rune{'=', '\r', '\n', '�', '{', ']'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonBlockAttributes19, - 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).callonBlockAttributes23, - 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).callonBlockAttributes27, - 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).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, - }, - &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: 283, col: 14, offset: 9113}, - run: (*parser).callonBlockAttributes37, - expr: &litMatcher{ - pos: position{line: 283, col: 14, offset: 9113}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - }, - }, - }, - }, + name: "PositionalAttribute", + pos: position{line: 307, col: 1, offset: 9431}, + expr: &choiceExpr{ + pos: position{line: 307, col: 24, offset: 9454}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 308, col: 5, offset: 9460}, + run: (*parser).callonPositionalAttribute2, + expr: &seqExpr{ + pos: position{line: 308, col: 5, offset: 9460}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 308, col: 5, offset: 9460}, + label: "value", + expr: &ruleRefExpr{ + pos: position{line: 308, col: 12, offset: 9467}, + name: "AttributeRawValue", + }, + }, + &choiceExpr{ + pos: position{line: 308, col: 32, offset: 9487}, + alternatives: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 308, col: 32, offset: 9487}, + expr: &seqExpr{ + pos: position{line: 308, col: 33, offset: 9488}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 308, col: 33, offset: 9488}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 308, col: 37, offset: 9492}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonPositionalAttribute13, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, - &litMatcher{ - pos: position{line: 289, col: 5, offset: 9299}, - val: "]]", - ignoreCase: false, - want: "\"]]\"", - }, }, }, }, }, + }, + &andExpr{ + pos: position{line: 308, col: 48, offset: 9503}, + expr: &litMatcher{ + pos: position{line: 308, col: 49, offset: 9504}, + val: "]", + ignoreCase: false, + want: "\"]\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 313, col: 6, offset: 9741}, + run: (*parser).callonPositionalAttribute17, + expr: &seqExpr{ + pos: position{line: 313, col: 6, offset: 9741}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 313, col: 6, offset: 9741}, + label: "value", + expr: &seqExpr{ + pos: position{line: 313, col: 13, offset: 9748}, + exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 251, col: 35, offset: 8186}, + pos: position{line: 313, col: 13, offset: 9748}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonBlockAttributes43, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonPositionalAttribute24, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -8242,195 +13437,36 @@ var g = &grammar{ }, }, &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 313, col: 21, offset: 9756}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: 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: 255, col: 12, offset: 8311}, - run: (*parser).callonBlockAttributes48, - expr: &seqExpr{ - pos: position{line: 255, col: 12, offset: 8311}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 255, col: 12, offset: 8311}, - label: "title", - expr: &actionExpr{ - pos: position{line: 294, col: 19, offset: 9418}, - run: (*parser).callonBlockAttributes51, - expr: &seqExpr{ - pos: position{line: 294, col: 19, offset: 9418}, + &seqExpr{ + pos: position{line: 313, col: 22, offset: 9757}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 294, col: 19, offset: 9418}, - val: ".", + pos: position{line: 313, col: 22, offset: 9757}, + val: ",", ignoreCase: false, - want: "\".\"", + want: "\",\"", }, - &labeledExpr{ - pos: position{line: 294, col: 23, offset: 9422}, - label: "title", - expr: &actionExpr{ - pos: position{line: 295, col: 5, offset: 9434}, - run: (*parser).callonBlockAttributes55, - expr: &seqExpr{ - pos: position{line: 295, col: 5, offset: 9434}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 295, col: 5, offset: 9434}, - expr: &charClassMatcher{ - pos: position{line: 295, col: 6, offset: 9435}, - val: "[. ]", - chars: []rune{'.', ' '}, - ignoreCase: false, - inverted: false, - }, - }, - &labeledExpr{ - pos: position{line: 296, col: 5, offset: 9547}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 296, col: 14, offset: 9556}, - expr: &choiceExpr{ - pos: position{line: 297, col: 9, offset: 9566}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 297, col: 10, offset: 9567}, - run: (*parser).callonBlockAttributes62, - expr: &oneOrMoreExpr{ - pos: position{line: 297, col: 10, offset: 9567}, - expr: &charClassMatcher{ - pos: position{line: 297, col: 10, offset: 9567}, - val: "[^\\r\\n�{]", - chars: []rune{'\r', '\n', '�', '{'}, - ignoreCase: false, - inverted: true, - }, - }, - }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonBlockAttributes65, - 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).callonBlockAttributes69, - 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).callonBlockAttributes73, - 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).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, - }, - &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: 302, col: 10, offset: 9713}, - run: (*parser).callonBlockAttributes83, - expr: &litMatcher{ - pos: position{line: 302, col: 10, offset: 9713}, - val: "{", - ignoreCase: false, - want: "\"{\"", - }, - }, - }, - }, - }, + &zeroOrMoreExpr{ + pos: position{line: 313, col: 26, offset: 9761}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonPositionalAttribute32, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, @@ -8438,106 +13474,102 @@ 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: " ", + &andExpr{ + pos: position{line: 313, col: 36, offset: 9771}, + expr: &litMatcher{ + pos: position{line: 313, col: 37, offset: 9772}, + 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\"", - }, + want: "\"]\"", }, }, }, }, - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 314, col: 5, offset: 9782}, + run: (*parser).callonPositionalAttribute36, + }, + }, + }, + }, + }, + }, + }, + { + name: "NamedAttribute", + pos: position{line: 324, col: 1, offset: 10097}, + expr: &actionExpr{ + pos: position{line: 324, col: 19, offset: 10115}, + run: (*parser).callonNamedAttribute1, + expr: &seqExpr{ + pos: position{line: 324, col: 19, offset: 10115}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 324, col: 19, offset: 10115}, + label: "key", + expr: &actionExpr{ + pos: position{line: 329, col: 22, offset: 10426}, + run: (*parser).callonNamedAttribute4, + expr: &seqExpr{ + pos: position{line: 329, col: 22, offset: 10426}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 329, col: 22, offset: 10426}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - inverted: false, + want: "\" \"", }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 259, col: 12, offset: 8429}, - run: (*parser).callonBlockAttributes93, - expr: &seqExpr{ - pos: position{line: 259, col: 12, offset: 8429}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 259, col: 12, offset: 8429}, - label: "attributes", - expr: &ruleRefExpr{ - pos: position{line: 259, col: 24, offset: 8441}, - 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: " ", + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNamedAttribute9, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", 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\"", - }, + want: "\"\\t\"", }, }, }, }, - &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, + }, + &oneOrMoreExpr{ + pos: position{line: 329, col: 29, offset: 10433}, + expr: &charClassMatcher{ + pos: position{line: 329, col: 29, offset: 10433}, + val: "[^\\r\\n=,]]", + chars: []rune{'\r', '\n', '=', ',', ']'}, + ignoreCase: false, + inverted: true, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 329, col: 42, offset: 10446}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2878, col: 10, offset: 95044}, + 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, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNamedAttribute16, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, }, }, }, @@ -8546,191 +13578,71 @@ var g = &grammar{ }, }, }, - }, - }, - }, - }, - { - name: "InlineAttributes", - pos: position{line: 266, col: 1, offset: 8608}, - expr: &actionExpr{ - pos: position{line: 267, col: 5, offset: 8632}, - run: (*parser).callonInlineAttributes1, - expr: &seqExpr{ - pos: position{line: 267, col: 5, offset: 8632}, - exprs: []interface{}{ &litMatcher{ - pos: position{line: 267, col: 5, offset: 8632}, - val: "[", + pos: position{line: 324, col: 43, offset: 10139}, + val: "=", ignoreCase: false, - want: "\"[\"", + want: "\"=\"", }, - &labeledExpr{ - pos: position{line: 268, col: 5, offset: 8640}, - 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", + &zeroOrMoreExpr{ + pos: position{line: 324, col: 47, offset: 10143}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNamedAttribute22, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, - &litMatcher{ - pos: position{line: 269, col: 5, offset: 8693}, - val: "]", - ignoreCase: false, - want: "\"]\"", - }, - }, - }, - }, - }, - { - name: "LongHandAttributes", - pos: position{line: 313, col: 1, offset: 10113}, - expr: &actionExpr{ - pos: position{line: 314, col: 5, offset: 10139}, - run: (*parser).callonLongHandAttributes1, - expr: &seqExpr{ - pos: position{line: 314, col: 5, offset: 10139}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 314, col: 5, offset: 10139}, - val: "[", - ignoreCase: false, - want: "\"[\"", - }, - ¬Expr{ - pos: position{line: 314, col: 9, offset: 10143}, - expr: &litMatcher{ - pos: position{line: 314, col: 10, offset: 10144}, - val: "[", - ignoreCase: false, - want: "\"[\"", - }, - }, - &labeledExpr{ - pos: position{line: 316, col: 5, offset: 10314}, - 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", - }, - }, - }, - }, + &labeledExpr{ + pos: position{line: 324, col: 54, offset: 10150}, + label: "value", + expr: &ruleRefExpr{ + pos: position{line: 324, col: 61, offset: 10157}, + name: "AttributeRawValue", + }, }, &zeroOrOneExpr{ - pos: position{line: 337, col: 8, offset: 11090}, + pos: position{line: 324, col: 80, offset: 10176}, expr: &seqExpr{ - pos: position{line: 337, col: 9, offset: 11091}, + pos: position{line: 324, col: 81, offset: 10177}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 337, col: 9, offset: 11091}, + pos: position{line: 324, col: 81, offset: 10177}, val: ",", ignoreCase: false, want: "\",\"", }, &zeroOrMoreExpr{ - pos: position{line: 337, col: 13, offset: 11095}, + pos: position{line: 324, col: 85, offset: 10181}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonFirstPositionalAttributes18, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNamedAttribute32, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -8742,232 +13654,68 @@ var g = &grammar{ }, }, }, - &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}, + name: "AttributeRawValue", + pos: position{line: 333, col: 1, offset: 10516}, 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, + pos: position{line: 334, col: 5, offset: 10542}, + run: (*parser).callonAttributeRawValue1, expr: &seqExpr{ - pos: position{line: 366, col: 29, offset: 11892}, + pos: position{line: 334, col: 5, offset: 10542}, 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", + pos: position{line: 334, col: 5, offset: 10542}, + label: "value", + expr: &choiceExpr{ + pos: position{line: 335, col: 9, offset: 10558}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 344, col: 5, offset: 10767}, + run: (*parser).callonAttributeRawValue5, + expr: &seqExpr{ + pos: position{line: 344, col: 5, offset: 10767}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 344, col: 5, offset: 10767}, + val: "'", + ignoreCase: false, + want: "\"'\"", }, - &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: "\"�\"", - }, - }, + ¬Expr{ + pos: position{line: 344, col: 9, offset: 10771}, + expr: &litMatcher{ + pos: position{line: 344, col: 10, offset: 10772}, + 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}, + &labeledExpr{ + pos: position{line: 345, col: 5, offset: 10851}, + label: "content", + expr: &actionExpr{ + pos: position{line: 356, col: 5, offset: 11114}, + run: (*parser).callonAttributeRawValue11, + expr: &labeledExpr{ + pos: position{line: 356, col: 5, offset: 11114}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 356, col: 14, offset: 11123}, + expr: &choiceExpr{ + pos: position{line: 357, col: 9, offset: 11133}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonAttributeRawValue15, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, @@ -8975,434 +13723,885 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonAttributeRawValue19, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonAttributeRawValue21, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonAttributeRawValue23, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonAttributeRawValue26, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonAttributeRawValue30, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonAttributeRawValue37, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonAttributeRawValue42, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonAttributeRawValue44, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonAttributeRawValue48, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonAttributeRawValue52, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonAttributeRawValue59, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonAttributeRawValue64, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonAttributeRawValue66, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonAttributeRawValue70, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonAttributeRawValue74, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 360, col: 12, offset: 11202}, + run: (*parser).callonAttributeRawValue80, + expr: &litMatcher{ + pos: position{line: 360, col: 12, offset: 11202}, + val: "\\'", + ignoreCase: false, + want: "\"\\\\'\"", + }, + }, + &litMatcher{ + pos: position{line: 363, col: 13, offset: 11304}, + val: "'`", + ignoreCase: false, + want: "\"'`\"", + }, + &litMatcher{ + pos: position{line: 363, col: 20, offset: 11311}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &actionExpr{ + pos: position{line: 363, col: 27, offset: 11318}, + run: (*parser).callonAttributeRawValue84, + expr: &litMatcher{ + pos: position{line: 363, col: 27, offset: 11318}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &actionExpr{ + pos: position{line: 366, col: 12, offset: 11478}, + run: (*parser).callonAttributeRawValue86, + expr: &oneOrMoreExpr{ + pos: position{line: 366, col: 12, offset: 11478}, + expr: &charClassMatcher{ + pos: position{line: 366, col: 12, offset: 11478}, + val: "[^\\r\\n\\\\\\ ]", + chars: []rune{'\r', '\n', '\\', '\'', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, }, }, }, - &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: "\"{\"", - }, + &litMatcher{ + pos: position{line: 346, col: 5, offset: 10902}, + 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: ",", + &actionExpr{ + pos: position{line: 374, col: 5, offset: 11713}, + run: (*parser).callonAttributeRawValue90, + expr: &seqExpr{ + pos: position{line: 374, col: 5, offset: 11713}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 374, col: 5, offset: 11713}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + ¬Expr{ + pos: position{line: 374, col: 10, offset: 11718}, + expr: &litMatcher{ + pos: position{line: 374, col: 11, offset: 11719}, + 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\"", - }, - }, - }, - }, + 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}, + &labeledExpr{ + pos: position{line: 375, col: 5, offset: 11798}, + label: "content", + expr: &actionExpr{ + pos: position{line: 385, col: 5, offset: 12078}, + run: (*parser).callonAttributeRawValue96, + expr: &labeledExpr{ + pos: position{line: 385, col: 5, offset: 12078}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 385, col: 14, offset: 12087}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 386, col: 9, offset: 12097}, alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonAttributeRawValue100, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + 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}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonPositionalAttribute32, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonAttributeRawValue104, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", }, }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonAttributeRawValue106, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonAttributeRawValue108, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonAttributeRawValue111, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonAttributeRawValue115, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonAttributeRawValue122, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonAttributeRawValue127, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonAttributeRawValue129, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonAttributeRawValue133, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonAttributeRawValue137, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonAttributeRawValue144, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonAttributeRawValue149, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonAttributeRawValue151, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonAttributeRawValue155, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonAttributeRawValue159, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 389, col: 12, offset: 12166}, + run: (*parser).callonAttributeRawValue165, + expr: &litMatcher{ + pos: position{line: 389, col: 12, offset: 12166}, + val: "\\\"", + ignoreCase: false, + want: "\"\\\\\\\"\"", + }, + }, + &litMatcher{ + pos: position{line: 392, col: 13, offset: 12268}, + val: "\"`", + ignoreCase: false, + want: "\"\\\"`\"", + }, + &litMatcher{ + pos: position{line: 392, col: 21, offset: 12276}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + &litMatcher{ + pos: position{line: 392, col: 29, offset: 12284}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + &actionExpr{ + pos: position{line: 392, col: 35, offset: 12290}, + run: (*parser).callonAttributeRawValue170, + expr: &litMatcher{ + pos: position{line: 392, col: 35, offset: 12290}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + &actionExpr{ + pos: position{line: 395, col: 12, offset: 12473}, + run: (*parser).callonAttributeRawValue172, + expr: &oneOrMoreExpr{ + pos: position{line: 395, col: 12, offset: 12473}, + expr: &charClassMatcher{ + pos: position{line: 395, col: 12, offset: 12473}, + val: "[^\\r\\n\\\\\"` ]", + chars: []rune{'\r', '\n', '\\', '"', '`', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, }, }, }, }, }, - &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: " ", + pos: position{line: 376, col: 5, offset: 11849}, + val: "\"", ignoreCase: false, - want: "\" \"", + 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\"", + &andExpr{ + pos: position{line: 376, col: 10, offset: 11854}, + expr: ¬Expr{ + pos: position{line: 376, col: 12, offset: 11856}, + expr: &seqExpr{ + pos: position{line: 376, col: 14, offset: 11858}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 376, col: 14, offset: 11858}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonAttributeRawValue182, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 376, col: 21, offset: 11865}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, + }, }, }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - { - 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", + pos: position{line: 337, col: 11, offset: 10640}, + name: "UnquotedAttributeRawValue", }, }, }, }, &andExpr{ - pos: position{line: 422, col: 5, offset: 13797}, + pos: position{line: 339, col: 5, offset: 10677}, expr: ¬Expr{ - pos: position{line: 422, col: 7, offset: 13799}, + pos: position{line: 339, col: 7, offset: 10679}, expr: &seqExpr{ - pos: position{line: 422, col: 9, offset: 13801}, + pos: position{line: 339, col: 9, offset: 10681}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 422, col: 9, offset: 13801}, + pos: position{line: 339, col: 9, offset: 10681}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonAttributeValue14, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonAttributeRawValue192, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -9412,7 +14611,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 422, col: 16, offset: 13808}, + pos: position{line: 339, col: 16, offset: 10688}, val: "=", ignoreCase: false, want: "\"=\"", @@ -9426,68 +14625,89 @@ var g = &grammar{ }, }, { - name: "SingleQuotedAttributeValue", - pos: position{line: 426, col: 1, offset: 13849}, + name: "UnquotedAttributeRawValue", + pos: position{line: 403, col: 1, offset: 12747}, expr: &actionExpr{ - pos: position{line: 427, col: 5, offset: 13884}, - run: (*parser).callonSingleQuotedAttributeValue1, + pos: position{line: 406, col: 5, offset: 12934}, + run: (*parser).callonUnquotedAttributeRawValue1, expr: &seqExpr{ - pos: position{line: 427, col: 5, offset: 13884}, + pos: position{line: 406, col: 5, offset: 12934}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 427, col: 5, offset: 13884}, - val: "'", - ignoreCase: false, - want: "\"'\"", + ¬Expr{ + pos: position{line: 406, col: 5, offset: 12934}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonUnquotedAttributeRawValue6, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, }, &labeledExpr{ - pos: position{line: 428, col: 5, offset: 13893}, + pos: position{line: 407, col: 5, offset: 13003}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 428, col: 14, offset: 13902}, + pos: position{line: 407, col: 14, offset: 13012}, expr: &choiceExpr{ - pos: position{line: 429, col: 9, offset: 13912}, + pos: position{line: 408, col: 9, offset: 13022}, 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', '�', '\\', '{'}, + &seqExpr{ + pos: position{line: 408, col: 10, offset: 13023}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 408, col: 10, offset: 13023}, + val: "[", ignoreCase: false, - inverted: true, + want: "\"[\"", + }, + &ruleRefExpr{ + pos: position{line: 408, col: 14, offset: 13027}, + name: "UnquotedAttributeRawValue", + }, + &litMatcher{ + pos: position{line: 408, col: 40, offset: 13053}, + val: "]", + ignoreCase: false, + want: "\"]\"", }, }, }, &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonSingleQuotedAttributeValue11, + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonUnquotedAttributeRawValue15, expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 947, col: 23, offset: 29896}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 945, col: 32, offset: 29864}, val: "�", ignoreCase: false, want: "\"�\"", }, &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, + pos: position{line: 947, col: 51, offset: 29924}, label: "ref", expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonSingleQuotedAttributeValue15, + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonUnquotedAttributeRawValue19, expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 947, col: 56, offset: 29929}, expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 947, col: 56, offset: 29929}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -9497,7 +14717,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, + pos: position{line: 945, col: 32, offset: 29864}, val: "�", ignoreCase: false, want: "\"�\"", @@ -9506,1007 +14726,663 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonSingleQuotedAttributeValue19, + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonUnquotedAttributeRawValue23, expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, + pos: position{line: 449, col: 5, offset: 14443}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", - ignoreCase: false, - want: "\"{\"", + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonUnquotedAttributeRawValue25, }, &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, + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonUnquotedAttributeRawValue28, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonUnquotedAttributeRawValue32, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonUnquotedAttributeRawValue39, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonUnquotedAttributeRawValue44, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonUnquotedAttributeRawValue46, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, }, - }, - }, - }, - &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")}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonUnquotedAttributeRawValue50, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonUnquotedAttributeRawValue54, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonUnquotedAttributeRawValue61, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonUnquotedAttributeRawValue66, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonUnquotedAttributeRawValue68, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + 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: 456, col: 31, offset: 14633}, + run: (*parser).callonUnquotedAttributeRawValue72, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonUnquotedAttributeRawValue76, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: 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: "\"\\\\\\\"\"", + pos: position{line: 411, col: 12, offset: 13161}, + run: (*parser).callonUnquotedAttributeRawValue82, + expr: &oneOrMoreExpr{ + pos: position{line: 411, col: 12, offset: 13161}, + expr: &charClassMatcher{ + pos: position{line: 411, col: 12, offset: 13161}, + val: "[^=,\\r\\n�] ]", + chars: []rune{'=', ',', '\r', '\n', '�', ']', ' '}, + ignoreCase: false, + inverted: true, + }, }, }, &litMatcher{ - pos: position{line: 458, col: 11, offset: 14745}, - val: "{", + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - want: "\"{\"", + want: "\" \"", }, &actionExpr{ - pos: position{line: 458, col: 17, offset: 14751}, - run: (*parser).callonDoubleQuotedAttributeValue32, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonUnquotedAttributeRawValue86, expr: &litMatcher{ - pos: position{line: 458, col: 17, offset: 14751}, - val: "\\", + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", ignoreCase: false, - want: "\"\\\\\"", + want: "\"\\t\"", }, }, }, }, }, }, - &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\"", + name: "CrossReference", + pos: position{line: 489, col: 1, offset: 15903}, + expr: &choiceExpr{ + pos: position{line: 489, col: 19, offset: 15921}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonCrossReference2, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonCrossReference6, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, }, }, }, - }, - }, - &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', '�', '{', ']'}, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonCrossReference12, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", ignoreCase: false, - inverted: true, + want: "\"\\t\"", }, }, }, - &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}, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonCrossReference18, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", - ranges: []rune{'0', '9'}, + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, ignoreCase: false, - inverted: false, + inverted: true, }, }, }, }, - &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")}, - 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: 449, col: 5, offset: 14443}, + run: (*parser).callonCrossReference23, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonCrossReference25, }, - }, - }, - &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, - }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonCrossReference28, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", }, - }, - }, - &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, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonCrossReference32, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + 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, - 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}, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, 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, + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonCrossReference39, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonCrossReference44, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonCrossReference46, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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: "-", + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + 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'}, - 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: "-", - ignoreCase: false, - 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'}, - ignoreCase: false, - inverted: false, - }, - }, - }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonCrossReference50, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonCrossReference54, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + 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).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: "-", - ignoreCase: false, - 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'}, - ignoreCase: false, - inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonCrossReference61, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonCrossReference66, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonCrossReference68, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, @@ -10516,46 +15392,67 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + 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", + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonCrossReference72, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", expr: &actionExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, - run: (*parser).callonLineRanges65, + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonCrossReference76, expr: &seqExpr{ - pos: position{line: 2267, col: 11, offset: 79895}, + pos: position{line: 118, col: 18, offset: 3399}, 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: "\"-\"", - }, + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, - &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, - }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, @@ -10565,445 +15462,418 @@ var g = &grammar{ }, }, }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonCrossReference82, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, }, }, }, - &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, - }, - }, - }, - }, - }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonCrossReference85, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonCrossReference89, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, }, }, }, }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + }, + &ruleRefExpr{ + pos: position{line: 489, col: 44, offset: 15946}, + name: "ExternalCrossReference", }, }, }, }, { - name: "TagRanges", - pos: position{line: 599, col: 1, offset: 18874}, + name: "ExternalCrossReference", + pos: position{line: 497, col: 1, offset: 16206}, expr: &actionExpr{ - pos: position{line: 599, col: 14, offset: 18887}, - run: (*parser).callonTagRanges1, + pos: position{line: 497, col: 27, offset: 16232}, + run: (*parser).callonExternalCrossReference1, expr: &seqExpr{ - pos: position{line: 599, col: 14, offset: 18887}, + pos: position{line: 497, col: 27, offset: 16232}, exprs: []interface{}{ + &litMatcher{ + pos: position{line: 497, col: 27, offset: 16232}, + val: "xref:", + ignoreCase: false, + want: "\"xref:\"", + }, &labeledExpr{ - pos: position{line: 599, col: 14, offset: 18887}, - label: "value", + pos: position{line: 497, col: 35, offset: 16240}, + label: "url", 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", + pos: position{line: 2839, col: 17, offset: 93911}, + run: (*parser).callonExternalCrossReference5, + expr: &labeledExpr{ + pos: position{line: 2839, col: 17, offset: 93911}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 2839, col: 22, offset: 93916}, + expr: &choiceExpr{ + pos: position{line: 2839, col: 23, offset: 93917}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2851, col: 13, offset: 94316}, + run: (*parser).callonExternalCrossReference9, + expr: &labeledExpr{ + pos: position{line: 2851, col: 13, offset: 94316}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2851, col: 22, offset: 94325}, expr: &choiceExpr{ - pos: position{line: 612, col: 18, offset: 19331}, + pos: position{line: 2852, col: 5, offset: 94331}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, - run: (*parser).callonTagRanges11, + pos: position{line: 2852, col: 5, offset: 94331}, + run: (*parser).callonExternalCrossReference13, expr: &oneOrMoreExpr{ - pos: position{line: 2217, col: 14, offset: 78190}, + pos: position{line: 2852, col: 5, offset: 94331}, expr: &charClassMatcher{ - pos: position{line: 2217, col: 14, offset: 78190}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + pos: position{line: 2852, col: 6, offset: 94332}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, ignoreCase: false, - inverted: false, + inverted: true, }, }, }, &actionExpr{ - pos: position{line: 618, col: 16, offset: 19515}, - run: (*parser).callonTagRanges14, + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonExternalCrossReference16, expr: &seqExpr{ - pos: position{line: 618, col: 16, offset: 19515}, + pos: position{line: 449, col: 5, offset: 14443}, 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: "\"*\"", - }, - }, - }, - }, &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, - }, + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonExternalCrossReference18, }, - }, - &actionExpr{ - pos: position{line: 618, col: 16, offset: 19515}, - run: (*parser).callonTagRanges29, - 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).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: "\"*\"", + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonExternalCrossReference21, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonExternalCrossReference25, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonExternalCrossReference32, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonExternalCrossReference37, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonExternalCrossReference39, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + 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: "*", - ignoreCase: false, - want: "\"*\"", + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonExternalCrossReference43, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonExternalCrossReference47, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, - }, - &andCodeExpr{ - pos: position{line: 621, col: 5, offset: 19577}, - run: (*parser).callonTagRanges55, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonExternalCrossReference54, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonExternalCrossReference59, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonExternalCrossReference61, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, - }, - }, - }, - }, - }, - &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")}, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonExternalCrossReference65, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", ignoreCase: false, - inverted: 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: "*", + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonExternalCrossReference69, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"*\"", + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, }, }, }, }, - &andCodeExpr{ - pos: position{line: 621, col: 5, offset: 19577}, - run: (*parser).callonTagRanges70, - }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", }, }, }, @@ -11014,165 +15884,570 @@ 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, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonExternalCrossReference75, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonExternalCrossReference77, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonExternalCrossReference80, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonExternalCrossReference82, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonExternalCrossReference86, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonExternalCrossReference92, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonExternalCrossReference98, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonExternalCrossReference103, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonExternalCrossReference105, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonExternalCrossReference108, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonExternalCrossReference112, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonExternalCrossReference119, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonExternalCrossReference124, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonExternalCrossReference126, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonExternalCrossReference130, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonExternalCrossReference134, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonExternalCrossReference141, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonExternalCrossReference146, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonExternalCrossReference148, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonExternalCrossReference152, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonExternalCrossReference156, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonExternalCrossReference162, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonExternalCrossReference165, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonExternalCrossReference169, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonExternalCrossReference173, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2858, col: 7, offset: 94556}, + run: (*parser).callonExternalCrossReference175, + expr: &litMatcher{ + pos: position{line: 2858, col: 7, offset: 94556}, + 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, - 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, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonExternalCrossReference177, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonExternalCrossReference181, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, }, - &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, - }, - }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 497, col: 54, offset: 16259}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 497, col: 72, offset: 16277}, + name: "InlineAttributes", }, }, }, @@ -11180,278 +16455,289 @@ var g = &grammar{ }, }, { - name: "ListParagraph", - pos: position{line: 646, col: 1, offset: 20429}, + name: "DelimitedBlock", + pos: position{line: 515, col: 1, offset: 16948}, expr: &choiceExpr{ - pos: position{line: 646, col: 18, offset: 20446}, + pos: position{line: 516, col: 5, offset: 16970}, 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}, - 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).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'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, + pos: position{line: 569, col: 5, offset: 18198}, + run: (*parser).callonDelimitedBlock2, + expr: &seqExpr{ + pos: position{line: 569, col: 5, offset: 18198}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 569, col: 5, offset: 18198}, + run: (*parser).callonDelimitedBlock4, + }, + &litMatcher{ + pos: position{line: 541, col: 26, offset: 17536}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 541, col: 33, offset: 17543}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDelimitedBlock9, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"//\"", + want: "\"\\n\"", }, - &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}, - expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: true, - }, - }, - }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + 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, - }, - }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDelimitedBlock16, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - }, - }, - }, - &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", - }, - }, - }, - }, - }, - }, - }, - { - name: "ListParagraphLine", - pos: position{line: 652, col: 1, offset: 20611}, - expr: &actionExpr{ - pos: position{line: 652, col: 22, offset: 20632}, - run: (*parser).callonListParagraphLine1, - expr: &seqExpr{ - pos: position{line: 652, col: 22, offset: 20632}, - 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, + &andCodeExpr{ + pos: position{line: 574, col: 5, offset: 18381}, + run: (*parser).callonDelimitedBlock18, }, - }, - }, - ¬Expr{ - pos: position{line: 653, col: 5, offset: 20641}, - expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonListParagraphLine7, - 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).callonListParagraphLine15, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 579, col: 5, offset: 18582}, + label: "content", + expr: &zeroOrMoreExpr{ + pos: position{line: 590, col: 5, offset: 18906}, + expr: &actionExpr{ + pos: position{line: 590, col: 6, offset: 18907}, + run: (*parser).callonDelimitedBlock21, + expr: &seqExpr{ + pos: position{line: 590, col: 6, offset: 18907}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 590, col: 6, offset: 18907}, + expr: &choiceExpr{ + pos: position{line: 587, col: 29, offset: 18849}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 541, col: 26, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 541, col: 26, offset: 17536}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 541, col: 33, offset: 17543}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDelimitedBlock30, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDelimitedBlock37, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 591, col: 5, offset: 18937}, + label: "line", + expr: &actionExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + run: (*parser).callonDelimitedBlock42, + expr: &seqExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 558, col: 5, offset: 17893}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &labeledExpr{ + pos: position{line: 559, col: 5, offset: 17966}, + label: "content", + expr: &actionExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + run: (*parser).callonDelimitedBlock48, + expr: &zeroOrMoreExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + expr: &charClassMatcher{ + pos: position{line: 559, col: 14, offset: 17975}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDelimitedBlock56, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, }, }, }, }, }, }, - }, - }, - ¬Expr{ - pos: position{line: 654, col: 5, offset: 20656}, - 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}, + &zeroOrOneExpr{ + pos: position{line: 580, col: 5, offset: 18616}, + expr: &choiceExpr{ + pos: position{line: 587, col: 29, offset: 18849}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 541, col: 26, offset: 17536}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 541, col: 26, offset: 17536}, val: "////", ignoreCase: false, want: "\"////\"", }, &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + pos: position{line: 541, col: 33, offset: 17543}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine31, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDelimitedBlock65, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -11461,77 +16747,44 @@ var g = &grammar{ }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDelimitedBlock72, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + 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).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, - }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, }, @@ -11539,189 +16792,388 @@ var g = &grammar{ }, }, }, - ¬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: " ", - 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\"", - }, - }, - }, - }, - }, - &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, + }, + &ruleRefExpr{ + pos: position{line: 517, col: 7, offset: 16989}, + name: "ExampleBlock", + }, + &ruleRefExpr{ + pos: position{line: 518, col: 7, offset: 17008}, + name: "FencedBlock", + }, + &ruleRefExpr{ + pos: position{line: 519, col: 7, offset: 17026}, + name: "ListingBlock", + }, + &ruleRefExpr{ + pos: position{line: 520, col: 7, offset: 17045}, + name: "LiteralBlock", + }, + &actionExpr{ + pos: position{line: 719, col: 5, offset: 22728}, + run: (*parser).callonDelimitedBlock80, + expr: &seqExpr{ + pos: position{line: 719, col: 5, offset: 22728}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 719, col: 5, offset: 22728}, + label: "firstLine", + expr: &actionExpr{ + pos: position{line: 726, col: 5, offset: 22987}, + run: (*parser).callonDelimitedBlock83, + expr: &seqExpr{ + pos: position{line: 726, col: 5, offset: 22987}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 726, col: 5, offset: 22987}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonDelimitedBlock86, expr: &seqExpr{ - pos: position{line: 703, col: 9, offset: 22211}, + pos: position{line: 482, col: 14, offset: 15644}, 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}, - expr: &litMatcher{ - pos: position{line: 703, col: 17, offset: 22219}, - val: ".", + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - want: "\".\"", + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDelimitedBlock94, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, }, }, }, }, - &andCodeExpr{ - pos: position{line: 707, col: 9, offset: 22319}, - run: (*parser).callonListParagraphLine64, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDelimitedBlock101, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, }, }, }, - &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: "\".\"", - }, + }, + &litMatcher{ + pos: position{line: 727, col: 5, offset: 23002}, + val: "> ", + ignoreCase: false, + want: "\"> \"", + }, + &labeledExpr{ + pos: position{line: 728, col: 5, offset: 23012}, + label: "content", + expr: &actionExpr{ + pos: position{line: 728, col: 14, offset: 23021}, + run: (*parser).callonDelimitedBlock105, + expr: &oneOrMoreExpr{ + pos: position{line: 728, col: 15, offset: 23022}, + expr: &charClassMatcher{ + pos: position{line: 728, col: 15, offset: 23022}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, - &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: "\".\"", - }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDelimitedBlock113, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, - &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, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 720, col: 5, offset: 22765}, + label: "otherLines", + expr: &zeroOrMoreExpr{ + pos: position{line: 720, col: 16, offset: 22776}, + expr: &choiceExpr{ + pos: position{line: 720, col: 17, offset: 22777}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 726, col: 5, offset: 22987}, + run: (*parser).callonDelimitedBlock118, + expr: &seqExpr{ + pos: position{line: 726, col: 5, offset: 22987}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 726, col: 5, offset: 22987}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonDelimitedBlock121, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDelimitedBlock129, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDelimitedBlock136, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, }, - &litMatcher{ - pos: position{line: 730, col: 21, offset: 23286}, - val: ".", - ignoreCase: false, - want: "\".\"", + }, + &litMatcher{ + pos: position{line: 727, col: 5, offset: 23002}, + val: "> ", + ignoreCase: false, + want: "\"> \"", + }, + &labeledExpr{ + pos: position{line: 728, col: 5, offset: 23012}, + label: "content", + expr: &actionExpr{ + pos: position{line: 728, col: 14, offset: 23021}, + run: (*parser).callonDelimitedBlock140, + expr: &oneOrMoreExpr{ + pos: position{line: 728, col: 15, offset: 23022}, + expr: &charClassMatcher{ + pos: position{line: 728, col: 15, offset: 23022}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, }, }, - }, - }, - &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'}, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - inverted: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDelimitedBlock148, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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).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, + }, + &actionExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + run: (*parser).callonDelimitedBlock150, + expr: &seqExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + run: (*parser).callonDelimitedBlock153, + expr: &oneOrMoreExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + expr: &charClassMatcher{ + pos: position{line: 1605, col: 14, offset: 53290}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, }, }, - &litMatcher{ - pos: position{line: 734, col: 26, offset: 23540}, - val: ")", - ignoreCase: false, - want: "\")\"", + }, + &andCodeExpr{ + pos: position{line: 1608, col: 5, offset: 53347}, + run: (*parser).callonDelimitedBlock156, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDelimitedBlock162, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, @@ -11729,58 +17181,142 @@ 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).callonListParagraphLine91, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 522, col: 7, offset: 17089}, + name: "PassthroughBlock", + }, + &ruleRefExpr{ + pos: position{line: 523, col: 7, offset: 17112}, + name: "QuoteBlock", + }, + &ruleRefExpr{ + pos: position{line: 524, col: 7, offset: 17129}, + name: "SidebarBlock", + }, + }, + }, + }, + { + name: "ExampleBlock", + pos: position{line: 598, col: 1, offset: 19070}, + expr: &actionExpr{ + pos: position{line: 599, col: 5, offset: 19090}, + run: (*parser).callonExampleBlock1, + expr: &seqExpr{ + pos: position{line: 599, col: 5, offset: 19090}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 599, col: 5, offset: 19090}, + run: (*parser).callonExampleBlock3, + }, + &litMatcher{ + pos: position{line: 543, col: 26, offset: 17580}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 543, col: 33, offset: 17587}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonExampleBlock8, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, - ¬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}, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonExampleBlock15, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 604, col: 5, offset: 19273}, + run: (*parser).callonExampleBlock17, + }, + &labeledExpr{ + pos: position{line: 609, col: 5, offset: 19474}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 609, col: 14, offset: 19483}, + name: "ExampleBlockContent", + }, + }, + &choiceExpr{ + pos: position{line: 617, col: 29, offset: 19740}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 543, col: 26, offset: 17580}, exprs: []interface{}{ + &litMatcher{ + pos: position{line: 543, col: 26, offset: 17580}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, &zeroOrMoreExpr{ - pos: position{line: 755, col: 5, offset: 24261}, + pos: position{line: 543, col: 33, offset: 17587}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine99, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonExampleBlock26, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -11789,849 +17325,924 @@ var g = &grammar{ }, }, }, - &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: "*", - ignoreCase: false, - want: "\"*\"", - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 761, col: 9, offset: 24441}, - run: (*parser).callonListParagraphLine109, - }, - }, - }, - }, - &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: "\"-\"", - }, - }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, - }, - }, - &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: " ", + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonExampleBlock33, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", 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\"", - }, + want: "\"\\r\"", }, }, }, }, }, }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, - ¬Expr{ - pos: position{line: 657, col: 5, offset: 20735}, - expr: &actionExpr{ - pos: position{line: 1623, col: 26, offset: 58130}, - run: (*parser).callonListParagraphLine119, - 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).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, - }, - }, - }, - }, - &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: "\" \"", + }, + }, + }, + }, + { + name: "ExampleBlockContent", + pos: position{line: 619, col: 1, offset: 19769}, + expr: &zeroOrMoreExpr{ + pos: position{line: 620, col: 4, offset: 19796}, + expr: &actionExpr{ + pos: position{line: 620, col: 5, offset: 19797}, + run: (*parser).callonExampleBlockContent2, + expr: &seqExpr{ + pos: position{line: 620, col: 5, offset: 19797}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 620, col: 5, offset: 19797}, + expr: &choiceExpr{ + pos: position{line: 617, col: 29, offset: 19740}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 543, col: 26, offset: 17580}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 543, col: 26, offset: 17580}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 543, col: 33, offset: 17587}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonExampleBlockContent11, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine130, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonExampleBlockContent18, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, }, }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, }, - }, - ¬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\"", + &labeledExpr{ + pos: position{line: 621, col: 5, offset: 19827}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 621, col: 11, offset: 19833}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 621, col: 11, offset: 19833}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + run: (*parser).callonExampleBlockContent25, + expr: &seqExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 558, col: 5, offset: 17893}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &labeledExpr{ + pos: position{line: 559, col: 5, offset: 17966}, + label: "content", + expr: &actionExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + run: (*parser).callonExampleBlockContent31, + expr: &zeroOrMoreExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + expr: &charClassMatcher{ + pos: position{line: 559, col: 14, offset: 17975}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonExampleBlockContent39, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, }, }, }, }, - &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, - }, + }, + }, + }, + }, + }, + }, + }, + { + name: "FencedBlock", + pos: position{line: 628, col: 1, offset: 19975}, + expr: &actionExpr{ + pos: position{line: 629, col: 5, offset: 19994}, + run: (*parser).callonFencedBlock1, + expr: &seqExpr{ + pos: position{line: 629, col: 5, offset: 19994}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 629, col: 5, offset: 19994}, + run: (*parser).callonFencedBlock3, + }, + &litMatcher{ + pos: position{line: 545, col: 25, offset: 17623}, + val: "```", + ignoreCase: false, + want: "\"```\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 545, col: 31, offset: 17629}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonFencedBlock8, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, - ¬Expr{ - pos: position{line: 659, col: 5, offset: 20788}, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonFencedBlock15, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 634, col: 5, offset: 20175}, + run: (*parser).callonFencedBlock17, + }, + &labeledExpr{ + pos: position{line: 639, col: 5, offset: 20375}, + label: "content", expr: &ruleRefExpr{ - pos: position{line: 659, col: 6, offset: 20789}, - name: "BlockAttributes", + pos: position{line: 639, col: 14, offset: 20384}, + name: "FencedBlockContent", }, }, - ¬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")}, - ignoreCase: false, - inverted: false, - }, - }, - &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", - ignoreCase: false, - want: "\"....\"", - }, + &choiceExpr{ + pos: position{line: 647, col: 28, offset: 20640}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 545, col: 25, offset: 17623}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 545, col: 25, offset: 17623}, + 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}, + &zeroOrMoreExpr{ + pos: position{line: 545, col: 31, offset: 17629}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2878, col: 10, offset: 95044}, + 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonFencedBlock26, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, - }, - &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\"", - }, - }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonFencedBlock33, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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: 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", + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "FencedBlockContent", + pos: position{line: 649, col: 1, offset: 20668}, + expr: &zeroOrMoreExpr{ + pos: position{line: 650, col: 5, offset: 20695}, + expr: &actionExpr{ + pos: position{line: 650, col: 6, offset: 20696}, + run: (*parser).callonFencedBlockContent2, + expr: &seqExpr{ + pos: position{line: 650, col: 6, offset: 20696}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 650, col: 6, offset: 20696}, + expr: &choiceExpr{ + pos: position{line: 647, col: 28, offset: 20640}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 545, col: 25, offset: 17623}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 545, col: 25, offset: 17623}, + val: "```", + ignoreCase: false, + want: "\"```\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 545, col: 31, offset: 17629}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - want: "\"\\t\"", + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonFencedBlockContent11, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + 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}, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonListParagraphLine192, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonFencedBlockContent18, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + 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: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, }, - &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\"", + }, + }, + &labeledExpr{ + pos: position{line: 651, col: 5, offset: 20725}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 651, col: 11, offset: 20731}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 651, col: 11, offset: 20731}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + run: (*parser).callonFencedBlockContent25, + expr: &seqExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 558, col: 5, offset: 17893}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 559, col: 5, offset: 17966}, + label: "content", + expr: &actionExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + run: (*parser).callonFencedBlockContent31, + expr: &zeroOrMoreExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + expr: &charClassMatcher{ + pos: position{line: 559, col: 14, offset: 17975}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + 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).callonListParagraphLine216, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonFencedBlockContent39, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "ListingBlock", + pos: position{line: 658, col: 1, offset: 20874}, + expr: &actionExpr{ + pos: position{line: 659, col: 5, offset: 20894}, + run: (*parser).callonListingBlock1, + expr: &seqExpr{ + pos: position{line: 659, col: 5, offset: 20894}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 659, col: 5, offset: 20894}, + run: (*parser).callonListingBlock3, + }, + &litMatcher{ + pos: position{line: 547, col: 26, offset: 17666}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 547, col: 33, offset: 17673}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListingBlock8, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListingBlock15, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 664, col: 5, offset: 21077}, + run: (*parser).callonListingBlock17, + }, + &labeledExpr{ + pos: position{line: 669, col: 5, offset: 21278}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 669, col: 14, offset: 21287}, + name: "ListingBlockContent", + }, + }, + &choiceExpr{ + pos: position{line: 677, col: 29, offset: 21549}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 547, col: 26, offset: 17666}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 547, col: 26, offset: 17666}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 547, col: 33, offset: 17673}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2878, col: 10, offset: 95044}, + 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonListingBlock26, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, - }, - &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: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListingBlock33, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, - ¬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}, + }, + }, + }, + }, + { + name: "ListingBlockContent", + pos: position{line: 679, col: 1, offset: 21578}, + expr: &zeroOrMoreExpr{ + pos: position{line: 680, col: 5, offset: 21606}, + expr: &actionExpr{ + pos: position{line: 680, col: 6, offset: 21607}, + run: (*parser).callonListingBlockContent2, + expr: &seqExpr{ + pos: position{line: 680, col: 6, offset: 21607}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 680, col: 6, offset: 21607}, + expr: &choiceExpr{ + pos: position{line: 677, col: 29, offset: 21549}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 547, col: 26, offset: 17666}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 547, col: 26, offset: 17666}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 547, col: 33, offset: 17673}, expr: &choiceExpr{ - pos: position{line: 805, col: 33, offset: 26234}, + pos: position{line: 2878, col: 10, offset: 95044}, 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, - }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", }, - &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: "\":\"", - }, - }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListingBlockContent11, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, - }, - }, - }, - &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}, + pos: position{line: 2893, col: 8, offset: 95335}, 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\"", - }, - }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListingBlockContent18, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, }, }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, }, - }, - &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: "\" \"", + &labeledExpr{ + pos: position{line: 681, col: 5, offset: 21637}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 681, col: 11, offset: 21643}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 681, col: 11, offset: 21643}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + run: (*parser).callonListingBlockContent25, + expr: &seqExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 558, col: 5, offset: 17893}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, - &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\"", + &labeledExpr{ + pos: position{line: 559, col: 5, offset: 17966}, + label: "content", + expr: &actionExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + run: (*parser).callonListingBlockContent31, + expr: &zeroOrMoreExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + expr: &charClassMatcher{ + pos: position{line: 559, col: 14, offset: 17975}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListingBlockContent39, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, - }, - }, - }, - &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", }, }, }, @@ -12639,65 +18250,41 @@ 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, - }, - }, - }, - }, }, }, }, }, { - name: "ContinuedListItemElement", - pos: position{line: 670, col: 1, offset: 21125}, + name: "LiteralBlock", + pos: position{line: 688, col: 1, offset: 21786}, expr: &actionExpr{ - pos: position{line: 670, col: 29, offset: 21153}, - run: (*parser).callonContinuedListItemElement1, + pos: position{line: 689, col: 5, offset: 21806}, + run: (*parser).callonLiteralBlock1, expr: &seqExpr{ - pos: position{line: 670, col: 29, offset: 21153}, + pos: position{line: 689, col: 5, offset: 21806}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 668, col: 25, offset: 21042}, - val: "+", + pos: position{line: 549, col: 26, offset: 17710}, + val: "....", ignoreCase: false, - want: "\"+\"", + want: "\"....\"", }, &zeroOrMoreExpr{ - pos: position{line: 668, col: 29, offset: 21046}, + pos: position{line: 549, col: 33, offset: 17717}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemElement7, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLiteralBlock7, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -12707,175 +18294,306 @@ var g = &grammar{ }, }, &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2886, col: 19, offset: 95185}, val: "\r\n", ignoreCase: 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: 2886, col: 28, offset: 95194}, + run: (*parser).callonLiteralBlock14, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, + &andCodeExpr{ + pos: position{line: 690, col: 5, offset: 21837}, + run: (*parser).callonLiteralBlock16, + }, &labeledExpr{ - pos: position{line: 670, col: 50, offset: 21174}, - label: "element", + pos: position{line: 694, col: 5, offset: 21989}, + label: "content", expr: &ruleRefExpr{ - pos: position{line: 670, col: 58, offset: 21182}, - name: "ContinuedListItemContent", + pos: position{line: 694, col: 14, offset: 21998}, + name: "LiteralBlockContent", }, }, - }, - }, - }, - }, - { - 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, - }, - }, + &andCodeExpr{ + pos: position{line: 695, col: 5, offset: 22023}, + run: (*parser).callonLiteralBlock19, }, - &labeledExpr{ - pos: position{line: 675, col: 5, offset: 21326}, - label: "content", + &zeroOrOneExpr{ + pos: position{line: 700, col: 5, offset: 22224}, expr: &choiceExpr{ - pos: position{line: 675, col: 14, offset: 21335}, + pos: position{line: 707, col: 29, offset: 22457}, 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}, - expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + &seqExpr{ + pos: position{line: 549, col: 26, offset: 17710}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 549, col: 26, offset: 17710}, + val: "....", + ignoreCase: false, + want: "\"....\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 549, col: 33, offset: 17717}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLiteralBlock27, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", 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).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, - }, - }, - }, + want: "\"\\t\"", }, }, }, }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonLiteralBlock34, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "LiteralBlockContent", + pos: position{line: 709, col: 1, offset: 22486}, + expr: &zeroOrMoreExpr{ + pos: position{line: 710, col: 5, offset: 22514}, + expr: &actionExpr{ + pos: position{line: 710, col: 6, offset: 22515}, + run: (*parser).callonLiteralBlockContent2, + expr: &seqExpr{ + pos: position{line: 710, col: 6, offset: 22515}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 710, col: 6, offset: 22515}, + expr: &choiceExpr{ + pos: position{line: 707, col: 29, offset: 22457}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 549, col: 26, offset: 17710}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", + pos: position{line: 549, col: 26, offset: 17710}, + val: "....", ignoreCase: false, - want: "\"//\"", + 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'}, + &zeroOrMoreExpr{ + pos: position{line: 549, col: 33, offset: 17717}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - inverted: true, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonLiteralBlockContent11, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, }, }, }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonLiteralBlockContent18, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 711, col: 5, offset: 22545}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 711, col: 11, offset: 22551}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 711, col: 11, offset: 22551}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + run: (*parser).callonLiteralBlockContent25, + expr: &seqExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 558, col: 5, offset: 17893}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &labeledExpr{ + pos: position{line: 559, col: 5, offset: 17966}, + label: "content", + expr: &actionExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + run: (*parser).callonLiteralBlockContent31, + expr: &zeroOrMoreExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + expr: &charClassMatcher{ + pos: position{line: 559, col: 14, offset: 17975}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonLiteralBlockContent39, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, @@ -12883,81 +18601,423 @@ var g = &grammar{ }, }, }, - &ruleRefExpr{ - pos: position{line: 677, col: 11, offset: 21388}, - name: "Table", + }, + }, + }, + }, + }, + }, + }, + { + name: "MarkdownQuoteAttribution", + pos: position{line: 734, col: 1, offset: 23140}, + expr: &actionExpr{ + pos: position{line: 735, col: 5, offset: 23173}, + run: (*parser).callonMarkdownQuoteAttribution1, + expr: &seqExpr{ + pos: position{line: 735, col: 5, offset: 23173}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 735, col: 5, offset: 23173}, + val: "-- ", + ignoreCase: false, + want: "\"-- \"", + }, + &labeledExpr{ + pos: position{line: 735, col: 11, offset: 23179}, + label: "author", + expr: &actionExpr{ + pos: position{line: 735, col: 19, offset: 23187}, + run: (*parser).callonMarkdownQuoteAttribution5, + expr: &oneOrMoreExpr{ + pos: position{line: 735, col: 20, offset: 23188}, + expr: &charClassMatcher{ + pos: position{line: 735, col: 20, offset: 23188}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, - &ruleRefExpr{ - pos: position{line: 678, col: 11, offset: 21404}, - name: "ImageBlock", + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonMarkdownQuoteAttribution13, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "PassthroughBlock", + pos: position{line: 744, col: 1, offset: 23356}, + expr: &actionExpr{ + pos: position{line: 745, col: 5, offset: 23380}, + run: (*parser).callonPassthroughBlock1, + expr: &seqExpr{ + pos: position{line: 745, col: 5, offset: 23380}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 745, col: 5, offset: 23380}, + run: (*parser).callonPassthroughBlock3, + }, + &litMatcher{ + pos: position{line: 551, col: 30, offset: 17758}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 551, col: 37, offset: 17765}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", }, &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}, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonPassthroughBlock8, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonPassthroughBlock15, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 750, col: 5, offset: 23571}, + run: (*parser).callonPassthroughBlock17, + }, + &labeledExpr{ + pos: position{line: 755, col: 5, offset: 23776}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 755, col: 14, offset: 23785}, + name: "PassthroughBlockContent", + }, + }, + &zeroOrOneExpr{ + pos: position{line: 756, col: 5, offset: 23814}, + expr: &choiceExpr{ + pos: position{line: 763, col: 33, offset: 24067}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 551, col: 30, offset: 17758}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 551, col: 30, offset: 17758}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 551, col: 37, offset: 17765}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, 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: "* * *", + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - want: "\"* * *\"", + want: "\" \"", }, - &litMatcher{ - pos: position{line: 1632, col: 37, offset: 58474}, - val: "---", - ignoreCase: false, - want: "\"---\"", + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonPassthroughBlock27, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, }, - &litMatcher{ - pos: position{line: 1632, col: 45, offset: 58482}, - val: "- - -", - ignoreCase: false, - want: "\"- - -\"", + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, - &litMatcher{ - pos: position{line: 1632, col: 55, offset: 58492}, - val: "___", + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonPassthroughBlock34, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", ignoreCase: false, - want: "\"___\"", + want: "\"\\r\"", }, - &litMatcher{ - pos: position{line: 1632, col: 63, offset: 58500}, - val: "_ _ _", - ignoreCase: false, - want: "\"_ _ _\"", + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "PassthroughBlockContent", + pos: position{line: 765, col: 1, offset: 24100}, + expr: &zeroOrMoreExpr{ + pos: position{line: 766, col: 5, offset: 24132}, + expr: &actionExpr{ + pos: position{line: 766, col: 6, offset: 24133}, + run: (*parser).callonPassthroughBlockContent2, + expr: &seqExpr{ + pos: position{line: 766, col: 6, offset: 24133}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 766, col: 6, offset: 24133}, + expr: &choiceExpr{ + pos: position{line: 763, col: 33, offset: 24067}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 551, col: 30, offset: 17758}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 551, col: 30, offset: 17758}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 551, col: 37, offset: 17765}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonPassthroughBlockContent11, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, }, }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2886, col: 19, offset: 95185}, val: "\r\n", ignoreCase: 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: 2886, col: 28, offset: 95194}, + run: (*parser).callonPassthroughBlockContent18, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 767, col: 5, offset: 24167}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 767, col: 11, offset: 24173}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 767, col: 11, offset: 24173}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + run: (*parser).callonPassthroughBlockContent25, + expr: &seqExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 558, col: 5, offset: 17893}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &labeledExpr{ + pos: position{line: 559, col: 5, offset: 17966}, + label: "content", + expr: &actionExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + run: (*parser).callonPassthroughBlockContent31, + expr: &zeroOrMoreExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + expr: &charClassMatcher{ + pos: position{line: 559, col: 14, offset: 17975}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonPassthroughBlockContent39, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, @@ -12965,49 +19025,225 @@ var g = &grammar{ }, }, }, - &ruleRefExpr{ - pos: position{line: 680, col: 11, offset: 21449}, - name: "OrderedListItem", + }, + }, + }, + }, + }, + }, + }, + { + name: "QuoteBlock", + pos: position{line: 774, col: 1, offset: 24314}, + expr: &actionExpr{ + pos: position{line: 775, col: 5, offset: 24332}, + run: (*parser).callonQuoteBlock1, + expr: &seqExpr{ + pos: position{line: 775, col: 5, offset: 24332}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 775, col: 5, offset: 24332}, + run: (*parser).callonQuoteBlock3, + }, + &litMatcher{ + pos: position{line: 553, col: 24, offset: 17800}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 553, col: 31, offset: 17807}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", }, - &ruleRefExpr{ - pos: position{line: 681, col: 11, offset: 21476}, - name: "UnorderedListItem", + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonQuoteBlock8, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, }, - &ruleRefExpr{ - pos: position{line: 682, col: 11, offset: 21505}, - name: "LabeledListItem", + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, - &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, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonQuoteBlock15, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 780, col: 5, offset: 24511}, + run: (*parser).callonQuoteBlock17, + }, + &labeledExpr{ + pos: position{line: 785, col: 5, offset: 24710}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 785, col: 14, offset: 24719}, + name: "QuoteBlockContent", + }, + }, + &choiceExpr{ + pos: position{line: 793, col: 27, offset: 24964}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 553, col: 24, offset: 17800}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 553, col: 24, offset: 17800}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 553, col: 31, offset: 17807}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonQuoteBlock26, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonQuoteBlock33, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuoteBlockContent", + pos: position{line: 795, col: 1, offset: 24991}, + expr: &zeroOrMoreExpr{ + pos: position{line: 796, col: 4, offset: 25016}, + expr: &actionExpr{ + pos: position{line: 796, col: 5, offset: 25017}, + run: (*parser).callonQuoteBlockContent2, + expr: &seqExpr{ + pos: position{line: 796, col: 5, offset: 25017}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 796, col: 5, offset: 25017}, + expr: &choiceExpr{ + pos: position{line: 793, col: 27, offset: 24964}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 553, col: 24, offset: 17800}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 553, col: 24, offset: 17800}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, + pos: position{line: 553, col: 31, offset: 17807}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent61, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonQuoteBlockContent11, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -13017,392 +19253,121 @@ var g = &grammar{ }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonQuoteBlockContent18, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, }, }, - }, - &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{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 797, col: 5, offset: 25045}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 797, col: 11, offset: 25051}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 797, col: 11, offset: 25051}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + run: (*parser).callonQuoteBlockContent25, + expr: &seqExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 558, col: 5, offset: 17893}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &labeledExpr{ + pos: position{line: 559, col: 5, offset: 17966}, + label: "content", 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, - 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).callonContinuedListItemContent84, - 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: 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, - }, - }, - }, - }, + pos: position{line: 559, col: 14, offset: 17975}, + run: (*parser).callonQuoteBlockContent31, + expr: &zeroOrMoreExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + expr: &charClassMatcher{ + pos: position{line: 559, col: 14, offset: 17975}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, - }, - }, - }, - }, - &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: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent113, - 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, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, - }, - &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{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - 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\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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).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'}, - 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: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonQuoteBlockContent39, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -13411,34 +19376,225 @@ var g = &grammar{ }, }, }, + }, + }, + }, + }, + }, + }, + }, + { + name: "SidebarBlock", + pos: position{line: 804, col: 1, offset: 25194}, + expr: &actionExpr{ + pos: position{line: 805, col: 5, offset: 25214}, + run: (*parser).callonSidebarBlock1, + expr: &seqExpr{ + pos: position{line: 805, col: 5, offset: 25214}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 805, col: 5, offset: 25214}, + run: (*parser).callonSidebarBlock3, + }, + &litMatcher{ + pos: position{line: 555, col: 26, offset: 17844}, + val: "****", + ignoreCase: false, + want: "\"****\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 555, col: 33, offset: 17851}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + 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}, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSidebarBlock8, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSidebarBlock15, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 810, col: 5, offset: 25397}, + run: (*parser).callonSidebarBlock17, + }, + &labeledExpr{ + pos: position{line: 815, col: 5, offset: 25598}, + label: "content", + expr: &ruleRefExpr{ + pos: position{line: 815, col: 14, offset: 25607}, + name: "SidebarBlockContent", + }, + }, + &choiceExpr{ + pos: position{line: 823, col: 29, offset: 25865}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 555, col: 26, offset: 17844}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 555, col: 26, offset: 17844}, + val: "****", + ignoreCase: false, + want: "\"****\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 555, col: 33, offset: 17851}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSidebarBlock26, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSidebarBlock33, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "SidebarBlockContent", + pos: position{line: 825, col: 1, offset: 25895}, + expr: &zeroOrMoreExpr{ + pos: position{line: 826, col: 4, offset: 25922}, + expr: &actionExpr{ + pos: position{line: 826, col: 5, offset: 25923}, + run: (*parser).callonSidebarBlockContent2, + expr: &seqExpr{ + pos: position{line: 826, col: 5, offset: 25923}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 826, col: 5, offset: 25923}, + expr: &choiceExpr{ + pos: position{line: 823, col: 29, offset: 25865}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 555, col: 26, offset: 17844}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", + pos: position{line: 555, col: 26, offset: 17844}, + val: "****", ignoreCase: false, - want: "\"....\"", + want: "\"****\"", }, &zeroOrMoreExpr{ - pos: position{line: 2098, col: 61, offset: 74237}, + pos: position{line: 555, col: 33, offset: 17851}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonContinuedListItemContent157, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSidebarBlockContent11, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -13448,567 +19604,1009 @@ var g = &grammar{ }, }, &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, val: "\r\n", ignoreCase: 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: 2886, col: 28, offset: 95194}, + run: (*parser).callonSidebarBlockContent18, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: 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).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, - }, - }, - }, - }, - }, - }, - }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 827, col: 5, offset: 25953}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 827, col: 11, offset: 25959}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 827, col: 11, offset: 25959}, + name: "FileInclusion", + }, + &actionExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + run: (*parser).callonSidebarBlockContent25, + expr: &seqExpr{ + pos: position{line: 558, col: 5, offset: 17893}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 558, col: 5, offset: 17893}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, }, - }, - &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: "....", + &labeledExpr{ + pos: position{line: 559, col: 5, offset: 17966}, + label: "content", + expr: &actionExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + run: (*parser).callonSidebarBlockContent31, + expr: &zeroOrMoreExpr{ + pos: position{line: 559, col: 14, offset: 17975}, + expr: &charClassMatcher{ + pos: position{line: 559, col: 14, offset: 17975}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, ignoreCase: false, - want: "\"....\"", + inverted: true, }, - &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, }, }, }, - }, - }, - }, - }, - &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, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, - &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: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSidebarBlockContent39, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, }, - &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\"", - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 194, col: 37, offset: 6213}, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "FileInclusion", + pos: position{line: 961, col: 1, offset: 30607}, + expr: &actionExpr{ + pos: position{line: 962, col: 5, offset: 30629}, + run: (*parser).callonFileInclusion1, + expr: &seqExpr{ + pos: position{line: 962, col: 5, offset: 30629}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 962, col: 5, offset: 30629}, + run: (*parser).callonFileInclusion3, + }, + &stateCodeExpr{ + pos: position{line: 966, col: 5, offset: 30716}, + run: (*parser).callonFileInclusion4, + }, + &labeledExpr{ + pos: position{line: 971, col: 5, offset: 30883}, + label: "incl", + expr: &actionExpr{ + pos: position{line: 972, col: 9, offset: 30898}, + run: (*parser).callonFileInclusion6, + expr: &seqExpr{ + pos: position{line: 972, col: 9, offset: 30898}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 972, col: 9, offset: 30898}, + val: "include::", + ignoreCase: false, + want: "\"include::\"", + }, + &labeledExpr{ + pos: position{line: 973, col: 9, offset: 30919}, + label: "path", + expr: &actionExpr{ + pos: position{line: 2839, col: 17, offset: 93911}, + run: (*parser).callonFileInclusion10, + expr: &labeledExpr{ + pos: position{line: 2839, col: 17, offset: 93911}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 2839, col: 22, offset: 93916}, + expr: &choiceExpr{ + pos: position{line: 2839, col: 23, offset: 93917}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2851, col: 13, offset: 94316}, + run: (*parser).callonFileInclusion14, + expr: &labeledExpr{ + pos: position{line: 2851, col: 13, offset: 94316}, label: "elements", - expr: &zeroOrMoreExpr{ - pos: position{line: 194, col: 46, offset: 6222}, + expr: &oneOrMoreExpr{ + pos: position{line: 2851, col: 22, offset: 94325}, expr: &choiceExpr{ - pos: position{line: 195, col: 5, offset: 6228}, + pos: position{line: 2852, col: 5, offset: 94331}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 195, col: 6, offset: 6229}, - run: (*parser).callonContinuedListItemContent217, + pos: position{line: 2852, col: 5, offset: 94331}, + run: (*parser).callonFileInclusion18, expr: &oneOrMoreExpr{ - pos: position{line: 195, col: 6, offset: 6229}, + pos: position{line: 2852, col: 5, offset: 94331}, expr: &charClassMatcher{ - pos: position{line: 195, col: 6, offset: 6229}, - val: "[^\\r\\n{]", - chars: []rune{'\r', '\n', '{'}, + pos: position{line: 2852, col: 6, offset: 94332}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, ignoreCase: false, inverted: true, }, }, }, &actionExpr{ - pos: position{line: 221, col: 25, offset: 7126}, - run: (*parser).callonContinuedListItemContent220, + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonFileInclusion21, expr: &seqExpr{ - pos: position{line: 221, col: 25, offset: 7126}, + pos: position{line: 449, col: 5, offset: 14443}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 221, col: 25, offset: 7126}, - val: "{counter:", - ignoreCase: false, - want: "\"{counter:\"", + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonFileInclusion23, }, &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, + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonFileInclusion26, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonFileInclusion30, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonFileInclusion37, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonFileInclusion42, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonFileInclusion44, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + 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).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: 467, col: 25, offset: 15133}, + run: (*parser).callonFileInclusion48, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonFileInclusion52, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + 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]", + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonFileInclusion59, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonFileInclusion64, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonFileInclusion66, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonFileInclusion70, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonFileInclusion74, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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, + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonFileInclusion80, expr: &seqExpr{ - pos: position{line: 225, col: 25, offset: 7281}, + pos: position{line: 2587, col: 5, offset: 86026}, 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, - }, - }, - }, - }, - }, + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonFileInclusion82, }, &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'}, + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonFileInclusion85, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonFileInclusion87, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", ignoreCase: false, - inverted: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonFileInclusion91, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonFileInclusion97, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonFileInclusion103, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonFileInclusion108, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonFileInclusion110, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonFileInclusion113, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonFileInclusion117, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonFileInclusion124, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonFileInclusion129, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonFileInclusion131, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonFileInclusion135, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonFileInclusion139, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonFileInclusion146, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonFileInclusion151, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonFileInclusion153, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonFileInclusion157, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonFileInclusion161, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonFileInclusion167, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", }, }, - &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, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonFileInclusion170, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonFileInclusion174, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, }, }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + 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")}, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonFileInclusion178, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, 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: 199, col: 6, offset: 6337}, - run: (*parser).callonContinuedListItemContent274, + pos: position{line: 2858, col: 7, offset: 94556}, + run: (*parser).callonFileInclusion180, expr: &litMatcher{ - pos: position{line: 199, col: 6, offset: 6337}, + pos: position{line: 2858, col: 7, offset: 94556}, val: "{", ignoreCase: false, want: "\"{\"", @@ -14019,133 +20617,436 @@ var g = &grammar{ }, }, }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonFileInclusion182, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonFileInclusion186, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + 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: 974, col: 9, offset: 30948}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 974, col: 27, offset: 30966}, + name: "InlineAttributes", + }, + }, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 978, col: 5, offset: 31127}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + 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, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 206, col: 45, offset: 6548}, - val: ":", - ignoreCase: false, - want: "\":\"", - }, - &zeroOrMoreExpr{ - pos: position{line: 206, col: 49, offset: 6552}, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonFileInclusion195, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonFileInclusion202, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "LineRanges", + pos: position{line: 985, col: 1, offset: 31260}, + expr: &actionExpr{ + pos: position{line: 985, col: 15, offset: 31274}, + run: (*parser).callonLineRanges1, + expr: &seqExpr{ + pos: position{line: 985, col: 15, offset: 31274}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 985, col: 15, offset: 31274}, + label: "value", + expr: &choiceExpr{ + pos: position{line: 985, col: 22, offset: 31281}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 992, col: 23, offset: 31464}, + run: (*parser).callonLineRanges5, + expr: &seqExpr{ + pos: position{line: 992, col: 23, offset: 31464}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 992, col: 23, offset: 31464}, + label: "first", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 992, col: 30, offset: 31471}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &actionExpr{ + pos: position{line: 1001, col: 19, offset: 31829}, + run: (*parser).callonLineRanges9, + expr: &seqExpr{ + pos: position{line: 1001, col: 19, offset: 31829}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1001, col: 19, offset: 31829}, + label: "start", + expr: &actionExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + run: (*parser).callonLineRanges12, + expr: &seqExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + expr: &litMatcher{ + pos: position{line: 2874, col: 11, offset: 94970}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 16, offset: 94975}, + expr: &actionExpr{ + pos: position{line: 2870, col: 10, offset: 94910}, + run: (*parser).callonLineRanges17, + expr: &charClassMatcher{ + pos: position{line: 2870, col: 10, offset: 94910}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1001, col: 34, offset: 31844}, + val: "..", + ignoreCase: false, + want: "\"..\"", + }, + &labeledExpr{ + pos: position{line: 1001, col: 39, offset: 31849}, + label: "end", + expr: &actionExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + run: (*parser).callonLineRanges21, + expr: &seqExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + expr: &litMatcher{ + pos: position{line: 2874, col: 11, offset: 94970}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 16, offset: 94975}, + expr: &actionExpr{ + pos: position{line: 2870, col: 10, offset: 94910}, + run: (*parser).callonLineRanges26, + expr: &charClassMatcher{ + pos: position{line: 2870, col: 10, offset: 94910}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, &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\"", + pos: position{line: 1005, col: 20, offset: 31969}, + run: (*parser).callonLineRanges28, + expr: &labeledExpr{ + pos: position{line: 1005, col: 20, offset: 31969}, + label: "singleline", + expr: &actionExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + run: (*parser).callonLineRanges30, + expr: &seqExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + expr: &litMatcher{ + pos: position{line: 2874, col: 11, offset: 94970}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 16, offset: 94975}, + expr: &actionExpr{ + pos: position{line: 2870, col: 10, offset: 94910}, + run: (*parser).callonLineRanges35, + expr: &charClassMatcher{ + pos: position{line: 2870, col: 10, offset: 94910}, + 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, + &labeledExpr{ + pos: position{line: 993, col: 5, offset: 31510}, + label: "others", + expr: &oneOrMoreExpr{ + pos: position{line: 993, col: 12, offset: 31517}, + expr: &actionExpr{ + pos: position{line: 994, col: 9, offset: 31527}, + run: (*parser).callonLineRanges39, + expr: &seqExpr{ + pos: position{line: 994, col: 9, offset: 31527}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 994, col: 10, offset: 31528}, + val: "[,;]", + chars: []rune{',', ';'}, + ignoreCase: false, + inverted: false, + }, + &labeledExpr{ + pos: position{line: 995, col: 9, offset: 31645}, + label: "other", + expr: &choiceExpr{ + pos: position{line: 995, col: 16, offset: 31652}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1001, col: 19, offset: 31829}, + run: (*parser).callonLineRanges44, + expr: &seqExpr{ + pos: position{line: 1001, col: 19, offset: 31829}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1001, col: 19, offset: 31829}, + label: "start", + expr: &actionExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + run: (*parser).callonLineRanges47, + expr: &seqExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + expr: &litMatcher{ + pos: position{line: 2874, col: 11, offset: 94970}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 16, offset: 94975}, + expr: &actionExpr{ + pos: position{line: 2870, col: 10, offset: 94910}, + run: (*parser).callonLineRanges52, + expr: &charClassMatcher{ + pos: position{line: 2870, col: 10, offset: 94910}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1001, col: 34, offset: 31844}, + val: "..", + ignoreCase: false, + want: "\"..\"", + }, + &labeledExpr{ + pos: position{line: 1001, col: 39, offset: 31849}, + label: "end", + expr: &actionExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + run: (*parser).callonLineRanges56, + expr: &seqExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + expr: &litMatcher{ + pos: position{line: 2874, col: 11, offset: 94970}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 16, offset: 94975}, + expr: &actionExpr{ + pos: position{line: 2870, col: 10, offset: 94910}, + run: (*parser).callonLineRanges61, + expr: &charClassMatcher{ + pos: position{line: 2870, col: 10, offset: 94910}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1005, col: 20, offset: 31969}, + run: (*parser).callonLineRanges63, + expr: &labeledExpr{ + pos: position{line: 1005, col: 20, offset: 31969}, + label: "singleline", + expr: &actionExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + run: (*parser).callonLineRanges65, + expr: &seqExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + expr: &litMatcher{ + pos: position{line: 2874, col: 11, offset: 94970}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 16, offset: 94975}, + expr: &actionExpr{ + pos: position{line: 2870, col: 10, offset: 94910}, + run: (*parser).callonLineRanges70, + expr: &charClassMatcher{ + pos: position{line: 2870, col: 10, offset: 94910}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, @@ -14154,45 +21055,41 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 208, col: 5, offset: 6619}, - run: (*parser).callonContinuedListItemContent301, + pos: position{line: 1001, col: 19, offset: 31829}, + run: (*parser).callonLineRanges72, expr: &seqExpr{ - pos: position{line: 208, col: 5, offset: 6619}, + pos: position{line: 1001, col: 19, offset: 31829}, 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", + pos: position{line: 1001, col: 19, offset: 31829}, + label: "start", expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonContinuedListItemContent305, + pos: position{line: 2874, col: 11, offset: 94970}, + run: (*parser).callonLineRanges75, expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, + pos: position{line: 2874, col: 11, offset: 94970}, 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")}, + &zeroOrOneExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + expr: &litMatcher{ + pos: position{line: 2874, col: 11, offset: 94970}, + val: "-", ignoreCase: false, - inverted: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 16, offset: 94975}, + expr: &actionExpr{ + pos: position{line: 2870, col: 10, offset: 94910}, + run: (*parser).callonLineRanges80, + expr: &charClassMatcher{ + pos: position{line: 2870, col: 10, offset: 94910}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -14200,1023 +21097,398 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 208, col: 30, offset: 6644}, - val: "!:", + pos: position{line: 1001, col: 34, offset: 31844}, + val: "..", ignoreCase: false, - want: "\"!:\"", + 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: 1001, col: 39, offset: 31849}, + label: "end", + expr: &actionExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + run: (*parser).callonLineRanges84, + expr: &seqExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + expr: &litMatcher{ + pos: position{line: 2874, col: 11, offset: 94970}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 16, offset: 94975}, + expr: &actionExpr{ + pos: position{line: 2870, col: 10, offset: 94910}, + run: (*parser).callonLineRanges89, + expr: &charClassMatcher{ + pos: position{line: 2870, col: 10, offset: 94910}, + 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: 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: 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}, - 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\"", - }, - }, - &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\"", - }, - }, - &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\"", - }, + pos: position{line: 1005, col: 20, offset: 31969}, + run: (*parser).callonLineRanges91, + expr: &labeledExpr{ + pos: position{line: 1005, col: 20, offset: 31969}, + label: "singleline", + expr: &actionExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + run: (*parser).callonLineRanges93, + expr: &seqExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + expr: &litMatcher{ + pos: position{line: 2874, col: 11, offset: 94970}, + val: "-", + ignoreCase: false, + want: "\"-\"", }, - &actionExpr{ - pos: position{line: 864, col: 5, offset: 27906}, - run: (*parser).callonContinuedListItemContent341, - expr: &litMatcher{ - pos: position{line: 864, col: 5, offset: 27906}, - val: "CAUTION", + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 16, offset: 94975}, + expr: &actionExpr{ + pos: position{line: 2870, col: 10, offset: 94910}, + run: (*parser).callonLineRanges98, + expr: &charClassMatcher{ + pos: position{line: 2870, col: 10, offset: 94910}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, - want: "\"CAUTION\"", + inverted: false, }, }, }, }, }, - &litMatcher{ - pos: position{line: 942, col: 24, offset: 30732}, - val: ": ", - ignoreCase: false, - want: "\": \"", - }, - &labeledExpr{ - pos: position{line: 942, col: 29, offset: 30737}, - label: "lines", - 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, - }, - }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + { + name: "TagRanges", + pos: position{line: 1010, col: 1, offset: 32104}, + expr: &actionExpr{ + pos: position{line: 1010, col: 14, offset: 32117}, + run: (*parser).callonTagRanges1, + expr: &seqExpr{ + pos: position{line: 1010, col: 14, offset: 32117}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1010, col: 14, offset: 32117}, + label: "value", + expr: &actionExpr{ + pos: position{line: 1014, col: 22, offset: 32254}, + run: (*parser).callonTagRanges4, + expr: &seqExpr{ + pos: position{line: 1014, col: 22, offset: 32254}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1014, col: 22, offset: 32254}, + label: "first", + expr: &choiceExpr{ + pos: position{line: 1023, col: 13, offset: 32564}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1023, col: 13, offset: 32564}, + run: (*parser).callonTagRanges8, + expr: &labeledExpr{ + pos: position{line: 1023, col: 13, offset: 32564}, + label: "tag", + expr: &choiceExpr{ + pos: position{line: 1023, col: 18, offset: 32569}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonTagRanges11, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 1029, col: 16, offset: 32769}, + run: (*parser).callonTagRanges14, + expr: &seqExpr{ + pos: position{line: 1029, col: 16, offset: 32769}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1029, col: 16, offset: 32769}, + label: "stars", + expr: &actionExpr{ + pos: position{line: 1029, col: 23, offset: 32776}, + run: (*parser).callonTagRanges17, + expr: &oneOrMoreExpr{ + pos: position{line: 1029, col: 23, offset: 32776}, + expr: &litMatcher{ + pos: position{line: 1029, col: 24, offset: 32777}, + 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, + &andCodeExpr{ + pos: position{line: 1032, col: 5, offset: 32831}, + run: (*parser).callonTagRanges20, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1025, col: 9, offset: 32657}, + run: (*parser).callonTagRanges21, + expr: &seqExpr{ + pos: position{line: 1025, col: 9, offset: 32657}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1025, col: 9, offset: 32657}, + val: "!", + ignoreCase: false, + want: "\"!\"", + }, + &labeledExpr{ + pos: position{line: 1025, col: 13, offset: 32661}, + label: "tag", + expr: &choiceExpr{ + pos: position{line: 1025, col: 18, offset: 32666}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonTagRanges26, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 1029, col: 16, offset: 32769}, + run: (*parser).callonTagRanges29, + expr: &seqExpr{ + pos: position{line: 1029, col: 16, offset: 32769}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1029, col: 16, offset: 32769}, + label: "stars", + expr: &actionExpr{ + pos: position{line: 1029, col: 23, offset: 32776}, + run: (*parser).callonTagRanges32, + expr: &oneOrMoreExpr{ + pos: position{line: 1029, col: 23, offset: 32776}, + expr: &litMatcher{ + pos: position{line: 1029, col: 24, offset: 32777}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, }, }, + &andCodeExpr{ + pos: position{line: 1032, col: 5, offset: 32831}, + run: (*parser).callonTagRanges35, + }, }, }, }, }, }, }, - &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{}{ - &litMatcher{ - pos: position{line: 668, col: 25, offset: 21042}, - val: "+", + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1015, col: 5, offset: 32275}, + label: "others", + expr: &zeroOrMoreExpr{ + pos: position{line: 1015, col: 12, offset: 32282}, + expr: &actionExpr{ + pos: position{line: 1016, col: 9, offset: 32292}, + run: (*parser).callonTagRanges38, + expr: &seqExpr{ + pos: position{line: 1016, col: 9, offset: 32292}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1016, col: 10, offset: 32293}, + val: "[,;]", + chars: []rune{',', ';'}, + ignoreCase: false, + inverted: false, + }, + &labeledExpr{ + pos: position{line: 1017, col: 9, offset: 32410}, + label: "other", + expr: &choiceExpr{ + pos: position{line: 1023, col: 13, offset: 32564}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1023, col: 13, offset: 32564}, + run: (*parser).callonTagRanges43, + expr: &labeledExpr{ + pos: position{line: 1023, col: 13, offset: 32564}, + label: "tag", + expr: &choiceExpr{ + pos: position{line: 1023, col: 18, offset: 32569}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonTagRanges46, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"+\"", + inverted: false, }, - &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, + }, + }, + &actionExpr{ + pos: position{line: 1029, col: 16, offset: 32769}, + run: (*parser).callonTagRanges49, + expr: &seqExpr{ + pos: position{line: 1029, col: 16, offset: 32769}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1029, col: 16, offset: 32769}, + label: "stars", + expr: &actionExpr{ + pos: position{line: 1029, col: 23, offset: 32776}, + run: (*parser).callonTagRanges52, + expr: &oneOrMoreExpr{ + pos: position{line: 1029, col: 23, offset: 32776}, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 1029, col: 24, offset: 32777}, + val: "*", ignoreCase: false, - want: "\"\\t\"", + want: "\"*\"", }, }, }, }, - }, - &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, - }, + &andCodeExpr{ + pos: position{line: 1032, col: 5, offset: 32831}, + run: (*parser).callonTagRanges55, }, }, }, }, }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1025, col: 9, offset: 32657}, + run: (*parser).callonTagRanges56, + expr: &seqExpr{ + pos: position{line: 1025, col: 9, offset: 32657}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1025, col: 9, offset: 32657}, + val: "!", + ignoreCase: false, + want: "\"!\"", + }, &labeledExpr{ - pos: position{line: 950, col: 99, offset: 31180}, - label: "line", + pos: position{line: 1025, col: 13, offset: 32661}, + label: "tag", expr: &choiceExpr{ - pos: position{line: 950, col: 105, offset: 31186}, + pos: position{line: 1025, col: 18, offset: 32666}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonContinuedListItemContent397, + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonTagRanges61, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &actionExpr{ + pos: position{line: 1029, col: 16, offset: 32769}, + run: (*parser).callonTagRanges64, expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, + pos: position{line: 1029, col: 16, offset: 32769}, 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", + pos: position{line: 1029, col: 16, offset: 32769}, + label: "stars", 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'}, + pos: position{line: 1029, col: 23, offset: 32776}, + run: (*parser).callonTagRanges67, + expr: &oneOrMoreExpr{ + pos: position{line: 1029, col: 23, offset: 32776}, + expr: &litMatcher{ + pos: position{line: 1029, col: 24, offset: 32777}, + 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: 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, + &andCodeExpr{ + pos: position{line: 1032, col: 5, offset: 32831}, + run: (*parser).callonTagRanges70, }, }, }, @@ -15236,876 +21508,164 @@ 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{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + { + name: "IncludedFileLine", + pos: position{line: 1039, col: 1, offset: 32998}, + expr: &actionExpr{ + pos: position{line: 1039, col: 21, offset: 33018}, + run: (*parser).callonIncludedFileLine1, + expr: &seqExpr{ + pos: position{line: 1039, col: 21, offset: 33018}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1039, col: 21, offset: 33018}, + label: "content", + expr: &zeroOrMoreExpr{ + pos: position{line: 1039, col: 29, offset: 33026}, + expr: &choiceExpr{ + pos: position{line: 1039, col: 30, offset: 33027}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1043, col: 25, offset: 33207}, + run: (*parser).callonIncludedFileLine6, + expr: &seqExpr{ + pos: position{line: 1043, col: 25, offset: 33207}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1043, col: 25, offset: 33207}, + val: "tag::", + ignoreCase: false, + want: "\"tag::\"", + }, + &labeledExpr{ + pos: position{line: 1043, col: 33, offset: 33215}, + label: "tag", + expr: &actionExpr{ + pos: position{line: 1043, col: 38, offset: 33220}, + run: (*parser).callonIncludedFileLine10, 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, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 2801, col: 14, offset: 92593}, + run: (*parser).callonIncludedFileLine11, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + 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).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, - }, - }, - }, - }, - }, - }, - }, - }, + }, + &litMatcher{ + pos: position{line: 1043, col: 78, offset: 33260}, + val: "[]", + ignoreCase: false, + want: "\"[]\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1047, col: 23, offset: 33355}, + run: (*parser).callonIncludedFileLine15, + expr: &seqExpr{ + pos: position{line: 1047, col: 23, offset: 33355}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1047, col: 23, offset: 33355}, + val: "end::", + ignoreCase: false, + want: "\"end::\"", + }, + &labeledExpr{ + pos: position{line: 1047, col: 31, offset: 33363}, + label: "tag", + expr: &actionExpr{ + pos: position{line: 1047, col: 36, offset: 33368}, + run: (*parser).callonIncludedFileLine19, + expr: &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonIncludedFileLine20, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, + &litMatcher{ + pos: position{line: 1047, col: 76, offset: 33408}, + val: "[]", + ignoreCase: false, + want: "\"[]\"", + }, }, }, }, + &actionExpr{ + pos: position{line: 1039, col: 74, offset: 33071}, + run: (*parser).callonIncludedFileLine24, + expr: &anyMatcher{ + line: 1039, col: 74, offset: 33071, + }, + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonIncludedFileLine31, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -16115,224 +21675,140 @@ var g = &grammar{ }, }, { - name: "OrderedListItem", - pos: position{line: 696, col: 1, offset: 21893}, + name: "InlineElement", + pos: position{line: 1104, col: 1, offset: 35063}, expr: &actionExpr{ - pos: position{line: 696, col: 20, offset: 21912}, - run: (*parser).callonOrderedListItem1, - expr: &seqExpr{ - pos: position{line: 696, col: 20, offset: 21912}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 696, col: 20, offset: 21912}, - label: "prefix", - expr: &actionExpr{ - pos: position{line: 701, col: 5, offset: 22141}, - run: (*parser).callonOrderedListItem4, + pos: position{line: 1105, col: 5, offset: 35086}, + run: (*parser).callonInlineElement1, + expr: &labeledExpr{ + pos: position{line: 1105, col: 5, offset: 35086}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1106, col: 9, offset: 35104}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + run: (*parser).callonInlineElement4, expr: &seqExpr{ - pos: position{line: 701, col: 5, offset: 22141}, + pos: position{line: 2820, col: 5, offset: 93371}, exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 701, col: 5, offset: 22141}, + &labeledExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + run: (*parser).callonInlineElement7, + expr: &oneOrMoreExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + expr: &charClassMatcher{ + pos: position{line: 2820, col: 14, offset: 93380}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 2823, col: 5, offset: 93461}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2823, col: 7, offset: 93463}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonOrderedListItem9, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineElement13, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", }, }, + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[.�0-9\\pL]", + chars: []rune{'.', '�'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonInlineElement20, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, - &labeledExpr{ - pos: position{line: 701, col: 12, offset: 22148}, - label: "prefix", + }, + }, + }, + &actionExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + run: (*parser).callonInlineElement22, + expr: &seqExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + expr: &charClassMatcher{ + pos: position{line: 2809, col: 5, offset: 92974}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2809, col: 15, offset: 92984}, expr: &choiceExpr{ - pos: position{line: 703, col: 9, offset: 22211}, + pos: position{line: 2809, col: 17, offset: 92986}, 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, - }, - }, - }, - }, - &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'}, - 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).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: "\".\"", - }, - }, - }, - }, - &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: ".", - ignoreCase: false, - want: "\".\"", - }, - }, - }, - }, - &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, - }, - }, - &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: "\")\"", - }, - }, - }, - }, - }, - }, - }, - &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\"", + &charClassMatcher{ + pos: position{line: 2809, col: 17, offset: 92986}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, }, @@ -16341,598 +21817,112 @@ var g = &grammar{ }, }, }, - }, - &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}, - expr: &actionExpr{ - pos: position{line: 748, col: 5, offset: 23950}, - run: (*parser).callonUnorderedListItem1, - expr: &seqExpr{ - pos: position{line: 748, col: 5, offset: 23950}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 748, col: 5, offset: 23950}, - label: "prefix", - expr: &actionExpr{ - pos: position{line: 755, col: 5, offset: 24261}, - run: (*parser).callonUnorderedListItem4, + &actionExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + run: (*parser).callonInlineElement31, expr: &seqExpr{ - pos: position{line: 755, col: 5, offset: 24261}, + pos: position{line: 2811, col: 9, offset: 93068}, 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: " ", - 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\"", - }, - }, - }, - }, - }, - &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, - }, - }, - }, - }, - &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: "-", - ignoreCase: false, - want: "\"-\"", - }, - }, - }, - }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 9, offset: 93068}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, &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: " ", + pos: position{line: 2811, col: 19, offset: 93078}, + expr: &seqExpr{ + pos: position{line: 2811, col: 20, offset: 93079}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2811, col: 20, offset: 93079}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, 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\"", - }, - }, - }, - }, - }, - }, - }, - }, - }, - &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: "[", - ignoreCase: false, - 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: "\"[ ]\"", - }, - }, - &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: "\"[*]\"", - }, - }, - &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]\"", - }, - }, - }, - }, - }, - &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: "\" \"", - }, - &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\"", - }, - }, + inverted: false, }, - }, - }, - }, - }, - }, - }, - }, - &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}, - expr: &actionExpr{ - pos: position{line: 799, col: 20, offset: 25873}, - run: (*parser).callonLabeledListItem1, - expr: &seqExpr{ - pos: position{line: 799, col: 20, offset: 25873}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 799, col: 20, offset: 25873}, - label: "term", - 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}, + pos: position{line: 2811, col: 27, offset: 93086}, expr: &charClassMatcher{ - pos: position{line: 805, col: 33, offset: 26234}, - val: "[^:\\r\\n]", - chars: []rune{':', '\r', '\n'}, + pos: position{line: 2811, col: 27, offset: 93086}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, 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: 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}, - 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).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: "\":\"", - }, - }, - }, - }, - &andCodeExpr{ - pos: position{line: 841, col: 5, offset: 27246}, - run: (*parser).callonLabeledListItem22, - }, - &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).callonLabeledListItem27, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, + inverted: false, }, }, }, - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 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", - }, - }, - }, - }, - }, - }, - }, - { - 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, + pos: position{line: 2829, col: 16, offset: 93605}, + run: (*parser).callonInlineElement40, expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, + pos: position{line: 2829, col: 16, offset: 93605}, 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, - }, + &charClassMatcher{ + pos: position{line: 2829, col: 17, offset: 93606}, + val: "[.,;!?]", + chars: []rune{'.', ',', ';', '!', '?'}, + ignoreCase: false, + inverted: false, }, &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, + pos: position{line: 2829, col: 46, offset: 93635}, expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, + pos: position{line: 2829, col: 48, offset: 93637}, alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, - val: "[\\r\\n ,]]", - chars: []rune{'\r', '\n', ' ', ',', ']'}, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - inverted: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineElement46, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2890, col: 9, offset: 95286, }, }, - }, - }, - }, - }, - }, - }, - &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{'=', '*', '_', '`'}, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - inverted: false, + want: "\"\\n\"", }, - &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")}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonInlineElement52, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", ignoreCase: false, - inverted: false, + want: "\"\\r\"", }, }, }, @@ -16942,25 +21932,25 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 995, col: 14, offset: 32701}, - run: (*parser).callonLabeledListItemTermElement22, + pos: position{line: 954, col: 14, offset: 30337}, + run: (*parser).callonInlineElement54, expr: &seqExpr{ - pos: position{line: 995, col: 14, offset: 32701}, + pos: position{line: 954, col: 14, offset: 30337}, exprs: []interface{}{ &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement26, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineElement58, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -16969,27 +21959,27 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 995, col: 20, offset: 32707}, + pos: position{line: 954, col: 20, offset: 30343}, val: "+", ignoreCase: false, want: "\"+\"", }, &zeroOrMoreExpr{ - pos: position{line: 995, col: 24, offset: 32711}, + pos: position{line: 954, col: 24, offset: 30347}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement32, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineElement64, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -16999,27 +21989,36 @@ var g = &grammar{ }, }, &andExpr{ - pos: position{line: 995, col: 31, offset: 32718}, + pos: position{line: 954, col: 31, offset: 30354}, expr: &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonInlineElement72, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -17028,282 +22027,552 @@ var g = &grammar{ }, }, }, - &oneOrMoreExpr{ - pos: position{line: 819, col: 11, offset: 26719}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &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, - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonLabeledListItemTermElement54, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonInlineElement74, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 1109, col: 11, offset: 35228}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1109, col: 11, offset: 35228}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonInlineElement84, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &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}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - 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\"", - }, - }, - }, - }, - }, - &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).callonLabeledListItemTermElement69, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &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}, + }, + &choiceExpr{ + pos: position{line: 1110, col: 13, offset: 35247}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonInlineElement87, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonInlineElement89, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonInlineElement92, expr: &choiceExpr{ - pos: position{line: 2154, col: 31, offset: 76313}, + pos: position{line: 491, col: 27, offset: 15997}, 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: 491, col: 27, offset: 15997}, + run: (*parser).callonInlineElement94, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonInlineElement98, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineElement104, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonInlineElement110, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonInlineElement115, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonInlineElement117, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonInlineElement120, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonInlineElement124, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonInlineElement131, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonInlineElement136, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonInlineElement138, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonInlineElement142, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonInlineElement146, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonInlineElement153, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonInlineElement158, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonInlineElement160, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonInlineElement164, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonInlineElement168, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonInlineElement174, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, }, &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\"", + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonInlineElement177, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonInlineElement181, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, }, }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - &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).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\"", - }, - }, - }, - }, - }, - &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: " ", + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonInlineElement185, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, 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\"", - }, - }, - }, - }, - }, - &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\"", - }, - }, - }, + inverted: false, }, }, }, @@ -17312,172 +22581,160 @@ var g = &grammar{ }, }, }, - }, - &litMatcher{ - pos: position{line: 2150, col: 5, offset: 76204}, - val: ")))", - ignoreCase: false, - want: "\")))\"", - }, - }, - }, - }, - &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, - expr: &choiceExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, - run: (*parser).callonLabeledListItemTermElement111, - 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).callonLabeledListItemTermElement115, - 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).callonLabeledListItemTermElement121, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + &ruleRefExpr{ + pos: position{line: 1111, col: 15, offset: 35278}, + name: "Quote", + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonInlineElement188, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonInlineElement190, }, - }, - &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}, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", expr: &choiceExpr{ - pos: position{line: 1549, col: 5, offset: 55031}, + pos: position{line: 452, col: 14, offset: 14516}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, - run: (*parser).callonLabeledListItemTermElement127, + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonInlineElement193, expr: &seqExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, + pos: position{line: 463, col: 25, offset: 14978}, exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 1549, col: 6, offset: 55032}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", ignoreCase: false, - inverted: false, + want: "\"{counter:\"", }, - &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, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonInlineElement197, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonInlineElement204, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonInlineElement209, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonInlineElement211, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonLabeledListItemTermElement132, + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonInlineElement215, expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, + pos: position{line: 467, col: 25, offset: 15133}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", ignoreCase: false, - want: "\"{\"", + want: "\"{counter2:\"", }, &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, + pos: position{line: 467, col: 38, offset: 15146}, label: "name", expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonLabeledListItemTermElement136, + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonInlineElement219, expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, + pos: position{line: 118, col: 18, offset: 3399}, exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 190, col: 18, offset: 6118}, + pos: position{line: 118, col: 18, offset: 3399}, val: "[_0-9\\pL]", chars: []rune{'_'}, ranges: []rune{'0', '9'}, @@ -17486,9 +22743,9 @@ var g = &grammar{ inverted: false, }, &zeroOrMoreExpr{ - pos: position{line: 190, col: 28, offset: 6128}, + pos: position{line: 118, col: 28, offset: 3409}, expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, + pos: position{line: 118, col: 29, offset: 3410}, val: "[-0-9\\pL]", chars: []rune{'-'}, ranges: []rune{'0', '9'}, @@ -17501,8 +22758,64 @@ var g = &grammar{ }, }, }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonInlineElement226, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonInlineElement231, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonInlineElement233, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, + pos: position{line: 467, col: 79, offset: 15187}, val: "}", ignoreCase: false, want: "\"}\"", @@ -17511,256 +22824,162 @@ var g = &grammar{ }, }, &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, + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonInlineElement237, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonInlineElement241, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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).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)\"", - }, - }, - &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)\"", - }, - }, - &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)\"", - }, - }, - &actionExpr{ - pos: position{line: 2186, col: 13, offset: 77056}, - run: (*parser).callonLabeledListItemTermElement163, - 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).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")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - }, - &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, + &actionExpr{ + pos: position{line: 2576, col: 5, offset: 85805}, + run: (*parser).callonInlineElement247, expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, + pos: position{line: 2576, col: 5, offset: 85805}, 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: 2576, col: 5, offset: 85805}, + run: (*parser).callonInlineElement249, }, - }, - }, - }, - }, - &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, - }, + &labeledExpr{ + pos: position{line: 2579, col: 5, offset: 85871}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2618, col: 11, offset: 87173}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2620, col: 15, offset: 87267}, + run: (*parser).callonInlineElement252, + expr: &litMatcher{ + pos: position{line: 2620, col: 15, offset: 87267}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", }, - &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]", + }, + &actionExpr{ + pos: position{line: 2626, col: 14, offset: 87382}, + run: (*parser).callonInlineElement254, + expr: &litMatcher{ + pos: position{line: 2626, col: 14, offset: 87382}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2630, col: 14, offset: 87458}, + run: (*parser).callonInlineElement256, + expr: &litMatcher{ + pos: position{line: 2630, col: 14, offset: 87458}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2634, col: 15, offset: 87536}, + run: (*parser).callonInlineElement258, + expr: &litMatcher{ + pos: position{line: 2634, col: 15, offset: 87536}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2638, col: 13, offset: 87611}, + run: (*parser).callonInlineElement260, + expr: &litMatcher{ + pos: position{line: 2638, col: 13, offset: 87611}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + run: (*parser).callonInlineElement262, + expr: &seqExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, + &litMatcher{ + pos: position{line: 2646, col: 31, offset: 87926}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2646, col: 35, offset: 87930}, + expr: &charClassMatcher{ + pos: position{line: 2646, col: 36, offset: 87931}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, @@ -17770,107 +22989,113 @@ 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).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, + &ruleRefExpr{ + pos: position{line: 1114, col: 15, offset: 35361}, + name: "InlineMacro", + }, + &actionExpr{ + pos: position{line: 2554, col: 5, offset: 85347}, + run: (*parser).callonInlineElement269, expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, + pos: position{line: 2554, col: 5, offset: 85347}, 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: 2554, col: 5, offset: 85347}, + run: (*parser).callonInlineElement271, }, - }, - }, - }, - }, - &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, + &labeledExpr{ + pos: position{line: 2557, col: 5, offset: 85417}, + label: "element", + expr: &actionExpr{ + pos: position{line: 954, col: 14, offset: 30337}, + run: (*parser).callonInlineElement273, + expr: &seqExpr{ + pos: position{line: 954, col: 14, offset: 30337}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineElement277, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, }, }, - &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, + &litMatcher{ + pos: position{line: 954, col: 20, offset: 30343}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 954, col: 24, offset: 30347}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineElement283, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 954, col: 31, offset: 30354}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonInlineElement291, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, @@ -17881,152 +23106,142 @@ var g = &grammar{ }, }, }, - }, - &litMatcher{ - pos: position{line: 225, col: 79, offset: 7335}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, - }, - }, - &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: 214, col: 16, offset: 6786}, - label: "name", - expr: &actionExpr{ - pos: position{line: 190, col: 18, offset: 6118}, - run: (*parser).callonLabeledListItemTermElement219, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonInlineElement293, expr: &seqExpr{ - pos: position{line: 190, col: 18, offset: 6118}, + pos: position{line: 947, col: 23, offset: 29896}, 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: 945, col: 32, offset: 29864}, + val: "�", ignoreCase: false, - inverted: 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, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonInlineElement297, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, }, }, - }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", + &actionExpr{ + pos: position{line: 2835, col: 12, offset: 93828}, + run: (*parser).callonInlineElement301, + expr: &anyMatcher{ + line: 2835, col: 12, offset: 93828, + }, + }, }, }, }, }, - &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: "IndexTerm", + pos: position{line: 1132, col: 1, offset: 36123}, 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: 1132, col: 14, offset: 36136}, + run: (*parser).callonIndexTerm1, + expr: &seqExpr{ + pos: position{line: 1132, col: 14, offset: 36136}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1132, col: 14, offset: 36136}, + val: "((", + ignoreCase: false, + want: "\"((\"", + }, + &labeledExpr{ + pos: position{line: 1132, col: 19, offset: 36141}, + label: "term", + expr: &ruleRefExpr{ + pos: position{line: 1132, col: 25, offset: 36147}, + name: "IndexTermContent", + }, + }, + &litMatcher{ + pos: position{line: 1132, col: 43, offset: 36165}, + val: "))", + ignoreCase: false, + want: "\"))\"", }, }, }, }, }, { - name: "InlineElement", - pos: position{line: 967, col: 1, offset: 31735}, + name: "IndexTermContent", + pos: position{line: 1136, col: 1, offset: 36237}, expr: &actionExpr{ - pos: position{line: 968, col: 5, offset: 31758}, - run: (*parser).callonInlineElement1, + pos: position{line: 1136, col: 21, offset: 36257}, + run: (*parser).callonIndexTermContent1, 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")}, - ignoreCase: false, - inverted: false, + pos: position{line: 1136, col: 21, offset: 36257}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 1136, col: 30, offset: 36266}, + expr: &choiceExpr{ + pos: position{line: 1136, col: 31, offset: 36267}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + run: (*parser).callonIndexTermContent5, + expr: &seqExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + expr: &charClassMatcher{ + pos: position{line: 2809, col: 5, offset: 92974}, + val: "[0-9\\pL]", + 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, + &andExpr{ + pos: position{line: 2809, col: 15, offset: 92984}, + expr: &choiceExpr{ + pos: position{line: 2809, col: 17, offset: 92986}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2809, col: 17, offset: 92986}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, }, }, }, @@ -18034,40 +23249,45 @@ var g = &grammar{ }, }, }, - }, - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonInlineElement13, - 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, + &actionExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + run: (*parser).callonIndexTermContent14, + expr: &seqExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 9, offset: 93068}, + 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, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 19, offset: 93078}, + expr: &seqExpr{ + pos: position{line: 2811, col: 20, offset: 93079}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2811, col: 20, offset: 93079}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 27, offset: 93086}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 27, offset: 93086}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -18075,1028 +23295,1487 @@ var g = &grammar{ }, }, }, - }, - &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}, - 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, - }, - }, - }, - }, - }, - }, + &ruleRefExpr{ + pos: position{line: 1136, col: 38, offset: 36274}, + name: "QuotedString", }, - }, - &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: "\"+\"", - }, - &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\"", - }, - }, - }, - }, - }, - &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, - }, - }, - }, - }, - }, - }, + &ruleRefExpr{ + pos: position{line: 1136, col: 53, offset: 36289}, + name: "QuotedText", }, - }, - &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", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", }, - }, - &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'}, - 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonIndexTermContent26, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, - &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: 2587, col: 5, offset: 86026}, + run: (*parser).callonIndexTermContent28, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonIndexTermContent30, }, - &actionExpr{ - pos: position{line: 2203, col: 21, offset: 77750}, - run: (*parser).callonInlineElement70, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", expr: &choiceExpr{ - pos: position{line: 1538, col: 27, offset: 54613}, + pos: position{line: 2592, col: 9, offset: 86195}, 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{}{ - &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).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, - }, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 1538, col: 40, offset: 54626}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonIndexTermContent33, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonIndexTermContent35, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", ignoreCase: false, - want: "\" \"", + 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\"", + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonIndexTermContent39, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, }, }, - }, - }, - }, - &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).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")}, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonIndexTermContent45, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", 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, - }, + want: "\"\\t\"", }, }, }, }, - &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")}, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonIndexTermContent51, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, ignoreCase: false, - inverted: 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, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonIndexTermContent56, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonIndexTermContent58, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonIndexTermContent61, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonIndexTermContent65, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonIndexTermContent72, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonIndexTermContent77, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonIndexTermContent79, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonIndexTermContent83, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonIndexTermContent87, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonIndexTermContent94, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonIndexTermContent99, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonIndexTermContent101, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonIndexTermContent105, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonIndexTermContent109, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, }, }, }, }, }, }, - &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", - ignoreCase: false, - want: "\"}\"", + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonIndexTermContent115, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + 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: 491, col: 79, offset: 16049}, + 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).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{'[', ']', '<', '>', ','}, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonIndexTermContent118, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", ignoreCase: false, - inverted: true, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonIndexTermContent122, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", }, }, }, }, - &litMatcher{ - pos: position{line: 1540, col: 18, offset: 54743}, - val: ">>", - ignoreCase: false, - want: "\">>\"", - }, }, }, }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonIndexTermContent126, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, - &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: "\"...\"", - }, + }, + }, + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonIndexTermContent128, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", }, - &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]", + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonIndexTermContent132, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", 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, - }, - }, }, }, }, - &ruleRefExpr{ - pos: position{line: 982, col: 15, offset: 32277}, - name: "InlineUserMacro", + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", }, - &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: 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")}, - 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: 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, - 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).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, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 221, col: 78, offset: 7179}, - val: "}", - ignoreCase: false, - want: "\"}\"", - }, - }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1136, col: 114, offset: 36350}, + run: (*parser).callonIndexTermContent136, + expr: &seqExpr{ + pos: position{line: 1136, col: 115, offset: 36351}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1136, col: 115, offset: 36351}, + expr: &litMatcher{ + pos: position{line: 1136, col: 116, offset: 36352}, + 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")}, - 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).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: 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'}, - ignoreCase: false, - inverted: false, - }, - }, - &actionExpr{ - pos: position{line: 231, col: 9, offset: 7491}, - run: (*parser).callonInlineElement173, - 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, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, + &anyMatcher{ + line: 1136, col: 121, offset: 36357, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "ImageBlock", + pos: position{line: 1156, col: 1, offset: 37066}, + expr: &actionExpr{ + pos: position{line: 1157, col: 5, offset: 37085}, + run: (*parser).callonImageBlock1, + expr: &seqExpr{ + pos: position{line: 1157, col: 5, offset: 37085}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 1157, col: 5, offset: 37085}, + run: (*parser).callonImageBlock3, + }, + &litMatcher{ + pos: position{line: 1161, col: 5, offset: 37237}, + val: "image::", + ignoreCase: false, + want: "\"image::\"", + }, + &labeledExpr{ + pos: position{line: 1161, col: 15, offset: 37247}, + label: "path", + expr: &actionExpr{ + pos: position{line: 2843, col: 13, offset: 94029}, + run: (*parser).callonImageBlock6, + expr: &seqExpr{ + pos: position{line: 2843, col: 13, offset: 94029}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2843, col: 13, offset: 94029}, + label: "scheme", + expr: &zeroOrOneExpr{ + pos: position{line: 2843, col: 20, offset: 94036}, + expr: &choiceExpr{ + pos: position{line: 2864, col: 11, offset: 94704}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 225, col: 79, offset: 7335}, - val: "}", + pos: position{line: 2864, col: 11, offset: 94704}, + val: "http://", ignoreCase: false, - want: "\"}\"", + want: "\"http://\"", }, - }, - }, - }, - &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: "{", + pos: position{line: 2864, col: 23, offset: 94716}, + val: "https://", 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, - }, - }, - }, - }, - }, + want: "\"https://\"", }, &litMatcher{ - pos: position{line: 214, col: 35, offset: 6805}, - val: "}", + pos: position{line: 2864, col: 36, offset: 94729}, + val: "ftp://", ignoreCase: false, - want: "\"}\"", + want: "\"ftp://\"", }, - }, - }, - }, - &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: "[[", + pos: position{line: 2864, col: 47, offset: 94740}, + val: "irc://", 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{'[', ']', '<', '>', ','}, - ignoreCase: false, - inverted: true, - }, - }, - }, + want: "\"irc://\"", }, &litMatcher{ - pos: position{line: 237, col: 33, offset: 7620}, - val: "]]", + pos: position{line: 2864, col: 58, offset: 94751}, + val: "mailto:", 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).callonInlineElement198, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + want: "\"mailto:\"", }, }, }, }, - &actionExpr{ - pos: position{line: 2147, col: 23, offset: 75975}, - run: (*parser).callonInlineElement200, - 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).callonInlineElement204, + }, + &labeledExpr{ + pos: position{line: 2843, col: 30, offset: 94046}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 2843, col: 35, offset: 94051}, + expr: &choiceExpr{ + pos: position{line: 2843, col: 36, offset: 94052}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2851, col: 13, offset: 94316}, + run: (*parser).callonImageBlock19, + expr: &labeledExpr{ + pos: position{line: 2851, col: 13, offset: 94316}, + label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 2154, col: 30, offset: 76312}, + pos: position{line: 2851, col: 22, offset: 94325}, expr: &choiceExpr{ - pos: position{line: 2154, col: 31, offset: 76313}, + pos: position{line: 2852, col: 5, offset: 94331}, 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).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, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + pos: position{line: 2852, col: 5, offset: 94331}, + run: (*parser).callonImageBlock23, + expr: &oneOrMoreExpr{ + pos: position{line: 2852, col: 5, offset: 94331}, + expr: &charClassMatcher{ + pos: position{line: 2852, col: 6, offset: 94332}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, + ignoreCase: false, + inverted: true, }, }, }, - &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: 449, col: 5, offset: 14443}, + run: (*parser).callonImageBlock26, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonImageBlock28, }, - &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\"", + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonImageBlock31, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonImageBlock35, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonImageBlock42, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonImageBlock47, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonImageBlock49, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonImageBlock53, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonImageBlock57, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonImageBlock64, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonImageBlock69, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonImageBlock71, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonImageBlock75, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonImageBlock79, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, }, }, }, }, }, - &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, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonImageBlock85, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonImageBlock87, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonImageBlock90, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonImageBlock92, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonImageBlock96, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonImageBlock102, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonImageBlock108, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonImageBlock113, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonImageBlock115, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonImageBlock118, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonImageBlock122, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonImageBlock129, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonImageBlock134, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonImageBlock136, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonImageBlock140, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonImageBlock144, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonImageBlock151, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonImageBlock156, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonImageBlock158, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonImageBlock162, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonImageBlock166, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonImageBlock172, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonImageBlock175, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonImageBlock179, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonImageBlock183, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -19104,639 +24783,1095 @@ var g = &grammar{ }, }, }, + &actionExpr{ + pos: position{line: 2858, col: 7, offset: 94556}, + run: (*parser).callonImageBlock185, + expr: &litMatcher{ + pos: position{line: 2858, col: 7, offset: 94556}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, }, }, }, }, }, - &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}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &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\"", - }, - }, - }, - }, - }, - &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\"", - }, - }, - }, - }, - }, - &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}, - 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).callonInlineElement252, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonImageBlock187, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonImageBlock191, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, }, - }, - }, - }, - &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: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonInlineElement260, - 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'}, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", ignoreCase: false, - inverted: false, + want: "\"�\"", }, }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - 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, - }, - }, }, }, }, }, }, - }, - }, - }, - }, - { - 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: 1161, col: 31, offset: 37263}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 1161, col: 49, offset: 37281}, + name: "InlineAttributes", + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 1161, col: 67, offset: 37299}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonImageBlock200, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, - &labeledExpr{ - pos: position{line: 1005, col: 9, offset: 33074}, - label: "text", - expr: &choiceExpr{ - pos: position{line: 1005, col: 15, offset: 33080}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1005, col: 15, offset: 33080}, - name: "UnconstrainedQuotedText", - }, - &ruleRefExpr{ - pos: position{line: 1005, col: 41, offset: 33106}, - name: "ConstrainedQuotedText", - }, - }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonImageBlock207, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, }, - &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}, + name: "InlineImage", + pos: position{line: 1167, col: 1, offset: 37593}, expr: &actionExpr{ - pos: position{line: 1055, col: 24, offset: 34377}, - run: (*parser).callonDoubleQuoteBoldText1, + pos: position{line: 1167, col: 16, offset: 37608}, + run: (*parser).callonInlineImage1, expr: &seqExpr{ - pos: position{line: 1055, col: 24, offset: 34377}, + pos: position{line: 1167, col: 16, offset: 37608}, 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: "**", + pos: position{line: 1167, col: 16, offset: 37608}, + val: "image:", ignoreCase: false, - want: "\"**\"", + want: "\"image:\"", }, - }, - }, - }, - }, - { - 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}, - 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}, + pos: position{line: 1167, col: 25, offset: 37617}, expr: &litMatcher{ - pos: position{line: 1061, col: 33, offset: 34606}, - val: "**", + pos: position{line: 1167, col: 26, offset: 37618}, + val: ":", ignoreCase: false, - want: "\"**\"", + 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}, - 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: 1167, col: 30, offset: 37622}, + label: "path", + expr: &actionExpr{ + pos: position{line: 2843, col: 13, offset: 94029}, + run: (*parser).callonInlineImage7, + expr: &seqExpr{ + pos: position{line: 2843, col: 13, offset: 94029}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2843, col: 13, offset: 94029}, + label: "scheme", + expr: &zeroOrOneExpr{ + pos: position{line: 2843, col: 20, offset: 94036}, + expr: &choiceExpr{ + pos: position{line: 2864, col: 11, offset: 94704}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2864, col: 11, offset: 94704}, + val: "http://", + ignoreCase: false, + want: "\"http://\"", }, - }, - }, - }, - }, - }, - &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, - }, - &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: 2864, col: 23, offset: 94716}, + val: "https://", + ignoreCase: false, + want: "\"https://\"", + }, + &litMatcher{ + pos: position{line: 2864, col: 36, offset: 94729}, + val: "ftp://", + ignoreCase: false, + want: "\"ftp://\"", + }, + &litMatcher{ + pos: position{line: 2864, col: 47, offset: 94740}, + val: "irc://", + ignoreCase: false, + want: "\"irc://\"", + }, + &litMatcher{ + pos: position{line: 2864, col: 58, offset: 94751}, + val: "mailto:", + ignoreCase: false, + want: "\"mailto:\"", }, }, }, }, }, - }, - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDoubleQuoteBoldTextElement26, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - &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, - }, - }, - }, - ¬Expr{ - pos: position{line: 1063, col: 15, offset: 34685}, + &labeledExpr{ + pos: position{line: 2843, col: 30, offset: 94046}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 2843, col: 35, offset: 94051}, expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2843, col: 36, offset: 94052}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: 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: 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'}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2851, col: 13, offset: 94316}, + run: (*parser).callonInlineImage20, + expr: &labeledExpr{ + pos: position{line: 2851, col: 13, offset: 94316}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2851, col: 22, offset: 94325}, + expr: &choiceExpr{ + pos: position{line: 2852, col: 5, offset: 94331}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2852, col: 5, offset: 94331}, + run: (*parser).callonInlineImage24, + expr: &oneOrMoreExpr{ + pos: position{line: 2852, col: 5, offset: 94331}, + expr: &charClassMatcher{ + pos: position{line: 2852, col: 6, offset: 94332}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonInlineImage27, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonInlineImage29, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonInlineImage32, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonInlineImage36, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonInlineImage43, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonInlineImage48, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonInlineImage50, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonInlineImage54, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonInlineImage58, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonInlineImage65, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonInlineImage70, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonInlineImage72, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonInlineImage76, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonInlineImage80, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonInlineImage86, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonInlineImage88, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonInlineImage91, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonInlineImage93, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonInlineImage97, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineImage103, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonInlineImage109, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonInlineImage114, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonInlineImage116, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonInlineImage119, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonInlineImage123, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonInlineImage130, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonInlineImage135, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonInlineImage137, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonInlineImage141, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonInlineImage145, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonInlineImage152, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonInlineImage157, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonInlineImage159, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonInlineImage163, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonInlineImage167, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonInlineImage173, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonInlineImage176, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonInlineImage180, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonInlineImage184, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2858, col: 7, offset: 94556}, + run: (*parser).callonInlineImage186, + expr: &litMatcher{ + pos: position{line: 2858, col: 7, offset: 94556}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, }, }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - &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, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonInlineImage188, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonInlineImage192, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, }, }, }, @@ -19746,61 +25881,59 @@ var g = &grammar{ }, }, }, + &labeledExpr{ + pos: position{line: 1167, col: 46, offset: 37638}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 1167, col: 64, offset: 37656}, + name: "InlineAttributes", + }, + }, }, }, }, }, { - name: "QuotedTextInDoubleQuoteBoldText", - pos: position{line: 1071, col: 1, offset: 34857}, + name: "InlineIcon", + pos: position{line: 1174, col: 1, offset: 38086}, expr: &actionExpr{ - pos: position{line: 1072, col: 5, offset: 34897}, - run: (*parser).callonQuotedTextInDoubleQuoteBoldText1, + pos: position{line: 1174, col: 15, offset: 38100}, + run: (*parser).callonInlineIcon1, expr: &seqExpr{ - pos: position{line: 1072, col: 5, offset: 34897}, + pos: position{line: 1174, col: 15, offset: 38100}, exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1174, col: 15, offset: 38100}, + val: "icon:", + ignoreCase: false, + want: "\"icon:\"", + }, &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", + pos: position{line: 1174, col: 23, offset: 38108}, + label: "icon", + expr: &actionExpr{ + pos: position{line: 1174, col: 29, offset: 38114}, + run: (*parser).callonInlineIcon5, + expr: &oneOrMoreExpr{ + pos: position{line: 1174, col: 29, offset: 38114}, + expr: &charClassMatcher{ + pos: position{line: 1174, col: 29, offset: 38114}, + val: "[_-0-9\\pL]", + chars: []rune{'_', '-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, }, }, }, &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", - }, - }, + pos: position{line: 1174, col: 73, offset: 38158}, + label: "attributes", + expr: &ruleRefExpr{ + pos: position{line: 1174, col: 85, offset: 38170}, + name: "InlineAttributes", }, }, }, @@ -19808,415 +25941,93 @@ var g = &grammar{ }, }, { - name: "SingleQuoteBoldText", - pos: position{line: 1088, col: 1, offset: 35478}, + name: "InlineFootnote", + pos: position{line: 1181, col: 1, offset: 38536}, expr: &choiceExpr{ - pos: position{line: 1089, col: 5, offset: 35506}, + pos: position{line: 1181, col: 19, offset: 38554}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1089, col: 5, offset: 35506}, - run: (*parser).callonSingleQuoteBoldText2, + pos: position{line: 1181, col: 19, offset: 38554}, + run: (*parser).callonInlineFootnote2, expr: &seqExpr{ - pos: position{line: 1089, col: 5, offset: 35506}, + pos: position{line: 1181, col: 19, offset: 38554}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1089, col: 6, offset: 35507}, - val: "*", + pos: position{line: 1181, col: 19, offset: 38554}, + val: "footnote:[", 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: "\"*\"", - }, + want: "\"footnote:[\"", }, &labeledExpr{ - pos: position{line: 1089, col: 16, offset: 35517}, - label: "elements", + pos: position{line: 1181, col: 32, offset: 38567}, + label: "content", expr: &ruleRefExpr{ - pos: position{line: 1089, col: 26, offset: 35527}, - name: "SingleQuoteBoldTextElements", + pos: position{line: 1181, col: 41, offset: 38576}, + name: "FootnoteContent", }, }, &litMatcher{ - pos: position{line: 1089, col: 55, offset: 35556}, - val: "*", + pos: position{line: 1181, col: 58, offset: 38593}, + 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, - }, - }, + want: "\"]\"", }, }, }, }, &actionExpr{ - pos: position{line: 1091, col: 9, offset: 35769}, - run: (*parser).callonSingleQuoteBoldText13, + pos: position{line: 1183, col: 9, offset: 38653}, + run: (*parser).callonInlineFootnote8, expr: &seqExpr{ - pos: position{line: 1091, col: 9, offset: 35769}, + pos: position{line: 1183, col: 9, offset: 38653}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1091, col: 9, offset: 35769}, - val: "*", + pos: position{line: 1183, col: 9, offset: 38653}, + val: "footnote:", ignoreCase: false, - want: "\"*\"", + want: "\"footnote:\"", }, &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: "*", + pos: position{line: 1183, col: 21, offset: 38665}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonInlineFootnote12, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"*\"", - }, - &ruleRefExpr{ - pos: position{line: 1091, col: 27, offset: 35787}, - name: "SingleQuoteBoldTextElements", + inverted: false, }, }, }, }, &litMatcher{ - pos: position{line: 1091, col: 56, offset: 35816}, - val: "*", + pos: position{line: 1183, col: 39, offset: 38683}, + 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, - }, - }, - }, - }, - }, - }, - }, - }, - &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, - }, - &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: 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\"", - }, - }, - }, - }, - }, - &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: "\"*\"", - }, - }, - }, - }, - }, - }, - }, - &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: "\"�\"", + 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, - }, + pos: position{line: 1183, col: 43, offset: 38687}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 1183, col: 51, offset: 38695}, + expr: &ruleRefExpr{ + pos: position{line: 1183, col: 52, offset: 38696}, + name: "FootnoteContent", }, }, }, &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: "*", + pos: position{line: 1183, col: 70, offset: 38714}, + 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, - }, - }, + want: "\"]\"", }, }, }, @@ -20225,56 +26036,32 @@ var g = &grammar{ }, }, { - name: "QuotedTextInSingleQuoteBoldText", - pos: position{line: 1106, col: 1, offset: 36315}, + name: "FootnoteContent", + pos: position{line: 1189, col: 1, offset: 38863}, expr: &actionExpr{ - pos: position{line: 1107, col: 5, offset: 36355}, - run: (*parser).callonQuotedTextInSingleQuoteBoldText1, - expr: &seqExpr{ - pos: position{line: 1107, col: 5, offset: 36355}, - 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", - }, - }, - }, - &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: 1189, col: 20, offset: 38882}, + run: (*parser).callonFootnoteContent1, + expr: &labeledExpr{ + pos: position{line: 1189, col: 20, offset: 38882}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 1189, col: 29, offset: 38891}, + expr: &seqExpr{ + pos: position{line: 1189, col: 30, offset: 38892}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1189, col: 30, offset: 38892}, + expr: &litMatcher{ + pos: position{line: 1189, col: 31, offset: 38893}, + val: "]", + ignoreCase: false, + want: "\"]\"", }, }, + &ruleRefExpr{ + pos: position{line: 1189, col: 35, offset: 38897}, + name: "InlineElement", + }, }, }, }, @@ -20282,156 +26069,94 @@ var g = &grammar{ }, }, { - name: "EscapedBoldText", - pos: position{line: 1122, col: 1, offset: 36934}, + name: "PassthroughMacro", + pos: position{line: 1221, col: 1, offset: 40586}, expr: &choiceExpr{ - pos: position{line: 1123, col: 5, offset: 36958}, + pos: position{line: 1221, col: 21, offset: 40606}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1123, col: 5, offset: 36958}, - run: (*parser).callonEscapedBoldText2, + pos: position{line: 1221, col: 21, offset: 40606}, + run: (*parser).callonPassthroughMacro2, expr: &seqExpr{ - pos: position{line: 1123, col: 5, offset: 36958}, + pos: position{line: 1221, col: 21, offset: 40606}, 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: "\"\\\\\"", - }, - }, - }, - }, - }, - }, - &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: "**", + pos: position{line: 1221, col: 21, offset: 40606}, + val: "pass:[", ignoreCase: false, - want: "\"**\"", + want: "\"pass:[\"", }, - }, - }, - }, - &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: "\\", + pos: position{line: 1221, col: 30, offset: 40615}, + label: "content", + expr: &zeroOrMoreExpr{ + pos: position{line: 1221, col: 38, offset: 40623}, + expr: &actionExpr{ + pos: position{line: 1227, col: 30, offset: 40949}, + run: (*parser).callonPassthroughMacro7, + expr: &charClassMatcher{ + pos: position{line: 1227, col: 30, offset: 40949}, + val: "[^]]", + chars: []rune{']'}, ignoreCase: false, - want: "\"\\\\\"", + inverted: true, }, }, }, }, &litMatcher{ - pos: position{line: 1125, col: 44, offset: 37229}, - val: "**", - ignoreCase: false, - want: "\"**\"", - }, - &labeledExpr{ - pos: position{line: 1125, col: 49, offset: 37234}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1125, col: 59, offset: 37244}, - name: "SingleQuoteBoldTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1125, col: 88, offset: 37273}, - val: "*", + pos: position{line: 1221, col: 67, offset: 40652}, + val: "]", ignoreCase: false, - want: "\"*\"", + want: "\"]\"", }, }, }, }, &actionExpr{ - pos: position{line: 1128, col: 9, offset: 37473}, - run: (*parser).callonEscapedBoldText24, + pos: position{line: 1223, col: 9, offset: 40756}, + run: (*parser).callonPassthroughMacro10, expr: &seqExpr{ - pos: position{line: 1128, col: 9, offset: 37473}, + pos: position{line: 1223, col: 9, offset: 40756}, 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: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, - }, - }, - }, &litMatcher{ - pos: position{line: 1128, col: 44, offset: 37508}, - val: "*", + pos: position{line: 1223, col: 9, offset: 40756}, + val: "pass:q[", ignoreCase: false, - want: "\"*\"", + want: "\"pass:q[\"", }, &labeledExpr{ - pos: position{line: 1128, col: 48, offset: 37512}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1128, col: 58, offset: 37522}, - name: "SingleQuoteBoldTextElements", + pos: position{line: 1223, col: 19, offset: 40766}, + label: "content", + expr: &zeroOrMoreExpr{ + pos: position{line: 1223, col: 27, offset: 40774}, + expr: &choiceExpr{ + pos: position{line: 1223, col: 28, offset: 40775}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1223, col: 28, offset: 40775}, + name: "QuotedText", + }, + &actionExpr{ + pos: position{line: 1227, col: 30, offset: 40949}, + run: (*parser).callonPassthroughMacro17, + expr: &charClassMatcher{ + pos: position{line: 1227, col: 30, offset: 40949}, + val: "[^]]", + chars: []rune{']'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, }, }, &litMatcher{ - pos: position{line: 1128, col: 87, offset: 37551}, - val: "*", + pos: position{line: 1223, col: 69, offset: 40816}, + val: "]", ignoreCase: false, - want: "\"*\"", + want: "\"]\"", }, }, }, @@ -20440,315 +26165,971 @@ var g = &grammar{ }, }, { - name: "ItalicText", - pos: position{line: 1136, col: 1, offset: 37759}, + name: "Link", + pos: position{line: 1234, col: 1, offset: 41205}, expr: &choiceExpr{ - pos: position{line: 1136, col: 15, offset: 37773}, + pos: position{line: 1234, col: 9, offset: 41213}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1136, col: 15, offset: 37773}, - name: "DoubleQuoteItalicText", + pos: position{line: 1234, col: 9, offset: 41213}, + name: "RelativeLink", }, &ruleRefExpr{ - pos: position{line: 1136, col: 39, offset: 37797}, - name: "SingleQuoteItalicText", + pos: position{line: 1234, col: 24, offset: 41228}, + name: "ExternalLink", }, }, }, }, { - name: "DoubleQuoteItalicText", - pos: position{line: 1138, col: 1, offset: 37820}, + name: "RelativeLink", + pos: position{line: 1237, col: 1, offset: 41309}, expr: &actionExpr{ - pos: position{line: 1138, col: 26, offset: 37845}, - run: (*parser).callonDoubleQuoteItalicText1, + pos: position{line: 1237, col: 17, offset: 41325}, + run: (*parser).callonRelativeLink1, expr: &seqExpr{ - pos: position{line: 1138, col: 26, offset: 37845}, + pos: position{line: 1237, col: 17, offset: 41325}, 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", - }, - }, - &litMatcher{ - pos: position{line: 1138, col: 72, offset: 37891}, - val: "__", + pos: position{line: 1237, col: 17, offset: 41325}, + val: "link:", 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: "\"link:\"", }, &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: 1237, col: 25, offset: 41333}, + label: "url", + expr: &actionExpr{ + pos: position{line: 2843, col: 13, offset: 94029}, + run: (*parser).callonRelativeLink5, + expr: &seqExpr{ + pos: position{line: 2843, col: 13, offset: 94029}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2843, col: 13, offset: 94029}, + label: "scheme", + expr: &zeroOrOneExpr{ + pos: position{line: 2843, col: 20, offset: 94036}, + expr: &choiceExpr{ + pos: position{line: 2864, col: 11, offset: 94704}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2864, col: 11, offset: 94704}, + val: "http://", + ignoreCase: false, + want: "\"http://\"", + }, + &litMatcher{ + pos: position{line: 2864, col: 23, offset: 94716}, + val: "https://", + ignoreCase: false, + want: "\"https://\"", + }, + &litMatcher{ + pos: position{line: 2864, col: 36, offset: 94729}, + val: "ftp://", + ignoreCase: false, + want: "\"ftp://\"", + }, + &litMatcher{ + pos: position{line: 2864, col: 47, offset: 94740}, + val: "irc://", + ignoreCase: false, + want: "\"irc://\"", + }, + &litMatcher{ + pos: position{line: 2864, col: 58, offset: 94751}, + 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: 2843, col: 30, offset: 94046}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 2843, col: 35, offset: 94051}, expr: &choiceExpr{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2843, col: 36, offset: 94052}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: 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: 2851, col: 13, offset: 94316}, + run: (*parser).callonRelativeLink18, + expr: &labeledExpr{ + pos: position{line: 2851, col: 13, offset: 94316}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2851, col: 22, offset: 94325}, + expr: &choiceExpr{ + pos: position{line: 2852, col: 5, offset: 94331}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2852, col: 5, offset: 94331}, + run: (*parser).callonRelativeLink22, + expr: &oneOrMoreExpr{ + pos: position{line: 2852, col: 5, offset: 94331}, + expr: &charClassMatcher{ + pos: position{line: 2852, col: 6, offset: 94332}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonRelativeLink25, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonRelativeLink27, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonRelativeLink30, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonRelativeLink34, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonRelativeLink41, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonRelativeLink46, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonRelativeLink48, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonRelativeLink52, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonRelativeLink56, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonRelativeLink63, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonRelativeLink68, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonRelativeLink70, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonRelativeLink74, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonRelativeLink78, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonRelativeLink84, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonRelativeLink86, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonRelativeLink89, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonRelativeLink91, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonRelativeLink95, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonRelativeLink101, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonRelativeLink107, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonRelativeLink112, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonRelativeLink114, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonRelativeLink117, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonRelativeLink121, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonRelativeLink128, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonRelativeLink133, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonRelativeLink135, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonRelativeLink139, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonRelativeLink143, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonRelativeLink150, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonRelativeLink155, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonRelativeLink157, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonRelativeLink161, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonRelativeLink165, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonRelativeLink171, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonRelativeLink174, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonRelativeLink178, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonRelativeLink182, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2858, col: 7, offset: 94556}, + run: (*parser).callonRelativeLink184, + expr: &litMatcher{ + pos: position{line: 2858, col: 7, offset: 94556}, + 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: 947, col: 23, offset: 29896}, + run: (*parser).callonRelativeLink186, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonRelativeLink190, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, }, }, }, @@ -20758,803 +27139,1271 @@ var g = &grammar{ }, }, }, + &labeledExpr{ + pos: position{line: 1237, col: 40, offset: 41348}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 1237, col: 58, offset: 41366}, + name: "InlineAttributes", + }, + }, }, }, }, }, { - name: "QuotedTextInDoubleQuoteItalicText", - pos: position{line: 1155, col: 1, offset: 38388}, + name: "ExternalLink", + pos: position{line: 1241, col: 1, offset: 41488}, expr: &actionExpr{ - pos: position{line: 1156, col: 5, offset: 38430}, - run: (*parser).callonQuotedTextInDoubleQuoteItalicText1, + pos: position{line: 1241, col: 17, offset: 41504}, + run: (*parser).callonExternalLink1, expr: &seqExpr{ - pos: position{line: 1156, col: 5, offset: 38430}, + pos: position{line: 1241, col: 17, offset: 41504}, 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", - }, - }, - }, - }, - }, - }, - }, - }, - { - 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: "_", - ignoreCase: false, - want: "\"_\"", - }, - }, - }, - }, - &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{}{ - &litMatcher{ - pos: position{line: 1175, col: 23, offset: 39315}, - val: "_", - ignoreCase: false, - want: "\"_\"", + pos: position{line: 1241, col: 17, offset: 41504}, + label: "url", + expr: &actionExpr{ + pos: position{line: 2847, col: 23, offset: 94178}, + run: (*parser).callonExternalLink4, + expr: &seqExpr{ + pos: position{line: 2847, col: 23, offset: 94178}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2847, col: 23, offset: 94178}, + label: "scheme", + expr: &choiceExpr{ + pos: position{line: 2864, col: 11, offset: 94704}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2864, col: 11, offset: 94704}, + val: "http://", + ignoreCase: false, + want: "\"http://\"", + }, + &litMatcher{ + pos: position{line: 2864, col: 23, offset: 94716}, + val: "https://", + ignoreCase: false, + want: "\"https://\"", + }, + &litMatcher{ + pos: position{line: 2864, col: 36, offset: 94729}, + val: "ftp://", + ignoreCase: false, + want: "\"ftp://\"", + }, + &litMatcher{ + pos: position{line: 2864, col: 47, offset: 94740}, + val: "irc://", + ignoreCase: false, + want: "\"irc://\"", + }, + &litMatcher{ + pos: position{line: 2864, col: 58, offset: 94751}, + val: "mailto:", + ignoreCase: false, + want: "\"mailto:\"", + }, + }, }, - &ruleRefExpr{ - pos: position{line: 1175, col: 27, offset: 39319}, - name: "SingleQuoteItalicTextElements", + }, + &labeledExpr{ + pos: position{line: 2847, col: 39, offset: 94194}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 2847, col: 44, offset: 94199}, + expr: &choiceExpr{ + pos: position{line: 2847, col: 45, offset: 94200}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2851, col: 13, offset: 94316}, + run: (*parser).callonExternalLink16, + expr: &labeledExpr{ + pos: position{line: 2851, col: 13, offset: 94316}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2851, col: 22, offset: 94325}, + expr: &choiceExpr{ + pos: position{line: 2852, col: 5, offset: 94331}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2852, col: 5, offset: 94331}, + run: (*parser).callonExternalLink20, + expr: &oneOrMoreExpr{ + pos: position{line: 2852, col: 5, offset: 94331}, + expr: &charClassMatcher{ + pos: position{line: 2852, col: 6, offset: 94332}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonExternalLink23, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonExternalLink25, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonExternalLink28, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonExternalLink32, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonExternalLink39, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonExternalLink44, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonExternalLink46, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonExternalLink50, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonExternalLink54, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonExternalLink61, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonExternalLink66, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonExternalLink68, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonExternalLink72, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonExternalLink76, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonExternalLink82, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonExternalLink84, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonExternalLink87, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonExternalLink89, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonExternalLink93, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonExternalLink99, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonExternalLink105, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonExternalLink110, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonExternalLink112, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonExternalLink115, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonExternalLink119, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonExternalLink126, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonExternalLink131, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonExternalLink133, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonExternalLink137, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonExternalLink141, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonExternalLink148, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonExternalLink153, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonExternalLink155, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonExternalLink159, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonExternalLink163, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonExternalLink169, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonExternalLink172, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonExternalLink176, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonExternalLink180, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2858, col: 7, offset: 94556}, + run: (*parser).callonExternalLink182, + expr: &litMatcher{ + pos: position{line: 2858, col: 7, offset: 94556}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonExternalLink184, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonExternalLink188, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + }, + }, }, }, }, }, - &litMatcher{ - pos: position{line: 1175, col: 58, offset: 39350}, - val: "_", - ignoreCase: false, - want: "\"_\"", - }, }, }, - }, - }, - }, - }, - { - 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: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSingleQuoteItalicTextElements5, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, + &labeledExpr{ + pos: position{line: 1241, col: 42, offset: 41529}, + label: "inlineAttributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1241, col: 59, offset: 41546}, + expr: &ruleRefExpr{ + pos: position{line: 1241, col: 60, offset: 41547}, + name: "InlineAttributes", }, }, }, }, - &oneOrMoreExpr{ - pos: position{line: 1179, col: 41, offset: 39612}, - expr: &ruleRefExpr{ - pos: position{line: 1179, col: 41, offset: 39612}, - name: "SingleQuoteItalicTextElement", - }, - }, }, }, }, { - name: "SingleQuoteItalicTextElement", - pos: position{line: 1181, col: 1, offset: 39643}, - expr: &choiceExpr{ - pos: position{line: 1182, col: 5, offset: 39680}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonSingleQuoteItalicTextElement2, - 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).callonSingleQuoteItalicTextElement11, - 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: 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, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "QuotedTextInSingleQuoteItalicText", - pos: position{line: 1190, col: 1, offset: 39863}, - 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", - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "EscapedItalicText", - pos: position{line: 1207, col: 1, offset: 40483}, - expr: &choiceExpr{ - pos: position{line: 1208, col: 5, offset: 40509}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1208, col: 5, offset: 40509}, - run: (*parser).callonEscapedItalicText2, - expr: &seqExpr{ - pos: position{line: 1208, col: 5, offset: 40509}, - 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: "__", - ignoreCase: false, - want: "\"__\"", - }, - }, - }, - }, - &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: "\\", - ignoreCase: false, - want: "\"\\\\\"", - }, - }, - }, - }, - &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: "_", - ignoreCase: false, - want: "\"_\"", - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1213, col: 9, offset: 41028}, - run: (*parser).callonEscapedItalicText24, - expr: &seqExpr{ - pos: position{line: 1213, col: 9, offset: 41028}, - 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: "_", - ignoreCase: false, - want: "\"_\"", - }, - &labeledExpr{ - pos: position{line: 1213, col: 48, offset: 41067}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 1213, col: 58, offset: 41077}, - name: "SingleQuoteItalicTextElements", - }, - }, - &litMatcher{ - pos: position{line: 1213, col: 89, offset: 41108}, - val: "_", - ignoreCase: false, - want: "\"_\"", - }, - }, - }, - }, - }, - }, - }, - { - name: "MonospaceText", - pos: position{line: 1220, col: 1, offset: 41318}, - expr: &choiceExpr{ - pos: position{line: 1220, col: 18, offset: 41335}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1220, col: 18, offset: 41335}, - name: "DoubleQuoteMonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1220, col: 45, offset: 41362}, - name: "SingleQuoteMonospaceText", - }, - }, - }, - }, - { - name: "DoubleQuoteMonospaceText", - pos: position{line: 1222, col: 1, offset: 41388}, - expr: &actionExpr{ - pos: position{line: 1222, col: 29, offset: 41416}, - run: (*parser).callonDoubleQuoteMonospaceText1, - expr: &seqExpr{ - pos: position{line: 1222, col: 29, offset: 41416}, - 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: "``", - 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: "\"``\"", - }, - }, - &labeledExpr{ - pos: position{line: 1229, col: 13, offset: 41757}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 1229, col: 22, offset: 41766}, + name: "ListElements", + pos: position{line: 1249, col: 1, offset: 41907}, + expr: &actionExpr{ + pos: position{line: 1250, col: 5, offset: 41928}, + run: (*parser).callonListElements1, + expr: &seqExpr{ + pos: position{line: 1250, col: 5, offset: 41928}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1250, col: 5, offset: 41928}, + label: "firstElement", + expr: &choiceExpr{ + pos: position{line: 1256, col: 5, offset: 42140}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonDoubleQuoteMonospaceTextElement7, + pos: position{line: 1385, col: 5, offset: 46170}, + run: (*parser).callonListElements5, expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, + pos: position{line: 1385, col: 5, offset: 46170}, 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: 1385, col: 5, offset: 46170}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + run: (*parser).callonListElements8, + expr: &seqExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements13, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1392, col: 12, offset: 46385}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + run: (*parser).callonListElements17, + expr: &seqExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + run: (*parser).callonListElements20, + expr: &oneOrMoreExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + expr: &litMatcher{ + pos: position{line: 1394, col: 17, offset: 46456}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1398, col: 9, offset: 46556}, + run: (*parser).callonListElements23, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + run: (*parser).callonListElements24, + expr: &seqExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + expr: &charClassMatcher{ + pos: position{line: 1417, col: 12, offset: 47274}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1417, col: 20, offset: 47282}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + run: (*parser).callonListElements29, + expr: &seqExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1419, col: 14, offset: 47400}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1419, col: 21, offset: 47407}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + run: (*parser).callonListElements33, + expr: &seqExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1421, col: 14, offset: 47528}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1421, col: 21, offset: 47535}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + run: (*parser).callonListElements37, + expr: &seqExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + expr: &charClassMatcher{ + pos: position{line: 1423, col: 14, offset: 47656}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1423, col: 26, offset: 47668}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + run: (*parser).callonListElements42, + expr: &seqExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + expr: &charClassMatcher{ + pos: position{line: 1425, col: 14, offset: 47789}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1425, col: 26, offset: 47801}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonListElements47, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + 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, + &labeledExpr{ + pos: position{line: 1386, col: 5, offset: 46209}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + run: (*parser).callonListElements51, + expr: &seqExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1325, col: 14, offset: 44379}, + run: (*parser).callonListElements54, + expr: &oneOrMoreExpr{ + pos: position{line: 1325, col: 14, offset: 44379}, + expr: &charClassMatcher{ + pos: position{line: 1325, col: 14, offset: 44379}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements62, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, }, }, @@ -21564,3034 +28413,3599 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonDoubleQuoteMonospaceTextElement16, + pos: position{line: 1435, col: 5, offset: 48067}, + run: (*parser).callonListElements64, expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, + pos: position{line: 1435, col: 5, offset: 48067}, 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: 1435, col: 5, offset: 48067}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + run: (*parser).callonListElements67, + expr: &seqExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements72, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1442, col: 12, offset: 48347}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1442, col: 20, offset: 48355}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + run: (*parser).callonListElements76, + expr: &seqExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + run: (*parser).callonListElements79, + expr: &oneOrMoreExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + expr: &litMatcher{ + pos: position{line: 1444, col: 17, offset: 48420}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1448, col: 9, offset: 48520}, + run: (*parser).callonListElements82, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1465, col: 14, offset: 49227}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1465, col: 21, offset: 49234}, + run: (*parser).callonListElements84, + expr: &litMatcher{ + pos: position{line: 1465, col: 22, offset: 49235}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonListElements86, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + 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, + &labeledExpr{ + pos: position{line: 1436, col: 5, offset: 48108}, + label: "checkstyle", + expr: &zeroOrOneExpr{ + pos: position{line: 1436, col: 16, offset: 48119}, + expr: &actionExpr{ + pos: position{line: 1472, col: 5, offset: 49396}, + run: (*parser).callonListElements91, + expr: &seqExpr{ + pos: position{line: 1472, col: 5, offset: 49396}, + exprs: []interface{}{ + &andExpr{ + pos: position{line: 1472, col: 5, offset: 49396}, + expr: &litMatcher{ + pos: position{line: 1472, col: 6, offset: 49397}, + val: "[", + ignoreCase: false, + want: "\"[\"", + }, + }, + &labeledExpr{ + pos: position{line: 1472, col: 10, offset: 49401}, + label: "style", + expr: &choiceExpr{ + pos: position{line: 1473, col: 7, offset: 49415}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1473, col: 7, offset: 49415}, + run: (*parser).callonListElements97, + expr: &litMatcher{ + pos: position{line: 1473, col: 7, offset: 49415}, + val: "[ ]", + ignoreCase: false, + want: "\"[ ]\"", + }, + }, + &actionExpr{ + pos: position{line: 1474, col: 7, offset: 49460}, + run: (*parser).callonListElements99, + expr: &litMatcher{ + pos: position{line: 1474, col: 7, offset: 49460}, + val: "[*]", + ignoreCase: false, + want: "\"[*]\"", + }, + }, + &actionExpr{ + pos: position{line: 1475, col: 7, offset: 49503}, + run: (*parser).callonListElements101, + expr: &litMatcher{ + pos: position{line: 1475, col: 7, offset: 49503}, + val: "[x]", + ignoreCase: false, + want: "\"[x]\"", + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonListElements103, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, }, }, - }, - ¬Expr{ - pos: position{line: 1231, col: 15, offset: 41830}, - 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: 1437, col: 5, offset: 48158}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + run: (*parser).callonListElements107, + expr: &seqExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1325, col: 14, offset: 44379}, + run: (*parser).callonListElements110, + expr: &oneOrMoreExpr{ + pos: position{line: 1325, col: 14, offset: 44379}, + expr: &charClassMatcher{ + pos: position{line: 1325, col: 14, offset: 44379}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements118, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, }, }, }, }, }, }, - &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, + pos: position{line: 1558, col: 5, offset: 51792}, + run: (*parser).callonListElements120, expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 1558, col: 5, offset: 51792}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, + pos: position{line: 1558, col: 5, offset: 51792}, 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, + pos: position{line: 1564, col: 5, offset: 51993}, + run: (*parser).callonListElements123, + expr: &seqExpr{ + pos: position{line: 1564, col: 5, offset: 51993}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1564, col: 5, offset: 51993}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1564, col: 9, offset: 51997}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + run: (*parser).callonListElements127, + expr: &oneOrMoreExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + expr: &charClassMatcher{ + pos: position{line: 1564, col: 14, offset: 52002}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1564, col: 62, offset: 52050}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonListElements131, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + 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: 1559, col: 5, offset: 51828}, + label: "description", + expr: &actionExpr{ + pos: position{line: 1569, col: 5, offset: 52128}, + run: (*parser).callonListElements135, + expr: &seqExpr{ + pos: position{line: 1569, col: 5, offset: 52128}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1569, col: 5, offset: 52128}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1569, col: 14, offset: 52137}, + run: (*parser).callonListElements138, + expr: &oneOrMoreExpr{ + pos: position{line: 1569, col: 14, offset: 52137}, + expr: &charClassMatcher{ + pos: position{line: 1569, col: 14, offset: 52137}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements146, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, }, }, }, }, - &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, + pos: position{line: 1484, col: 5, offset: 49696}, + run: (*parser).callonListElements148, expr: &seqExpr{ - pos: position{line: 1253, col: 7, offset: 42535}, + pos: position{line: 1484, col: 5, offset: 49696}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1253, col: 7, offset: 42535}, - val: "``", - ignoreCase: false, - want: "\"``\"", + &labeledExpr{ + pos: position{line: 1484, col: 5, offset: 49696}, + label: "term", + expr: &actionExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + run: (*parser).callonListElements151, + expr: &oneOrMoreExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + expr: &seqExpr{ + pos: position{line: 1492, col: 6, offset: 49956}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1492, col: 6, offset: 49956}, + expr: &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonListElements155, + expr: &seqExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonListElements158, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonListElements161, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1492, col: 35, offset: 49985}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements168, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1492, col: 40, offset: 49990, + }, + }, + }, + }, + }, }, - &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: 1485, col: 5, offset: 49731}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonListElements172, + expr: &seqExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonListElements175, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonListElements178, + }, + }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "QuotedTextInDoubleQuoteMonospaceText", - pos: position{line: 1240, col: 1, offset: 42075}, - expr: &actionExpr{ - pos: position{line: 1241, col: 5, offset: 42119}, - run: (*parser).callonQuotedTextInDoubleQuoteMonospaceText1, - expr: &seqExpr{ - pos: position{line: 1241, col: 5, offset: 42119}, - 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: "`", - ignoreCase: false, - want: "\"`\"", - }, - &ruleRefExpr{ - pos: position{line: 1260, col: 27, offset: 43029}, - name: "SingleQuoteMonospaceTextElements", - }, - }, - }, - }, - &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, - }, - }, - }, - }, - }, - }, - }, - }, - &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, - }, - }, - }, - }, - }, - }, - }, - }, - &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, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "QuotedTextInSingleQuoteMonospaceText", - pos: position{line: 1276, col: 1, offset: 43728}, - expr: &actionExpr{ - pos: position{line: 1277, col: 5, offset: 43772}, - run: (*parser).callonQuotedTextInSingleQuoteMonospaceText1, - expr: &seqExpr{ - pos: position{line: 1277, col: 5, offset: 43772}, - 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", - expr: &choiceExpr{ - pos: position{line: 1278, col: 11, offset: 43816}, - 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, - 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: 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, - 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).callonSingleQuotedStringElement9, - 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}, + &labeledExpr{ + pos: position{line: 1486, col: 5, offset: 49776}, + label: "description", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 1524, col: 5, offset: 50845}, alternatives: []interface{}{ - &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\"", - }, - }, - }, - }, - }, - &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: 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, - 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, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &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", - }, - }, - }, - }, - }, - &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, - 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).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\"", - }, - }, - }, - }, - }, - &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: 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: "\"#\"", + pos: position{line: 1526, col: 9, offset: 50923}, + run: (*parser).callonListElements181, + expr: &seqExpr{ + pos: position{line: 1526, col: 9, offset: 50923}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1526, col: 9, offset: 50923}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements186, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements193, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 1527, col: 9, offset: 50943}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonListElements196, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements204, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements211, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1528, col: 9, offset: 50963}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 1528, col: 17, offset: 50971}, + expr: &actionExpr{ + pos: position{line: 1310, col: 5, offset: 43944}, + run: (*parser).callonListElements215, + expr: &seqExpr{ + pos: position{line: 1310, col: 5, offset: 43944}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1310, col: 5, offset: 43944}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonListElements218, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements226, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements233, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1311, col: 5, offset: 43959}, + expr: &seqExpr{ + pos: position{line: 1343, col: 34, offset: 44869}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1343, col: 34, offset: 44869}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1343, col: 38, offset: 44873}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements241, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements246, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1312, col: 5, offset: 43994}, + expr: &actionExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + run: (*parser).callonListElements249, + expr: &seqExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements254, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1392, col: 12, offset: 46385}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + run: (*parser).callonListElements258, + expr: &seqExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + run: (*parser).callonListElements261, + expr: &oneOrMoreExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + expr: &litMatcher{ + pos: position{line: 1394, col: 17, offset: 46456}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1398, col: 9, offset: 46556}, + run: (*parser).callonListElements264, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + run: (*parser).callonListElements265, + expr: &seqExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + expr: &charClassMatcher{ + pos: position{line: 1417, col: 12, offset: 47274}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1417, col: 20, offset: 47282}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + run: (*parser).callonListElements270, + expr: &seqExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1419, col: 14, offset: 47400}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1419, col: 21, offset: 47407}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + run: (*parser).callonListElements274, + expr: &seqExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1421, col: 14, offset: 47528}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1421, col: 21, offset: 47535}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + run: (*parser).callonListElements278, + expr: &seqExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + expr: &charClassMatcher{ + pos: position{line: 1423, col: 14, offset: 47656}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1423, col: 26, offset: 47668}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + run: (*parser).callonListElements283, + expr: &seqExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + expr: &charClassMatcher{ + pos: position{line: 1425, col: 14, offset: 47789}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1425, col: 26, offset: 47801}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonListElements288, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1313, col: 5, offset: 44024}, + expr: &actionExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + run: (*parser).callonListElements292, + expr: &seqExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements297, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1442, col: 12, offset: 48347}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1442, col: 20, offset: 48355}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + run: (*parser).callonListElements301, + expr: &seqExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + run: (*parser).callonListElements304, + expr: &oneOrMoreExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + expr: &litMatcher{ + pos: position{line: 1444, col: 17, offset: 48420}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1448, col: 9, offset: 48520}, + run: (*parser).callonListElements307, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1465, col: 14, offset: 49227}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1465, col: 21, offset: 49234}, + run: (*parser).callonListElements309, + expr: &litMatcher{ + pos: position{line: 1465, col: 22, offset: 49235}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonListElements311, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1314, col: 5, offset: 44056}, + expr: &actionExpr{ + pos: position{line: 1564, col: 5, offset: 51993}, + run: (*parser).callonListElements315, + expr: &seqExpr{ + pos: position{line: 1564, col: 5, offset: 51993}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1564, col: 5, offset: 51993}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1564, col: 9, offset: 51997}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + run: (*parser).callonListElements319, + expr: &oneOrMoreExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + expr: &charClassMatcher{ + pos: position{line: 1564, col: 14, offset: 52002}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1564, col: 62, offset: 52050}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonListElements323, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1315, col: 5, offset: 44086}, + expr: &seqExpr{ + pos: position{line: 1315, col: 7, offset: 44088}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + run: (*parser).callonListElements328, + expr: &oneOrMoreExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + expr: &seqExpr{ + pos: position{line: 1492, col: 6, offset: 49956}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1492, col: 6, offset: 49956}, + expr: &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonListElements332, + expr: &seqExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonListElements335, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonListElements338, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1492, col: 35, offset: 49985}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements345, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1492, col: 40, offset: 49990, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonListElements348, + expr: &seqExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonListElements351, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonListElements354, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1316, col: 5, offset: 44144}, + expr: &actionExpr{ + pos: position{line: 527, col: 5, offset: 17165}, + run: (*parser).callonListElements356, + expr: &seqExpr{ + pos: position{line: 527, col: 5, offset: 17165}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 527, col: 5, offset: 17165}, + expr: &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 528, col: 5, offset: 17195}, + label: "delimiter", + expr: &choiceExpr{ + pos: position{line: 529, col: 9, offset: 17215}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 541, col: 26, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 541, col: 26, offset: 17536}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 541, col: 33, offset: 17543}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements367, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements374, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 543, col: 26, offset: 17580}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 543, col: 26, offset: 17580}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 543, col: 33, offset: 17587}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements381, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements388, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 545, col: 25, offset: 17623}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 545, col: 25, offset: 17623}, + val: "```", + ignoreCase: false, + want: "\"```\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 545, col: 31, offset: 17629}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements395, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements402, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 547, col: 26, offset: 17666}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 547, col: 26, offset: 17666}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 547, col: 33, offset: 17673}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements409, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements416, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 549, col: 26, offset: 17710}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 549, col: 26, offset: 17710}, + val: "....", + ignoreCase: false, + want: "\"....\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 549, col: 33, offset: 17717}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements423, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements430, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 551, col: 30, offset: 17758}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 551, col: 30, offset: 17758}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 551, col: 37, offset: 17765}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements437, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements444, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 553, col: 24, offset: 17800}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 553, col: 24, offset: 17800}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 553, col: 31, offset: 17807}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements451, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements458, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 555, col: 26, offset: 17844}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 555, col: 26, offset: 17844}, + val: "****", + ignoreCase: false, + want: "\"****\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 555, col: 33, offset: 17851}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElements465, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements472, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1317, col: 5, offset: 44164}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1317, col: 14, offset: 44173}, + run: (*parser).callonListElements475, + expr: &oneOrMoreExpr{ + pos: position{line: 1317, col: 14, offset: 44173}, + expr: &charClassMatcher{ + pos: position{line: 1317, col: 14, offset: 44173}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements483, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1536, col: 9, offset: 51194}, + run: (*parser).callonListElements485, + expr: &seqExpr{ + pos: position{line: 1536, col: 9, offset: 51194}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonListElements487, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1537, col: 9, offset: 51246}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1537, col: 18, offset: 51255}, + run: (*parser).callonListElements491, + expr: &oneOrMoreExpr{ + pos: position{line: 1537, col: 18, offset: 51255}, + expr: &charClassMatcher{ + pos: position{line: 1537, col: 18, offset: 51255}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElements499, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, }, }, - }, - &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: "\"�\"", - }, + &labeledExpr{ + pos: position{line: 1251, col: 5, offset: 41964}, + label: "otherElements", + expr: &ruleRefExpr{ + pos: position{line: 1251, col: 20, offset: 41979}, + name: "OtherListElements", }, }, }, - &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: "OtherListElements", + pos: position{line: 1261, col: 1, offset: 42239}, + expr: &actionExpr{ + pos: position{line: 1261, col: 22, offset: 42260}, + run: (*parser).callonOtherListElements1, + expr: &labeledExpr{ + pos: position{line: 1261, col: 22, offset: 42260}, + label: "otherElements", + expr: &zeroOrMoreExpr{ + pos: position{line: 1261, col: 36, offset: 42274}, + expr: &ruleRefExpr{ + pos: position{line: 1261, col: 36, offset: 42274}, + name: "OtherListElement", }, }, }, }, }, { - name: "NonSingleQuoteMarkedText", - pos: position{line: 1439, col: 1, offset: 50035}, + name: "OtherListElement", + pos: position{line: 1265, col: 1, offset: 42358}, expr: &actionExpr{ - pos: position{line: 1440, col: 5, offset: 50067}, - run: (*parser).callonNonSingleQuoteMarkedText1, + pos: position{line: 1266, col: 5, offset: 42497}, + run: (*parser).callonOtherListElement1, expr: &seqExpr{ - pos: position{line: 1440, col: 5, offset: 50067}, + pos: position{line: 1266, col: 5, offset: 42497}, 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", + ¬Expr{ + pos: position{line: 1266, col: 5, offset: 42497}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, }, &labeledExpr{ - pos: position{line: 1441, col: 5, offset: 50105}, - label: "text", + pos: position{line: 1267, col: 5, offset: 42507}, + label: "element", expr: &choiceExpr{ - pos: position{line: 1441, col: 11, offset: 50111}, + pos: position{line: 1268, col: 9, offset: 42525}, 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", + &actionExpr{ + pos: position{line: 1268, col: 13, offset: 42529}, + run: (*parser).callonOtherListElement8, + expr: &seqExpr{ + pos: position{line: 1268, col: 13, offset: 42529}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1268, col: 13, offset: 42529}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonOtherListElement11, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement19, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement26, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1269, col: 13, offset: 42553}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1385, col: 5, offset: 46170}, + run: (*parser).callonOtherListElement29, + expr: &seqExpr{ + pos: position{line: 1385, col: 5, offset: 46170}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1385, col: 5, offset: 46170}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + run: (*parser).callonOtherListElement32, + expr: &seqExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement37, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1392, col: 12, offset: 46385}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + run: (*parser).callonOtherListElement41, + expr: &seqExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + run: (*parser).callonOtherListElement44, + expr: &oneOrMoreExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + expr: &litMatcher{ + pos: position{line: 1394, col: 17, offset: 46456}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1398, col: 9, offset: 46556}, + run: (*parser).callonOtherListElement47, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + run: (*parser).callonOtherListElement48, + expr: &seqExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + expr: &charClassMatcher{ + pos: position{line: 1417, col: 12, offset: 47274}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1417, col: 20, offset: 47282}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + run: (*parser).callonOtherListElement53, + expr: &seqExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1419, col: 14, offset: 47400}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1419, col: 21, offset: 47407}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + run: (*parser).callonOtherListElement57, + expr: &seqExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1421, col: 14, offset: 47528}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1421, col: 21, offset: 47535}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + run: (*parser).callonOtherListElement61, + expr: &seqExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + expr: &charClassMatcher{ + pos: position{line: 1423, col: 14, offset: 47656}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1423, col: 26, offset: 47668}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + run: (*parser).callonOtherListElement66, + expr: &seqExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + expr: &charClassMatcher{ + pos: position{line: 1425, col: 14, offset: 47789}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1425, col: 26, offset: 47801}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement71, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1386, col: 5, offset: 46209}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + run: (*parser).callonOtherListElement75, + expr: &seqExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1325, col: 14, offset: 44379}, + run: (*parser).callonOtherListElement78, + expr: &oneOrMoreExpr{ + pos: position{line: 1325, col: 14, offset: 44379}, + expr: &charClassMatcher{ + pos: position{line: 1325, col: 14, offset: 44379}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement86, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, - &ruleRefExpr{ - pos: position{line: 1446, col: 11, offset: 50231}, - name: "SuperscriptText", + &actionExpr{ + pos: position{line: 1272, col: 13, offset: 42645}, + run: (*parser).callonOtherListElement88, + expr: &seqExpr{ + pos: position{line: 1272, col: 13, offset: 42645}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1272, col: 13, offset: 42645}, + label: "attributes", + expr: &oneOrMoreExpr{ + pos: position{line: 1272, col: 24, offset: 42656}, + expr: &ruleRefExpr{ + pos: position{line: 1272, col: 25, offset: 42657}, + name: "BlockAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1273, col: 13, offset: 42688}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1385, col: 5, offset: 46170}, + run: (*parser).callonOtherListElement94, + expr: &seqExpr{ + pos: position{line: 1385, col: 5, offset: 46170}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1385, col: 5, offset: 46170}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + run: (*parser).callonOtherListElement97, + expr: &seqExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement102, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1392, col: 12, offset: 46385}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + run: (*parser).callonOtherListElement106, + expr: &seqExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + run: (*parser).callonOtherListElement109, + expr: &oneOrMoreExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + expr: &litMatcher{ + pos: position{line: 1394, col: 17, offset: 46456}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1398, col: 9, offset: 46556}, + run: (*parser).callonOtherListElement112, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + run: (*parser).callonOtherListElement113, + expr: &seqExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + expr: &charClassMatcher{ + pos: position{line: 1417, col: 12, offset: 47274}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1417, col: 20, offset: 47282}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + run: (*parser).callonOtherListElement118, + expr: &seqExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1419, col: 14, offset: 47400}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1419, col: 21, offset: 47407}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + run: (*parser).callonOtherListElement122, + expr: &seqExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1421, col: 14, offset: 47528}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1421, col: 21, offset: 47535}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + run: (*parser).callonOtherListElement126, + expr: &seqExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + expr: &charClassMatcher{ + pos: position{line: 1423, col: 14, offset: 47656}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1423, col: 26, offset: 47668}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + run: (*parser).callonOtherListElement131, + expr: &seqExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + expr: &charClassMatcher{ + pos: position{line: 1425, col: 14, offset: 47789}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1425, col: 26, offset: 47801}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement136, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1386, col: 5, offset: 46209}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + run: (*parser).callonOtherListElement140, + expr: &seqExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1325, col: 14, offset: 44379}, + run: (*parser).callonOtherListElement143, + expr: &oneOrMoreExpr{ + pos: position{line: 1325, col: 14, offset: 44379}, + expr: &charClassMatcher{ + pos: position{line: 1325, col: 14, offset: 44379}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement151, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, - }, - }, - }, - }, - }, - }, - }, - { - 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, + &actionExpr{ + pos: position{line: 1276, col: 13, offset: 42816}, + run: (*parser).callonOtherListElement153, expr: &seqExpr{ - pos: position{line: 1045, col: 25, offset: 34151}, + pos: position{line: 1276, col: 13, offset: 42816}, 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: "\"\\\\\"", + pos: position{line: 1276, col: 13, offset: 42816}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonOtherListElement156, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement164, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement171, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, }, }, - }, - }, - }, - }, - &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: "\"+++\"", + &labeledExpr{ + pos: position{line: 1277, col: 13, offset: 42840}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1435, col: 5, offset: 48067}, + run: (*parser).callonOtherListElement174, + expr: &seqExpr{ + pos: position{line: 1435, col: 5, offset: 48067}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1435, col: 5, offset: 48067}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + run: (*parser).callonOtherListElement177, + expr: &seqExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement182, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1442, col: 12, offset: 48347}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1442, col: 20, offset: 48355}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + run: (*parser).callonOtherListElement186, + expr: &seqExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + run: (*parser).callonOtherListElement189, + expr: &oneOrMoreExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + expr: &litMatcher{ + pos: position{line: 1444, col: 17, offset: 48420}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1448, col: 9, offset: 48520}, + run: (*parser).callonOtherListElement192, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1465, col: 14, offset: 49227}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1465, col: 21, offset: 49234}, + run: (*parser).callonOtherListElement194, + expr: &litMatcher{ + pos: position{line: 1465, col: 22, offset: 49235}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement196, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1436, col: 5, offset: 48108}, + label: "checkstyle", + expr: &zeroOrOneExpr{ + pos: position{line: 1436, col: 16, offset: 48119}, + expr: &actionExpr{ + pos: position{line: 1472, col: 5, offset: 49396}, + run: (*parser).callonOtherListElement201, + expr: &seqExpr{ + pos: position{line: 1472, col: 5, offset: 49396}, + exprs: []interface{}{ + &andExpr{ + pos: position{line: 1472, col: 5, offset: 49396}, + expr: &litMatcher{ + pos: position{line: 1472, col: 6, offset: 49397}, + val: "[", + ignoreCase: false, + want: "\"[\"", + }, + }, + &labeledExpr{ + pos: position{line: 1472, col: 10, offset: 49401}, + label: "style", + expr: &choiceExpr{ + pos: position{line: 1473, col: 7, offset: 49415}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1473, col: 7, offset: 49415}, + run: (*parser).callonOtherListElement207, + expr: &litMatcher{ + pos: position{line: 1473, col: 7, offset: 49415}, + val: "[ ]", + ignoreCase: false, + want: "\"[ ]\"", + }, + }, + &actionExpr{ + pos: position{line: 1474, col: 7, offset: 49460}, + run: (*parser).callonOtherListElement209, + expr: &litMatcher{ + pos: position{line: 1474, col: 7, offset: 49460}, + val: "[*]", + ignoreCase: false, + want: "\"[*]\"", + }, + }, + &actionExpr{ + pos: position{line: 1475, col: 7, offset: 49503}, + run: (*parser).callonOtherListElement211, + expr: &litMatcher{ + pos: position{line: 1475, col: 7, offset: 49503}, + val: "[x]", + ignoreCase: false, + want: "\"[x]\"", + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement213, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1437, col: 5, offset: 48158}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + run: (*parser).callonOtherListElement217, + expr: &seqExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1325, col: 14, offset: 44379}, + run: (*parser).callonOtherListElement220, + expr: &oneOrMoreExpr{ + pos: position{line: 1325, col: 14, offset: 44379}, + expr: &charClassMatcher{ + pos: position{line: 1325, col: 14, offset: 44379}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement228, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, }, }, - &anyMatcher{ - line: 1517, col: 64, offset: 53705, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1280, col: 13, offset: 42934}, + run: (*parser).callonOtherListElement230, + expr: &seqExpr{ + pos: position{line: 1280, col: 13, offset: 42934}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1280, col: 13, offset: 42934}, + label: "attributes", + expr: &oneOrMoreExpr{ + pos: position{line: 1280, col: 24, offset: 42945}, + expr: &ruleRefExpr{ + pos: position{line: 1280, col: 25, offset: 42946}, + name: "BlockAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1281, col: 13, offset: 42977}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1435, col: 5, offset: 48067}, + run: (*parser).callonOtherListElement236, + expr: &seqExpr{ + pos: position{line: 1435, col: 5, offset: 48067}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1435, col: 5, offset: 48067}, + label: "prefix", + expr: &actionExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + run: (*parser).callonOtherListElement239, + expr: &seqExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement244, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1442, col: 12, offset: 48347}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1442, col: 20, offset: 48355}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + run: (*parser).callonOtherListElement248, + expr: &seqExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + run: (*parser).callonOtherListElement251, + expr: &oneOrMoreExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + expr: &litMatcher{ + pos: position{line: 1444, col: 17, offset: 48420}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1448, col: 9, offset: 48520}, + run: (*parser).callonOtherListElement254, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1465, col: 14, offset: 49227}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1465, col: 21, offset: 49234}, + run: (*parser).callonOtherListElement256, + expr: &litMatcher{ + pos: position{line: 1465, col: 22, offset: 49235}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement258, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1436, col: 5, offset: 48108}, + label: "checkstyle", + expr: &zeroOrOneExpr{ + pos: position{line: 1436, col: 16, offset: 48119}, + expr: &actionExpr{ + pos: position{line: 1472, col: 5, offset: 49396}, + run: (*parser).callonOtherListElement263, + expr: &seqExpr{ + pos: position{line: 1472, col: 5, offset: 49396}, + exprs: []interface{}{ + &andExpr{ + pos: position{line: 1472, col: 5, offset: 49396}, + expr: &litMatcher{ + pos: position{line: 1472, col: 6, offset: 49397}, + val: "[", + ignoreCase: false, + want: "\"[\"", + }, + }, + &labeledExpr{ + pos: position{line: 1472, col: 10, offset: 49401}, + label: "style", + expr: &choiceExpr{ + pos: position{line: 1473, col: 7, offset: 49415}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1473, col: 7, offset: 49415}, + run: (*parser).callonOtherListElement269, + expr: &litMatcher{ + pos: position{line: 1473, col: 7, offset: 49415}, + val: "[ ]", + ignoreCase: false, + want: "\"[ ]\"", + }, + }, + &actionExpr{ + pos: position{line: 1474, col: 7, offset: 49460}, + run: (*parser).callonOtherListElement271, + expr: &litMatcher{ + pos: position{line: 1474, col: 7, offset: 49460}, + val: "[*]", + ignoreCase: false, + want: "\"[*]\"", + }, + }, + &actionExpr{ + pos: position{line: 1475, col: 7, offset: 49503}, + run: (*parser).callonOtherListElement273, + expr: &litMatcher{ + pos: position{line: 1475, col: 7, offset: 49503}, + val: "[x]", + ignoreCase: false, + want: "\"[x]\"", + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement275, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1437, col: 5, offset: 48158}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + run: (*parser).callonOtherListElement279, + expr: &seqExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1325, col: 5, offset: 44370}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1325, col: 14, offset: 44379}, + run: (*parser).callonOtherListElement282, + expr: &oneOrMoreExpr{ + pos: position{line: 1325, col: 14, offset: 44379}, + expr: &charClassMatcher{ + pos: position{line: 1325, col: 14, offset: 44379}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement290, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, }, - &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: 1284, col: 13, offset: 43107}, + run: (*parser).callonOtherListElement292, + expr: &seqExpr{ + pos: position{line: 1284, col: 13, offset: 43107}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1284, col: 13, offset: 43107}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonOtherListElement295, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlinePassthrough19, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - want: "\"\\t\"", + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement303, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + 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}, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2886, col: 19, offset: 95185}, val: "\r\n", ignoreCase: 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: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement310, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, }, - ¬Expr{ - pos: position{line: 1519, col: 24, offset: 53887}, - expr: &litMatcher{ - pos: position{line: 1511, col: 32, offset: 53409}, - val: "+++", - ignoreCase: false, - want: "\"+++\"", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1285, col: 13, offset: 43131}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1558, col: 5, offset: 51792}, + run: (*parser).callonOtherListElement313, + expr: &seqExpr{ + pos: position{line: 1558, col: 5, offset: 51792}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1558, col: 5, offset: 51792}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1564, col: 5, offset: 51993}, + run: (*parser).callonOtherListElement316, + expr: &seqExpr{ + pos: position{line: 1564, col: 5, offset: 51993}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1564, col: 5, offset: 51993}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1564, col: 9, offset: 51997}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + run: (*parser).callonOtherListElement320, + expr: &oneOrMoreExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + expr: &charClassMatcher{ + pos: position{line: 1564, col: 14, offset: 52002}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1564, col: 62, offset: 52050}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement324, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1559, col: 5, offset: 51828}, + label: "description", + expr: &actionExpr{ + pos: position{line: 1569, col: 5, offset: 52128}, + run: (*parser).callonOtherListElement328, + expr: &seqExpr{ + pos: position{line: 1569, col: 5, offset: 52128}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1569, col: 5, offset: 52128}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1569, col: 14, offset: 52137}, + run: (*parser).callonOtherListElement331, + expr: &oneOrMoreExpr{ + pos: position{line: 1569, col: 14, offset: 52137}, + expr: &charClassMatcher{ + pos: position{line: 1569, col: 14, offset: 52137}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement339, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, }, - }, - &anyMatcher{ - line: 1519, col: 53, offset: 53916, }, }, }, @@ -24599,685 +32013,1881 @@ var g = &grammar{ }, }, }, - }, - &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: "\"+\"", + &actionExpr{ + pos: position{line: 1288, col: 13, offset: 43223}, + run: (*parser).callonOtherListElement341, + expr: &seqExpr{ + pos: position{line: 1288, col: 13, offset: 43223}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1288, col: 13, offset: 43223}, + label: "attributes", + expr: &oneOrMoreExpr{ + pos: position{line: 1288, col: 24, offset: 43234}, + expr: &ruleRefExpr{ + pos: position{line: 1288, col: 25, offset: 43235}, + name: "BlockAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1289, col: 13, offset: 43266}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1558, col: 5, offset: 51792}, + run: (*parser).callonOtherListElement347, + expr: &seqExpr{ + pos: position{line: 1558, col: 5, offset: 51792}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1558, col: 5, offset: 51792}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1564, col: 5, offset: 51993}, + run: (*parser).callonOtherListElement350, + expr: &seqExpr{ + pos: position{line: 1564, col: 5, offset: 51993}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1564, col: 5, offset: 51993}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1564, col: 9, offset: 51997}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + run: (*parser).callonOtherListElement354, + expr: &oneOrMoreExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + expr: &charClassMatcher{ + pos: position{line: 1564, col: 14, offset: 52002}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1564, col: 62, offset: 52050}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement358, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1559, col: 5, offset: 51828}, + label: "description", + expr: &actionExpr{ + pos: position{line: 1569, col: 5, offset: 52128}, + run: (*parser).callonOtherListElement362, + expr: &seqExpr{ + pos: position{line: 1569, col: 5, offset: 52128}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1569, col: 5, offset: 52128}, + label: "rawline", + expr: &actionExpr{ + pos: position{line: 1569, col: 14, offset: 52137}, + run: (*parser).callonOtherListElement365, + expr: &oneOrMoreExpr{ + pos: position{line: 1569, col: 14, offset: 52137}, + expr: &charClassMatcher{ + pos: position{line: 1569, col: 14, offset: 52137}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement373, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, }, }, - ¬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: "\" \"", + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1292, col: 11, offset: 43392}, + name: "ListElementContinuation", + }, + &actionExpr{ + pos: position{line: 1293, col: 13, offset: 43428}, + run: (*parser).callonOtherListElement376, + expr: &seqExpr{ + pos: position{line: 1293, col: 13, offset: 43428}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1293, col: 13, offset: 43428}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonOtherListElement379, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement387, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlinePassthrough43, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement394, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, }, }, - ¬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, + }, + }, + &labeledExpr{ + pos: position{line: 1294, col: 13, offset: 43452}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1484, col: 5, offset: 49696}, + run: (*parser).callonOtherListElement397, + expr: &seqExpr{ + pos: position{line: 1484, col: 5, offset: 49696}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1484, col: 5, offset: 49696}, + label: "term", + expr: &actionExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + run: (*parser).callonOtherListElement400, + expr: &oneOrMoreExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + expr: &seqExpr{ + pos: position{line: 1492, col: 6, offset: 49956}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1492, col: 6, offset: 49956}, + expr: &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonOtherListElement404, + expr: &seqExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonOtherListElement407, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonOtherListElement410, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1492, col: 35, offset: 49985}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement417, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1492, col: 40, offset: 49990, + }, + }, + }, + }, }, }, - }, - }, - &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}, + &labeledExpr{ + pos: position{line: 1485, col: 5, offset: 49731}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonOtherListElement421, expr: &seqExpr{ - pos: position{line: 1505, col: 86, offset: 53034}, + pos: position{line: 1497, col: 5, offset: 50087}, exprs: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 1505, col: 86, offset: 53034}, - 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: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonOtherListElement424, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", ignoreCase: false, - want: "\" \"", + want: "\":\"", }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlinePassthrough57, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonOtherListElement427, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1486, col: 5, offset: 49776}, + label: "description", + expr: &choiceExpr{ + pos: position{line: 1524, col: 5, offset: 50845}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1526, col: 9, offset: 50923}, + run: (*parser).callonOtherListElement430, + expr: &seqExpr{ + pos: position{line: 1526, col: 9, offset: 50923}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1526, col: 9, offset: 50923}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement435, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement442, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 1527, col: 9, offset: 50943}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonOtherListElement445, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement453, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement460, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1528, col: 9, offset: 50963}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 1528, col: 17, offset: 50971}, + expr: &actionExpr{ + pos: position{line: 1310, col: 5, offset: 43944}, + run: (*parser).callonOtherListElement464, + expr: &seqExpr{ + pos: position{line: 1310, col: 5, offset: 43944}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1310, col: 5, offset: 43944}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonOtherListElement467, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement475, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement482, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1311, col: 5, offset: 43959}, + expr: &seqExpr{ + pos: position{line: 1343, col: 34, offset: 44869}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1343, col: 34, offset: 44869}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1343, col: 38, offset: 44873}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement490, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement495, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1312, col: 5, offset: 43994}, + expr: &actionExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + run: (*parser).callonOtherListElement498, + expr: &seqExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement503, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1392, col: 12, offset: 46385}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + run: (*parser).callonOtherListElement507, + expr: &seqExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + run: (*parser).callonOtherListElement510, + expr: &oneOrMoreExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + expr: &litMatcher{ + pos: position{line: 1394, col: 17, offset: 46456}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1398, col: 9, offset: 46556}, + run: (*parser).callonOtherListElement513, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + run: (*parser).callonOtherListElement514, + expr: &seqExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + expr: &charClassMatcher{ + pos: position{line: 1417, col: 12, offset: 47274}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1417, col: 20, offset: 47282}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + run: (*parser).callonOtherListElement519, + expr: &seqExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1419, col: 14, offset: 47400}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1419, col: 21, offset: 47407}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + run: (*parser).callonOtherListElement523, + expr: &seqExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1421, col: 14, offset: 47528}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1421, col: 21, offset: 47535}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + run: (*parser).callonOtherListElement527, + expr: &seqExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + expr: &charClassMatcher{ + pos: position{line: 1423, col: 14, offset: 47656}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1423, col: 26, offset: 47668}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + run: (*parser).callonOtherListElement532, + expr: &seqExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + expr: &charClassMatcher{ + pos: position{line: 1425, col: 14, offset: 47789}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1425, col: 26, offset: 47801}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement537, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1313, col: 5, offset: 44024}, + expr: &actionExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + run: (*parser).callonOtherListElement541, + expr: &seqExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement546, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1442, col: 12, offset: 48347}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1442, col: 20, offset: 48355}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + run: (*parser).callonOtherListElement550, + expr: &seqExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + run: (*parser).callonOtherListElement553, + expr: &oneOrMoreExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + expr: &litMatcher{ + pos: position{line: 1444, col: 17, offset: 48420}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1448, col: 9, offset: 48520}, + run: (*parser).callonOtherListElement556, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1465, col: 14, offset: 49227}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1465, col: 21, offset: 49234}, + run: (*parser).callonOtherListElement558, + expr: &litMatcher{ + pos: position{line: 1465, col: 22, offset: 49235}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement560, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1314, col: 5, offset: 44056}, + expr: &actionExpr{ + pos: position{line: 1564, col: 5, offset: 51993}, + run: (*parser).callonOtherListElement564, + expr: &seqExpr{ + pos: position{line: 1564, col: 5, offset: 51993}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1564, col: 5, offset: 51993}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1564, col: 9, offset: 51997}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + run: (*parser).callonOtherListElement568, + expr: &oneOrMoreExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + expr: &charClassMatcher{ + pos: position{line: 1564, col: 14, offset: 52002}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1564, col: 62, offset: 52050}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement572, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1315, col: 5, offset: 44086}, + expr: &seqExpr{ + pos: position{line: 1315, col: 7, offset: 44088}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + run: (*parser).callonOtherListElement577, + expr: &oneOrMoreExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + expr: &seqExpr{ + pos: position{line: 1492, col: 6, offset: 49956}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1492, col: 6, offset: 49956}, + expr: &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonOtherListElement581, + expr: &seqExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonOtherListElement584, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonOtherListElement587, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1492, col: 35, offset: 49985}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement594, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1492, col: 40, offset: 49990, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonOtherListElement597, + expr: &seqExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonOtherListElement600, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonOtherListElement603, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1316, col: 5, offset: 44144}, + expr: &actionExpr{ + pos: position{line: 527, col: 5, offset: 17165}, + run: (*parser).callonOtherListElement605, + expr: &seqExpr{ + pos: position{line: 527, col: 5, offset: 17165}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 527, col: 5, offset: 17165}, + expr: &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 528, col: 5, offset: 17195}, + label: "delimiter", + expr: &choiceExpr{ + pos: position{line: 529, col: 9, offset: 17215}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 541, col: 26, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 541, col: 26, offset: 17536}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 541, col: 33, offset: 17543}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement616, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement623, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 543, col: 26, offset: 17580}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 543, col: 26, offset: 17580}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 543, col: 33, offset: 17587}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement630, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement637, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 545, col: 25, offset: 17623}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 545, col: 25, offset: 17623}, + val: "```", + ignoreCase: false, + want: "\"```\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 545, col: 31, offset: 17629}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement644, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement651, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 547, col: 26, offset: 17666}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 547, col: 26, offset: 17666}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 547, col: 33, offset: 17673}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement658, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement665, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 549, col: 26, offset: 17710}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 549, col: 26, offset: 17710}, + val: "....", + ignoreCase: false, + want: "\"....\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 549, col: 33, offset: 17717}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement672, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement679, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 551, col: 30, offset: 17758}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 551, col: 30, offset: 17758}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 551, col: 37, offset: 17765}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement686, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement693, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 553, col: 24, offset: 17800}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 553, col: 24, offset: 17800}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 553, col: 31, offset: 17807}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement700, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement707, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 555, col: 26, offset: 17844}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 555, col: 26, offset: 17844}, + val: "****", + ignoreCase: false, + want: "\"****\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 555, col: 33, offset: 17851}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement714, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement721, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1317, col: 5, offset: 44164}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1317, col: 14, offset: 44173}, + run: (*parser).callonOtherListElement724, + expr: &oneOrMoreExpr{ + pos: position{line: 1317, col: 14, offset: 44173}, + expr: &charClassMatcher{ + pos: position{line: 1317, col: 14, offset: 44173}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement732, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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, - }, - }, - }, - }, - &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, + &actionExpr{ + pos: position{line: 1536, col: 9, offset: 51194}, + run: (*parser).callonOtherListElement734, + expr: &seqExpr{ + pos: position{line: 1536, col: 9, offset: 51194}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement736, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1537, col: 9, offset: 51246}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1537, col: 18, offset: 51255}, + run: (*parser).callonOtherListElement740, + expr: &oneOrMoreExpr{ + pos: position{line: 1537, col: 18, offset: 51255}, + expr: &charClassMatcher{ + pos: position{line: 1537, col: 18, offset: 51255}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement748, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, }, }, }, - }, - }, - }, - &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, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", + }, + }, }, }, }, @@ -25285,300 +33895,1655 @@ var g = &grammar{ }, }, }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1544, col: 54, offset: 54859}, - label: "inlineAttributes", - expr: &ruleRefExpr{ - pos: position{line: 1544, col: 72, offset: 54877}, - name: "InlineAttributes", - }, - }, - }, - }, - }, - }, - { - 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: "RelativeLink", - pos: position{line: 1564, col: 1, offset: 55531}, - expr: &actionExpr{ - pos: position{line: 1564, col: 17, offset: 55547}, - run: (*parser).callonRelativeLink1, - expr: &seqExpr{ - pos: position{line: 1564, col: 17, offset: 55547}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1564, col: 17, offset: 55547}, - val: "link:", - ignoreCase: false, - want: "\"link:\"", - }, - &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://\"", - }, - &litMatcher{ - pos: position{line: 2257, col: 58, offset: 79692}, - val: "mailto:", - ignoreCase: false, - want: "\"mailto:\"", + &actionExpr{ + pos: position{line: 1297, col: 13, offset: 43544}, + run: (*parser).callonOtherListElement750, + expr: &seqExpr{ + pos: position{line: 1297, col: 13, offset: 43544}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1297, col: 13, offset: 43544}, + label: "attributes", + expr: &oneOrMoreExpr{ + pos: position{line: 1297, col: 24, offset: 43555}, + expr: &ruleRefExpr{ + pos: position{line: 1297, col: 25, offset: 43556}, + name: "BlockAttributes", }, }, }, - }, - }, - &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, + &labeledExpr{ + pos: position{line: 1298, col: 13, offset: 43587}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1484, col: 5, offset: 49696}, + run: (*parser).callonOtherListElement756, + expr: &seqExpr{ + pos: position{line: 1484, col: 5, offset: 49696}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1484, col: 5, offset: 49696}, + label: "term", + expr: &actionExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + run: (*parser).callonOtherListElement759, + expr: &oneOrMoreExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + expr: &seqExpr{ + pos: position{line: 1492, col: 6, offset: 49956}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1492, col: 6, offset: 49956}, + expr: &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonOtherListElement763, + expr: &seqExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonOtherListElement766, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonOtherListElement769, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1492, col: 35, offset: 49985}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement776, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1492, col: 40, offset: 49990, + }, + }, + }, + }, + }, }, - }, - }, - &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: 1485, col: 5, offset: 49731}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonOtherListElement780, + expr: &seqExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonOtherListElement783, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonOtherListElement786, + }, + }, + }, }, - &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: 1486, col: 5, offset: 49776}, + label: "description", + expr: &choiceExpr{ + pos: position{line: 1524, col: 5, offset: 50845}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1526, col: 9, offset: 50923}, + run: (*parser).callonOtherListElement789, + expr: &seqExpr{ + pos: position{line: 1526, col: 9, offset: 50923}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1526, col: 9, offset: 50923}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement794, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement801, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 1527, col: 9, offset: 50943}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonOtherListElement804, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement812, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement819, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1528, col: 9, offset: 50963}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 1528, col: 17, offset: 50971}, + expr: &actionExpr{ + pos: position{line: 1310, col: 5, offset: 43944}, + run: (*parser).callonOtherListElement823, + expr: &seqExpr{ + pos: position{line: 1310, col: 5, offset: 43944}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1310, col: 5, offset: 43944}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonOtherListElement826, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement834, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement841, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1311, col: 5, offset: 43959}, + expr: &seqExpr{ + pos: position{line: 1343, col: 34, offset: 44869}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1343, col: 34, offset: 44869}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1343, col: 38, offset: 44873}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement849, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement854, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1312, col: 5, offset: 43994}, + expr: &actionExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + run: (*parser).callonOtherListElement857, + expr: &seqExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement862, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1392, col: 12, offset: 46385}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + run: (*parser).callonOtherListElement866, + expr: &seqExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + run: (*parser).callonOtherListElement869, + expr: &oneOrMoreExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + expr: &litMatcher{ + pos: position{line: 1394, col: 17, offset: 46456}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1398, col: 9, offset: 46556}, + run: (*parser).callonOtherListElement872, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + run: (*parser).callonOtherListElement873, + expr: &seqExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + expr: &charClassMatcher{ + pos: position{line: 1417, col: 12, offset: 47274}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1417, col: 20, offset: 47282}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + run: (*parser).callonOtherListElement878, + expr: &seqExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1419, col: 14, offset: 47400}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1419, col: 21, offset: 47407}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + run: (*parser).callonOtherListElement882, + expr: &seqExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1421, col: 14, offset: 47528}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1421, col: 21, offset: 47535}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + run: (*parser).callonOtherListElement886, + expr: &seqExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + expr: &charClassMatcher{ + pos: position{line: 1423, col: 14, offset: 47656}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1423, col: 26, offset: 47668}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + run: (*parser).callonOtherListElement891, + expr: &seqExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + expr: &charClassMatcher{ + pos: position{line: 1425, col: 14, offset: 47789}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1425, col: 26, offset: 47801}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement896, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1313, col: 5, offset: 44024}, + expr: &actionExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + run: (*parser).callonOtherListElement900, + expr: &seqExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement905, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1442, col: 12, offset: 48347}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1442, col: 20, offset: 48355}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + run: (*parser).callonOtherListElement909, + expr: &seqExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + run: (*parser).callonOtherListElement912, + expr: &oneOrMoreExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + expr: &litMatcher{ + pos: position{line: 1444, col: 17, offset: 48420}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1448, col: 9, offset: 48520}, + run: (*parser).callonOtherListElement915, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1465, col: 14, offset: 49227}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1465, col: 21, offset: 49234}, + run: (*parser).callonOtherListElement917, + expr: &litMatcher{ + pos: position{line: 1465, col: 22, offset: 49235}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement919, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1314, col: 5, offset: 44056}, + expr: &actionExpr{ + pos: position{line: 1564, col: 5, offset: 51993}, + run: (*parser).callonOtherListElement923, + expr: &seqExpr{ + pos: position{line: 1564, col: 5, offset: 51993}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1564, col: 5, offset: 51993}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1564, col: 9, offset: 51997}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + run: (*parser).callonOtherListElement927, + expr: &oneOrMoreExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + expr: &charClassMatcher{ + pos: position{line: 1564, col: 14, offset: 52002}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1564, col: 62, offset: 52050}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement931, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1315, col: 5, offset: 44086}, + expr: &seqExpr{ + pos: position{line: 1315, col: 7, offset: 44088}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + run: (*parser).callonOtherListElement936, + expr: &oneOrMoreExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + expr: &seqExpr{ + pos: position{line: 1492, col: 6, offset: 49956}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1492, col: 6, offset: 49956}, + expr: &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonOtherListElement940, + expr: &seqExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonOtherListElement943, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonOtherListElement946, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1492, col: 35, offset: 49985}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement953, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1492, col: 40, offset: 49990, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonOtherListElement956, + expr: &seqExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonOtherListElement959, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonOtherListElement962, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1316, col: 5, offset: 44144}, + expr: &actionExpr{ + pos: position{line: 527, col: 5, offset: 17165}, + run: (*parser).callonOtherListElement964, + expr: &seqExpr{ + pos: position{line: 527, col: 5, offset: 17165}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 527, col: 5, offset: 17165}, + expr: &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 528, col: 5, offset: 17195}, + label: "delimiter", + expr: &choiceExpr{ + pos: position{line: 529, col: 9, offset: 17215}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 541, col: 26, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 541, col: 26, offset: 17536}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 541, col: 33, offset: 17543}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement975, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement982, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 543, col: 26, offset: 17580}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 543, col: 26, offset: 17580}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 543, col: 33, offset: 17587}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement989, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement996, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 545, col: 25, offset: 17623}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 545, col: 25, offset: 17623}, + val: "```", + ignoreCase: false, + want: "\"```\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 545, col: 31, offset: 17629}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1003, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1010, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 547, col: 26, offset: 17666}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 547, col: 26, offset: 17666}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 547, col: 33, offset: 17673}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1017, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1024, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 549, col: 26, offset: 17710}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 549, col: 26, offset: 17710}, + val: "....", + ignoreCase: false, + want: "\"....\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 549, col: 33, offset: 17717}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1031, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1038, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 551, col: 30, offset: 17758}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 551, col: 30, offset: 17758}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 551, col: 37, offset: 17765}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1045, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1052, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 553, col: 24, offset: 17800}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 553, col: 24, offset: 17800}, + val: "____", + ignoreCase: false, + want: "\"____\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 553, col: 31, offset: 17807}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1059, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1066, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 555, col: 26, offset: 17844}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 555, col: 26, offset: 17844}, + val: "****", + ignoreCase: false, + want: "\"****\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 555, col: 33, offset: 17851}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1073, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1080, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1317, col: 5, offset: 44164}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1317, col: 14, offset: 44173}, + run: (*parser).callonOtherListElement1083, + expr: &oneOrMoreExpr{ + pos: position{line: 1317, col: 14, offset: 44173}, + expr: &charClassMatcher{ + pos: position{line: 1317, col: 14, offset: 44173}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1091, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &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: 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: "\"�\"", - }, - &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, + &actionExpr{ + pos: position{line: 1536, col: 9, offset: 51194}, + run: (*parser).callonOtherListElement1093, + expr: &seqExpr{ + pos: position{line: 1536, col: 9, offset: 51194}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement1095, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1537, col: 9, offset: 51246}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1537, col: 18, offset: 51255}, + run: (*parser).callonOtherListElement1099, + expr: &oneOrMoreExpr{ + pos: position{line: 1537, col: 18, offset: 51255}, + expr: &charClassMatcher{ + pos: position{line: 1537, col: 18, offset: 51255}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1107, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, }, }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, }, }, }, @@ -25587,1255 +35552,1290 @@ var g = &grammar{ }, }, }, - }, - }, - }, - &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:\"", - }, + &actionExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + run: (*parser).callonOtherListElement1109, + expr: &seqExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2609, col: 31, offset: 86880}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2609, col: 36, offset: 86885}, + expr: &litMatcher{ + pos: position{line: 2609, col: 37, offset: 86886}, + val: "//", + ignoreCase: false, + want: "\"//\"", }, }, - }, - }, - &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: 1940, col: 32, offset: 69012}, - label: "ref", - 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, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, - }, + &labeledExpr{ + pos: position{line: 2604, col: 49, offset: 86686}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + run: (*parser).callonOtherListElement1115, + expr: &zeroOrMoreExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + expr: &charClassMatcher{ + pos: position{line: 2611, col: 29, offset: 86921}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, - }, - }, - }, - }, - }, - }, - &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}, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, 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://\"", + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, }, &litMatcher{ - pos: position{line: 2257, col: 36, offset: 79670}, - val: "ftp://", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"ftp://\"", + want: "\"\\n\"", }, &litMatcher{ - pos: position{line: 2257, col: 47, offset: 79681}, - val: "irc://", + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - want: "\"irc://\"", + want: "\"\\r\\n\"", }, - &litMatcher{ - pos: position{line: 2257, col: 58, offset: 79692}, - val: "mailto:", - ignoreCase: false, - want: "\"mailto:\"", + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1123, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, }, }, - &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: 1302, col: 13, offset: 43743}, + run: (*parser).callonOtherListElement1125, + expr: &labeledExpr{ + pos: position{line: 1302, col: 13, offset: 43743}, + label: "element", + expr: &actionExpr{ + pos: position{line: 1310, col: 5, offset: 43944}, + run: (*parser).callonOtherListElement1127, + expr: &seqExpr{ + pos: position{line: 1310, col: 5, offset: 43944}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1310, col: 5, offset: 43944}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonOtherListElement1130, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1138, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1145, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, }, }, }, - &actionExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, - run: (*parser).callonInlineImage23, + ¬Expr{ + pos: position{line: 1311, col: 5, offset: 43959}, expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 1343, col: 34, offset: 44869}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", + pos: position{line: 1343, col: 34, offset: 44869}, + val: "+", ignoreCase: false, - want: "\"�\"", + want: "\"+\"", }, - &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, - label: "ref", - 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'}, + &zeroOrMoreExpr{ + pos: position{line: 1343, col: 38, offset: 44873}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - inverted: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1153, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, }, }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1158, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - }, - &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: "\" \"", - }, - &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: 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, - 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: " ", - 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\"", + ¬Expr{ + pos: position{line: 1312, col: 5, offset: 43994}, + expr: &actionExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + run: (*parser).callonOtherListElement1161, + expr: &seqExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1392, col: 5, offset: 46378}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1166, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1392, col: 12, offset: 46385}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + run: (*parser).callonOtherListElement1170, + expr: &seqExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1394, col: 9, offset: 46448}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + run: (*parser).callonOtherListElement1173, + expr: &oneOrMoreExpr{ + pos: position{line: 1394, col: 16, offset: 46455}, + expr: &litMatcher{ + pos: position{line: 1394, col: 17, offset: 46456}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1398, col: 9, offset: 46556}, + run: (*parser).callonOtherListElement1176, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + run: (*parser).callonOtherListElement1177, + expr: &seqExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1417, col: 11, offset: 47273}, + expr: &charClassMatcher{ + pos: position{line: 1417, col: 12, offset: 47274}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1417, col: 20, offset: 47282}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + run: (*parser).callonOtherListElement1182, + expr: &seqExpr{ + pos: position{line: 1419, col: 13, offset: 47399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1419, col: 14, offset: 47400}, + val: "[a-z]", + ranges: []rune{'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1419, col: 21, offset: 47407}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + run: (*parser).callonOtherListElement1186, + expr: &seqExpr{ + pos: position{line: 1421, col: 13, offset: 47527}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1421, col: 14, offset: 47528}, + val: "[A-Z]", + ranges: []rune{'A', 'Z'}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 1421, col: 21, offset: 47535}, + val: ".", + ignoreCase: false, + want: "\".\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + run: (*parser).callonOtherListElement1190, + expr: &seqExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1423, col: 13, offset: 47655}, + expr: &charClassMatcher{ + pos: position{line: 1423, col: 14, offset: 47656}, + val: "[ivxdlcm]", + chars: []rune{'i', 'v', 'x', 'd', 'l', 'c', 'm'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1423, col: 26, offset: 47668}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + run: (*parser).callonOtherListElement1195, + expr: &seqExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1425, col: 13, offset: 47788}, + expr: &charClassMatcher{ + pos: position{line: 1425, col: 14, offset: 47789}, + val: "[IVXDLCM]", + chars: []rune{'I', 'V', 'X', 'D', 'L', 'C', 'M'}, + ignoreCase: false, + inverted: false, + }, + }, + &litMatcher{ + pos: position{line: 1425, col: 26, offset: 47801}, + val: ")", + ignoreCase: false, + want: "\")\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement1200, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + 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: 1313, col: 5, offset: 44024}, + expr: &actionExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + run: (*parser).callonOtherListElement1204, + expr: &seqExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1442, col: 5, offset: 48340}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1209, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1442, col: 12, offset: 48347}, + label: "prefix", + expr: &choiceExpr{ + pos: position{line: 1442, col: 20, offset: 48355}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + run: (*parser).callonOtherListElement1213, + expr: &seqExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1444, col: 9, offset: 48412}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + run: (*parser).callonOtherListElement1216, + expr: &oneOrMoreExpr{ + pos: position{line: 1444, col: 16, offset: 48419}, + expr: &litMatcher{ + pos: position{line: 1444, col: 17, offset: 48420}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1448, col: 9, offset: 48520}, + run: (*parser).callonOtherListElement1219, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1465, col: 14, offset: 49227}, + label: "depth", + expr: &actionExpr{ + pos: position{line: 1465, col: 21, offset: 49234}, + run: (*parser).callonOtherListElement1221, + expr: &litMatcher{ + pos: position{line: 1465, col: 22, offset: 49235}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement1223, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + 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, + pos: position{line: 1314, col: 5, offset: 44056}, + expr: &actionExpr{ + pos: position{line: 1564, col: 5, offset: 51993}, + run: (*parser).callonOtherListElement1227, + expr: &seqExpr{ + pos: position{line: 1564, col: 5, offset: 51993}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1564, col: 5, offset: 51993}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1564, col: 9, offset: 51997}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + run: (*parser).callonOtherListElement1231, + expr: &oneOrMoreExpr{ + pos: position{line: 1564, col: 14, offset: 52002}, + expr: &charClassMatcher{ + pos: position{line: 1564, col: 14, offset: 52002}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1564, col: 62, offset: 52050}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonOtherListElement1235, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + 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).callonDelimitedBlock22, + ¬Expr{ + pos: position{line: 1315, col: 5, offset: 44086}, expr: &seqExpr{ - pos: position{line: 1845, col: 27, offset: 65635}, + pos: position{line: 1315, col: 7, offset: 44088}, 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: "\"```\"", + &actionExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + run: (*parser).callonOtherListElement1240, + expr: &oneOrMoreExpr{ + pos: position{line: 1492, col: 5, offset: 49955}, + expr: &seqExpr{ + pos: position{line: 1492, col: 6, offset: 49956}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1492, col: 6, offset: 49956}, + expr: &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonOtherListElement1244, + expr: &seqExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonOtherListElement1247, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonOtherListElement1250, + }, + }, + }, }, - &zeroOrMoreExpr{ - pos: position{line: 1843, col: 35, offset: 65590}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + }, + ¬Expr{ + pos: position{line: 1492, col: 35, offset: 49985}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1257, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1492, col: 40, offset: 49990, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + run: (*parser).callonOtherListElement1260, + expr: &seqExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1497, col: 5, offset: 50087}, + label: "separator", + expr: &actionExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + run: (*parser).callonOtherListElement1263, + expr: &oneOrMoreExpr{ + pos: position{line: 1497, col: 16, offset: 50098}, + expr: &litMatcher{ + pos: position{line: 1497, col: 17, offset: 50099}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1500, col: 5, offset: 50156}, + run: (*parser).callonOtherListElement1266, + }, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1316, col: 5, offset: 44144}, + expr: &actionExpr{ + pos: position{line: 527, col: 5, offset: 17165}, + run: (*parser).callonOtherListElement1268, + expr: &seqExpr{ + pos: position{line: 527, col: 5, offset: 17165}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 527, col: 5, offset: 17165}, + expr: &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 528, col: 5, offset: 17195}, + label: "delimiter", + expr: &choiceExpr{ + pos: position{line: 529, col: 9, offset: 17215}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 541, col: 26, offset: 17536}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 541, col: 26, offset: 17536}, + val: "////", + ignoreCase: false, + want: "\"////\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 541, col: 33, offset: 17543}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1279, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1286, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 543, col: 26, offset: 17580}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 543, col: 26, offset: 17580}, + val: "====", + ignoreCase: false, + want: "\"====\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 543, col: 33, offset: 17587}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1293, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1300, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 545, col: 25, offset: 17623}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 545, col: 25, offset: 17623}, + val: "```", + ignoreCase: false, + want: "\"```\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 545, col: 31, offset: 17629}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1307, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1314, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 547, col: 26, offset: 17666}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 547, col: 26, offset: 17666}, + val: "----", + ignoreCase: false, + want: "\"----\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 547, col: 33, offset: 17673}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1321, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1328, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 549, col: 26, offset: 17710}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 549, col: 26, offset: 17710}, + val: "....", + ignoreCase: false, + want: "\"....\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 549, col: 33, offset: 17717}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1335, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1342, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 551, col: 30, offset: 17758}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 551, col: 30, offset: 17758}, + val: "++++", + ignoreCase: false, + want: "\"++++\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 551, col: 37, offset: 17765}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1349, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock31, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1356, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + 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: 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}, - 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{}{ + &seqExpr{ + pos: position{line: 553, col: 24, offset: 17800}, + 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: 553, col: 24, offset: 17800}, + 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: 553, col: 31, offset: 17807}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1363, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, }, }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - &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, - 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: " ", - 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: 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}, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock94, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1370, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + 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: 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).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{}{ + &seqExpr{ + pos: position{line: 555, col: 26, offset: 17844}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 555, col: 26, offset: 17844}, + 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: 555, col: 33, offset: 17851}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonOtherListElement1377, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1384, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, @@ -26847,117 +36847,279 @@ var g = &grammar{ }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 1860, col: 29, offset: 66216}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1860, col: 30, offset: 66217}, - exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1317, col: 5, offset: 44164}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1317, col: 14, offset: 44173}, + run: (*parser).callonOtherListElement1387, + expr: &oneOrMoreExpr{ + pos: position{line: 1317, col: 14, offset: 44173}, + expr: &charClassMatcher{ + pos: position{line: 1317, col: 14, offset: 44173}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 1860, col: 30, offset: 66217}, - val: "----", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"----\"", + want: "\"\\n\"", }, - &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).callonDelimitedBlock124, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + 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, - }, - }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonOtherListElement1395, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - ¬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, + }, + }, + }, + }, + }, + }, + }, + { + name: "ListElementContinuation", + pos: position{line: 1335, col: 1, offset: 44597}, + expr: &actionExpr{ + pos: position{line: 1336, col: 5, offset: 44629}, + run: (*parser).callonListElementContinuation1, + expr: &seqExpr{ + pos: position{line: 1336, col: 5, offset: 44629}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1336, col: 5, offset: 44629}, + label: "offset", + expr: &zeroOrMoreExpr{ + pos: position{line: 1336, col: 12, offset: 44636}, + expr: &seqExpr{ + pos: position{line: 1336, col: 13, offset: 44637}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1336, col: 13, offset: 44637}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuation9, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, }, + }, + }, + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1738, col: 29, offset: 62027}, - val: "____", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"____\"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuation14, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1343, col: 34, offset: 44869}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1343, col: 38, offset: 44873}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuation20, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuation25, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1338, col: 5, offset: 44693}, + label: "element", + expr: &zeroOrOneExpr{ + pos: position{line: 1338, col: 13, offset: 44701}, + expr: &ruleRefExpr{ + pos: position{line: 1338, col: 13, offset: 44701}, + name: "ListElementContinuationElement", + }, + }, + }, + }, + }, + }, + }, + { + name: "ListElementContinuationElement", + pos: position{line: 1345, col: 1, offset: 44889}, + expr: &actionExpr{ + pos: position{line: 1346, col: 5, offset: 44967}, + run: (*parser).callonListElementContinuationElement1, + expr: &seqExpr{ + pos: position{line: 1346, col: 5, offset: 44967}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1346, col: 5, offset: 44967}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1347, col: 5, offset: 44993}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1347, col: 16, offset: 45004}, + expr: &ruleRefExpr{ + pos: position{line: 1347, col: 17, offset: 45005}, + name: "BlockAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1348, col: 5, offset: 45027}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1349, col: 9, offset: 45045}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonListElementContinuationElement11, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, &zeroOrMoreExpr{ - pos: position{line: 1738, col: 36, offset: 62034}, + pos: position{line: 482, col: 19, offset: 15649}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock141, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement19, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -26967,169 +37129,494 @@ var g = &grammar{ }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, + pos: position{line: 2886, col: 19, offset: 95185}, val: "\r\n", ignoreCase: 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: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement26, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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: 108, col: 5, offset: 3008}, + run: (*parser).callonListElementContinuationElement28, + expr: &seqExpr{ + pos: position{line: 108, col: 5, offset: 3008}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 108, col: 5, offset: 3008}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 108, col: 9, offset: 3012}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonListElementContinuationElement32, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, + &litMatcher{ + pos: position{line: 108, col: 30, offset: 3033}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, &labeledExpr{ - pos: position{line: 1874, col: 30, offset: 66758}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1878, col: 25, offset: 66936}, + pos: position{line: 109, col: 5, offset: 3042}, + label: "value", + expr: &zeroOrOneExpr{ + pos: position{line: 109, col: 11, offset: 3048}, expr: &actionExpr{ - pos: position{line: 1878, col: 26, offset: 66937}, - run: (*parser).callonDelimitedBlock150, + pos: position{line: 123, col: 5, offset: 3500}, + run: (*parser).callonListElementContinuationElement40, expr: &seqExpr{ - pos: position{line: 1878, col: 26, offset: 66937}, + pos: position{line: 123, col: 5, offset: 3500}, 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}, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonListElementContinuationElement42, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &labeledExpr{ + pos: position{line: 123, col: 12, offset: 3507}, + label: "elements", + expr: &zeroOrMoreExpr{ + pos: position{line: 123, col: 21, offset: 3516}, + expr: &actionExpr{ + pos: position{line: 127, col: 37, offset: 3675}, + run: (*parser).callonListElementContinuationElement47, + expr: &seqExpr{ + pos: position{line: 127, col: 37, offset: 3675}, 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{ + pos: position{line: 127, col: 37, offset: 3675}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock159, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement55, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + 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, + &labeledExpr{ + pos: position{line: 128, col: 5, offset: 3685}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 129, col: 9, offset: 3703}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 129, col: 10, offset: 3704}, + run: (*parser).callonListElementContinuationElement59, + expr: &oneOrMoreExpr{ + pos: position{line: 129, col: 10, offset: 3704}, + expr: &charClassMatcher{ + pos: position{line: 129, col: 10, offset: 3704}, + val: "[^\\r\\n{]", + chars: []rune{'\r', '\n', '{'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonListElementContinuationElement62, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonListElementContinuationElement64, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonListElementContinuationElement67, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonListElementContinuationElement71, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonListElementContinuationElement78, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonListElementContinuationElement83, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonListElementContinuationElement85, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonListElementContinuationElement89, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonListElementContinuationElement93, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonListElementContinuationElement100, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonListElementContinuationElement105, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonListElementContinuationElement107, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonListElementContinuationElement111, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonListElementContinuationElement115, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 133, col: 12, offset: 3832}, + run: (*parser).callonListElementContinuationElement121, + expr: &litMatcher{ + pos: position{line: 133, col: 12, offset: 3832}, + 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: 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}, - 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, }, }, }, @@ -27144,71 +37631,34 @@ var g = &grammar{ }, }, &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, + pos: position{line: 2893, col: 8, offset: 95335}, 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}, + pos: position{line: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement128, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -27216,42 +37666,74 @@ var g = &grammar{ }, }, }, - &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: 140, col: 19, offset: 3987}, + run: (*parser).callonListElementContinuationElement130, expr: &seqExpr{ - pos: position{line: 1885, col: 21, offset: 67225}, + pos: position{line: 140, col: 19, offset: 3987}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1891, col: 35, offset: 67502}, - val: "++++", + pos: position{line: 140, col: 19, offset: 3987}, + val: ":!", ignoreCase: false, - want: "\"++++\"", + want: "\":!\"", + }, + &labeledExpr{ + pos: position{line: 140, col: 24, offset: 3992}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonListElementContinuationElement134, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 140, col: 45, offset: 4013}, + val: ":", + ignoreCase: false, + want: "\":\"", }, &zeroOrMoreExpr{ - pos: position{line: 1891, col: 42, offset: 67509}, + pos: position{line: 140, col: 49, offset: 4017}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock206, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement143, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -27261,283 +37743,253 @@ var g = &grammar{ }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement150, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - &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, - }, - }, - }, - }, - }, - }, - ¬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).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}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 142, col: 5, offset: 4084}, + run: (*parser).callonListElementContinuationElement152, + expr: &seqExpr{ + pos: position{line: 142, col: 5, offset: 4084}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 142, col: 5, offset: 4084}, + val: ":", + ignoreCase: false, + want: "\":\"", }, - &choiceExpr{ - pos: position{line: 1893, col: 33, offset: 67553}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1893, col: 34, offset: 67554}, + &labeledExpr{ + pos: position{line: 142, col: 9, offset: 4088}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonListElementContinuationElement156, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1893, col: 34, offset: 67554}, - val: "++++", + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"++++\"", + inverted: false, }, &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).callonDelimitedBlock254, - 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, + }, + }, + &litMatcher{ + pos: position{line: 142, col: 30, offset: 4109}, + val: "!:", + ignoreCase: false, + want: "\"!:\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 142, col: 35, offset: 4114}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement165, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2890, col: 9, offset: 95286, }, }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement172, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1352, col: 11, offset: 45121}, + name: "DelimitedBlock", + }, + &actionExpr{ + pos: position{line: 2755, col: 18, offset: 91083}, + run: (*parser).callonListElementContinuationElement175, + expr: &seqExpr{ + pos: position{line: 2755, col: 18, offset: 91083}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2755, col: 19, offset: 91084}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2755, col: 19, offset: 91084}, + val: "***", + ignoreCase: false, + want: "\"***\"", + }, + &litMatcher{ + pos: position{line: 2755, col: 27, offset: 91092}, + val: "* * *", + ignoreCase: false, + want: "\"* * *\"", + }, + &litMatcher{ + pos: position{line: 2755, col: 37, offset: 91102}, + val: "---", + ignoreCase: false, + want: "\"---\"", + }, + &litMatcher{ + pos: position{line: 2755, col: 45, offset: 91110}, + val: "- - -", + ignoreCase: false, + want: "\"- - -\"", + }, + &litMatcher{ + pos: position{line: 2755, col: 55, offset: 91120}, + val: "___", + ignoreCase: false, + want: "\"___\"", + }, + &litMatcher{ + pos: position{line: 2755, col: 63, offset: 91128}, + val: "_ _ _", + ignoreCase: false, + want: "\"_ _ _\"", + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, }, }, }, + &ruleRefExpr{ + pos: position{line: 1354, col: 11, offset: 45207}, + name: "ListElements", + }, + &ruleRefExpr{ + pos: position{line: 1355, col: 11, offset: 45230}, + name: "ImageBlock", + }, + &ruleRefExpr{ + pos: position{line: 1356, col: 11, offset: 45251}, + name: "FileInclusion", + }, &actionExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, - run: (*parser).callonDelimitedBlock263, + pos: position{line: 2654, col: 5, offset: 88215}, + run: (*parser).callonListElementContinuationElement189, expr: &seqExpr{ - pos: position{line: 1908, col: 17, offset: 68045}, + pos: position{line: 2654, col: 5, offset: 88215}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1904, col: 31, offset: 67955}, - val: "////", + pos: position{line: 2661, col: 19, offset: 88391}, + val: "|===", ignoreCase: false, - want: "\"////\"", + want: "\"|===\"", }, &zeroOrMoreExpr{ - pos: position{line: 1904, col: 38, offset: 67962}, + pos: position{line: 2661, col: 26, offset: 88398}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock269, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement195, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -27547,70 +37999,82 @@ var g = &grammar{ }, }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement202, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, &labeledExpr{ - pos: position{line: 1908, col: 44, offset: 68072}, - label: "content", - expr: &zeroOrMoreExpr{ - pos: position{line: 1912, col: 27, offset: 68225}, + pos: position{line: 2655, col: 5, offset: 88239}, + label: "header", + expr: &zeroOrOneExpr{ + pos: position{line: 2655, col: 12, offset: 88246}, expr: &actionExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, - run: (*parser).callonDelimitedBlock278, + pos: position{line: 2669, col: 5, offset: 88558}, + run: (*parser).callonListElementContinuationElement206, expr: &seqExpr{ - pos: position{line: 1912, col: 28, offset: 68226}, + pos: position{line: 2669, col: 5, offset: 88558}, 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}, + &labeledExpr{ + pos: position{line: 2669, col: 5, offset: 88558}, + label: "cells", + expr: &oneOrMoreExpr{ + pos: position{line: 2669, col: 11, offset: 88564}, + expr: &actionExpr{ + pos: position{line: 2675, col: 5, offset: 88681}, + run: (*parser).callonListElementContinuationElement210, + expr: &seqExpr{ + pos: position{line: 2675, col: 5, offset: 88681}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", + pos: position{line: 2675, col: 5, offset: 88681}, + val: "|", ignoreCase: false, - want: "\"////\"", + want: "\"|\"", }, &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, + pos: position{line: 2675, col: 9, offset: 88685}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonDelimitedBlock287, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement216, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", @@ -27619,608 +38083,145 @@ 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, - }, - }, - }, - }, - }, - }, - ¬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, - }, - }, - }, - &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'}, - 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: 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).callonDelimitedBlock317, - 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: "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: "\" \"", - }, - &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, - }, - }, - }, - }, - }, - }, - }, - }, - &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, - }, - }, - }, - }, - }, + &labeledExpr{ + pos: position{line: 2676, col: 5, offset: 88697}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 2676, col: 14, offset: 88706}, + expr: &actionExpr{ + pos: position{line: 2708, col: 5, offset: 89494}, + run: (*parser).callonListElementContinuationElement220, + expr: &labeledExpr{ + pos: position{line: 2708, col: 5, offset: 89494}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2708, col: 14, offset: 89503}, + run: (*parser).callonListElementContinuationElement222, + expr: &oneOrMoreExpr{ + pos: position{line: 2708, col: 14, offset: 89503}, + expr: &charClassMatcher{ + pos: position{line: 2708, col: 14, offset: 89503}, + val: "[^\\r\\n|]", + chars: []rune{'\r', '\n', '|'}, + ignoreCase: false, + inverted: true, }, }, }, }, }, }, - &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\"", + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement230, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2670, col: 5, offset: 88586}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonListElementContinuationElement233, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement241, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement248, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, @@ -28229,994 +38230,868 @@ var g = &grammar{ }, }, }, - &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: "////", - 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).callonExampleBlockRawContent76, - 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: 2656, col: 5, offset: 88265}, + label: "rows", + expr: &zeroOrMoreExpr{ + pos: position{line: 2656, col: 10, offset: 88270}, + expr: &choiceExpr{ + pos: position{line: 2680, col: 13, offset: 88803}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2690, col: 5, offset: 89022}, + run: (*parser).callonListElementContinuationElement253, + expr: &seqExpr{ + pos: position{line: 2690, col: 5, offset: 89022}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2690, col: 5, offset: 89022}, + expr: &choiceExpr{ + pos: position{line: 2665, col: 22, offset: 88471}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2661, col: 19, offset: 88391}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2661, col: 19, offset: 88391}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2661, col: 26, offset: 88398}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2878, col: 10, offset: 95044}, + 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement262, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, - }, - }, - &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}, - 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: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement269, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, }, }, }, - &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}, - 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).callonExampleBlockRawContent106, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 2691, col: 5, offset: 89045}, + label: "cells", + expr: &oneOrMoreExpr{ + pos: position{line: 2691, col: 11, offset: 89051}, + expr: &actionExpr{ + pos: position{line: 2691, col: 12, offset: 89052}, + run: (*parser).callonListElementContinuationElement275, + expr: &seqExpr{ + pos: position{line: 2691, col: 12, offset: 89052}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2691, col: 12, offset: 89052}, + label: "cell", + expr: &actionExpr{ + pos: position{line: 2700, col: 5, offset: 89293}, + run: (*parser).callonListElementContinuationElement278, + expr: &seqExpr{ + pos: position{line: 2700, col: 5, offset: 89293}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2700, col: 5, offset: 89293}, + expr: &choiceExpr{ + pos: position{line: 2665, col: 22, offset: 88471}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2661, col: 19, offset: 88391}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2661, col: 19, offset: 88391}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2661, col: 26, offset: 88398}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement287, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement294, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, }, }, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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).callonExampleBlockRawContent118, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + ¬Expr{ + pos: position{line: 2701, col: 5, offset: 89316}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonListElementContinuationElement299, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement307, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement314, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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, - }, - }, + &litMatcher{ + pos: position{line: 2702, col: 5, offset: 89331}, + 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).callonExampleBlockRawContent130, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &zeroOrMoreExpr{ + pos: position{line: 2702, col: 9, offset: 89335}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - want: "\"\\t\"", + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement320, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + 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: 2702, col: 16, offset: 89342}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 2702, col: 25, offset: 89351}, + expr: &actionExpr{ + pos: position{line: 2708, col: 5, offset: 89494}, + run: (*parser).callonListElementContinuationElement324, + expr: &labeledExpr{ + pos: position{line: 2708, col: 5, offset: 89494}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2708, col: 14, offset: 89503}, + run: (*parser).callonListElementContinuationElement326, + expr: &oneOrMoreExpr{ + pos: position{line: 2708, col: 14, offset: 89503}, + expr: &charClassMatcher{ + pos: position{line: 2708, col: 14, offset: 89503}, + 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: "\"////\"", + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, - &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\"", - }, - }, - }, - }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement334, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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, - }, - }, - }, + }, + }, + }, + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2694, col: 6, offset: 89114}, + alternatives: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2694, col: 6, offset: 89114}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonListElementContinuationElement338, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, }, - &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\"", - }, - }, - }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + 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'}, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement346, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\t\"", }, }, }, }, }, - &seqExpr{ - pos: position{line: 1788, col: 26, offset: 63733}, - exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 1788, col: 26, offset: 63733}, - val: "****", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"****\"", + want: "\"\\n\"", }, - &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\"", - }, - }, - }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement353, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 2694, col: 19, offset: 89127}, + expr: &choiceExpr{ + pos: position{line: 2665, col: 22, offset: 88471}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2661, col: 19, offset: 88391}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2661, col: 19, offset: 88391}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2661, col: 26, offset: 88398}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2878, col: 10, offset: 95044}, + 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement362, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, - }, - &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\"", - }, - }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement369, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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\"", }, }, }, }, }, }, - }, - }, - &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}, - 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}, + pos: position{line: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2890, col: 9, offset: 95286, }, }, }, }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonExampleBlockRawContent194, - }, }, }, }, }, }, }, - }, - }, - }, - }, - &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, - }, - }, - }, - &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", - 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, - }, - }, - }, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1692, col: 15, offset: 60380}, - name: "ImageBlock", - }, - &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, - }, - }, - }, - }, - }, - }, - }, - &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: " ", - 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, - }, - }, - }, - }, - &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: "```", - 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: 2683, col: 5, offset: 88870}, + run: (*parser).callonListElementContinuationElement373, + expr: &seqExpr{ + pos: position{line: 2683, col: 5, offset: 88870}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2683, col: 5, offset: 88870}, + expr: &choiceExpr{ + pos: position{line: 2665, col: 22, offset: 88471}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2661, col: 19, offset: 88391}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2661, col: 19, offset: 88391}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2661, col: 26, offset: 88398}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement382, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", 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\"", - }, + 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\"", + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement389, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", ignoreCase: false, - inverted: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2684, col: 5, offset: 88893}, + label: "cells", + expr: &oneOrMoreExpr{ + pos: position{line: 2684, col: 11, offset: 88899}, + expr: &actionExpr{ + pos: position{line: 2700, col: 5, offset: 89293}, + run: (*parser).callonListElementContinuationElement395, + expr: &seqExpr{ + pos: position{line: 2700, col: 5, offset: 89293}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2700, col: 5, offset: 89293}, + expr: &choiceExpr{ + pos: position{line: 2665, col: 22, offset: 88471}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2661, col: 19, offset: 88391}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2661, col: 19, offset: 88391}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2661, col: 26, offset: 88398}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement404, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement411, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2701, col: 5, offset: 89316}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonListElementContinuationElement416, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement424, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement431, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, }, }, }, }, - }, - ¬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).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, - }, - }, + &litMatcher{ + pos: position{line: 2702, col: 5, offset: 89331}, + 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).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'}, + &zeroOrMoreExpr{ + pos: position{line: 2702, col: 9, offset: 89335}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - inverted: true, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement437, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + 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: 2702, col: 16, offset: 89342}, + label: "content", + expr: &zeroOrOneExpr{ + pos: position{line: 2702, col: 25, offset: 89351}, + expr: &actionExpr{ + pos: position{line: 2708, col: 5, offset: 89494}, + run: (*parser).callonListElementContinuationElement441, + expr: &labeledExpr{ + pos: position{line: 2708, col: 5, offset: 89494}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2708, col: 14, offset: 89503}, + run: (*parser).callonListElementContinuationElement443, + expr: &oneOrMoreExpr{ + pos: position{line: 2708, col: 14, offset: 89503}, + expr: &charClassMatcher{ + pos: position{line: 2708, col: 14, offset: 89503}, + val: "[^\\r\\n|]", + chars: []rune{'\r', '\n', '|'}, + ignoreCase: false, + inverted: true, + }, + }, + }, }, }, }, @@ -29226,284 +39101,109 @@ 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).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}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement451, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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: 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: " ", - 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, - }, - }, - }, - }, - &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: "----", - ignoreCase: false, - want: "\"----\"", + &zeroOrMoreExpr{ + pos: position{line: 2685, col: 5, offset: 88920}, + expr: &actionExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + run: (*parser).callonListElementContinuationElement454, + expr: &seqExpr{ + pos: position{line: 482, col: 14, offset: 15644}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 482, col: 14, offset: 15644}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, - &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\"", - }, - }, - }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 482, col: 19, offset: 15649}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + 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'}, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement462, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"\\t\"", }, }, }, }, }, - ¬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).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}, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2890, col: 9, offset: 95286, }, }, - }, - &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, - }, - }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + 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'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement469, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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\"", }, }, }, @@ -29516,284 +39216,519 @@ var g = &grammar{ }, }, }, - &choiceExpr{ - pos: position{line: 1860, col: 29, offset: 66216}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1860, col: 30, offset: 66217}, - exprs: []interface{}{ + }, + }, + }, + &choiceExpr{ + pos: position{line: 2665, col: 22, offset: 88471}, + alternatives: []interface{}{ + &seqExpr{ + pos: position{line: 2661, col: 19, offset: 88391}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2661, col: 19, offset: 88391}, + val: "|===", + ignoreCase: false, + want: "\"|===\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 2661, col: 26, offset: 88398}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1860, col: 30, offset: 66217}, - val: "----", + pos: position{line: 2878, col: 10, offset: 95044}, + 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\"", - }, - }, - }, - }, + 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement477, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement484, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, }, }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, - &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, + }, + }, + }, + &actionExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + run: (*parser).callonListElementContinuationElement488, + expr: &seqExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2609, col: 31, offset: 86880}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2609, col: 36, offset: 86885}, + expr: &litMatcher{ + pos: position{line: 2609, col: 37, offset: 86886}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + }, + &labeledExpr{ + pos: position{line: 2604, col: 49, offset: 86686}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + run: (*parser).callonListElementContinuationElement494, + expr: &zeroOrMoreExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + expr: &charClassMatcher{ + pos: position{line: 2611, col: 29, offset: 86921}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, - &litMatcher{ - pos: position{line: 1738, col: 29, offset: 62027}, - val: "____", + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement502, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", ignoreCase: false, - want: "\"____\"", + want: "\"\\r\"", }, - &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: 1593, col: 5, offset: 52905}, + run: (*parser).callonListElementContinuationElement504, + expr: &seqExpr{ + pos: position{line: 1593, col: 5, offset: 52905}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1593, col: 5, offset: 52905}, + label: "kind", + expr: &choiceExpr{ + pos: position{line: 92, col: 19, offset: 2545}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 92, col: 19, offset: 2545}, + run: (*parser).callonListElementContinuationElement508, + expr: &litMatcher{ + pos: position{line: 92, col: 19, offset: 2545}, + val: "TIP", + ignoreCase: false, + want: "\"TIP\"", + }, + }, + &actionExpr{ + pos: position{line: 94, col: 5, offset: 2583}, + run: (*parser).callonListElementContinuationElement510, + expr: &litMatcher{ + pos: position{line: 94, col: 5, offset: 2583}, + val: "NOTE", + ignoreCase: false, + want: "\"NOTE\"", + }, + }, + &actionExpr{ + pos: position{line: 96, col: 5, offset: 2623}, + run: (*parser).callonListElementContinuationElement512, + expr: &litMatcher{ + pos: position{line: 96, col: 5, offset: 2623}, + val: "IMPORTANT", + ignoreCase: false, + want: "\"IMPORTANT\"", + }, + }, + &actionExpr{ + pos: position{line: 98, col: 5, offset: 2673}, + run: (*parser).callonListElementContinuationElement514, + expr: &litMatcher{ + pos: position{line: 98, col: 5, offset: 2673}, + val: "WARNING", + ignoreCase: false, + want: "\"WARNING\"", + }, + }, + &actionExpr{ + pos: position{line: 100, col: 5, offset: 2719}, + run: (*parser).callonListElementContinuationElement516, + expr: &litMatcher{ + pos: position{line: 100, col: 5, offset: 2719}, + val: "CAUTION", + ignoreCase: false, + want: "\"CAUTION\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1593, col: 27, offset: 52927}, + val: ": ", + ignoreCase: false, + want: "\": \"", + }, + &labeledExpr{ + pos: position{line: 1594, col: 5, offset: 52937}, + label: "firstLine", + expr: &actionExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + run: (*parser).callonListElementContinuationElement520, + expr: &seqExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + run: (*parser).callonListElementContinuationElement523, + expr: &oneOrMoreExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + expr: &charClassMatcher{ + pos: position{line: 1605, col: 14, offset: 53290}, + 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: 1608, col: 5, offset: 53347}, + run: (*parser).callonListElementContinuationElement526, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement532, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, }, - &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).callonExampleBlockRawContent370, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1595, col: 5, offset: 52971}, + label: "otherLines", + expr: &zeroOrMoreExpr{ + pos: position{line: 1595, col: 16, offset: 52982}, + expr: &actionExpr{ + pos: position{line: 1596, col: 9, offset: 52992}, + run: (*parser).callonListElementContinuationElement536, + expr: &seqExpr{ + pos: position{line: 1596, col: 9, offset: 52992}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1596, col: 9, offset: 52992}, expr: &seqExpr{ - pos: position{line: 1878, col: 26, offset: 66937}, + pos: position{line: 1343, col: 34, offset: 44869}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1878, col: 26, offset: 66937}, + &litMatcher{ + pos: position{line: 1343, col: 34, offset: 44869}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1343, col: 38, offset: 44873}, expr: &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1740, col: 28, offset: 62098}, - exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonListElementContinuationElement544, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement549, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1597, col: 9, offset: 53031}, + label: "line", + expr: &choiceExpr{ + pos: position{line: 1597, col: 15, offset: 53037}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + run: (*parser).callonListElementContinuationElement553, + expr: &seqExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2609, col: 31, offset: 86880}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2609, col: 36, offset: 86885}, + expr: &litMatcher{ + pos: position{line: 2609, col: 37, offset: 86886}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + }, + &labeledExpr{ + pos: position{line: 2604, col: 49, offset: 86686}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + run: (*parser).callonListElementContinuationElement559, + expr: &zeroOrMoreExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + expr: &charClassMatcher{ + pos: position{line: 2611, col: 29, offset: 86921}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 1740, col: 28, offset: 62098}, - val: "____", + pos: position{line: 2886, col: 12, offset: 95178}, + 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).callonExampleBlockRawContent379, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + 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, - }, - }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement567, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - ¬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, + &actionExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + run: (*parser).callonListElementContinuationElement569, + expr: &seqExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + run: (*parser).callonListElementContinuationElement572, + expr: &oneOrMoreExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + expr: &charClassMatcher{ + pos: position{line: 1605, col: 14, offset: 53290}, + 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).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, - }, + }, + &andCodeExpr{ + pos: position{line: 1608, col: 5, offset: 53347}, + run: (*parser).callonListElementContinuationElement575, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement581, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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\"", }, }, }, @@ -29806,411 +39741,181 @@ 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: " ", + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1616, col: 5, offset: 53511}, + run: (*parser).callonListElementContinuationElement583, + expr: &seqExpr{ + pos: position{line: 1616, col: 5, offset: 53511}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1616, col: 5, offset: 53511}, + label: "firstLine", + expr: &actionExpr{ + pos: position{line: 1623, col: 5, offset: 53796}, + run: (*parser).callonListElementContinuationElement586, + expr: &seqExpr{ + pos: position{line: 1623, col: 5, offset: 53796}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1623, col: 5, offset: 53796}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1623, col: 14, offset: 53805}, + run: (*parser).callonListElementContinuationElement589, + expr: &seqExpr{ + pos: position{line: 1623, col: 14, offset: 53805}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonListElementContinuationElement591, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, 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\"", - }, + 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]", + &oneOrMoreExpr{ + pos: position{line: 1623, col: 21, offset: 53812}, + expr: &charClassMatcher{ + pos: position{line: 1623, col: 21, offset: 53812}, + val: "[^\\r\\n]", chars: []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, - }, - }, }, - }, - }, - }, - }, - &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\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 1626, col: 5, offset: 53869}, + run: (*parser).callonListElementContinuationElement596, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, - }, - }, - }, - &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'}, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\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, + want: "\"\\n\"", }, - }, - }, - }, - }, - }, - }, - &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: " ", + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - want: "\" \"", + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent451, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement602, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + 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, - }, - }, - }, - }, - &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}, - 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).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}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 1617, col: 5, offset: 53552}, + label: "otherLines", + expr: &zeroOrMoreExpr{ + pos: position{line: 1617, col: 16, offset: 53563}, + expr: &choiceExpr{ + pos: position{line: 1617, col: 17, offset: 53564}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + run: (*parser).callonListElementContinuationElement607, + expr: &seqExpr{ + pos: position{line: 2604, col: 22, offset: 86659}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2609, col: 31, offset: 86880}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + ¬Expr{ + pos: position{line: 2609, col: 36, offset: 86885}, + expr: &litMatcher{ + pos: position{line: 2609, col: 37, offset: 86886}, + val: "//", + ignoreCase: false, + want: "\"//\"", + }, + }, + &labeledExpr{ + pos: position{line: 2604, col: 49, offset: 86686}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + run: (*parser).callonListElementContinuationElement613, + expr: &zeroOrMoreExpr{ + pos: position{line: 2611, col: 29, offset: 86921}, + expr: &charClassMatcher{ + pos: position{line: 2611, col: 29, offset: 86921}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, - &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, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement621, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -30218,861 +39923,851 @@ var g = &grammar{ }, }, }, - }, - &choiceExpr{ - pos: position{line: 1893, col: 33, offset: 67553}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1893, col: 34, offset: 67554}, + &actionExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + run: (*parser).callonListElementContinuationElement623, + expr: &seqExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, 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: " ", + &labeledExpr{ + pos: position{line: 1605, col: 5, offset: 53281}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + run: (*parser).callonListElementContinuationElement626, + expr: &oneOrMoreExpr{ + pos: position{line: 1605, col: 14, offset: 53290}, + expr: &charClassMatcher{ + pos: position{line: 1605, col: 14, offset: 53290}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, 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\"", - }, + inverted: true, }, }, }, }, + &andCodeExpr{ + pos: position{line: 1608, col: 5, offset: 53347}, + run: (*parser).callonListElementContinuationElement629, + }, &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + pos: position{line: 2893, col: 8, offset: 95335}, alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - inverted: false, + want: "\"\\r\\n\"", }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement635, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, }, }, - ¬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: "////", + }, + }, + }, + &actionExpr{ + pos: position{line: 1374, col: 5, offset: 45885}, + run: (*parser).callonListElementContinuationElement637, + expr: &seqExpr{ + pos: position{line: 1374, col: 5, offset: 45885}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1374, col: 5, offset: 45885}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1374, col: 14, offset: 45894}, + run: (*parser).callonListElementContinuationElement640, + expr: &oneOrMoreExpr{ + pos: position{line: 1374, col: 14, offset: 45894}, + expr: &charClassMatcher{ + pos: position{line: 1374, col: 14, offset: 45894}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, ignoreCase: false, - want: "\"////\"", + inverted: true, }, - &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: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonListElementContinuationElement648, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, - &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: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonExampleBlockRawContent533, - 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).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'}, - 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: "Callout", + pos: position{line: 1548, col: 1, offset: 51488}, + expr: &actionExpr{ + pos: position{line: 1550, col: 5, offset: 51566}, + run: (*parser).callonCallout1, + expr: &seqExpr{ + pos: position{line: 1550, col: 5, offset: 51566}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 1550, col: 5, offset: 51566}, + run: (*parser).callonCallout3, + }, + &litMatcher{ + pos: position{line: 1553, col: 5, offset: 51628}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + &labeledExpr{ + pos: position{line: 1553, col: 9, offset: 51632}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 1553, col: 14, offset: 51637}, + run: (*parser).callonCallout6, + expr: &oneOrMoreExpr{ + pos: position{line: 1553, col: 14, offset: 51637}, + expr: &charClassMatcher{ + pos: position{line: 1553, col: 14, offset: 51637}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1553, col: 62, offset: 51685}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1553, col: 66, offset: 51689}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonCallout13, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 1553, col: 73, offset: 51696}, + expr: &choiceExpr{ + pos: position{line: 1553, col: 75, offset: 51698}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonCallout21, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + &ruleRefExpr{ + pos: position{line: 1553, col: 81, offset: 51704}, + name: "Callout", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedText", + pos: position{line: 1636, col: 1, offset: 54331}, + expr: &choiceExpr{ + pos: position{line: 1637, col: 5, offset: 54350}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1638, col: 9, offset: 54360}, + run: (*parser).callonQuotedText2, + expr: &seqExpr{ + pos: position{line: 1638, col: 9, offset: 54360}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1638, col: 9, offset: 54360}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1638, col: 20, offset: 54371}, + expr: &ruleRefExpr{ + pos: position{line: 1638, col: 21, offset: 54372}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1639, col: 9, offset: 54498}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 1639, col: 15, offset: 54504}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1639, col: 15, offset: 54504}, + name: "UnconstrainedQuotedText", + }, + &ruleRefExpr{ + pos: position{line: 1639, col: 41, offset: 54530}, + name: "ConstrainedQuotedText", + }, + }, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1643, col: 7, offset: 54649}, + name: "EscapedQuotedText", + }, + }, + }, + }, + { + name: "ConstrainedQuotedText", + pos: position{line: 1649, col: 1, offset: 54840}, + expr: &choiceExpr{ + pos: position{line: 1650, col: 5, offset: 54870}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1650, col: 5, offset: 54870}, + name: "SingleQuoteBoldText", + }, + &ruleRefExpr{ + pos: position{line: 1651, col: 7, offset: 54897}, + name: "SingleQuoteItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1652, col: 7, offset: 54925}, + name: "SingleQuoteMarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1653, col: 7, offset: 54953}, + name: "SingleQuoteMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1654, col: 7, offset: 54985}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1655, col: 7, offset: 55006}, + name: "SuperscriptText", + }, + }, + }, + }, + { + name: "UnconstrainedQuotedText", + pos: position{line: 1657, col: 1, offset: 55024}, + expr: &choiceExpr{ + pos: position{line: 1658, col: 5, offset: 55056}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1658, col: 5, offset: 55056}, + name: "DoubleQuoteBoldText", + }, + &ruleRefExpr{ + pos: position{line: 1659, col: 7, offset: 55082}, + name: "DoubleQuoteItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1660, col: 7, offset: 55110}, + name: "DoubleQuoteMarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1661, col: 7, offset: 55138}, + name: "DoubleQuoteMonospaceText", + }, + }, + }, + }, + { + name: "EscapedQuotedText", + pos: position{line: 1663, col: 1, offset: 55164}, + expr: &actionExpr{ + pos: position{line: 1664, col: 5, offset: 55245}, + run: (*parser).callonEscapedQuotedText1, + expr: &seqExpr{ + pos: position{line: 1664, col: 5, offset: 55245}, + exprs: []interface{}{ + &andExpr{ + pos: position{line: 1664, col: 5, offset: 55245}, + expr: &litMatcher{ + pos: position{line: 1664, col: 7, offset: 55247}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &labeledExpr{ + pos: position{line: 1665, col: 5, offset: 55256}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1666, col: 9, offset: 55274}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1666, col: 9, offset: 55274}, + name: "EscapedBoldText", + }, + &ruleRefExpr{ + pos: position{line: 1667, col: 11, offset: 55301}, + name: "EscapedItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1668, col: 11, offset: 55329}, + name: "EscapedMarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1669, col: 11, offset: 55357}, + name: "EscapedMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1670, col: 11, offset: 55389}, + name: "EscapedSubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1671, col: 11, offset: 55421}, + name: "EscapedSuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "BoldText", + pos: position{line: 1691, col: 1, offset: 55948}, + expr: &choiceExpr{ + pos: position{line: 1691, col: 13, offset: 55960}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1691, col: 13, offset: 55960}, + name: "DoubleQuoteBoldText", + }, + &ruleRefExpr{ + pos: position{line: 1691, col: 35, offset: 55982}, + name: "SingleQuoteBoldText", + }, + }, + }, + }, + { + name: "DoubleQuoteBoldText", + pos: position{line: 1705, col: 1, offset: 56344}, + expr: &actionExpr{ + pos: position{line: 1706, col: 5, offset: 56372}, + run: (*parser).callonDoubleQuoteBoldText1, + expr: &seqExpr{ + pos: position{line: 1706, col: 5, offset: 56372}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1703, col: 33, offset: 56338}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + &labeledExpr{ + pos: position{line: 1707, col: 5, offset: 56406}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1707, col: 15, offset: 56416}, + name: "DoubleQuoteBoldTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1703, col: 33, offset: 56338}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + }, + }, + }, + }, + { + name: "DoubleQuoteBoldTextElements", + pos: position{line: 1712, col: 1, offset: 56573}, + expr: &oneOrMoreExpr{ + pos: position{line: 1712, col: 32, offset: 56604}, + expr: &ruleRefExpr{ + pos: position{line: 1712, col: 32, offset: 56604}, + name: "DoubleQuoteBoldTextElement", + }, + }, + }, + { + name: "DoubleQuoteBoldTextElement", + pos: position{line: 1714, col: 1, offset: 56635}, + expr: &actionExpr{ + pos: position{line: 1715, col: 5, offset: 56670}, + run: (*parser).callonDoubleQuoteBoldTextElement1, + expr: &seqExpr{ + pos: position{line: 1715, col: 5, offset: 56670}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1715, col: 5, offset: 56670}, + expr: &litMatcher{ + pos: position{line: 1703, col: 33, offset: 56338}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + }, + &labeledExpr{ + pos: position{line: 1716, col: 5, offset: 56704}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1717, col: 9, offset: 56722}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1696, col: 5, offset: 56096}, + run: (*parser).callonDoubleQuoteBoldTextElement7, + expr: &seqExpr{ + pos: position{line: 1696, col: 5, offset: 56096}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1696, col: 5, offset: 56096}, + expr: &charClassMatcher{ + pos: position{line: 1696, col: 5, offset: 56096}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 1696, col: 19, offset: 56110}, + expr: &choiceExpr{ + pos: position{line: 1696, col: 21, offset: 56112}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + 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: " ", - 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonDoubleQuoteBoldTextElement14, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, + &litMatcher{ + pos: position{line: 1693, col: 22, offset: 56070}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, }, }, }, - &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, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonDoubleQuoteBoldTextElement17, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 1719, col: 11, offset: 56795}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDoubleQuoteBoldTextElement24, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1719, col: 19, offset: 56803}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDoubleQuoteBoldTextElement30, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, - &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", - 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: 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\"", - }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteBoldTextElement32, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteBoldTextElement34, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonDoubleQuoteBoldTextElement37, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteBoldTextElement41, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, - }, - }, - }, - }, - }, - }, - &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}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, - &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\"", - }, - }, - }, - }, - }, - &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{}{ + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteBoldTextElement48, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + 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: 471, col: 17, offset: 15278}, + val: ":", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\":\"", }, - }, - }, - }, - }, - }, - }, - &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).callonExampleBlockRawContent628, - 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).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\"", - }, - }, - }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteBoldTextElement53, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteBoldTextElement55, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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, - }, - }, }, }, }, }, }, }, - &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, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 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: "\"....\"", - }, - &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: " ", + pos: position{line: 463, col: 78, offset: 15031}, + 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\"", - }, + want: "\"}\"", }, }, }, }, - &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).callonExampleBlockRawContent667, - expr: &labeledExpr{ - pos: position{line: 2103, col: 44, offset: 74559}, - label: "lines", - expr: &zeroOrMoreExpr{ - pos: position{line: 2103, col: 50, offset: 74565}, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonDoubleQuoteBoldTextElement59, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", expr: &actionExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, - run: (*parser).callonExampleBlockRawContent670, + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteBoldTextElement63, expr: &seqExpr{ - pos: position{line: 2108, col: 5, offset: 74705}, + pos: position{line: 118, col: 18, offset: 3399}, 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}, + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteBoldTextElement70, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteBoldTextElement75, expr: &charClassMatcher{ - pos: position{line: 2108, col: 34, offset: 74734}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, ignoreCase: false, - inverted: true, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteBoldTextElement77, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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, }, }, }, @@ -31081,75 +40776,66 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, - &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: " ", + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonDoubleQuoteBoldTextElement81, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteBoldTextElement85, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + 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).callonExampleBlockRawContent690, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", }, }, }, @@ -31157,699 +40843,483 @@ var g = &grammar{ }, }, }, - &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", + }, + }, + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonDoubleQuoteBoldTextElement91, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonDoubleQuoteBoldTextElement93, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonDoubleQuoteBoldTextElement96, expr: &choiceExpr{ - pos: position{line: 856, col: 19, offset: 27732}, + pos: position{line: 491, col: 27, offset: 15997}, 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\"", - }, - }, - }, - }, - }, - &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, - }, - }, - }, - }, - }, - }, - }, - &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).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, - }, + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonDoubleQuoteBoldTextElement98, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonDoubleQuoteBoldTextElement102, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2878, col: 10, offset: 95044}, + 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonDoubleQuoteBoldTextElement108, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, - }, - }, - &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}, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, + pos: position{line: 502, col: 5, offset: 16440}, 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}, + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonDoubleQuoteBoldTextElement114, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, 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}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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).callonExampleBlockRawContent767, - 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).callonExampleBlockRawContent779, - 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).callonExampleBlockRawContent791, - 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'}, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []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: 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).callonExampleBlockRawContent803, - 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: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteBoldTextElement119, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteBoldTextElement121, }, - }, - }, - }, - &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\"", + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonDoubleQuoteBoldTextElement124, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteBoldTextElement128, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteBoldTextElement135, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteBoldTextElement140, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteBoldTextElement142, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + 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: 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).callonExampleBlockRawContent827, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonDoubleQuoteBoldTextElement146, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteBoldTextElement150, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteBoldTextElement157, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteBoldTextElement162, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteBoldTextElement164, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonDoubleQuoteBoldTextElement168, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteBoldTextElement172, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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: 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, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonDoubleQuoteBoldTextElement178, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + 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: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonDoubleQuoteBoldTextElement181, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonDoubleQuoteBoldTextElement185, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + 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, }, }, }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonExampleBlockRawContent843, - }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", }, }, }, @@ -31857,169 +41327,592 @@ var g = &grammar{ }, }, }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonDoubleQuoteBoldTextElement189, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, - &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: "> ", + }, + }, + }, + &actionExpr{ + pos: position{line: 2620, col: 15, offset: 87267}, + run: (*parser).callonDoubleQuoteBoldTextElement191, + expr: &litMatcher{ + pos: position{line: 2620, col: 15, offset: 87267}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2626, col: 14, offset: 87382}, + run: (*parser).callonDoubleQuoteBoldTextElement193, + expr: &litMatcher{ + pos: position{line: 2626, col: 14, offset: 87382}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2630, col: 14, offset: 87458}, + run: (*parser).callonDoubleQuoteBoldTextElement195, + expr: &litMatcher{ + pos: position{line: 2630, col: 14, offset: 87458}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2634, col: 15, offset: 87536}, + run: (*parser).callonDoubleQuoteBoldTextElement197, + expr: &litMatcher{ + pos: position{line: 2634, col: 15, offset: 87536}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2638, col: 13, offset: 87611}, + run: (*parser).callonDoubleQuoteBoldTextElement199, + expr: &litMatcher{ + pos: position{line: 2638, col: 13, offset: 87611}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + run: (*parser).callonDoubleQuoteBoldTextElement201, + expr: &seqExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2646, col: 31, offset: 87926}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2646, col: 35, offset: 87930}, + expr: &charClassMatcher{ + pos: position{line: 2646, col: 36, offset: 87931}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1723, col: 11, offset: 56932}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 1724, col: 11, offset: 56954}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 1725, col: 11, offset: 56977}, + name: "QuotedTextInDoubleQuoteBoldText", + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonDoubleQuoteBoldTextElement210, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonDoubleQuoteBoldTextElement214, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, 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).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: 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", - 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: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 1744, col: 5, offset: 57489}, + val: "[^\\r\\n*]", + chars: []rune{'\r', '\n', '*'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 1745, col: 7, offset: 57586}, + run: (*parser).callonDoubleQuoteBoldTextElement219, + expr: &seqExpr{ + pos: position{line: 1745, col: 7, offset: 57586}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1703, col: 33, offset: 56338}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonDoubleQuoteBoldTextElement222, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInDoubleQuoteBoldText", + pos: position{line: 1731, col: 1, offset: 57131}, + expr: &actionExpr{ + pos: position{line: 1732, col: 5, offset: 57171}, + run: (*parser).callonQuotedTextInDoubleQuoteBoldText1, + expr: &seqExpr{ + pos: position{line: 1732, col: 5, offset: 57171}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1732, col: 5, offset: 57171}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1732, col: 16, offset: 57182}, + expr: &ruleRefExpr{ + pos: position{line: 1732, col: 17, offset: 57183}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1733, col: 5, offset: 57209}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 1734, col: 9, offset: 57224}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1734, col: 9, offset: 57224}, + name: "SingleQuoteBoldText", + }, + &ruleRefExpr{ + pos: position{line: 1735, col: 11, offset: 57254}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1736, col: 11, offset: 57275}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1737, col: 11, offset: 57296}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1738, col: 11, offset: 57320}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1739, col: 11, offset: 57344}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "SingleQuoteBoldText", + pos: position{line: 1756, col: 1, offset: 57973}, + expr: &actionExpr{ + pos: position{line: 1757, col: 5, offset: 58001}, + run: (*parser).callonSingleQuoteBoldText1, + expr: &seqExpr{ + pos: position{line: 1757, col: 5, offset: 58001}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1752, col: 38, offset: 57927}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + &labeledExpr{ + pos: position{line: 1758, col: 5, offset: 58039}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1758, col: 15, offset: 58049}, + name: "SingleQuoteBoldTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1754, col: 36, offset: 57967}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + }, + { + name: "SingleQuoteBoldTextElements", + pos: position{line: 1763, col: 1, offset: 58209}, + expr: &actionExpr{ + pos: position{line: 1764, col: 5, offset: 58246}, + run: (*parser).callonSingleQuoteBoldTextElements1, + expr: &seqExpr{ + pos: position{line: 1764, col: 5, offset: 58246}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1764, col: 5, offset: 58246}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + ¬Expr{ + pos: position{line: 1764, col: 10, offset: 58251}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuoteBoldTextElements9, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1765, col: 5, offset: 58290}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 1765, col: 14, offset: 58299}, + expr: &ruleRefExpr{ + pos: position{line: 1765, col: 15, offset: 58300}, + name: "SingleQuoteBoldTextElement", + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1766, col: 5, offset: 58334}, + run: (*parser).callonSingleQuoteBoldTextElements14, + }, + }, + }, + }, + }, + { + name: "SingleQuoteBoldTextElement", + pos: position{line: 1772, col: 1, offset: 58475}, + expr: &choiceExpr{ + pos: position{line: 1773, col: 5, offset: 58510}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1696, col: 5, offset: 56096}, + run: (*parser).callonSingleQuoteBoldTextElement2, + expr: &seqExpr{ + pos: position{line: 1696, col: 5, offset: 56096}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1696, col: 5, offset: 56096}, + expr: &charClassMatcher{ + pos: position{line: 1696, col: 5, offset: 56096}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 1696, col: 19, offset: 56110}, + expr: &choiceExpr{ + pos: position{line: 1696, col: 21, offset: 56112}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuoteBoldTextElement9, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &litMatcher{ + pos: position{line: 1693, col: 22, offset: 56070}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonSingleQuoteBoldTextElement12, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 1775, col: 7, offset: 58542}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSingleQuoteBoldTextElement19, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1775, col: 15, offset: 58550}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSingleQuoteBoldTextElement25, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteBoldTextElement27, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteBoldTextElement29, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonSingleQuoteBoldTextElement32, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteBoldTextElement36, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteBoldTextElement43, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteBoldTextElement48, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + 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).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, - }, - }, - }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteBoldTextElement50, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, @@ -32031,1096 +41924,595 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, - &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: 467, col: 25, offset: 15133}, + run: (*parser).callonSingleQuoteBoldTextElement54, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteBoldTextElement58, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, - &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).callonExampleBlockRawContent889, - 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).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, - }, - }, - }, - }, - }, - }, - &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, - }, - }, - }, - }, - }, - }, - &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, - }, - }, - }, - }, - }, - }, - &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).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, - }, - }, - }, - }, - }, - }, - &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).callonExampleBlockRawContent950, - 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).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, - }, - }, - }, - }, - }, - }, - &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).callonExampleBlockRawContent974, - 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).callonExampleBlockRawContent982, - expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteBoldTextElement65, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteBoldTextElement70, expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteBoldTextElement72, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, }, - &andCodeExpr{ - pos: position{line: 904, col: 43, offset: 29545}, - run: (*parser).callonExampleBlockRawContent990, - }, }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonSingleQuoteBoldTextElement76, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteBoldTextElement80, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, - &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}, - 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).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, - }, - }, - }, - }, - }, - }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonSingleQuoteBoldTextElement86, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonSingleQuoteBoldTextElement88, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonSingleQuoteBoldTextElement91, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonSingleQuoteBoldTextElement93, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonSingleQuoteBoldTextElement97, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", + pos: position{line: 2878, col: 10, offset: 95044}, + 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, - }, - }, - }, + 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuoteBoldTextElement103, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, - &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, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonSingleQuoteBoldTextElement109, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + 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: "====", + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, 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'}, - 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: 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: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteBoldTextElement114, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteBoldTextElement116, }, - }, - &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}, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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).callonExampleBlockRawContent1093, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonSingleQuoteBoldTextElement119, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteBoldTextElement123, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteBoldTextElement130, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteBoldTextElement135, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteBoldTextElement137, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + 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: 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).callonExampleBlockRawContent1105, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonSingleQuoteBoldTextElement141, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteBoldTextElement145, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteBoldTextElement152, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteBoldTextElement157, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteBoldTextElement159, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + 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: 456, col: 31, offset: 14633}, + run: (*parser).callonSingleQuoteBoldTextElement163, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteBoldTextElement167, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, }, }, }, @@ -33129,633 +42521,906 @@ 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).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, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 506, col: 8, offset: 16673}, + run: (*parser).callonSingleQuoteBoldTextElement173, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + 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: 904, col: 43, offset: 29545}, - run: (*parser).callonExampleBlockRawContent1121, - }, }, }, }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, }, - }, - }, - &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: "====", - 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\"", + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonSingleQuoteBoldTextElement176, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonSingleQuoteBoldTextElement180, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, }, }, }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + 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: 2595, col: 11, offset: 86299}, + run: (*parser).callonSingleQuoteBoldTextElement184, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2620, col: 15, offset: 87267}, + run: (*parser).callonSingleQuoteBoldTextElement186, + expr: &litMatcher{ + pos: position{line: 2620, col: 15, offset: 87267}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2626, col: 14, offset: 87382}, + run: (*parser).callonSingleQuoteBoldTextElement188, + expr: &litMatcher{ + pos: position{line: 2626, col: 14, offset: 87382}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2630, col: 14, offset: 87458}, + run: (*parser).callonSingleQuoteBoldTextElement190, + expr: &litMatcher{ + pos: position{line: 2630, col: 14, offset: 87458}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2634, col: 15, offset: 87536}, + run: (*parser).callonSingleQuoteBoldTextElement192, + expr: &litMatcher{ + pos: position{line: 2634, col: 15, offset: 87536}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2638, col: 13, offset: 87611}, + run: (*parser).callonSingleQuoteBoldTextElement194, + expr: &litMatcher{ + pos: position{line: 2638, col: 13, offset: 87611}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + run: (*parser).callonSingleQuoteBoldTextElement196, + expr: &seqExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2646, col: 31, offset: 87926}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2646, col: 35, offset: 87930}, + expr: &charClassMatcher{ + pos: position{line: 2646, col: 36, offset: 87931}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1779, col: 7, offset: 58663}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 1780, col: 7, offset: 58681}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 1781, col: 7, offset: 58700}, + name: "QuotedTextInSingleQuoteBoldText", + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonSingleQuoteBoldTextElement205, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonSingleQuoteBoldTextElement209, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 1797, col: 5, offset: 59158}, + val: "[^\\r\\n *]", + chars: []rune{'\r', '\n', ' ', '*'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 1798, col: 7, offset: 59263}, + run: (*parser).callonSingleQuoteBoldTextElement214, + expr: &seqExpr{ + pos: position{line: 1798, col: 7, offset: 59263}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1798, col: 7, offset: 59263}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonSingleQuoteBoldTextElement217, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInSingleQuoteBoldText", + pos: position{line: 1785, col: 1, offset: 58801}, + expr: &actionExpr{ + pos: position{line: 1786, col: 5, offset: 58841}, + run: (*parser).callonQuotedTextInSingleQuoteBoldText1, + expr: &seqExpr{ + pos: position{line: 1786, col: 5, offset: 58841}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1786, col: 5, offset: 58841}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1786, col: 16, offset: 58852}, + expr: &ruleRefExpr{ + pos: position{line: 1786, col: 17, offset: 58853}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1787, col: 5, offset: 58879}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 1788, col: 9, offset: 58894}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1788, col: 9, offset: 58894}, + name: "DoubleQuoteBoldText", + }, + &ruleRefExpr{ + pos: position{line: 1789, col: 11, offset: 58924}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1790, col: 11, offset: 58945}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1791, col: 11, offset: 58969}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1792, col: 11, offset: 58990}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1793, col: 11, offset: 59014}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "EscapedBoldText", + pos: position{line: 1802, col: 1, offset: 59438}, + expr: &choiceExpr{ + pos: position{line: 1803, col: 5, offset: 59462}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1803, col: 5, offset: 59462}, + run: (*parser).callonEscapedBoldText2, + expr: &seqExpr{ + pos: position{line: 1803, col: 5, offset: 59462}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1803, col: 5, offset: 59462}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1684, col: 25, offset: 55764}, + run: (*parser).callonEscapedBoldText5, + expr: &seqExpr{ + pos: position{line: 1684, col: 25, offset: 55764}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1684, col: 25, offset: 55764}, + val: "\\\\", + ignoreCase: false, + want: "\"\\\\\\\\\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1684, col: 30, offset: 55769}, + expr: &litMatcher{ + pos: position{line: 1684, col: 30, offset: 55769}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1803, col: 40, offset: 59497}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + &labeledExpr{ + pos: position{line: 1803, col: 45, offset: 59502}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1803, col: 55, offset: 59512}, + name: "DoubleQuoteBoldTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1803, col: 84, offset: 59541}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1805, col: 9, offset: 59698}, + run: (*parser).callonEscapedBoldText14, + expr: &seqExpr{ + pos: position{line: 1805, col: 9, offset: 59698}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1805, col: 9, offset: 59698}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + run: (*parser).callonEscapedBoldText17, + expr: &oneOrMoreExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + expr: &litMatcher{ + pos: position{line: 1680, col: 25, offset: 55691}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1805, col: 44, offset: 59733}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + &labeledExpr{ + pos: position{line: 1805, col: 49, offset: 59738}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1805, col: 59, offset: 59748}, + name: "SingleQuoteBoldTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1805, col: 88, offset: 59777}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1808, col: 9, offset: 59977}, + run: (*parser).callonEscapedBoldText24, + expr: &seqExpr{ + pos: position{line: 1808, col: 9, offset: 59977}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1808, col: 9, offset: 59977}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + run: (*parser).callonEscapedBoldText27, + expr: &oneOrMoreExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + expr: &litMatcher{ + pos: position{line: 1680, col: 25, offset: 55691}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1808, col: 44, offset: 60012}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + &labeledExpr{ + pos: position{line: 1808, col: 48, offset: 60016}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1808, col: 58, offset: 60026}, + name: "SingleQuoteBoldTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1808, col: 87, offset: 60055}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, + }, + }, + }, + }, + }, + { + name: "ItalicText", + pos: position{line: 1816, col: 1, offset: 60353}, + expr: &choiceExpr{ + pos: position{line: 1816, col: 15, offset: 60367}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1816, col: 15, offset: 60367}, + name: "DoubleQuoteItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1816, col: 39, offset: 60391}, + name: "SingleQuoteItalicText", + }, + }, + }, + }, + { + name: "DoubleQuoteItalicText", + pos: position{line: 1830, col: 1, offset: 60719}, + expr: &actionExpr{ + pos: position{line: 1831, col: 5, offset: 60749}, + run: (*parser).callonDoubleQuoteItalicText1, + expr: &seqExpr{ + pos: position{line: 1831, col: 5, offset: 60749}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1828, col: 35, offset: 60713}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + &labeledExpr{ + pos: position{line: 1832, col: 5, offset: 60785}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1832, col: 15, offset: 60795}, + name: "DoubleQuoteItalicTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1828, col: 35, offset: 60713}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + }, + }, + }, + }, + { + name: "DoubleQuoteItalicTextElements", + pos: position{line: 1837, col: 1, offset: 61003}, + expr: &oneOrMoreExpr{ + pos: position{line: 1837, col: 34, offset: 61036}, + expr: &ruleRefExpr{ + pos: position{line: 1837, col: 34, offset: 61036}, + name: "DoubleQuoteItalicTextElement", + }, + }, + }, + { + name: "DoubleQuoteItalicTextElement", + pos: position{line: 1839, col: 1, offset: 61068}, + expr: &actionExpr{ + pos: position{line: 1840, col: 5, offset: 61105}, + run: (*parser).callonDoubleQuoteItalicTextElement1, + expr: &seqExpr{ + pos: position{line: 1840, col: 5, offset: 61105}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1840, col: 5, offset: 61105}, + expr: &litMatcher{ + pos: position{line: 1828, col: 35, offset: 60713}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + }, + &labeledExpr{ + pos: position{line: 1841, col: 5, offset: 61141}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1842, col: 9, offset: 61159}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1821, col: 5, offset: 60465}, + run: (*parser).callonDoubleQuoteItalicTextElement7, + expr: &seqExpr{ + pos: position{line: 1821, col: 5, offset: 60465}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1821, col: 5, offset: 60465}, + expr: &charClassMatcher{ + pos: position{line: 1821, col: 5, offset: 60465}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 1821, col: 15, offset: 60475}, + expr: &choiceExpr{ + pos: position{line: 1821, col: 17, offset: 60477}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDoubleQuoteItalicTextElement14, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, + &litMatcher{ + pos: position{line: 1818, col: 24, offset: 60437}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, }, }, }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - { - name: "QuoteBlock", - pos: position{line: 1722, col: 1, offset: 61387}, - expr: &actionExpr{ - pos: position{line: 1723, col: 5, offset: 61406}, - run: (*parser).callonQuoteBlock1, - expr: &seqExpr{ - pos: position{line: 1723, col: 5, offset: 61406}, - 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: "\"____\"", - }, - &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).callonQuoteBlock8, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonDoubleQuoteItalicTextElement17, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + 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: 1732, col: 30, offset: 61778}, - label: "content", - expr: &ruleRefExpr{ - pos: position{line: 1732, col: 39, offset: 61787}, - name: "QuoteBlockRawContent", - }, - }, - &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}, + &seqExpr{ + pos: position{line: 1844, col: 11, offset: 61234}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", ignoreCase: false, - want: "\" \"", + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlock23, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDoubleQuoteItalicTextElement24, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + 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: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - }, - { - 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}, - exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1844, col: 19, offset: 61242}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1740, col: 28, offset: 62098}, - val: "____", + pos: position{line: 2886, col: 12, offset: 95178}, + 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).callonQuoteBlockRawContent13, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + 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, - }, - }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDoubleQuoteItalicTextElement30, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - ¬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: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteItalicTextElement32, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteItalicTextElement34, }, - &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", - expr: &actionExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - run: (*parser).callonQuoteBlockRawContent33, - expr: &seqExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - label: "content", + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonDoubleQuoteItalicTextElement37, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteItalicTextElement41, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, expr: &actionExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - run: (*parser).callonQuoteBlockRawContent36, + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteItalicTextElement48, expr: &seqExpr{ - pos: position{line: 929, col: 14, offset: 30348}, + pos: position{line: 471, col: 17, offset: 15278}, exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, &labeledExpr{ - pos: position{line: 929, col: 14, offset: 30348}, - label: "elements", + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", expr: &choiceExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, + pos: position{line: 471, col: 28, offset: 15289}, 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, - }, - }, - }, - }, - }, - }, + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteItalicTextElement53, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, }, }, &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: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteItalicTextElement55, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + 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, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, - &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, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonDoubleQuoteItalicTextElement59, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteItalicTextElement63, expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, + pos: position{line: 118, col: 18, offset: 3399}, 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'}, + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteItalicTextElement70, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteItalicTextElement75, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteItalicTextElement77, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, @@ -33763,921 +43428,1146 @@ var g = &grammar{ }, }, }, - &litMatcher{ - pos: position{line: 1916, col: 45, offset: 68340}, - val: "//", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonDoubleQuoteItalicTextElement81, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteItalicTextElement85, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"//\"", + 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).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, - }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonDoubleQuoteItalicTextElement91, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonDoubleQuoteItalicTextElement93, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonDoubleQuoteItalicTextElement96, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonDoubleQuoteItalicTextElement98, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonDoubleQuoteItalicTextElement102, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2878, col: 10, offset: 95044}, + 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: 2878, col: 16, offset: 95050}, + run: (*parser).callonDoubleQuoteItalicTextElement108, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, }, - }, - }, - &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}, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, + pos: position{line: 502, col: 5, offset: 16440}, 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}, + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonDoubleQuoteItalicTextElement114, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, 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).callonQuoteBlockRawContent106, - 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).callonQuoteBlockRawContent118, - 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'}, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []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: 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).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, - }, - }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteItalicTextElement119, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteItalicTextElement121, }, - }, - }, - }, - &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).callonQuoteBlockRawContent142, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonDoubleQuoteItalicTextElement124, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteItalicTextElement128, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteItalicTextElement135, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteItalicTextElement140, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteItalicTextElement142, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + 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: 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).callonQuoteBlockRawContent154, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonDoubleQuoteItalicTextElement146, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteItalicTextElement150, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteItalicTextElement157, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteItalicTextElement162, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteItalicTextElement164, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + 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: 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).callonQuoteBlockRawContent166, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonDoubleQuoteItalicTextElement168, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteItalicTextElement172, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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: 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).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, - }, - }, - }, - }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonDoubleQuoteItalicTextElement178, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + 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).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, - }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + 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, - }, - }, - }, - &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\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 1753, col: 15, offset: 62500}, - name: "ImageBlock", - }, - &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: "\"_ _ _\"", + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonDoubleQuoteItalicTextElement181, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonDoubleQuoteItalicTextElement185, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + 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: 2595, col: 11, offset: 86299}, + run: (*parser).callonDoubleQuoteItalicTextElement189, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, }, }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1755, col: 15, offset: 62553}, - name: "OrderedListItem", + }, + }, + }, + &actionExpr{ + pos: position{line: 2620, col: 15, offset: 87267}, + run: (*parser).callonDoubleQuoteItalicTextElement191, + expr: &litMatcher{ + pos: position{line: 2620, col: 15, offset: 87267}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2626, col: 14, offset: 87382}, + run: (*parser).callonDoubleQuoteItalicTextElement193, + expr: &litMatcher{ + pos: position{line: 2626, col: 14, offset: 87382}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2630, col: 14, offset: 87458}, + run: (*parser).callonDoubleQuoteItalicTextElement195, + expr: &litMatcher{ + pos: position{line: 2630, col: 14, offset: 87458}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2634, col: 15, offset: 87536}, + run: (*parser).callonDoubleQuoteItalicTextElement197, + expr: &litMatcher{ + pos: position{line: 2634, col: 15, offset: 87536}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2638, col: 13, offset: 87611}, + run: (*parser).callonDoubleQuoteItalicTextElement199, + expr: &litMatcher{ + pos: position{line: 2638, col: 13, offset: 87611}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + run: (*parser).callonDoubleQuoteItalicTextElement201, + expr: &seqExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, - &ruleRefExpr{ - pos: position{line: 1756, col: 15, offset: 62584}, - name: "UnorderedListItem", + &litMatcher{ + pos: position{line: 2646, col: 31, offset: 87926}, + val: "'", + ignoreCase: false, + want: "\"'\"", }, - &ruleRefExpr{ - pos: position{line: 1757, col: 15, offset: 62617}, - name: "ContinuedListItemElement", + &andExpr{ + pos: position{line: 2646, col: 35, offset: 87930}, + expr: &charClassMatcher{ + pos: position{line: 2646, col: 36, offset: 87931}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, }, - &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: "```", + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1848, col: 11, offset: 61371}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 1849, col: 11, offset: 61393}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 1850, col: 11, offset: 61416}, + name: "QuotedTextInDoubleQuoteItalicText", + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonDoubleQuoteItalicTextElement210, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonDoubleQuoteItalicTextElement214, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, - want: "\"```\"", + inverted: false, }, - &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: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 1868, col: 5, offset: 61927}, + val: "[^\\r\\n_]", + chars: []rune{'\r', '\n', '_'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 1869, col: 7, offset: 62026}, + run: (*parser).callonDoubleQuoteItalicTextElement219, + expr: &seqExpr{ + pos: position{line: 1869, col: 7, offset: 62026}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1869, col: 7, offset: 62026}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonDoubleQuoteItalicTextElement222, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInDoubleQuoteItalicText", + pos: position{line: 1856, col: 1, offset: 61574}, + expr: &actionExpr{ + pos: position{line: 1857, col: 5, offset: 61616}, + run: (*parser).callonQuotedTextInDoubleQuoteItalicText1, + expr: &seqExpr{ + pos: position{line: 1857, col: 5, offset: 61616}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1857, col: 5, offset: 61616}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1857, col: 16, offset: 61627}, + expr: &ruleRefExpr{ + pos: position{line: 1857, col: 17, offset: 61628}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1858, col: 5, offset: 61654}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 1858, col: 11, offset: 61660}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1858, col: 11, offset: 61660}, + name: "SingleQuoteItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1859, col: 11, offset: 61692}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 1860, col: 11, offset: 61711}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1861, col: 11, offset: 61732}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1862, col: 11, offset: 61756}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1863, col: 11, offset: 61780}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "SingleQuoteItalicText", + pos: position{line: 1880, col: 1, offset: 62402}, + expr: &actionExpr{ + pos: position{line: 1881, col: 5, offset: 62432}, + run: (*parser).callonSingleQuoteItalicText1, + expr: &seqExpr{ + pos: position{line: 1881, col: 5, offset: 62432}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1876, col: 40, offset: 62353}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + &labeledExpr{ + pos: position{line: 1882, col: 5, offset: 62472}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1882, col: 15, offset: 62482}, + name: "SingleQuoteItalicTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1878, col: 38, offset: 62396}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + }, + }, + }, + }, + { + name: "SingleQuoteItalicTextElements", + pos: position{line: 1887, col: 1, offset: 62649}, + expr: &actionExpr{ + pos: position{line: 1888, col: 5, offset: 62687}, + run: (*parser).callonSingleQuoteItalicTextElements1, + expr: &seqExpr{ + pos: position{line: 1888, col: 5, offset: 62687}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1888, col: 5, offset: 62687}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + ¬Expr{ + pos: position{line: 1888, col: 10, offset: 62692}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuoteItalicTextElements9, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1889, col: 5, offset: 62731}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 1889, col: 14, offset: 62740}, + expr: &ruleRefExpr{ + pos: position{line: 1889, col: 15, offset: 62741}, + name: "SingleQuoteItalicTextElement", + }, + }, + }, + &andCodeExpr{ + pos: position{line: 1890, col: 5, offset: 62776}, + run: (*parser).callonSingleQuoteItalicTextElements14, + }, + }, + }, + }, + }, + { + name: "SingleQuoteItalicTextElement", + pos: position{line: 1896, col: 1, offset: 62917}, + expr: &choiceExpr{ + pos: position{line: 1897, col: 5, offset: 62954}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1821, col: 5, offset: 60465}, + run: (*parser).callonSingleQuoteItalicTextElement2, + expr: &seqExpr{ + pos: position{line: 1821, col: 5, offset: 60465}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1821, col: 5, offset: 60465}, + expr: &charClassMatcher{ + pos: position{line: 1821, col: 5, offset: 60465}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 1821, col: 15, offset: 60475}, + expr: &choiceExpr{ + pos: position{line: 1821, col: 17, offset: 60477}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuoteItalicTextElement9, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &litMatcher{ + pos: position{line: 1818, col: 24, offset: 60437}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonSingleQuoteItalicTextElement12, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 1899, col: 7, offset: 62988}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSingleQuoteItalicTextElement19, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1899, col: 15, offset: 62996}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSingleQuoteItalicTextElement25, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteItalicTextElement27, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteItalicTextElement29, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonSingleQuoteItalicTextElement32, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteItalicTextElement36, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + 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).callonQuoteBlockRawContent234, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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, - }, - }, - }, - }, - &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'}, - 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).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}, - 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: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteItalicTextElement43, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteItalicTextElement48, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteItalicTextElement50, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, @@ -34688,279 +44578,597 @@ var g = &grammar{ }, }, }, - &choiceExpr{ - pos: position{line: 1843, col: 28, offset: 65583}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1843, col: 29, offset: 65584}, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonSingleQuoteItalicTextElement54, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteItalicTextElement58, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteItalicTextElement65, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1843, col: 29, offset: 65584}, - val: "```", + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", ignoreCase: false, - want: "\"```\"", + want: "\":\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1843, col: 35, offset: 65590}, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 471, col: 28, offset: 15289}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent282, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteItalicTextElement70, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteItalicTextElement72, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, - &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}, - 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: 456, col: 31, offset: 14633}, + run: (*parser).callonSingleQuoteItalicTextElement76, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteItalicTextElement80, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + 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).callonQuoteBlockRawContent297, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonSingleQuoteItalicTextElement86, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonSingleQuoteItalicTextElement88, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonSingleQuoteItalicTextElement91, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonSingleQuoteItalicTextElement93, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", + pos: position{line: 491, col: 27, offset: 15997}, + 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: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonSingleQuoteItalicTextElement97, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + 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: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuoteItalicTextElement103, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, }, }, - }, - }, - &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: "----", + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonSingleQuoteItalicTextElement109, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, 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).callonQuoteBlockRawContent315, - 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: 1862, col: 54, offset: 66296}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonQuoteBlockRawContent325, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteItalicTextElement114, expr: &seqExpr{ - pos: position{line: 42, col: 12, offset: 1077}, + pos: position{line: 449, col: 5, offset: 14443}, 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: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteItalicTextElement116, }, &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, + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonSingleQuoteItalicTextElement119, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteItalicTextElement123, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteItalicTextElement130, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteItalicTextElement135, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteItalicTextElement137, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + 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: 467, col: 25, offset: 15133}, + run: (*parser).callonSingleQuoteItalicTextElement141, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteItalicTextElement145, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteItalicTextElement152, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteItalicTextElement157, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteItalicTextElement159, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonSingleQuoteItalicTextElement163, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteItalicTextElement167, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, }, }, }, @@ -34968,289 +45176,796 @@ var g = &grammar{ }, }, }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonSingleQuoteItalicTextElement173, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, }, }, }, }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + 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\"", - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 9, offset: 16122}, + run: (*parser).callonSingleQuoteItalicTextElement176, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonSingleQuoteItalicTextElement180, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + 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: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", }, }, }, }, }, }, - &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, - }, + }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonSingleQuoteItalicTextElement184, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2620, col: 15, offset: 87267}, + run: (*parser).callonSingleQuoteItalicTextElement186, + expr: &litMatcher{ + pos: position{line: 2620, col: 15, offset: 87267}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2626, col: 14, offset: 87382}, + run: (*parser).callonSingleQuoteItalicTextElement188, + expr: &litMatcher{ + pos: position{line: 2626, col: 14, offset: 87382}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2630, col: 14, offset: 87458}, + run: (*parser).callonSingleQuoteItalicTextElement190, + expr: &litMatcher{ + pos: position{line: 2630, col: 14, offset: 87458}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2634, col: 15, offset: 87536}, + run: (*parser).callonSingleQuoteItalicTextElement192, + expr: &litMatcher{ + pos: position{line: 2634, col: 15, offset: 87536}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2638, col: 13, offset: 87611}, + run: (*parser).callonSingleQuoteItalicTextElement194, + expr: &litMatcher{ + pos: position{line: 2638, col: 13, offset: 87611}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + run: (*parser).callonSingleQuoteItalicTextElement196, + expr: &seqExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2646, col: 31, offset: 87926}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2646, col: 35, offset: 87930}, + expr: &charClassMatcher{ + pos: position{line: 2646, col: 36, offset: 87931}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1903, col: 7, offset: 63109}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 1904, col: 7, offset: 63127}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 1905, col: 7, offset: 63146}, + name: "QuotedTextInSingleQuoteItalicText", + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonSingleQuoteItalicTextElement205, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonSingleQuoteItalicTextElement209, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 1921, col: 5, offset: 63603}, + val: "[^\\r\\n _]", + chars: []rune{'\r', '\n', ' ', '_'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 1922, col: 7, offset: 63710}, + run: (*parser).callonSingleQuoteItalicTextElement214, + expr: &seqExpr{ + pos: position{line: 1922, col: 7, offset: 63710}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1922, col: 7, offset: 63710}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonSingleQuoteItalicTextElement217, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInSingleQuoteItalicText", + pos: position{line: 1909, col: 1, offset: 63251}, + expr: &actionExpr{ + pos: position{line: 1910, col: 5, offset: 63292}, + run: (*parser).callonQuotedTextInSingleQuoteItalicText1, + expr: &seqExpr{ + pos: position{line: 1910, col: 5, offset: 63292}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1910, col: 5, offset: 63292}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1910, col: 16, offset: 63303}, + expr: &ruleRefExpr{ + pos: position{line: 1910, col: 17, offset: 63304}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1911, col: 5, offset: 63330}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 1911, col: 11, offset: 63336}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1911, col: 11, offset: 63336}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 1912, col: 11, offset: 63355}, + name: "DoubleQuoteItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1913, col: 11, offset: 63387}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1914, col: 11, offset: 63408}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1915, col: 11, offset: 63432}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1916, col: 11, offset: 63456}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "EscapedItalicText", + pos: position{line: 1926, col: 1, offset: 63888}, + expr: &choiceExpr{ + pos: position{line: 1927, col: 5, offset: 63914}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1927, col: 5, offset: 63914}, + run: (*parser).callonEscapedItalicText2, + expr: &seqExpr{ + pos: position{line: 1927, col: 5, offset: 63914}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1927, col: 5, offset: 63914}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1684, col: 25, offset: 55764}, + run: (*parser).callonEscapedItalicText5, + expr: &seqExpr{ + pos: position{line: 1684, col: 25, offset: 55764}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1684, col: 25, offset: 55764}, + val: "\\\\", + ignoreCase: false, + want: "\"\\\\\\\\\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1684, col: 30, offset: 55769}, + expr: &litMatcher{ + pos: position{line: 1684, col: 30, offset: 55769}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1927, col: 40, offset: 63949}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + &labeledExpr{ + pos: position{line: 1927, col: 45, offset: 63954}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1927, col: 55, offset: 63964}, + name: "DoubleQuoteItalicTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1927, col: 86, offset: 63995}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1929, col: 9, offset: 64152}, + run: (*parser).callonEscapedItalicText14, + expr: &seqExpr{ + pos: position{line: 1929, col: 9, offset: 64152}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1929, col: 9, offset: 64152}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + run: (*parser).callonEscapedItalicText17, + expr: &oneOrMoreExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + expr: &litMatcher{ + pos: position{line: 1680, col: 25, offset: 55691}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1929, col: 44, offset: 64187}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + &labeledExpr{ + pos: position{line: 1929, col: 49, offset: 64192}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1929, col: 59, offset: 64202}, + name: "SingleQuoteItalicTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1929, col: 90, offset: 64233}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1932, col: 9, offset: 64433}, + run: (*parser).callonEscapedItalicText24, + expr: &seqExpr{ + pos: position{line: 1932, col: 9, offset: 64433}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1932, col: 9, offset: 64433}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + run: (*parser).callonEscapedItalicText27, + expr: &oneOrMoreExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + expr: &litMatcher{ + pos: position{line: 1680, col: 25, offset: 55691}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1932, col: 44, offset: 64468}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + &labeledExpr{ + pos: position{line: 1932, col: 48, offset: 64472}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1932, col: 58, offset: 64482}, + name: "SingleQuoteItalicTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1932, col: 89, offset: 64513}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + }, + }, + }, + }, + }, + }, + { + name: "MonospaceText", + pos: position{line: 1939, col: 1, offset: 64832}, + expr: &choiceExpr{ + pos: position{line: 1939, col: 18, offset: 64849}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1939, col: 18, offset: 64849}, + name: "DoubleQuoteMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1939, col: 45, offset: 64876}, + name: "SingleQuoteMonospaceText", + }, + }, + }, + }, + { + name: "DoubleQuoteMonospaceText", + pos: position{line: 1953, col: 1, offset: 65228}, + expr: &actionExpr{ + pos: position{line: 1954, col: 5, offset: 65261}, + run: (*parser).callonDoubleQuoteMonospaceText1, + expr: &seqExpr{ + pos: position{line: 1954, col: 5, offset: 65261}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1951, col: 38, offset: 65222}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + &labeledExpr{ + pos: position{line: 1955, col: 5, offset: 65300}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 1955, col: 15, offset: 65310}, + name: "DoubleQuoteMonospaceTextElements", + }, + }, + &litMatcher{ + pos: position{line: 1951, col: 38, offset: 65222}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + }, + }, + }, + }, + { + name: "DoubleQuoteMonospaceTextElements", + pos: position{line: 1960, col: 1, offset: 65482}, + expr: &oneOrMoreExpr{ + pos: position{line: 1960, col: 37, offset: 65518}, + expr: &ruleRefExpr{ + pos: position{line: 1960, col: 37, offset: 65518}, + name: "DoubleQuoteMonospaceTextElement", + }, + }, + }, + { + name: "DoubleQuoteMonospaceTextElement", + pos: position{line: 1962, col: 1, offset: 65585}, + expr: &actionExpr{ + pos: position{line: 1963, col: 5, offset: 65625}, + run: (*parser).callonDoubleQuoteMonospaceTextElement1, + expr: &seqExpr{ + pos: position{line: 1963, col: 5, offset: 65625}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1963, col: 5, offset: 65625}, + expr: &litMatcher{ + pos: position{line: 1951, col: 38, offset: 65222}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + }, + &labeledExpr{ + pos: position{line: 1964, col: 5, offset: 65664}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1965, col: 9, offset: 65682}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1944, col: 5, offset: 64959}, + run: (*parser).callonDoubleQuoteMonospaceTextElement7, + expr: &seqExpr{ + pos: position{line: 1944, col: 5, offset: 64959}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1944, col: 5, offset: 64959}, + expr: &charClassMatcher{ + pos: position{line: 1944, col: 5, offset: 64959}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 1944, col: 15, offset: 64969}, + expr: &choiceExpr{ + pos: position{line: 1944, col: 17, offset: 64971}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1738, col: 29, offset: 62027}, - val: "____", + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - want: "\"____\"", + 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\"", - }, - }, - }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDoubleQuoteMonospaceTextElement14, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + 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: 1941, col: 27, offset: 64928}, + val: "`", + ignoreCase: false, + want: "\"`\"", }, - &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, - }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonDoubleQuoteMonospaceTextElement17, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 1967, col: 11, offset: 65760}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDoubleQuoteMonospaceTextElement24, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1967, col: 19, offset: 65768}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDoubleQuoteMonospaceTextElement30, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteMonospaceTextElement32, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteMonospaceTextElement34, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonDoubleQuoteMonospaceTextElement37, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteMonospaceTextElement41, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, - &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}, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteMonospaceTextElement48, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteMonospaceTextElement53, expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteMonospaceTextElement55, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -35261,202 +45976,177 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, - &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: " ", + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonDoubleQuoteMonospaceTextElement59, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteMonospaceTextElement63, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + 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).callonQuoteBlockRawContent409, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteMonospaceTextElement70, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteMonospaceTextElement75, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteMonospaceTextElement77, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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: 467, col: 79, offset: 15187}, + 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: 456, col: 31, offset: 14633}, + run: (*parser).callonDoubleQuoteMonospaceTextElement81, expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 456, col: 31, offset: 14633}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + pos: position{line: 456, col: 31, offset: 14633}, + 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).callonQuoteBlockRawContent428, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteMonospaceTextElement85, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 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).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'}, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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: "\"}\"", }, }, }, @@ -35464,938 +46154,1119 @@ var g = &grammar{ }, }, }, - &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}, + }, + }, + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonDoubleQuoteMonospaceTextElement91, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonDoubleQuoteMonospaceTextElement93, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonDoubleQuoteMonospaceTextElement96, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 491, col: 27, offset: 15997}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent451, - 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: 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: "++++", + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonDoubleQuoteMonospaceTextElement98, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonDoubleQuoteMonospaceTextElement102, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDoubleQuoteMonospaceTextElement108, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", ignoreCase: false, - want: "\"++++\"", + want: "\"\\t\"", }, - &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: " ", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonDoubleQuoteMonospaceTextElement114, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + 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).callonQuoteBlockRawContent469, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + 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: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteMonospaceTextElement119, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteMonospaceTextElement121, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonDoubleQuoteMonospaceTextElement124, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteMonospaceTextElement128, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteMonospaceTextElement135, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteMonospaceTextElement140, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteMonospaceTextElement142, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonDoubleQuoteMonospaceTextElement146, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteMonospaceTextElement150, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteMonospaceTextElement157, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteMonospaceTextElement162, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteMonospaceTextElement164, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonDoubleQuoteMonospaceTextElement168, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteMonospaceTextElement172, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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: 1895, col: 62, offset: 67641}, - label: "line", - expr: &actionExpr{ - pos: position{line: 42, col: 12, offset: 1077}, - run: (*parser).callonQuoteBlockRawContent479, - 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).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, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 506, col: 8, offset: 16673}, + run: (*parser).callonDoubleQuoteMonospaceTextElement178, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", 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: 491, col: 79, offset: 16049}, + 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\"", + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonDoubleQuoteMonospaceTextElement181, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonDoubleQuoteMonospaceTextElement185, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + 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: 493, col: 22, offset: 16135}, + 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: 2595, col: 11, offset: 86299}, + run: (*parser).callonDoubleQuoteMonospaceTextElement189, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, }, }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1765, col: 15, offset: 62853}, - name: "Table", + }, + }, + }, + &actionExpr{ + pos: position{line: 2620, col: 15, offset: 87267}, + run: (*parser).callonDoubleQuoteMonospaceTextElement191, + expr: &litMatcher{ + pos: position{line: 2620, col: 15, offset: 87267}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2626, col: 14, offset: 87382}, + run: (*parser).callonDoubleQuoteMonospaceTextElement193, + expr: &litMatcher{ + pos: position{line: 2626, col: 14, offset: 87382}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2630, col: 14, offset: 87458}, + run: (*parser).callonDoubleQuoteMonospaceTextElement195, + expr: &litMatcher{ + pos: position{line: 2630, col: 14, offset: 87458}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2634, col: 15, offset: 87536}, + run: (*parser).callonDoubleQuoteMonospaceTextElement197, + expr: &litMatcher{ + pos: position{line: 2634, col: 15, offset: 87536}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2638, col: 13, offset: 87611}, + run: (*parser).callonDoubleQuoteMonospaceTextElement199, + expr: &litMatcher{ + pos: position{line: 2638, col: 13, offset: 87611}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + run: (*parser).callonDoubleQuoteMonospaceTextElement201, + expr: &seqExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, - &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: "////", + &litMatcher{ + pos: position{line: 2646, col: 31, offset: 87926}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2646, col: 35, offset: 87930}, + expr: &charClassMatcher{ + pos: position{line: 2646, col: 36, offset: 87931}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 1971, col: 11, offset: 65897}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 1972, col: 11, offset: 65919}, + name: "QuotedString", + }, + &litMatcher{ + pos: position{line: 2624, col: 18, offset: 87346}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &ruleRefExpr{ + pos: position{line: 1974, col: 11, offset: 66009}, + name: "QuotedTextInDoubleQuoteMonospaceText", + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonDoubleQuoteMonospaceTextElement211, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonDoubleQuoteMonospaceTextElement215, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, 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).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, - }, - }, - }, + inverted: false, }, - &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: 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}, - 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: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 1993, col: 5, offset: 66541}, + val: "[^\\r\\n`]", + chars: []rune{'\r', '\n', '`'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 1994, col: 7, offset: 66643}, + run: (*parser).callonDoubleQuoteMonospaceTextElement220, + expr: &seqExpr{ + pos: position{line: 1994, col: 7, offset: 66643}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1994, col: 7, offset: 66643}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonDoubleQuoteMonospaceTextElement223, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInDoubleQuoteMonospaceText", + pos: position{line: 1980, col: 1, offset: 66173}, + expr: &actionExpr{ + pos: position{line: 1981, col: 5, offset: 66217}, + run: (*parser).callonQuotedTextInDoubleQuoteMonospaceText1, + expr: &seqExpr{ + pos: position{line: 1981, col: 5, offset: 66217}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1981, col: 5, offset: 66217}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 1981, col: 16, offset: 66228}, + expr: &ruleRefExpr{ + pos: position{line: 1981, col: 17, offset: 66229}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 1982, col: 5, offset: 66255}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 1983, col: 9, offset: 66270}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1983, col: 9, offset: 66270}, + name: "SingleQuoteMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1984, col: 11, offset: 66305}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 1985, col: 11, offset: 66324}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1986, col: 11, offset: 66345}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 1987, col: 11, offset: 66366}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1988, col: 11, offset: 66390}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "SingleQuoteMonospaceText", + pos: position{line: 2007, col: 1, offset: 67129}, + expr: &actionExpr{ + pos: position{line: 2008, col: 5, offset: 67162}, + run: (*parser).callonSingleQuoteMonospaceText1, + expr: &seqExpr{ + pos: position{line: 2008, col: 5, offset: 67162}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2003, col: 43, offset: 67077}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + &labeledExpr{ + pos: position{line: 2009, col: 5, offset: 67206}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2009, col: 15, offset: 67216}, + name: "SingleQuoteMonospaceTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2005, col: 41, offset: 67123}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + }, + }, + }, + { + name: "SingleQuoteMonospaceTextElements", + pos: position{line: 2014, col: 1, offset: 67392}, + expr: &actionExpr{ + pos: position{line: 2015, col: 5, offset: 67433}, + run: (*parser).callonSingleQuoteMonospaceTextElements1, + expr: &seqExpr{ + pos: position{line: 2015, col: 5, offset: 67433}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2015, col: 5, offset: 67433}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + ¬Expr{ + pos: position{line: 2015, col: 10, offset: 67438}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuoteMonospaceTextElements9, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2016, col: 5, offset: 67477}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2016, col: 14, offset: 67486}, + expr: &ruleRefExpr{ + pos: position{line: 2016, col: 15, offset: 67487}, + name: "SingleQuoteMonospaceTextElement", + }, + }, + }, + &andCodeExpr{ + pos: position{line: 2017, col: 5, offset: 67525}, + run: (*parser).callonSingleQuoteMonospaceTextElements14, + }, + }, + }, + }, + }, + { + name: "SingleQuoteMonospaceTextElement", + pos: position{line: 2023, col: 1, offset: 67666}, + expr: &choiceExpr{ + pos: position{line: 2024, col: 5, offset: 67707}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + run: (*parser).callonSingleQuoteMonospaceTextElement2, + expr: &seqExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + expr: &charClassMatcher{ + pos: position{line: 2809, col: 5, offset: 92974}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2809, col: 15, offset: 92984}, + expr: &choiceExpr{ + pos: position{line: 2809, col: 17, offset: 92986}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2809, col: 17, offset: 92986}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + run: (*parser).callonSingleQuoteMonospaceTextElement11, + expr: &seqExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 9, offset: 93068}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 19, offset: 93078}, + expr: &seqExpr{ + pos: position{line: 2811, col: 20, offset: 93079}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2811, col: 20, offset: 93079}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 27, offset: 93086}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 27, offset: 93086}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonSingleQuoteMonospaceTextElement20, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 2026, col: 7, offset: 67732}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSingleQuoteMonospaceTextElement27, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2026, col: 15, offset: 67740}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSingleQuoteMonospaceTextElement33, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteMonospaceTextElement35, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteMonospaceTextElement37, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonSingleQuoteMonospaceTextElement40, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteMonospaceTextElement44, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteMonospaceTextElement51, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", ignoreCase: false, - want: "\"////\"", + want: "\":\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1906, col: 37, offset: 68010}, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 471, col: 28, offset: 15289}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", - }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent563, - 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).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: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent588, - 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: 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}, + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteMonospaceTextElement56, 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).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, - 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).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, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 471, col: 28, offset: 15289}, + 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, - }, - }, - }, - }, - }, - }, - }, - }, - &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, - }, - }, - }, - &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).callonQuoteBlockRawContent639, - 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: 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, - }, - }, - }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteMonospaceTextElement58, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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, - }, - }, }, }, }, @@ -36406,853 +47277,593 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, - &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: "....", - 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: " ", + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonSingleQuoteMonospaceTextElement62, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteMonospaceTextElement66, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent661, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\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'}, - 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).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, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, - &choiceExpr{ - pos: position{line: 2098, col: 125, offset: 74301}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 2098, col: 126, offset: 74302}, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteMonospaceTextElement73, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", ignoreCase: false, - want: "\"....\"", + want: "\":\"", }, - &zeroOrMoreExpr{ - pos: position{line: 2098, col: 148, offset: 74324}, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 471, col: 28, offset: 15289}, alternatives: []interface{}{ - &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: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteMonospaceTextElement78, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteMonospaceTextElement80, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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: 467, col: 79, offset: 15187}, + 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: 456, col: 31, offset: 14633}, + run: (*parser).callonSingleQuoteMonospaceTextElement84, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteMonospaceTextElement88, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonSingleQuoteMonospaceTextElement94, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonSingleQuoteMonospaceTextElement96, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonSingleQuoteMonospaceTextElement99, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonSingleQuoteMonospaceTextElement101, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonSingleQuoteMonospaceTextElement105, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + 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", - ignoreCase: false, - want: "\"CAUTION\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuoteMonospaceTextElement111, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, }, }, }, - }, - }, - &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: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonSingleQuoteMonospaceTextElement117, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 502, col: 6, offset: 16441}, + 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: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + 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: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteMonospaceTextElement122, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteMonospaceTextElement124, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonSingleQuoteMonospaceTextElement127, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", ignoreCase: false, - want: "\" \"", + want: "\"{counter:\"", }, - &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\"", + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteMonospaceTextElement131, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 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).callonQuoteBlockRawContent803, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteMonospaceTextElement138, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteMonospaceTextElement143, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteMonospaceTextElement145, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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: 463, col: 78, offset: 15031}, + 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: 467, col: 25, offset: 15133}, + run: (*parser).callonSingleQuoteMonospaceTextElement149, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 467, col: 25, offset: 15133}, + 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: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteMonospaceTextElement153, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteMonospaceTextElement160, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteMonospaceTextElement165, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteMonospaceTextElement167, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + 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: 456, col: 31, offset: 14633}, + run: (*parser).callonSingleQuoteMonospaceTextElement171, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 456, col: 31, offset: 14633}, + 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: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteMonospaceTextElement175, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", }, }, }, @@ -37262,690 +47873,808 @@ 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: 506, col: 8, offset: 16673}, + run: (*parser).callonSingleQuoteMonospaceTextElement181, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonSingleQuoteMonospaceTextElement184, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonSingleQuoteMonospaceTextElement188, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + 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: 2595, col: 11, offset: 86299}, + run: (*parser).callonSingleQuoteMonospaceTextElement192, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2620, col: 15, offset: 87267}, + run: (*parser).callonSingleQuoteMonospaceTextElement194, + expr: &litMatcher{ + pos: position{line: 2620, col: 15, offset: 87267}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2626, col: 14, offset: 87382}, + run: (*parser).callonSingleQuoteMonospaceTextElement196, + expr: &litMatcher{ + pos: position{line: 2626, col: 14, offset: 87382}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2630, col: 14, offset: 87458}, + run: (*parser).callonSingleQuoteMonospaceTextElement198, + expr: &litMatcher{ + pos: position{line: 2630, col: 14, offset: 87458}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2634, col: 15, offset: 87536}, + run: (*parser).callonSingleQuoteMonospaceTextElement200, + expr: &litMatcher{ + pos: position{line: 2634, col: 15, offset: 87536}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2638, col: 13, offset: 87611}, + run: (*parser).callonSingleQuoteMonospaceTextElement202, + expr: &litMatcher{ + pos: position{line: 2638, col: 13, offset: 87611}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + run: (*parser).callonSingleQuoteMonospaceTextElement204, + expr: &seqExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2646, col: 31, offset: 87926}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2646, col: 35, offset: 87930}, + expr: &charClassMatcher{ + pos: position{line: 2646, col: 36, offset: 87931}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2030, col: 7, offset: 67853}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 2031, col: 7, offset: 67871}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 2032, col: 7, offset: 67890}, + name: "QuotedTextInSingleQuoteMonospaceText", + }, + &litMatcher{ + pos: position{line: 2624, col: 18, offset: 87346}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonSingleQuoteMonospaceTextElement214, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonSingleQuoteMonospaceTextElement218, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2050, col: 5, offset: 68389}, + run: (*parser).callonSingleQuoteMonospaceTextElement222, + expr: &choiceExpr{ + pos: position{line: 2050, col: 6, offset: 68390}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2050, col: 6, offset: 68390}, + val: "[^\\r\\n` ]", + chars: []rune{'\r', '\n', '`', ' '}, + ignoreCase: false, + inverted: true, + }, + &seqExpr{ + pos: position{line: 2051, col: 7, offset: 68502}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1941, col: 27, offset: 64928}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonSingleQuoteMonospaceTextElement227, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInSingleQuoteMonospaceText", + pos: position{line: 2037, col: 1, offset: 68021}, + expr: &actionExpr{ + pos: position{line: 2038, col: 5, offset: 68065}, + run: (*parser).callonQuotedTextInSingleQuoteMonospaceText1, + expr: &seqExpr{ + pos: position{line: 2038, col: 5, offset: 68065}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2038, col: 5, offset: 68065}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 2038, col: 16, offset: 68076}, + expr: &ruleRefExpr{ + pos: position{line: 2038, col: 17, offset: 68077}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 2039, col: 5, offset: 68103}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 2040, col: 9, offset: 68118}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2040, col: 9, offset: 68118}, + name: "DoubleQuoteMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 2041, col: 11, offset: 68153}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 2042, col: 11, offset: 68172}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 2043, col: 11, offset: 68193}, + name: "MarkedText", + }, + &ruleRefExpr{ + pos: position{line: 2044, col: 11, offset: 68214}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2045, col: 11, offset: 68238}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "EscapedMonospaceText", + pos: position{line: 2055, col: 1, offset: 68703}, + expr: &choiceExpr{ + pos: position{line: 2056, col: 5, offset: 68732}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2056, col: 5, offset: 68732}, + run: (*parser).callonEscapedMonospaceText2, + expr: &seqExpr{ + pos: position{line: 2056, col: 5, offset: 68732}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2056, col: 5, offset: 68732}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1684, col: 25, offset: 55764}, + run: (*parser).callonEscapedMonospaceText5, + expr: &seqExpr{ + pos: position{line: 1684, col: 25, offset: 55764}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1684, col: 25, offset: 55764}, + val: "\\\\", + ignoreCase: false, + want: "\"\\\\\\\\\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1684, col: 30, offset: 55769}, + expr: &litMatcher{ + pos: position{line: 1684, col: 30, offset: 55769}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2056, col: 40, offset: 68767}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + &labeledExpr{ + pos: position{line: 2056, col: 45, offset: 68772}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2056, col: 55, offset: 68782}, + name: "DoubleQuoteMonospaceTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2056, col: 89, offset: 68816}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2058, col: 9, offset: 68973}, + run: (*parser).callonEscapedMonospaceText14, + expr: &seqExpr{ + pos: position{line: 2058, col: 9, offset: 68973}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2058, col: 9, offset: 68973}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + run: (*parser).callonEscapedMonospaceText17, + expr: &oneOrMoreExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + expr: &litMatcher{ + pos: position{line: 1680, col: 25, offset: 55691}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2058, col: 44, offset: 69008}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + &labeledExpr{ + pos: position{line: 2058, col: 49, offset: 69013}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2058, col: 59, offset: 69023}, + name: "SingleQuoteMonospaceTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2058, col: 93, offset: 69057}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2061, col: 9, offset: 69257}, + run: (*parser).callonEscapedMonospaceText24, + expr: &seqExpr{ + pos: position{line: 2061, col: 9, offset: 69257}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2061, col: 9, offset: 69257}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + run: (*parser).callonEscapedMonospaceText27, + expr: &oneOrMoreExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + expr: &litMatcher{ + pos: position{line: 1680, col: 25, offset: 55691}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2061, col: 44, offset: 69292}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + &labeledExpr{ + pos: position{line: 2061, col: 48, offset: 69296}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2061, col: 58, offset: 69306}, + name: "SingleQuoteMonospaceTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2061, col: 92, offset: 69340}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, + }, + }, + }, + }, + }, + { + name: "MarkedText", + pos: position{line: 2068, col: 1, offset: 69637}, + expr: &choiceExpr{ + pos: position{line: 2068, col: 15, offset: 69651}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2068, col: 15, offset: 69651}, + name: "DoubleQuoteMarkedText", + }, + &ruleRefExpr{ + pos: position{line: 2068, col: 39, offset: 69675}, + name: "SingleQuoteMarkedText", + }, + }, + }, + }, + { + name: "DoubleQuoteMarkedText", + pos: position{line: 2082, col: 1, offset: 70013}, + expr: &actionExpr{ + pos: position{line: 2083, col: 5, offset: 70043}, + run: (*parser).callonDoubleQuoteMarkedText1, + expr: &seqExpr{ + pos: position{line: 2083, col: 5, offset: 70043}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2080, col: 35, offset: 70007}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + &labeledExpr{ + pos: position{line: 2084, col: 5, offset: 70079}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2084, col: 15, offset: 70089}, + name: "DoubleQuoteMarkedTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2080, col: 35, offset: 70007}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + }, + }, + }, + }, + { + name: "DoubleQuoteMarkedTextElements", + pos: position{line: 2089, col: 1, offset: 70252}, + expr: &zeroOrMoreExpr{ + pos: position{line: 2089, col: 34, offset: 70285}, + expr: &ruleRefExpr{ + pos: position{line: 2089, col: 34, offset: 70285}, + name: "DoubleQuoteMarkedTextElement", + }, + }, + }, + { + name: "DoubleQuoteMarkedTextElement", + pos: position{line: 2091, col: 1, offset: 70316}, + expr: &actionExpr{ + pos: position{line: 2092, col: 5, offset: 70385}, + run: (*parser).callonDoubleQuoteMarkedTextElement1, + expr: &seqExpr{ + pos: position{line: 2092, col: 5, offset: 70385}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2092, col: 5, offset: 70385}, + expr: &litMatcher{ + pos: position{line: 2080, col: 35, offset: 70007}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + }, + &labeledExpr{ + pos: position{line: 2093, col: 5, offset: 70421}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2094, col: 9, offset: 70439}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2073, col: 5, offset: 69749}, + run: (*parser).callonDoubleQuoteMarkedTextElement7, + expr: &seqExpr{ + pos: position{line: 2073, col: 5, offset: 69749}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2073, col: 5, offset: 69749}, + expr: &charClassMatcher{ + pos: position{line: 2073, col: 5, offset: 69749}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2073, col: 19, offset: 69763}, + expr: &choiceExpr{ + pos: position{line: 2073, col: 21, offset: 69765}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 884, col: 5, offset: 28625}, - val: "> ", + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - want: "\"> \"", + 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).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, - }, - }, - }, - }, - }, - }, - }, - }, - &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, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDoubleQuoteMarkedTextElement14, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, + &litMatcher{ + pos: position{line: 2070, col: 24, offset: 69721}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, }, }, }, - &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, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonDoubleQuoteMarkedTextElement17, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 2096, col: 11, offset: 70514}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDoubleQuoteMarkedTextElement24, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2096, col: 19, offset: 70522}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDoubleQuoteMarkedTextElement30, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, - &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, - }, - }, - }, - }, - }, - }, - &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'}, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteMarkedTextElement32, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteMarkedTextElement34, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonDoubleQuoteMarkedTextElement37, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteMarkedTextElement41, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteMarkedTextElement48, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteMarkedTextElement53, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteMarkedTextElement55, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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 +48684,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: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonDoubleQuoteMarkedTextElement59, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteMarkedTextElement63, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteMarkedTextElement70, expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 471, col: 17, offset: 15278}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", ignoreCase: false, - want: "\"////\"", + want: "\":\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 471, col: 28, offset: 15289}, alternatives: []interface{}{ - &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: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteMarkedTextElement75, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteMarkedTextElement77, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, @@ -38088,629 +48795,568 @@ 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: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonDoubleQuoteMarkedTextElement81, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteMarkedTextElement85, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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, - }, - }, - }, - }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonDoubleQuoteMarkedTextElement91, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonDoubleQuoteMarkedTextElement93, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonDoubleQuoteMarkedTextElement96, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonDoubleQuoteMarkedTextElement98, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonDoubleQuoteMarkedTextElement102, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + 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}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &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, - }, - }, - }, - }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + 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).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: 2878, col: 16, offset: 95050}, + run: (*parser).callonDoubleQuoteMarkedTextElement108, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, - &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: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonDoubleQuoteMarkedTextElement114, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + 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).callonQuoteBlockRawContent1093, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + 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: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteMarkedTextElement119, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuoteMarkedTextElement121, }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonQuoteBlockRawContent1105, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonDoubleQuoteMarkedTextElement124, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteMarkedTextElement128, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteMarkedTextElement135, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteMarkedTextElement140, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteMarkedTextElement142, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonDoubleQuoteMarkedTextElement146, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteMarkedTextElement150, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuoteMarkedTextElement157, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuoteMarkedTextElement162, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuoteMarkedTextElement164, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonDoubleQuoteMarkedTextElement168, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuoteMarkedTextElement172, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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: 506, col: 8, offset: 16673}, + run: (*parser).callonDoubleQuoteMarkedTextElement178, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + 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: 491, col: 79, offset: 16049}, + 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: 493, col: 9, offset: 16122}, + run: (*parser).callonDoubleQuoteMarkedTextElement181, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonDoubleQuoteMarkedTextElement185, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + 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: 493, col: 22, offset: 16135}, + 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: 2595, col: 11, offset: 86299}, + run: (*parser).callonDoubleQuoteMarkedTextElement189, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, }, }, }, @@ -38719,6 +49365,177 @@ var g = &grammar{ }, }, }, + &actionExpr{ + pos: position{line: 2620, col: 15, offset: 87267}, + run: (*parser).callonDoubleQuoteMarkedTextElement191, + expr: &litMatcher{ + pos: position{line: 2620, col: 15, offset: 87267}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2626, col: 14, offset: 87382}, + run: (*parser).callonDoubleQuoteMarkedTextElement193, + expr: &litMatcher{ + pos: position{line: 2626, col: 14, offset: 87382}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2630, col: 14, offset: 87458}, + run: (*parser).callonDoubleQuoteMarkedTextElement195, + expr: &litMatcher{ + pos: position{line: 2630, col: 14, offset: 87458}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2634, col: 15, offset: 87536}, + run: (*parser).callonDoubleQuoteMarkedTextElement197, + expr: &litMatcher{ + pos: position{line: 2634, col: 15, offset: 87536}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2638, col: 13, offset: 87611}, + run: (*parser).callonDoubleQuoteMarkedTextElement199, + expr: &litMatcher{ + pos: position{line: 2638, col: 13, offset: 87611}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + run: (*parser).callonDoubleQuoteMarkedTextElement201, + expr: &seqExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2646, col: 31, offset: 87926}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2646, col: 35, offset: 87930}, + expr: &charClassMatcher{ + pos: position{line: 2646, col: 36, offset: 87931}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2100, col: 11, offset: 70651}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 2101, col: 11, offset: 70673}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 2102, col: 11, offset: 70696}, + name: "QuotedTextInDoubleMarkedBoldText", + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonDoubleQuoteMarkedTextElement210, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonDoubleQuoteMarkedTextElement214, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 2122, col: 5, offset: 71211}, + val: "[^\\r\\n#]", + chars: []rune{'\r', '\n', '#'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 2123, col: 7, offset: 71310}, + run: (*parser).callonDoubleQuoteMarkedTextElement219, + expr: &seqExpr{ + pos: position{line: 2123, col: 7, offset: 71310}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2080, col: 35, offset: 70007}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonDoubleQuoteMarkedTextElement222, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, }, }, }, @@ -38727,998 +49544,994 @@ var g = &grammar{ }, }, { - name: "SidebarBlock", - pos: position{line: 1784, col: 1, offset: 63513}, + name: "QuotedTextInDoubleMarkedBoldText", + pos: position{line: 2109, col: 1, offset: 70850}, expr: &actionExpr{ - pos: position{line: 1784, col: 17, offset: 63529}, - run: (*parser).callonSidebarBlock1, + pos: position{line: 2110, col: 5, offset: 70890}, + run: (*parser).callonQuotedTextInDoubleMarkedBoldText1, + expr: &seqExpr{ + pos: position{line: 2110, col: 5, offset: 70890}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2110, col: 5, offset: 70890}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 2110, col: 16, offset: 70901}, + expr: &ruleRefExpr{ + pos: position{line: 2110, col: 17, offset: 70902}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 2111, col: 5, offset: 70928}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 2112, col: 9, offset: 70943}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2112, col: 9, offset: 70943}, + name: "SingleQuoteMarkedText", + }, + &ruleRefExpr{ + pos: position{line: 2113, col: 11, offset: 70975}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 2114, col: 11, offset: 70994}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 2115, col: 11, offset: 71015}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 2116, col: 11, offset: 71039}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2117, col: 11, offset: 71063}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "SingleQuoteMarkedText", + pos: position{line: 2134, col: 1, offset: 71717}, + expr: &actionExpr{ + pos: position{line: 2135, col: 5, offset: 71747}, + run: (*parser).callonSingleQuoteMarkedText1, expr: &seqExpr{ - pos: position{line: 1784, col: 17, offset: 63529}, + pos: position{line: 2135, col: 5, offset: 71747}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1790, col: 31, offset: 63782}, - val: "****", + pos: position{line: 2130, col: 40, offset: 71669}, + val: "#", ignoreCase: false, - want: "\"****\"", + want: "\"#\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1790, col: 38, offset: 63789}, + &labeledExpr{ + pos: position{line: 2136, col: 5, offset: 71787}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2136, col: 15, offset: 71797}, + name: "SingleQuoteMarkedTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2132, col: 38, offset: 71711}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, + }, + }, + }, + }, + { + name: "SingleQuoteMarkedTextElements", + pos: position{line: 2141, col: 1, offset: 71964}, + expr: &actionExpr{ + pos: position{line: 2142, col: 5, offset: 72002}, + run: (*parser).callonSingleQuoteMarkedTextElements1, + expr: &seqExpr{ + pos: position{line: 2142, col: 5, offset: 72002}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2142, col: 5, offset: 72002}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + ¬Expr{ + pos: position{line: 2142, col: 10, offset: 72007}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuoteMarkedTextElements9, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2143, col: 5, offset: 72046}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2143, col: 14, offset: 72055}, + expr: &ruleRefExpr{ + pos: position{line: 2143, col: 15, offset: 72056}, + name: "SingleQuoteMarkedTextElement", + }, + }, + }, + &andCodeExpr{ + pos: position{line: 2144, col: 5, offset: 72092}, + run: (*parser).callonSingleQuoteMarkedTextElements14, + }, + }, + }, + }, + }, + { + name: "SingleQuoteMarkedTextElement", + pos: position{line: 2150, col: 1, offset: 72233}, + expr: &choiceExpr{ + pos: position{line: 2151, col: 5, offset: 72270}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2073, col: 5, offset: 69749}, + run: (*parser).callonSingleQuoteMarkedTextElement2, + expr: &seqExpr{ + pos: position{line: 2073, col: 5, offset: 69749}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2073, col: 5, offset: 69749}, + expr: &charClassMatcher{ + pos: position{line: 2073, col: 5, offset: 69749}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2073, col: 19, offset: 69763}, + expr: &choiceExpr{ + pos: position{line: 2073, col: 21, offset: 69765}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuoteMarkedTextElement9, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &litMatcher{ + pos: position{line: 2070, col: 24, offset: 69721}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonSingleQuoteMarkedTextElement12, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &seqExpr{ + pos: position{line: 2153, col: 7, offset: 72304}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - want: "\" \"", + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlock7, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSingleQuoteMarkedTextElement19, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + 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, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 1784, col: 44, offset: 63556}, - label: "content", - expr: &ruleRefExpr{ - pos: position{line: 1784, col: 53, offset: 63565}, - name: "SidebarBlockRawContent", - }, - }, - &choiceExpr{ - pos: position{line: 1792, col: 29, offset: 63829}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1792, col: 30, offset: 63830}, - exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2153, col: 15, offset: 72312}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1792, col: 30, offset: 63830}, - val: "****", + pos: position{line: 2886, col: 12, offset: 95178}, + 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: 2886, col: 19, offset: 95185}, + 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, - }, - }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSingleQuoteMarkedTextElement25, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, }, }, }, - }, - }, - }, - { - 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: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteMarkedTextElement27, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteMarkedTextElement29, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonSingleQuoteMarkedTextElement32, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1792, col: 30, offset: 63830}, - val: "****", + pos: position{line: 463, col: 25, offset: 14978}, + 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: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteMarkedTextElement36, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteMarkedTextElement43, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteMarkedTextElement48, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteMarkedTextElement50, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, }, }, }, }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + 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: 467, col: 25, offset: 15133}, + run: (*parser).callonSingleQuoteMarkedTextElement54, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteMarkedTextElement58, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, expr: &actionExpr{ - pos: position{line: 929, col: 5, offset: 30339}, - run: (*parser).callonSidebarBlockRawContent33, + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteMarkedTextElement65, expr: &seqExpr{ - pos: position{line: 929, col: 5, offset: 30339}, + pos: position{line: 471, col: 17, offset: 15278}, exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + 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: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteMarkedTextElement70, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteMarkedTextElement72, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, expr: &charClassMatcher{ - pos: position{line: 929, col: 28, offset: 30362}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 473, col: 9, offset: 15343}, + 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: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonSingleQuoteMarkedTextElement76, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteMarkedTextElement80, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonSingleQuoteMarkedTextElement86, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonSingleQuoteMarkedTextElement88, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonSingleQuoteMarkedTextElement91, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonSingleQuoteMarkedTextElement93, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonSingleQuoteMarkedTextElement97, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuoteMarkedTextElement103, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonSingleQuoteMarkedTextElement109, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 502, col: 6, offset: 16441}, + 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: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, }, }, }, }, }, - }, - }, - &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{}{ + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteMarkedTextElement114, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuoteMarkedTextElement116, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonSingleQuoteMarkedTextElement119, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", ignoreCase: false, - want: "\" \"", + want: "\"{counter:\"", }, - &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\"", + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteMarkedTextElement123, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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).callonSidebarBlockRawContent118, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteMarkedTextElement130, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteMarkedTextElement135, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteMarkedTextElement137, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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: 463, col: 78, offset: 15031}, + 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: 467, col: 25, offset: 15133}, + run: (*parser).callonSingleQuoteMarkedTextElement141, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 467, col: 25, offset: 15133}, + 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: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteMarkedTextElement145, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuoteMarkedTextElement152, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuoteMarkedTextElement157, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuoteMarkedTextElement159, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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: 467, col: 79, offset: 15187}, + 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: 456, col: 31, offset: 14633}, + run: (*parser).callonSingleQuoteMarkedTextElement163, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 456, col: 31, offset: 14633}, + 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: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuoteMarkedTextElement167, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 456, col: 54, offset: 14656}, + 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 +50541,1132 @@ 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: 506, col: 8, offset: 16673}, + run: (*parser).callonSingleQuoteMarkedTextElement173, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonSingleQuoteMarkedTextElement176, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonSingleQuoteMarkedTextElement180, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + 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, - }, - }, + }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonSingleQuoteMarkedTextElement184, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2620, col: 15, offset: 87267}, + run: (*parser).callonSingleQuoteMarkedTextElement186, + expr: &litMatcher{ + pos: position{line: 2620, col: 15, offset: 87267}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2626, col: 14, offset: 87382}, + run: (*parser).callonSingleQuoteMarkedTextElement188, + expr: &litMatcher{ + pos: position{line: 2626, col: 14, offset: 87382}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2630, col: 14, offset: 87458}, + run: (*parser).callonSingleQuoteMarkedTextElement190, + expr: &litMatcher{ + pos: position{line: 2630, col: 14, offset: 87458}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2634, col: 15, offset: 87536}, + run: (*parser).callonSingleQuoteMarkedTextElement192, + expr: &litMatcher{ + pos: position{line: 2634, col: 15, offset: 87536}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2638, col: 13, offset: 87611}, + run: (*parser).callonSingleQuoteMarkedTextElement194, + expr: &litMatcher{ + pos: position{line: 2638, col: 13, offset: 87611}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + run: (*parser).callonSingleQuoteMarkedTextElement196, + expr: &seqExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2646, col: 31, offset: 87926}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2646, col: 35, offset: 87930}, + expr: &charClassMatcher{ + pos: position{line: 2646, col: 36, offset: 87931}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2157, col: 7, offset: 72425}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 2158, col: 7, offset: 72443}, + name: "QuotedString", + }, + &ruleRefExpr{ + pos: position{line: 2159, col: 7, offset: 72462}, + name: "QuotedTextInSingleQuoteMarkedText", + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonSingleQuoteMarkedTextElement205, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonSingleQuoteMarkedTextElement209, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &charClassMatcher{ + pos: position{line: 2176, col: 5, offset: 72929}, + val: "[^\\r\\n #]", + chars: []rune{'\r', '\n', ' ', '#'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 2177, col: 7, offset: 73034}, + run: (*parser).callonSingleQuoteMarkedTextElement214, + expr: &seqExpr{ + pos: position{line: 2177, col: 7, offset: 73034}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2177, col: 7, offset: 73034}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonSingleQuoteMarkedTextElement217, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInSingleQuoteMarkedText", + pos: position{line: 2163, col: 1, offset: 72567}, + expr: &actionExpr{ + pos: position{line: 2164, col: 5, offset: 72608}, + run: (*parser).callonQuotedTextInSingleQuoteMarkedText1, + expr: &seqExpr{ + pos: position{line: 2164, col: 5, offset: 72608}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2164, col: 5, offset: 72608}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 2164, col: 16, offset: 72619}, + expr: &ruleRefExpr{ + pos: position{line: 2164, col: 17, offset: 72620}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 2165, col: 5, offset: 72646}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 2166, col: 9, offset: 72661}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2166, col: 9, offset: 72661}, + name: "DoubleQuoteMarkedText", + }, + &ruleRefExpr{ + pos: position{line: 2167, col: 11, offset: 72693}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 2168, col: 11, offset: 72712}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 2169, col: 11, offset: 72733}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 2170, col: 11, offset: 72757}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2171, col: 11, offset: 72781}, + name: "SuperscriptText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "EscapedMarkedText", + pos: position{line: 2181, col: 1, offset: 73209}, + expr: &choiceExpr{ + pos: position{line: 2182, col: 5, offset: 73234}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2182, col: 5, offset: 73234}, + run: (*parser).callonEscapedMarkedText2, + expr: &seqExpr{ + pos: position{line: 2182, col: 5, offset: 73234}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2182, col: 5, offset: 73234}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1684, col: 25, offset: 55764}, + run: (*parser).callonEscapedMarkedText5, + expr: &seqExpr{ + pos: position{line: 1684, col: 25, offset: 55764}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1684, col: 25, offset: 55764}, + val: "\\\\", + ignoreCase: false, + want: "\"\\\\\\\\\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1684, col: 30, offset: 55769}, + expr: &litMatcher{ + pos: position{line: 1684, col: 30, offset: 55769}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2182, col: 40, offset: 73269}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + &labeledExpr{ + pos: position{line: 2182, col: 45, offset: 73274}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2182, col: 55, offset: 73284}, + name: "DoubleQuoteMarkedTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2182, col: 86, offset: 73315}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2184, col: 9, offset: 73472}, + run: (*parser).callonEscapedMarkedText14, + expr: &seqExpr{ + pos: position{line: 2184, col: 9, offset: 73472}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2184, col: 9, offset: 73472}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + run: (*parser).callonEscapedMarkedText17, + expr: &oneOrMoreExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + expr: &litMatcher{ + pos: position{line: 1680, col: 25, offset: 55691}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2184, col: 44, offset: 73507}, + val: "##", + ignoreCase: false, + want: "\"##\"", + }, + &labeledExpr{ + pos: position{line: 2184, col: 49, offset: 73512}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2184, col: 59, offset: 73522}, + name: "SingleQuoteMarkedTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2184, col: 90, offset: 73553}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2187, col: 9, offset: 73753}, + run: (*parser).callonEscapedMarkedText24, + expr: &seqExpr{ + pos: position{line: 2187, col: 9, offset: 73753}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2187, col: 9, offset: 73753}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + run: (*parser).callonEscapedMarkedText27, + expr: &oneOrMoreExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + expr: &litMatcher{ + pos: position{line: 1680, col: 25, offset: 55691}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2187, col: 44, offset: 73788}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, + &labeledExpr{ + pos: position{line: 2187, col: 48, offset: 73792}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2187, col: 58, offset: 73802}, + name: "SingleQuoteMarkedTextElements", + }, + }, + &litMatcher{ + pos: position{line: 2187, col: 89, offset: 73833}, + val: "#", + ignoreCase: false, + want: "\"#\"", + }, + }, + }, + }, + }, + }, + }, + { + name: "SubscriptText", + pos: position{line: 2194, col: 1, offset: 74145}, + expr: &actionExpr{ + pos: position{line: 2195, col: 5, offset: 74167}, + run: (*parser).callonSubscriptText1, + expr: &seqExpr{ + pos: position{line: 2195, col: 5, offset: 74167}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2201, col: 27, offset: 74382}, + val: "~", + ignoreCase: false, + want: "\"~\"", + }, + &labeledExpr{ + pos: position{line: 2196, col: 5, offset: 74194}, + label: "element", + expr: &ruleRefExpr{ + pos: position{line: 2196, col: 14, offset: 74203}, + name: "SubscriptTextElement", + }, + }, + &litMatcher{ + pos: position{line: 2201, col: 27, offset: 74382}, + val: "~", + ignoreCase: false, + want: "\"~\"", + }, + }, + }, + }, + }, + { + name: "SubscriptTextElement", + pos: position{line: 2203, col: 1, offset: 74387}, + expr: &choiceExpr{ + pos: position{line: 2203, col: 25, offset: 74411}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2203, col: 25, offset: 74411}, + name: "QuotedText", + }, + &actionExpr{ + pos: position{line: 2205, col: 21, offset: 74463}, + run: (*parser).callonSubscriptTextElement3, + expr: &oneOrMoreExpr{ + pos: position{line: 2205, col: 21, offset: 74463}, + expr: &charClassMatcher{ + pos: position{line: 2205, col: 21, offset: 74463}, + val: "[^\\r\\n ~]", + chars: []rune{'\r', '\n', ' ', '~'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + { + name: "EscapedSubscriptText", + pos: position{line: 2209, col: 1, offset: 74548}, + expr: &actionExpr{ + pos: position{line: 2210, col: 5, offset: 74577}, + run: (*parser).callonEscapedSubscriptText1, + expr: &seqExpr{ + pos: position{line: 2210, col: 5, offset: 74577}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2210, col: 5, offset: 74577}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + run: (*parser).callonEscapedSubscriptText4, + expr: &oneOrMoreExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + expr: &litMatcher{ + pos: position{line: 1680, col: 25, offset: 55691}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2201, col: 27, offset: 74382}, + val: "~", + ignoreCase: false, + want: "\"~\"", + }, + &labeledExpr{ + pos: position{line: 2212, col: 5, offset: 74645}, + label: "element", + expr: &ruleRefExpr{ + pos: position{line: 2212, col: 14, offset: 74654}, + name: "SubscriptTextElement", + }, + }, + &litMatcher{ + pos: position{line: 2201, col: 27, offset: 74382}, + val: "~", + ignoreCase: false, + want: "\"~\"", + }, + }, + }, + }, + }, + { + name: "SuperscriptText", + pos: position{line: 2220, col: 1, offset: 74917}, + expr: &actionExpr{ + pos: position{line: 2221, col: 5, offset: 74941}, + run: (*parser).callonSuperscriptText1, + expr: &seqExpr{ + pos: position{line: 2221, col: 5, offset: 74941}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2227, col: 29, offset: 75168}, + val: "^", + ignoreCase: false, + want: "\"^\"", + }, + &labeledExpr{ + pos: position{line: 2222, col: 5, offset: 74971}, + label: "element", + expr: &ruleRefExpr{ + pos: position{line: 2222, col: 14, offset: 74980}, + name: "SuperscriptTextElement", + }, + }, + &litMatcher{ + pos: position{line: 2227, col: 29, offset: 75168}, + val: "^", + ignoreCase: false, + want: "\"^\"", + }, + }, + }, + }, + }, + { + name: "SuperscriptTextElement", + pos: position{line: 2229, col: 1, offset: 75173}, + expr: &choiceExpr{ + pos: position{line: 2229, col: 27, offset: 75199}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2229, col: 27, offset: 75199}, + name: "QuotedText", + }, + &actionExpr{ + pos: position{line: 2231, col: 23, offset: 75255}, + run: (*parser).callonSuperscriptTextElement3, + expr: &oneOrMoreExpr{ + pos: position{line: 2231, col: 23, offset: 75255}, + expr: &charClassMatcher{ + pos: position{line: 2231, col: 23, offset: 75255}, + val: "[^\\r\\n ^]", + chars: []rune{'\r', '\n', ' ', '^'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + { + name: "EscapedSuperscriptText", + pos: position{line: 2235, col: 1, offset: 75340}, + expr: &actionExpr{ + pos: position{line: 2236, col: 5, offset: 75371}, + run: (*parser).callonEscapedSuperscriptText1, + expr: &seqExpr{ + pos: position{line: 2236, col: 5, offset: 75371}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2236, col: 5, offset: 75371}, + label: "backslashes", + expr: &actionExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + run: (*parser).callonEscapedSuperscriptText4, + expr: &oneOrMoreExpr{ + pos: position{line: 1680, col: 25, offset: 55691}, + expr: &litMatcher{ + pos: position{line: 1680, col: 25, offset: 55691}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2227, col: 29, offset: 75168}, + val: "^", + ignoreCase: false, + want: "\"^\"", + }, + &labeledExpr{ + pos: position{line: 2238, col: 5, offset: 75441}, + label: "element", + expr: &ruleRefExpr{ + pos: position{line: 2238, col: 14, offset: 75450}, + name: "SuperscriptTextElement", + }, + }, + &litMatcher{ + pos: position{line: 2227, col: 29, offset: 75168}, + val: "^", + ignoreCase: false, + want: "\"^\"", + }, + }, + }, + }, + }, + { + name: "QuotedString", + pos: position{line: 2247, col: 1, offset: 75898}, + expr: &choiceExpr{ + pos: position{line: 2247, col: 17, offset: 75914}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2247, col: 17, offset: 75914}, + name: "SingleQuotedString", + }, + &ruleRefExpr{ + pos: position{line: 2247, col: 38, offset: 75935}, + name: "DoubleQuotedString", + }, + }, + }, + }, + { + name: "SingleQuotedString", + pos: position{line: 2249, col: 1, offset: 75955}, + expr: &actionExpr{ + pos: position{line: 2250, col: 5, offset: 75982}, + run: (*parser).callonSingleQuotedString1, + expr: &seqExpr{ + pos: position{line: 2250, col: 5, offset: 75982}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2261, col: 27, offset: 76313}, + val: "'`", + ignoreCase: false, + want: "\"'`\"", + }, + ¬Expr{ + pos: position{line: 2261, col: 32, offset: 76318}, + expr: &charClassMatcher{ + pos: position{line: 2261, col: 33, offset: 76319}, + val: "[ \\t\\r\\n]", + chars: []rune{' ', '\t', '\r', '\n'}, + ignoreCase: false, + inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 2251, col: 5, offset: 76010}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2251, col: 14, offset: 76019}, + name: "SingleQuotedStringElements", + }, + }, + &litMatcher{ + pos: position{line: 2263, col: 25, offset: 76354}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + }, + }, + }, + { + name: "SingleQuotedStringElements", + pos: position{line: 2256, col: 1, offset: 76163}, + expr: &actionExpr{ + pos: position{line: 2257, col: 5, offset: 76198}, + run: (*parser).callonSingleQuotedStringElements1, + expr: &labeledExpr{ + pos: position{line: 2257, col: 5, offset: 76198}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2257, col: 14, offset: 76207}, + expr: &ruleRefExpr{ + pos: position{line: 2257, col: 15, offset: 76208}, + name: "SingleQuotedStringElement", + }, + }, + }, + }, + }, + { + name: "SingleQuotedStringElement", + pos: position{line: 2270, col: 1, offset: 76567}, + expr: &actionExpr{ + pos: position{line: 2271, col: 5, offset: 76601}, + run: (*parser).callonSingleQuotedStringElement1, + expr: &seqExpr{ + pos: position{line: 2271, col: 5, offset: 76601}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2271, col: 5, offset: 76601}, + expr: &litMatcher{ + pos: position{line: 2263, col: 25, offset: 76354}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &labeledExpr{ + pos: position{line: 2272, col: 5, offset: 76627}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2273, col: 9, offset: 76645}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2265, col: 21, offset: 76380}, + run: (*parser).callonSingleQuotedStringElement7, + expr: &seqExpr{ + pos: position{line: 2265, col: 21, offset: 76380}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2265, col: 21, offset: 76380}, + expr: &charClassMatcher{ + pos: position{line: 2265, col: 21, offset: 76380}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2265, col: 31, offset: 76390}, + expr: &choiceExpr{ + pos: position{line: 2265, col: 33, offset: 76392}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + 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).callonSidebarBlockRawContent203, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuotedStringElement14, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + 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: 2263, col: 25, offset: 76354}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", }, }, }, }, - &ruleRefExpr{ - pos: position{line: 1805, col: 15, offset: 64211}, - name: "ImageBlock", + }, + }, + }, + &seqExpr{ + pos: position{line: 2274, col: 11, offset: 76672}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSingleQuotedStringElement21, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, - &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: "\"_ _ _\"", - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 2274, col: 19, offset: 76680}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSingleQuotedStringElement27, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuotedStringElement29, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuotedStringElement31, }, - &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: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonSingleQuotedStringElement34, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 463, col: 25, offset: 14978}, + 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: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuotedStringElement38, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuotedStringElement45, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuotedStringElement50, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuotedStringElement52, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonSingleQuotedStringElement56, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuotedStringElement60, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuotedStringElement67, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuotedStringElement72, expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuotedStringElement74, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -40150,75 +51677,66 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + 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: 456, col: 31, offset: 14633}, + run: (*parser).callonSingleQuotedStringElement78, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuotedStringElement82, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", }, }, }, @@ -40226,285 +51744,602 @@ 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: 2587, col: 5, offset: 86026}, + run: (*parser).callonSingleQuotedStringElement88, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonSingleQuotedStringElement90, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonSingleQuotedStringElement93, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 491, col: 27, offset: 15997}, alternatives: []interface{}{ - &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: "----", + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonSingleQuotedStringElement95, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonSingleQuotedStringElement99, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuotedStringElement105, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", ignoreCase: false, - want: "\"----\"", + want: "\"\\t\"", }, - &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: " ", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonSingleQuotedStringElement111, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + 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: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + 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: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuotedStringElement116, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSingleQuotedStringElement118, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonSingleQuotedStringElement121, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuotedStringElement125, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuotedStringElement132, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuotedStringElement137, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuotedStringElement139, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonSingleQuotedStringElement143, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuotedStringElement147, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSingleQuotedStringElement154, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSingleQuotedStringElement159, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSingleQuotedStringElement161, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonSingleQuotedStringElement165, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSingleQuotedStringElement169, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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).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'}, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonSingleQuotedStringElement175, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", 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: 491, col: 79, offset: 16049}, + 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).callonSidebarBlockRawContent345, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonSingleQuotedStringElement178, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonSingleQuotedStringElement182, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + 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", + pos: position{line: 493, col: 22, offset: 16135}, + 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: "\">>\"", }, }, }, }, }, + }, + }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonSingleQuotedStringElement186, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2277, col: 11, offset: 76792}, + name: "InlineMacro", + }, + &seqExpr{ + pos: position{line: 2278, col: 11, offset: 76814}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 954, col: 14, offset: 30337}, + run: (*parser).callonSingleQuotedStringElement190, + expr: &seqExpr{ + pos: position{line: 954, col: 14, offset: 30337}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuotedStringElement194, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 954, col: 20, offset: 30343}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 954, col: 24, offset: 30347}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuotedStringElement200, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 954, col: 31, offset: 30354}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSingleQuotedStringElement208, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -40512,416 +52347,488 @@ var g = &grammar{ }, }, }, - &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, + }, + ¬Expr{ + pos: position{line: 2278, col: 21, offset: 76824}, + expr: &litMatcher{ + pos: position{line: 2263, col: 25, offset: 76354}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 2279, col: 11, offset: 76881}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSingleQuotedStringElement215, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2279, col: 17, offset: 76887}, + expr: &litMatcher{ + pos: position{line: 2263, col: 25, offset: 76354}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2620, col: 15, offset: 87267}, + run: (*parser).callonSingleQuotedStringElement219, + expr: &litMatcher{ + pos: position{line: 2620, col: 15, offset: 87267}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2626, col: 14, offset: 87382}, + run: (*parser).callonSingleQuotedStringElement221, + expr: &litMatcher{ + pos: position{line: 2626, col: 14, offset: 87382}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2630, col: 14, offset: 87458}, + run: (*parser).callonSingleQuotedStringElement223, + expr: &litMatcher{ + pos: position{line: 2630, col: 14, offset: 87458}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2634, col: 15, offset: 87536}, + run: (*parser).callonSingleQuotedStringElement225, + expr: &litMatcher{ + pos: position{line: 2634, col: 15, offset: 87536}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2638, col: 13, offset: 87611}, + run: (*parser).callonSingleQuotedStringElement227, + expr: &litMatcher{ + pos: position{line: 2638, col: 13, offset: 87611}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + run: (*parser).callonSingleQuotedStringElement229, + expr: &seqExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2646, col: 31, offset: 87926}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2646, col: 35, offset: 87930}, + expr: &charClassMatcher{ + pos: position{line: 2646, col: 36, offset: 87931}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2281, col: 11, offset: 76936}, + name: "QuotedTextInSingleQuotedString", + }, + &ruleRefExpr{ + pos: position{line: 2282, col: 11, offset: 76977}, + name: "DoubleQuotedString", + }, + &charClassMatcher{ + pos: position{line: 2299, col: 41, offset: 77459}, + val: "[^\\r\\n\\t `]", + chars: []rune{'\r', '\n', '\t', ' ', '`'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 2299, col: 55, offset: 77473}, + run: (*parser).callonSingleQuotedStringElement238, + expr: &seqExpr{ + pos: position{line: 2299, col: 55, offset: 77473}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2299, col: 55, offset: 77473}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + ¬Expr{ + pos: position{line: 2299, col: 59, offset: 77477}, + expr: &litMatcher{ + pos: position{line: 2299, col: 60, offset: 77478}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInSingleQuotedString", + pos: position{line: 2288, col: 1, offset: 77085}, + expr: &actionExpr{ + pos: position{line: 2289, col: 5, offset: 77123}, + run: (*parser).callonQuotedTextInSingleQuotedString1, + expr: &seqExpr{ + pos: position{line: 2289, col: 5, offset: 77123}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2289, col: 5, offset: 77123}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 2289, col: 16, offset: 77134}, + expr: &ruleRefExpr{ + pos: position{line: 2289, col: 17, offset: 77135}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 2290, col: 5, offset: 77161}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 2290, col: 11, offset: 77167}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2290, col: 11, offset: 77167}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 2291, col: 11, offset: 77186}, + name: "ItalicText", + }, + &actionExpr{ + pos: position{line: 2292, col: 12, offset: 77208}, + run: (*parser).callonQuotedTextInSingleQuotedString10, + expr: &seqExpr{ + pos: position{line: 2292, col: 12, offset: 77208}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2292, col: 12, offset: 77208}, + expr: &litMatcher{ + pos: position{line: 2292, col: 13, offset: 77209}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &labeledExpr{ + pos: position{line: 2292, col: 18, offset: 77214}, + label: "element", + expr: &ruleRefExpr{ + pos: position{line: 2292, col: 27, offset: 77223}, + name: "MonospaceText", + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2293, col: 11, offset: 77272}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2294, col: 11, offset: 77296}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2295, col: 11, offset: 77322}, + name: "MarkedText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "DoubleQuotedString", + pos: position{line: 2303, col: 1, offset: 77550}, + expr: &actionExpr{ + pos: position{line: 2303, col: 23, offset: 77572}, + run: (*parser).callonDoubleQuotedString1, + expr: &seqExpr{ + pos: position{line: 2303, col: 23, offset: 77572}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2340, col: 27, offset: 78818}, + val: "\"`", + ignoreCase: false, + want: "\"\\\"`\"", + }, + ¬Expr{ + pos: position{line: 2340, col: 33, offset: 78824}, + expr: &charClassMatcher{ + pos: position{line: 2340, col: 34, offset: 78825}, + val: "[ \\t\\r\\n]", + chars: []rune{' ', '\t', '\r', '\n'}, + ignoreCase: false, + inverted: false, + }, + }, + &labeledExpr{ + pos: position{line: 2303, col: 46, offset: 77595}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 2303, col: 55, offset: 77604}, + name: "DoubleQuotedStringElements", + }, + }, + &litMatcher{ + pos: position{line: 2342, col: 25, offset: 78860}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + }, + }, + }, + }, + { + name: "DoubleQuotedStringElements", + pos: position{line: 2307, col: 1, offset: 77743}, + expr: &actionExpr{ + pos: position{line: 2307, col: 31, offset: 77773}, + run: (*parser).callonDoubleQuotedStringElements1, + expr: &labeledExpr{ + pos: position{line: 2307, col: 31, offset: 77773}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2307, col: 41, offset: 77783}, + expr: &ruleRefExpr{ + pos: position{line: 2307, col: 41, offset: 77783}, + name: "DoubleQuotedStringElement", + }, + }, + }, + }, + }, + { + name: "DoubleQuotedStringElement", + pos: position{line: 2312, col: 1, offset: 77944}, + expr: &actionExpr{ + pos: position{line: 2313, col: 5, offset: 77978}, + run: (*parser).callonDoubleQuotedStringElement1, + expr: &seqExpr{ + pos: position{line: 2313, col: 5, offset: 77978}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2313, col: 5, offset: 77978}, + expr: &litMatcher{ + pos: position{line: 2342, col: 25, offset: 78860}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + }, + &labeledExpr{ + pos: position{line: 2314, col: 5, offset: 78004}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2315, col: 9, offset: 78022}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2265, col: 21, offset: 76380}, + run: (*parser).callonDoubleQuotedStringElement7, + expr: &seqExpr{ + pos: position{line: 2265, col: 21, offset: 76380}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2265, col: 21, offset: 76380}, + expr: &charClassMatcher{ + pos: position{line: 2265, col: 21, offset: 76380}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2265, col: 31, offset: 76390}, + expr: &choiceExpr{ + pos: position{line: 2265, col: 33, offset: 76392}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDoubleQuotedStringElement14, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, }, &litMatcher{ - pos: position{line: 1738, col: 29, offset: 62027}, - val: "____", + pos: position{line: 2263, col: 25, offset: 76354}, + val: "`'", ignoreCase: false, - want: "\"____\"", + 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\"", - }, - }, + }, + }, + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 2316, col: 11, offset: 78049}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 954, col: 14, offset: 30337}, + run: (*parser).callonDoubleQuotedStringElement18, + expr: &seqExpr{ + pos: position{line: 954, col: 14, offset: 30337}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDoubleQuotedStringElement22, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, + }, + &litMatcher{ + pos: position{line: 954, col: 20, offset: 30343}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 954, col: 24, offset: 30347}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\" \"", }, - }, - }, - &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, - }, - }, - }, - }, - }, - }, - }, - }, - }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDoubleQuotedStringElement28, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, }, - &choiceExpr{ - pos: position{line: 1740, col: 27, offset: 62097}, + }, + &andExpr{ + pos: position{line: 954, col: 31, offset: 30354}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, 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}, + pos: position{line: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, - }, - }, - }, - }, - &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}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, - }, + line: 2890, col: 9, offset: 95286, }, }, - }, - }, - &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, - }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + 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}, + pos: position{line: 2886, col: 19, offset: 95185}, val: "\r\n", ignoreCase: false, want: "\"\\r\\n\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 2886, col: 28, offset: 95194}, + run: (*parser).callonDoubleQuotedStringElement36, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -40929,206 +52836,334 @@ 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: "++++", + }, + ¬Expr{ + pos: position{line: 2316, col: 21, offset: 78059}, + expr: &litMatcher{ + pos: position{line: 2263, col: 25, offset: 76354}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 2317, col: 11, offset: 78116}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDoubleQuotedStringElement43, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2317, col: 17, offset: 78122}, + expr: &litMatcher{ + pos: position{line: 2342, col: 25, offset: 78860}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + }, + }, + }, + &seqExpr{ + pos: position{line: 2318, col: 11, offset: 78154}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDoubleQuotedStringElement51, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2318, col: 19, offset: 78162}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonDoubleQuotedStringElement57, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", ignoreCase: false, - want: "\"++++\"", + want: "\"\\r\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1891, col: 42, offset: 67509}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuotedStringElement59, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuotedStringElement61, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonDoubleQuotedStringElement64, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", ignoreCase: false, - want: "\" \"", + want: "\"{counter:\"", }, - &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\"", + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuotedStringElement68, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 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'}, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuotedStringElement75, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuotedStringElement80, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuotedStringElement82, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonDoubleQuotedStringElement86, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuotedStringElement90, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuotedStringElement97, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuotedStringElement102, expr: &charClassMatcher{ - pos: position{line: 42, col: 26, offset: 1091}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuotedStringElement104, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -41139,75 +53174,66 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + 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: 456, col: 31, offset: 14633}, + run: (*parser).callonDoubleQuotedStringElement108, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuotedStringElement112, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", }, }, }, @@ -41215,378 +53241,1304 @@ var g = &grammar{ }, }, }, - &ruleRefExpr{ - pos: position{line: 1817, col: 15, offset: 64562}, - name: "Table", + }, + }, + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonDoubleQuotedStringElement118, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonDoubleQuotedStringElement120, }, - &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}, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonDoubleQuotedStringElement123, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 491, col: 27, offset: 15997}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonDoubleQuotedStringElement125, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonDoubleQuotedStringElement129, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonDoubleQuotedStringElement135, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonDoubleQuotedStringElement141, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuotedStringElement146, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonDoubleQuotedStringElement148, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonDoubleQuotedStringElement151, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuotedStringElement155, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuotedStringElement162, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuotedStringElement167, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuotedStringElement169, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonDoubleQuotedStringElement173, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuotedStringElement177, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonDoubleQuotedStringElement184, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonDoubleQuotedStringElement189, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonDoubleQuotedStringElement191, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonDoubleQuotedStringElement195, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonDoubleQuotedStringElement199, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonDoubleQuotedStringElement205, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + 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\"", + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonDoubleQuotedStringElement208, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonDoubleQuotedStringElement212, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + 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: 2595, col: 11, offset: 86299}, + run: (*parser).callonDoubleQuotedStringElement216, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, }, }, - &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{}{ + }, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2321, col: 11, offset: 78274}, + name: "InlineMacro", + }, + &ruleRefExpr{ + pos: position{line: 2322, col: 11, offset: 78296}, + name: "QuotedTextInDoubleQuotedString", + }, + &ruleRefExpr{ + pos: position{line: 2323, col: 11, offset: 78337}, + name: "SingleQuotedString", + }, + &actionExpr{ + pos: position{line: 2344, col: 41, offset: 78907}, + run: (*parser).callonDoubleQuotedStringElement221, + expr: &choiceExpr{ + pos: position{line: 2344, col: 42, offset: 78908}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2344, col: 42, offset: 78908}, + val: "[^\\r\\n\\t `]", + chars: []rune{'\r', '\n', '\t', ' ', '`'}, + ignoreCase: false, + inverted: true, + }, + &seqExpr{ + pos: position{line: 2344, col: 56, offset: 78922}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 2344, col: 56, offset: 78922}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + ¬Expr{ + pos: position{line: 2344, col: 60, offset: 78926}, + expr: &litMatcher{ + pos: position{line: 2344, col: 61, offset: 78927}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "QuotedTextInDoubleQuotedString", + pos: position{line: 2328, col: 1, offset: 78448}, + expr: &actionExpr{ + pos: position{line: 2329, col: 5, offset: 78486}, + run: (*parser).callonQuotedTextInDoubleQuotedString1, + expr: &seqExpr{ + pos: position{line: 2329, col: 5, offset: 78486}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2329, col: 5, offset: 78486}, + label: "attributes", + expr: &zeroOrOneExpr{ + pos: position{line: 2329, col: 16, offset: 78497}, + expr: &ruleRefExpr{ + pos: position{line: 2329, col: 17, offset: 78498}, + name: "LongHandAttributes", + }, + }, + }, + &labeledExpr{ + pos: position{line: 2330, col: 5, offset: 78524}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 2331, col: 9, offset: 78539}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2331, col: 9, offset: 78539}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 2332, col: 11, offset: 78558}, + name: "ItalicText", + }, + &actionExpr{ + pos: position{line: 2333, col: 12, offset: 78580}, + run: (*parser).callonQuotedTextInDoubleQuotedString10, + expr: &seqExpr{ + pos: position{line: 2333, col: 12, offset: 78580}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2333, col: 12, offset: 78580}, + expr: &litMatcher{ + pos: position{line: 2333, col: 13, offset: 78581}, + val: "`\"", + ignoreCase: false, + want: "\"`\\\"\"", + }, + }, + &labeledExpr{ + pos: position{line: 2333, col: 19, offset: 78587}, + label: "element", + expr: &ruleRefExpr{ + pos: position{line: 2333, col: 28, offset: 78596}, + name: "MonospaceText", + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2334, col: 11, offset: 78645}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2335, col: 11, offset: 78669}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 2336, col: 11, offset: 78695}, + name: "MarkedText", + }, + }, + }, + }, + }, + }, + }, + }, + { + name: "AttributesGroup", + pos: position{line: 2379, col: 1, offset: 80084}, + expr: &actionExpr{ + pos: position{line: 2379, col: 20, offset: 80103}, + run: (*parser).callonAttributesGroup1, + expr: &seqExpr{ + pos: position{line: 2379, col: 20, offset: 80103}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2379, col: 20, offset: 80103}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2379, col: 29, offset: 80112}, + expr: &choiceExpr{ + pos: position{line: 2380, col: 5, offset: 80118}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + run: (*parser).callonAttributesGroup6, + expr: &oneOrMoreExpr{ + pos: position{line: 2801, col: 14, offset: 92593}, + expr: &charClassMatcher{ + pos: position{line: 2801, col: 14, offset: 92593}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonAttributesGroup10, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonAttributesGroup12, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonAttributesGroup14, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonAttributesGroup17, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonAttributesGroup19, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonAttributesGroup23, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - want: "\"////\"", + 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", + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonAttributesGroup29, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonAttributesGroup35, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + 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\"", + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonAttributesGroup40, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonAttributesGroup42, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonAttributesGroup45, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonAttributesGroup49, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonAttributesGroup56, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonAttributesGroup61, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonAttributesGroup63, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonAttributesGroup67, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonAttributesGroup71, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonAttributesGroup78, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonAttributesGroup83, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonAttributesGroup85, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonAttributesGroup89, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonAttributesGroup93, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonAttributesGroup99, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + 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, - }, - }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + 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, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, - }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonAttributesGroup102, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonAttributesGroup106, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, }, }, }, }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, }, }, }, }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonAttributesGroup110, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, }, - &choiceExpr{ - pos: position{line: 1906, col: 29, offset: 68002}, - alternatives: []interface{}{ - &seqExpr{ - pos: position{line: 1906, col: 30, offset: 68003}, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2383, col: 7, offset: 80169}, + name: "Quote", + }, + &ruleRefExpr{ + pos: position{line: 2384, col: 7, offset: 80181}, + name: "InlinePassthrough", + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonAttributesGroup114, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonAttributesGroup116, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonAttributesGroup119, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1906, col: 30, offset: 68003}, - val: "////", + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", ignoreCase: false, - want: "\"////\"", + want: "\"{counter:\"", }, - &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).callonSidebarBlockRawContent563, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonAttributesGroup123, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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, - }, - }, - }, - }, - }, - }, - }, - &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, - }, - &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}, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, expr: &actionExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, - run: (*parser).callonSidebarBlockRawContent580, + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonAttributesGroup130, expr: &seqExpr{ - pos: position{line: 2161, col: 14, offset: 76486}, + pos: position{line: 471, col: 17, offset: 15278}, 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: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", }, - &zeroOrMoreExpr{ - pos: position{line: 2161, col: 19, offset: 76491}, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 471, col: 28, offset: 15289}, alternatives: []interface{}{ - &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", + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonAttributesGroup135, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonAttributesGroup137, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, @@ -41595,224 +54547,107 @@ 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).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, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", }, }, }, }, - }, - }, - }, - }, - &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: " ", - ignoreCase: false, - want: "\" \"", - }, - &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonSidebarBlockRawContent617, - 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, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 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: 467, col: 25, offset: 15133}, + run: (*parser).callonAttributesGroup141, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonAttributesGroup145, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonAttributesGroup152, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonAttributesGroup157, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonAttributesGroup159, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, }, }, }, @@ -41821,51 +54656,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: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonAttributesGroup163, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonAttributesGroup167, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, }, }, }, @@ -41873,129 +54727,441 @@ 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: 947, col: 23, offset: 29896}, + run: (*parser).callonAttributesGroup173, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonAttributesGroup177, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + 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).callonSidebarBlockRawContent661, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2835, col: 12, offset: 93828}, + run: (*parser).callonAttributesGroup181, + expr: &anyMatcher{ + line: 2835, col: 12, offset: 93828, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + { + name: "ElementAttributesGroup", + pos: position{line: 2392, col: 1, offset: 80453}, + expr: &actionExpr{ + pos: position{line: 2392, col: 27, offset: 80479}, + run: (*parser).callonElementAttributesGroup1, + expr: &seqExpr{ + pos: position{line: 2392, col: 27, offset: 80479}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2392, col: 27, offset: 80479}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2392, col: 36, offset: 80488}, + expr: &choiceExpr{ + pos: position{line: 2393, col: 5, offset: 80494}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + run: (*parser).callonElementAttributesGroup6, + expr: &seqExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + run: (*parser).callonElementAttributesGroup9, + expr: &oneOrMoreExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + expr: &charClassMatcher{ + pos: position{line: 2820, col: 14, offset: 93380}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + 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", + }, + }, + &andExpr{ + pos: position{line: 2823, col: 5, offset: 93461}, + expr: &choiceExpr{ + pos: position{line: 2823, col: 7, offset: 93463}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonElementAttributesGroup15, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", ignoreCase: false, - want: "\"\\r\\n\"", + want: "\"\\t\"", }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + }, + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[.�0-9\\pL]", + chars: []rune{'.', '�'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonElementAttributesGroup22, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + run: (*parser).callonElementAttributesGroup24, + expr: &seqExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + expr: &charClassMatcher{ + pos: position{line: 2809, col: 5, offset: 92974}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2809, col: 15, offset: 92984}, + expr: &choiceExpr{ + pos: position{line: 2809, col: 17, offset: 92986}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2809, col: 17, offset: 92986}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + run: (*parser).callonElementAttributesGroup33, + expr: &seqExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 9, offset: 93068}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 19, offset: 93078}, + expr: &seqExpr{ + pos: position{line: 2811, col: 20, offset: 93079}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2811, col: 20, offset: 93079}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 27, offset: 93086}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 27, offset: 93086}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, 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: 2829, col: 16, offset: 93605}, + run: (*parser).callonElementAttributesGroup42, + expr: &seqExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2829, col: 17, offset: 93606}, + val: "[.,;!?]", + chars: []rune{'.', ',', ';', '!', '?'}, + ignoreCase: false, + inverted: false, + }, + &andExpr{ + pos: position{line: 2829, col: 46, offset: 93635}, + expr: &choiceExpr{ + pos: position{line: 2829, col: 48, offset: 93637}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonElementAttributesGroup48, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonElementAttributesGroup54, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonElementAttributesGroup56, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonElementAttributesGroup58, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonElementAttributesGroup61, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonElementAttributesGroup65, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonElementAttributesGroup72, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + 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: 471, col: 17, offset: 15278}, + 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: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonElementAttributesGroup77, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonElementAttributesGroup79, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, }, @@ -42003,775 +55169,665 @@ var g = &grammar{ }, }, }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + 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: 467, col: 25, offset: 15133}, + run: (*parser).callonElementAttributesGroup83, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 2077, col: 26, offset: 73358}, - val: "....", + pos: position{line: 467, col: 25, offset: 15133}, + 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: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonElementAttributesGroup87, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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, - }, - }, - }, - }, - }, - }, - }, - &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\"", + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonElementAttributesGroup94, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonElementAttributesGroup99, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonElementAttributesGroup101, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, - }, - &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: 467, col: 79, offset: 15187}, + 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: 456, col: 31, offset: 14633}, + run: (*parser).callonElementAttributesGroup105, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + 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: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonElementAttributesGroup109, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 456, col: 54, offset: 14656}, + 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: 2395, col: 7, offset: 80539}, + name: "Quote", + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonElementAttributesGroup116, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonElementAttributesGroup118, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonElementAttributesGroup121, expr: &choiceExpr{ - pos: position{line: 879, col: 37, offset: 28365}, + pos: position{line: 491, col: 27, offset: 15997}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, - run: (*parser).callonSidebarBlockRawContent717, + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonElementAttributesGroup123, expr: &seqExpr{ - pos: position{line: 1916, col: 22, offset: 68317}, + pos: position{line: 491, col: 27, offset: 15997}, 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: 491, col: 27, offset: 15997}, + val: "<<", ignoreCase: false, - want: "\"//\"", + want: "\"<<\"", }, &labeledExpr{ - pos: position{line: 1916, col: 50, offset: 68345}, - label: "content", + pos: position{line: 491, col: 32, offset: 16002}, + 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: 2866, col: 7, offset: 94768}, + run: (*parser).callonElementAttributesGroup127, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 2866, col: 7, offset: 94768}, + 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, - }, - }, - }, - }, - }, - }, - }, - &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}, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, expr: &choiceExpr{ - pos: position{line: 1654, col: 19, offset: 59095}, + pos: position{line: 2878, col: 10, offset: 95044}, 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, - }, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + 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).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, - }, - }, - }, - }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonElementAttributesGroup133, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, - &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\"", - }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonElementAttributesGroup139, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 502, col: 6, offset: 16441}, + 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: 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: " ", + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, 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\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: 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).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, - }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonElementAttributesGroup144, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonElementAttributesGroup146, }, - }, - }, - }, - }, - &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\"", + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonElementAttributesGroup149, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonElementAttributesGroup153, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonElementAttributesGroup160, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonElementAttributesGroup165, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonElementAttributesGroup167, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonElementAttributesGroup171, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonElementAttributesGroup175, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonElementAttributesGroup182, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonElementAttributesGroup187, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonElementAttributesGroup189, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonElementAttributesGroup193, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonElementAttributesGroup197, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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: 1889, col: 30, offset: 67449}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1889, col: 30, offset: 67449}, - val: "++++", + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonElementAttributesGroup203, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + 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: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonElementAttributesGroup206, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, &labeledExpr{ - pos: position{line: 904, col: 5, offset: 29507}, - label: "content", + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", expr: &actionExpr{ - pos: position{line: 914, col: 28, offset: 29807}, - run: (*parser).callonSidebarBlockRawContent835, + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonElementAttributesGroup210, expr: &oneOrMoreExpr{ - pos: position{line: 914, col: 28, offset: 29807}, + pos: position{line: 2866, col: 7, offset: 94768}, expr: &charClassMatcher{ - pos: position{line: 914, col: 28, offset: 29807}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 2866, col: 7, offset: 94768}, + 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: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", }, }, }, @@ -42779,773 +55835,1021 @@ var g = &grammar{ }, }, }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonElementAttributesGroup214, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + 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{}{ + }, + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonElementAttributesGroup216, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonElementAttributesGroup220, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2835, col: 12, offset: 93828}, + run: (*parser).callonElementAttributesGroup224, + expr: &anyMatcher{ + line: 2835, col: 12, offset: 93828, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + { + name: "HeaderGroup", + pos: position{line: 2403, col: 1, offset: 80797}, + expr: &actionExpr{ + pos: position{line: 2404, col: 5, offset: 80817}, + run: (*parser).callonHeaderGroup1, + expr: &seqExpr{ + pos: position{line: 2404, col: 5, offset: 80817}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2404, col: 5, offset: 80817}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2404, col: 14, offset: 80826}, + expr: &ruleRefExpr{ + pos: position{line: 2404, col: 15, offset: 80827}, + name: "HeaderGroupElement", + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + { + name: "HeaderGroupElement", + pos: position{line: 2408, col: 1, offset: 80904}, + expr: &actionExpr{ + pos: position{line: 2409, col: 5, offset: 80930}, + run: (*parser).callonHeaderGroupElement1, + expr: &seqExpr{ + pos: position{line: 2409, col: 5, offset: 80930}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2409, col: 5, offset: 80930}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2410, col: 5, offset: 80939}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2411, col: 9, offset: 80957}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + run: (*parser).callonHeaderGroupElement8, + expr: &seqExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + run: (*parser).callonHeaderGroupElement11, + expr: &oneOrMoreExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + expr: &charClassMatcher{ + pos: position{line: 2820, col: 14, offset: 93380}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 2823, col: 5, offset: 93461}, + expr: &choiceExpr{ + pos: position{line: 2823, col: 7, offset: 93463}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 884, col: 5, offset: 28625}, - val: "> ", + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - want: "\"> \"", + 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).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, - }, - }, - }, - }, - }, - }, - }, - }, - &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).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, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonHeaderGroupElement17, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[.�0-9\\pL]", + chars: []rune{'.', '�'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonHeaderGroupElement24, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, }, }, - &actionExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - run: (*parser).callonSidebarBlockRawContent884, + }, + }, + }, + &actionExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + run: (*parser).callonHeaderGroupElement26, + expr: &seqExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + expr: &charClassMatcher{ + pos: position{line: 2809, col: 5, offset: 92974}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2809, col: 15, offset: 92984}, + expr: &choiceExpr{ + pos: position{line: 2809, col: 17, offset: 92986}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2809, col: 17, offset: 92986}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + run: (*parser).callonHeaderGroupElement35, + expr: &seqExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 9, offset: 93068}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 19, offset: 93078}, expr: &seqExpr{ - pos: position{line: 888, col: 5, offset: 28831}, + pos: position{line: 2811, col: 20, offset: 93079}, exprs: []interface{}{ - &andCodeExpr{ - pos: position{line: 888, col: 5, offset: 28831}, - run: (*parser).callonSidebarBlockRawContent886, + &charClassMatcher{ + pos: position{line: 2811, col: 20, offset: 93079}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, }, - &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, - }, - }, - }, - }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 27, offset: 93086}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 27, offset: 93086}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + run: (*parser).callonHeaderGroupElement44, + expr: &seqExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2829, col: 17, offset: 93606}, + val: "[.,;!?]", + chars: []rune{'.', ',', ';', '!', '?'}, + ignoreCase: false, + inverted: false, + }, + &andExpr{ + pos: position{line: 2829, col: 46, offset: 93635}, + expr: &choiceExpr{ + pos: position{line: 2829, col: 48, offset: 93637}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonHeaderGroupElement50, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonHeaderGroupElement56, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonHeaderGroupElement59, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &ruleRefExpr{ + pos: position{line: 2413, col: 11, offset: 80994}, + name: "InlinePassthrough", + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonHeaderGroupElement62, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonHeaderGroupElement64, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonHeaderGroupElement67, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonHeaderGroupElement69, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonHeaderGroupElement73, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + 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}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ - &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, - }, - }, - }, - }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", }, - }, - &seqExpr{ - pos: position{line: 1736, col: 24, offset: 61955}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1736, col: 24, offset: 61955}, - val: "____", + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonHeaderGroupElement79, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", 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, - }, - }, - }, + want: "\"\\t\"", }, }, }, - &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: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonHeaderGroupElement85, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + 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: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + 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: 449, col: 5, offset: 14443}, + run: (*parser).callonHeaderGroupElement90, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonHeaderGroupElement92, }, - &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: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonHeaderGroupElement95, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonHeaderGroupElement99, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonHeaderGroupElement106, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonHeaderGroupElement111, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonHeaderGroupElement113, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonHeaderGroupElement117, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonHeaderGroupElement121, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonHeaderGroupElement128, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonHeaderGroupElement133, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonHeaderGroupElement135, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonHeaderGroupElement139, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonHeaderGroupElement143, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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: 506, col: 8, offset: 16673}, + run: (*parser).callonHeaderGroupElement149, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + 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: 493, col: 9, offset: 16122}, + run: (*parser).callonHeaderGroupElement152, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonHeaderGroupElement156, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, }, }, }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + 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: 2595, col: 11, offset: 86299}, + run: (*parser).callonHeaderGroupElement160, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2415, col: 11, offset: 81049}, + name: "Quote", + }, + &ruleRefExpr{ + pos: position{line: 2416, col: 11, offset: 81065}, + name: "Link", + }, + &ruleRefExpr{ + pos: position{line: 2417, col: 11, offset: 81080}, + name: "InlineIcon", + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonHeaderGroupElement165, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonHeaderGroupElement167, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonHeaderGroupElement170, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonHeaderGroupElement174, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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, - }, }, }, - }, - }, - }, - }, - }, - }, - &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}, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonHeaderGroupElement181, expr: &seqExpr{ - pos: position{line: 1902, col: 26, offset: 67906}, + pos: position{line: 471, col: 17, offset: 15278}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1902, col: 26, offset: 67906}, - val: "////", + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", ignoreCase: false, - want: "\"////\"", + want: "\":\"", }, - &zeroOrMoreExpr{ - pos: position{line: 1902, col: 33, offset: 67913}, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 471, col: 28, offset: 15289}, alternatives: []interface{}{ - &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: 471, col: 28, offset: 15289}, + run: (*parser).callonHeaderGroupElement186, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + 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: 473, col: 9, offset: 15343}, + run: (*parser).callonHeaderGroupElement188, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, @@ -43553,498 +56857,701 @@ 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).callonSidebarBlockRawContent1012, - expr: &zeroOrMoreExpr{ - pos: position{line: 1920, col: 29, offset: 68473}, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonHeaderGroupElement192, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonHeaderGroupElement196, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, expr: &charClassMatcher{ - pos: position{line: 1920, col: 29, offset: 68473}, - val: "[^\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - inverted: true, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonHeaderGroupElement203, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonHeaderGroupElement208, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonHeaderGroupElement210, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonHeaderGroupElement214, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonHeaderGroupElement218, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []rune{'\r', '\n'}, + pos: position{line: 118, col: 18, offset: 3399}, + 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: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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: "\"....\"", - }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonHeaderGroupElement224, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonHeaderGroupElement228, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2576, col: 5, offset: 85805}, + run: (*parser).callonHeaderGroupElement232, + expr: &seqExpr{ + pos: position{line: 2576, col: 5, offset: 85805}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2576, col: 5, offset: 85805}, + run: (*parser).callonHeaderGroupElement234, + }, + &labeledExpr{ + pos: position{line: 2579, col: 5, offset: 85871}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2618, col: 11, offset: 87173}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2620, col: 15, offset: 87267}, + run: (*parser).callonHeaderGroupElement237, + expr: &litMatcher{ + pos: position{line: 2620, col: 15, offset: 87267}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2626, col: 14, offset: 87382}, + run: (*parser).callonHeaderGroupElement239, + expr: &litMatcher{ + pos: position{line: 2626, col: 14, offset: 87382}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2630, col: 14, offset: 87458}, + run: (*parser).callonHeaderGroupElement241, + expr: &litMatcher{ + pos: position{line: 2630, col: 14, offset: 87458}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2634, col: 15, offset: 87536}, + run: (*parser).callonHeaderGroupElement243, + expr: &litMatcher{ + pos: position{line: 2634, col: 15, offset: 87536}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2638, col: 13, offset: 87611}, + run: (*parser).callonHeaderGroupElement245, + expr: &litMatcher{ + pos: position{line: 2638, col: 13, offset: 87611}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + run: (*parser).callonHeaderGroupElement247, + expr: &seqExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2646, col: 31, offset: 87926}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2646, col: 35, offset: 87930}, + expr: &charClassMatcher{ + pos: position{line: 2646, col: 36, offset: 87931}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 184, col: 4, offset: 5334}, + run: (*parser).callonHeaderGroupElement253, + expr: &seqExpr{ + pos: position{line: 184, col: 4, offset: 5334}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 184, col: 4, offset: 5334}, + val: "[[", + ignoreCase: false, + want: "\"[[\"", + }, + &labeledExpr{ + pos: position{line: 185, col: 5, offset: 5344}, + label: "id", + expr: &actionExpr{ + pos: position{line: 186, col: 9, offset: 5357}, + run: (*parser).callonHeaderGroupElement257, + expr: &labeledExpr{ + pos: position{line: 186, col: 9, offset: 5357}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 186, col: 18, offset: 5366}, + expr: &choiceExpr{ + pos: position{line: 187, col: 13, offset: 5380}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 187, col: 14, offset: 5381}, + run: (*parser).callonHeaderGroupElement261, + expr: &oneOrMoreExpr{ + pos: position{line: 187, col: 14, offset: 5381}, + expr: &charClassMatcher{ + pos: position{line: 187, col: 14, offset: 5381}, + val: "[^=\\r\\n�{]]", + chars: []rune{'=', '\r', '\n', '�', '{', ']'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonHeaderGroupElement264, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonHeaderGroupElement268, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + 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: "```", - 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{}{ + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonHeaderGroupElement272, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonHeaderGroupElement274, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonHeaderGroupElement277, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + 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: 463, col: 25, offset: 14978}, + val: "{counter:", 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: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonHeaderGroupElement281, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonHeaderGroupElement288, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonHeaderGroupElement293, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonHeaderGroupElement295, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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: 463, col: 78, offset: 15031}, + 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).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: 467, col: 25, offset: 15133}, + run: (*parser).callonHeaderGroupElement299, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + 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: 467, col: 25, offset: 15133}, + val: "{counter2:", ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, - }, + want: "\"{counter2:\"", }, - }, - }, - }, - }, - &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: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonHeaderGroupElement303, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 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\"", + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonHeaderGroupElement310, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonHeaderGroupElement315, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonHeaderGroupElement317, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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'}, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + 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\"", + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonHeaderGroupElement321, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonHeaderGroupElement325, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: 456, col: 54, offset: 14656}, + 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 +57560,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'}, + &actionExpr{ + pos: position{line: 192, col: 16, offset: 5617}, + run: (*parser).callonHeaderGroupElement331, + expr: &litMatcher{ + pos: position{line: 192, col: 16, offset: 5617}, + 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, - }, - }, }, }, }, + &litMatcher{ + pos: position{line: 198, col: 5, offset: 5803}, + val: "]]", + ignoreCase: false, + want: "\"]]\"", + }, }, }, }, + &ruleRefExpr{ + pos: position{line: 2422, col: 11, offset: 81298}, + name: "InlineFootnote", + }, + &actionExpr{ + pos: position{line: 2835, col: 12, offset: 93828}, + run: (*parser).callonHeaderGroupElement335, + expr: &anyMatcher{ + line: 2835, col: 12, offset: 93828, + }, + }, }, }, }, @@ -44192,663 +57606,862 @@ 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, + name: "MacrosGroup", + pos: position{line: 2428, col: 1, offset: 81417}, + expr: &actionExpr{ + pos: position{line: 2428, col: 16, offset: 81432}, + run: (*parser).callonMacrosGroup1, + expr: &seqExpr{ + pos: position{line: 2428, col: 16, offset: 81432}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2428, col: 16, offset: 81432}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2428, col: 25, offset: 81441}, + expr: &choiceExpr{ + pos: position{line: 2429, col: 5, offset: 81447}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + run: (*parser).callonMacrosGroup6, + expr: &seqExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + run: (*parser).callonMacrosGroup9, + expr: &oneOrMoreExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + expr: &charClassMatcher{ + pos: position{line: 2820, col: 14, offset: 93380}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 2823, col: 5, offset: 93461}, + expr: &choiceExpr{ + pos: position{line: 2823, col: 7, offset: 93463}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonMacrosGroup15, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[.�0-9\\pL]", + chars: []rune{'.', '�'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonMacrosGroup22, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + }, }, }, - }, - }, - &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: 2809, col: 5, offset: 92974}, + run: (*parser).callonMacrosGroup24, + expr: &seqExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + expr: &charClassMatcher{ + pos: position{line: 2809, col: 5, offset: 92974}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2809, col: 15, offset: 92984}, + expr: &choiceExpr{ + pos: position{line: 2809, col: 17, offset: 92986}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2809, col: 17, offset: 92986}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, }, }, }, - }, - }, - }, - }, - }, - &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", + &actionExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + run: (*parser).callonMacrosGroup33, + expr: &seqExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 9, offset: 93068}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 19, offset: 93078}, + expr: &seqExpr{ + pos: position{line: 2811, col: 20, offset: 93079}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2811, col: 20, offset: 93079}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 27, offset: 93086}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 27, offset: 93086}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, }, }, - }, - }, - &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, + &actionExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + run: (*parser).callonMacrosGroup42, expr: &seqExpr{ - pos: position{line: 2148, col: 12, offset: 76027}, + pos: position{line: 2829, col: 16, offset: 93605}, exprs: []interface{}{ - &zeroOrMoreExpr{ - pos: position{line: 2148, col: 12, offset: 76027}, + &charClassMatcher{ + pos: position{line: 2829, col: 17, offset: 93606}, + val: "[.,;!?]", + chars: []rune{'.', ',', ';', '!', '?'}, + ignoreCase: false, + inverted: false, + }, + &andExpr{ + pos: position{line: 2829, col: 46, offset: 93635}, expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2829, col: 48, offset: 93637}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2878, col: 10, offset: 95044}, val: " ", ignoreCase: false, want: "\" \"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonInlineMacros39, + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonMacrosGroup48, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, + pos: position{line: 2878, col: 16, offset: 95050}, val: "\t", ignoreCase: false, want: "\"\\t\"", }, }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonMacrosGroup54, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 2430, col: 7, offset: 81464}, + name: "InlineMacro", + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonMacrosGroup57, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2148, col: 19, offset: 76034}, - val: ",", + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", ignoreCase: false, - want: "\",\"", + 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: " ", + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonMacrosGroup61, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &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\"", + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2835, col: 12, offset: 93828}, + run: (*parser).callonMacrosGroup65, + expr: &anyMatcher{ + line: 2835, col: 12, offset: 93828, + }, + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + { + name: "NoneGroup", + pos: position{line: 2438, col: 1, offset: 81765}, + expr: &actionExpr{ + pos: position{line: 2438, col: 14, offset: 81778}, + run: (*parser).callonNoneGroup1, + expr: &seqExpr{ + pos: position{line: 2438, col: 14, offset: 81778}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2438, col: 14, offset: 81778}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2438, col: 23, offset: 81787}, + expr: &actionExpr{ + pos: position{line: 2443, col: 5, offset: 81888}, + run: (*parser).callonNoneGroup5, + expr: &seqExpr{ + pos: position{line: 2443, col: 5, offset: 81888}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2443, col: 5, offset: 81888}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2444, col: 5, offset: 81897}, + label: "element", + expr: &oneOrMoreExpr{ + pos: position{line: 2444, col: 13, offset: 81905}, + expr: &choiceExpr{ + pos: position{line: 2445, col: 9, offset: 81915}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + run: (*parser).callonNoneGroup13, + expr: &seqExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + run: (*parser).callonNoneGroup16, + expr: &oneOrMoreExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + expr: &charClassMatcher{ + pos: position{line: 2820, col: 14, offset: 93380}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 2823, col: 5, offset: 93461}, + expr: &choiceExpr{ + pos: position{line: 2823, col: 7, offset: 93463}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNoneGroup22, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[.�0-9\\pL]", + chars: []rune{'.', '�'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonNoneGroup29, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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).callonInlineMacros48, - 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).callonInlineMacros52, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + &actionExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + run: (*parser).callonNoneGroup31, + expr: &seqExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + expr: &charClassMatcher{ + pos: position{line: 2809, col: 5, offset: 92974}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2809, col: 15, offset: 92984}, + expr: &choiceExpr{ + pos: position{line: 2809, col: 17, offset: 92986}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2809, col: 17, offset: 92986}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, }, }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - &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, - 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).callonInlineMacros61, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + run: (*parser).callonNoneGroup40, + expr: &seqExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 9, offset: 93068}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 19, offset: 93078}, + expr: &seqExpr{ + pos: position{line: 2811, col: 20, offset: 93079}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2811, col: 20, offset: 93079}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 27, offset: 93086}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 27, offset: 93086}, + 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).callonInlineMacros67, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &actionExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + run: (*parser).callonNoneGroup49, + expr: &seqExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2829, col: 17, offset: 93606}, + val: "[.,;!?]", + chars: []rune{'.', ',', ';', '!', '?'}, + ignoreCase: false, + inverted: false, + }, + &andExpr{ + pos: position{line: 2829, col: 46, offset: 93635}, + expr: &choiceExpr{ + pos: position{line: 2829, col: 48, offset: 93637}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNoneGroup55, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonNoneGroup61, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + 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).callonInlineMacros70, - 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")}, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonNoneGroup63, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", ignoreCase: false, - inverted: false, + want: "\"�\"", }, - &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\"", + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonNoneGroup67, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, }, }, + &actionExpr{ + pos: position{line: 2835, col: 12, offset: 93828}, + run: (*parser).callonNoneGroup71, + expr: &anyMatcher{ + line: 2835, col: 12, offset: 93828, + }, + }, }, }, }, }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, }, - &litMatcher{ - pos: position{line: 2150, col: 5, offset: 76204}, - val: ")))", - ignoreCase: false, - want: "\")))\"", - }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, }, - &ruleRefExpr{ - pos: position{line: 1938, col: 7, offset: 68970}, - name: "IndexTerm", + }, + }, + }, + { + name: "NormalGroup", + pos: position{line: 2453, col: 1, offset: 82313}, + expr: &actionExpr{ + pos: position{line: 2453, col: 16, offset: 82328}, + run: (*parser).callonNormalGroup1, + expr: &seqExpr{ + pos: position{line: 2453, col: 16, offset: 82328}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2453, col: 16, offset: 82328}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2453, col: 25, offset: 82337}, + expr: &ruleRefExpr{ + pos: position{line: 2453, col: 26, offset: 82338}, + name: "NormalGroupElement", + }, + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, }, }, { - 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", + name: "NormalGroupElement", + pos: position{line: 2457, col: 1, offset: 82415}, + expr: &actionExpr{ + pos: position{line: 2458, col: 5, offset: 82442}, + run: (*parser).callonNormalGroupElement1, + expr: &seqExpr{ + pos: position{line: 2458, col: 5, offset: 82442}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2458, col: 5, offset: 82442}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, - &actionExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - run: (*parser).callonInlinePassthroughSubs5, - 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, + }, + }, + &labeledExpr{ + pos: position{line: 2459, col: 5, offset: 82451}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2460, col: 9, offset: 82469}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + run: (*parser).callonNormalGroupElement8, + expr: &seqExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + run: (*parser).callonNormalGroupElement11, + expr: &oneOrMoreExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + expr: &charClassMatcher{ + pos: position{line: 2820, col: 14, offset: 93380}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, - }, - }, - }, - }, - &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, + &andExpr{ + pos: position{line: 2823, col: 5, offset: 93461}, + expr: &choiceExpr{ + pos: position{line: 2823, col: 7, offset: 93463}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", }, - }, - }, - }, - }, - }, - }, - }, - &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, - }, - }, - &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]", + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNormalGroupElement17, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[.�0-9\\pL]", + chars: []rune{'.', '�'}, ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonNormalGroupElement24, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, }, }, }, - }, - &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, - }, + &actionExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + run: (*parser).callonNormalGroupElement26, + expr: &seqExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + expr: &charClassMatcher{ + pos: position{line: 2809, col: 5, offset: 92974}, + 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: "\"�\"", - }, - }, - }, - }, - &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", - ignoreCase: false, - want: "\"\\t\"", - }, - }, - }, - }, - }, - &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")}, - 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, + &andExpr{ + pos: position{line: 2809, col: 15, offset: 92984}, + expr: &choiceExpr{ + pos: position{line: 2809, col: 17, offset: 92986}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2809, col: 17, offset: 92986}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, }, }, }, @@ -44856,40 +58469,45 @@ var g = &grammar{ }, }, }, - }, - &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")}, - 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: 2811, col: 9, offset: 93068}, + run: (*parser).callonNormalGroupElement35, + expr: &seqExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 9, offset: 93068}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 19, offset: 93078}, + expr: &seqExpr{ + pos: position{line: 2811, col: 20, offset: 93079}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2811, col: 20, offset: 93079}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 27, offset: 93086}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 27, offset: 93086}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, }, }, }, @@ -44897,45 +58515,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: 2829, col: 16, offset: 93605}, + run: (*parser).callonNormalGroupElement44, + expr: &seqExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2829, col: 17, offset: 93606}, + 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")}, + &andExpr{ + pos: position{line: 2829, col: 46, offset: 93635}, + expr: &choiceExpr{ + pos: position{line: 2829, col: 48, offset: 93637}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - inverted: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNormalGroupElement50, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonNormalGroupElement56, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, @@ -44943,383 +58583,1047 @@ 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{}{ + &actionExpr{ + pos: position{line: 954, col: 14, offset: 30337}, + run: (*parser).callonNormalGroupElement58, + expr: &seqExpr{ + pos: position{line: 954, col: 14, offset: 30337}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1538, col: 27, offset: 54613}, - val: "<<", + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - want: "\"<<\"", + 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, - }, - }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNormalGroupElement62, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, - &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", - ignoreCase: false, - want: "\"\\t\"", - }, - }, + }, + }, + &litMatcher{ + pos: position{line: 954, col: 20, offset: 30343}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 954, col: 24, offset: 30347}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNormalGroupElement68, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", }, }, }, - &litMatcher{ - pos: position{line: 1538, col: 47, offset: 54633}, - val: ",", - ignoreCase: false, - want: "\",\"", + }, + }, + &andExpr{ + pos: position{line: 954, col: 31, offset: 30354}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonNormalGroupElement76, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, - &labeledExpr{ - pos: position{line: 1538, col: 51, offset: 54637}, - label: "label", - expr: &oneOrMoreExpr{ - pos: position{line: 1548, col: 24, offset: 55025}, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNormalGroupElement79, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonNormalGroupElement83, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + &ruleRefExpr{ + pos: position{line: 2464, col: 11, offset: 82575}, + name: "Quote", + }, + &ruleRefExpr{ + pos: position{line: 2465, col: 11, offset: 82591}, + name: "InlinePassthrough", + }, + &ruleRefExpr{ + pos: position{line: 2466, col: 11, offset: 82619}, + name: "InlineMacro", + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonNormalGroupElement88, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonNormalGroupElement90, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonNormalGroupElement93, expr: &choiceExpr{ - pos: position{line: 1549, col: 5, offset: 55031}, + pos: position{line: 491, col: 27, offset: 15997}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, - run: (*parser).callonSpecialCharacterSubs49, + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonNormalGroupElement95, expr: &seqExpr{ - pos: position{line: 1549, col: 6, offset: 55032}, + pos: position{line: 491, col: 27, offset: 15997}, exprs: []interface{}{ - &charClassMatcher{ - pos: position{line: 1549, col: 6, offset: 55032}, - val: "[0-9\\pL]", - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", ignoreCase: false, - inverted: 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', '{', '<', '>'}, - ignoreCase: false, - inverted: true, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonNormalGroupElement99, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNormalGroupElement105, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, }, }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonNormalGroupElement111, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonNormalGroupElement116, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonNormalGroupElement118, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonNormalGroupElement121, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonNormalGroupElement125, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonNormalGroupElement132, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonNormalGroupElement137, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonNormalGroupElement139, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonNormalGroupElement143, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonNormalGroupElement147, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonNormalGroupElement154, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonNormalGroupElement159, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonNormalGroupElement161, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonNormalGroupElement165, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonNormalGroupElement169, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonNormalGroupElement175, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, }, }, }, &actionExpr{ - pos: position{line: 214, col: 12, offset: 6782}, - run: (*parser).callonSpecialCharacterSubs54, + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonNormalGroupElement178, expr: &seqExpr{ - pos: position{line: 214, col: 12, offset: 6782}, + pos: position{line: 493, col: 9, offset: 16122}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 214, col: 12, offset: 6782}, - val: "{", + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", ignoreCase: false, - want: "\"{\"", + want: "\"<<\"", }, &labeledExpr{ - pos: position{line: 214, col: 16, offset: 6786}, - label: "name", + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", 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, + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonNormalGroupElement182, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonNormalGroupElement186, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonNormalGroupElement188, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonNormalGroupElement190, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonNormalGroupElement193, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonNormalGroupElement197, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonNormalGroupElement204, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonNormalGroupElement209, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonNormalGroupElement211, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + 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: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonNormalGroupElement215, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonNormalGroupElement219, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonNormalGroupElement226, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonNormalGroupElement231, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonNormalGroupElement233, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + 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: 467, col: 79, offset: 15187}, + 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: 456, col: 31, offset: 14633}, + run: (*parser).callonNormalGroupElement237, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonNormalGroupElement241, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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, + &actionExpr{ + pos: position{line: 2576, col: 5, offset: 85805}, + run: (*parser).callonNormalGroupElement247, + expr: &seqExpr{ + pos: position{line: 2576, col: 5, offset: 85805}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2576, col: 5, offset: 85805}, + run: (*parser).callonNormalGroupElement249, }, - }, - &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: 2579, col: 5, offset: 85871}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2618, col: 11, offset: 87173}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2620, col: 15, offset: 87267}, + run: (*parser).callonNormalGroupElement252, + expr: &litMatcher{ + pos: position{line: 2620, col: 15, offset: 87267}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2626, col: 14, offset: 87382}, + run: (*parser).callonNormalGroupElement254, + expr: &litMatcher{ + pos: position{line: 2626, col: 14, offset: 87382}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2630, col: 14, offset: 87458}, + run: (*parser).callonNormalGroupElement256, + expr: &litMatcher{ + pos: position{line: 2630, col: 14, offset: 87458}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2634, col: 15, offset: 87536}, + run: (*parser).callonNormalGroupElement258, + expr: &litMatcher{ + pos: position{line: 2634, col: 15, offset: 87536}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2638, col: 13, offset: 87611}, + run: (*parser).callonNormalGroupElement260, + expr: &litMatcher{ + pos: position{line: 2638, col: 13, offset: 87611}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + run: (*parser).callonNormalGroupElement262, + expr: &seqExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2646, col: 31, offset: 87926}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2646, col: 35, offset: 87930}, + expr: &charClassMatcher{ + pos: position{line: 2646, col: 36, offset: 87931}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, }, }, }, @@ -45327,40 +59631,112 @@ var g = &grammar{ }, }, }, - }, - &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, + &actionExpr{ + pos: position{line: 2554, col: 5, offset: 85347}, + run: (*parser).callonNormalGroupElement268, + expr: &seqExpr{ + pos: position{line: 2554, col: 5, offset: 85347}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2554, col: 5, offset: 85347}, + run: (*parser).callonNormalGroupElement270, }, - }, - &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: 2557, col: 5, offset: 85417}, + label: "element", + expr: &actionExpr{ + pos: position{line: 954, col: 14, offset: 30337}, + run: (*parser).callonNormalGroupElement272, + expr: &seqExpr{ + pos: position{line: 954, col: 14, offset: 30337}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNormalGroupElement276, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 954, col: 20, offset: 30343}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 954, col: 24, offset: 30347}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonNormalGroupElement282, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 954, col: 31, offset: 30354}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonNormalGroupElement290, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, }, }, }, @@ -45368,360 +59744,550 @@ var g = &grammar{ }, }, }, - }, - &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")}, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonNormalGroupElement292, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + 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}, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonNormalGroupElement296, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, - val: "[0-9\\pL]", + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, }, }, }, - }, - }, - }, - }, - &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", + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", ignoreCase: false, - want: "\"\\t\"", + want: "\"�\"", }, }, }, }, - }, - &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: 2835, col: 12, offset: 93828}, + run: (*parser).callonNormalGroupElement300, + expr: &anyMatcher{ + line: 2835, col: 12, offset: 93828, }, }, }, - &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, + name: "PostReplacementsGroup", + pos: position{line: 2475, col: 1, offset: 82985}, + expr: &actionExpr{ + pos: position{line: 2475, col: 27, offset: 83011}, + run: (*parser).callonPostReplacementsGroup1, + expr: &seqExpr{ + pos: position{line: 2475, col: 27, offset: 83011}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2475, col: 27, offset: 83011}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2475, col: 36, offset: 83020}, + expr: &choiceExpr{ + pos: position{line: 2476, col: 5, offset: 83026}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + run: (*parser).callonPostReplacementsGroup6, + expr: &seqExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + run: (*parser).callonPostReplacementsGroup9, + expr: &oneOrMoreExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + expr: &charClassMatcher{ + pos: position{line: 2820, col: 14, offset: 93380}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 2823, col: 5, offset: 93461}, + expr: &choiceExpr{ + pos: position{line: 2823, col: 7, offset: 93463}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonPostReplacementsGroup15, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[.�0-9\\pL]", + chars: []rune{'.', '�'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonPostReplacementsGroup22, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, }, }, - &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', ' '}, + }, + &actionExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + run: (*parser).callonPostReplacementsGroup24, + expr: &seqExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + expr: &charClassMatcher{ + pos: position{line: 2809, col: 5, offset: 92974}, + 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, + }, + &andExpr{ + pos: position{line: 2809, col: 15, offset: 92984}, + expr: &choiceExpr{ + pos: position{line: 2809, col: 17, offset: 92986}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2809, col: 17, offset: 92986}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, }, }, }, }, - }, - }, - &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}, - 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', ' ', ',', ']'}, + &actionExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + run: (*parser).callonPostReplacementsGroup33, + expr: &seqExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 9, offset: 93068}, + 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: 2811, col: 19, offset: 93078}, + expr: &seqExpr{ + pos: position{line: 2811, col: 20, offset: 93079}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2811, col: 20, offset: 93079}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 27, offset: 93086}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 27, offset: 93086}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, }, }, - }, - }, - &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")}, - ignoreCase: false, - inverted: false, + &actionExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + run: (*parser).callonPostReplacementsGroup42, + expr: &seqExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2829, col: 17, offset: 93606}, + val: "[.,;!?]", + chars: []rune{'.', ',', ';', '!', '?'}, + ignoreCase: false, + inverted: false, + }, + &andExpr{ + pos: position{line: 2829, col: 46, offset: 93635}, + expr: &choiceExpr{ + pos: position{line: 2829, col: 48, offset: 93637}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonPostReplacementsGroup48, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonPostReplacementsGroup54, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, }, }, - &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")}, + }, + &actionExpr{ + pos: position{line: 954, col: 14, offset: 30337}, + run: (*parser).callonPostReplacementsGroup56, + expr: &seqExpr{ + pos: position{line: 954, col: 14, offset: 30337}, + exprs: []interface{}{ + &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - inverted: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonPostReplacementsGroup60, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 954, col: 20, offset: 30343}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 954, col: 24, offset: 30347}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonPostReplacementsGroup66, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &andExpr{ + pos: position{line: 954, col: 31, offset: 30354}, + expr: &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonPostReplacementsGroup74, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, }, }, }, - }, - }, - &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: " ", + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonPostReplacementsGroup77, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", ignoreCase: false, - want: "\" \"", + want: "\"\\t\"", }, - &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\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonPostReplacementsGroup81, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonPostReplacementsGroup83, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonPostReplacementsGroup87, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, }, }, + &actionExpr{ + pos: position{line: 2835, col: 12, offset: 93828}, + run: (*parser).callonPostReplacementsGroup91, + expr: &anyMatcher{ + line: 2835, col: 12, offset: 93828, + }, + }, }, }, - &actionExpr{ - pos: position{line: 221, col: 25, offset: 7126}, - run: (*parser).callonAttributeSubs36, - 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).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{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + }, + }, + }, + }, + { + name: "QuotesGroup", + pos: position{line: 2486, col: 1, offset: 83334}, + expr: &actionExpr{ + pos: position{line: 2486, col: 16, offset: 83349}, + run: (*parser).callonQuotesGroup1, + expr: &seqExpr{ + pos: position{line: 2486, col: 16, offset: 83349}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2486, col: 16, offset: 83349}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2486, col: 25, offset: 83358}, + expr: &choiceExpr{ + pos: position{line: 2487, col: 5, offset: 83364}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + run: (*parser).callonQuotesGroup6, + expr: &seqExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + run: (*parser).callonQuotesGroup9, + expr: &oneOrMoreExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, + pos: position{line: 2820, col: 14, offset: 93380}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, @@ -45730,57 +60296,62 @@ var g = &grammar{ }, }, }, - }, - }, - &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{}{ + &andExpr{ + pos: position{line: 2823, col: 5, offset: 93461}, + expr: &choiceExpr{ + pos: position{line: 2823, col: 7, offset: 93463}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", + pos: position{line: 2878, col: 10, offset: 95044}, + 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).callonAttributeSubs52, - 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).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, - }, - }, - }, - }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonQuotesGroup15, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[.�0-9\\pL]", + chars: []rune{'.', '�'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonQuotesGroup22, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -45788,110 +60359,154 @@ 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")}, - 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: 2809, col: 5, offset: 92974}, + run: (*parser).callonQuotesGroup24, + expr: &seqExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + expr: &charClassMatcher{ + pos: position{line: 2809, col: 5, offset: 92974}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 2809, col: 15, offset: 92984}, + expr: &choiceExpr{ + pos: position{line: 2809, col: 17, offset: 92986}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2809, col: 17, offset: 92986}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, ignoreCase: false, inverted: false, }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, }, }, }, - &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, + }, + &actionExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + run: (*parser).callonQuotesGroup33, + expr: &seqExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 9, offset: 93068}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 19, offset: 93078}, expr: &seqExpr{ - pos: position{line: 229, col: 17, offset: 7426}, + pos: position{line: 2811, col: 20, offset: 93079}, exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2811, col: 20, offset: 93079}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 27, offset: 93086}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 27, offset: 93086}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + run: (*parser).callonQuotesGroup42, + expr: &seqExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2829, col: 17, offset: 93606}, + val: "[.,;!?]", + chars: []rune{'.', ',', ';', '!', '?'}, + ignoreCase: false, + inverted: false, + }, + &andExpr{ + pos: position{line: 2829, col: 46, offset: 93635}, + expr: &choiceExpr{ + pos: position{line: 2829, col: 48, offset: 93637}, + alternatives: []interface{}{ &litMatcher{ - pos: position{line: 229, col: 17, offset: 7426}, - val: ":", + pos: position{line: 2878, col: 10, offset: 95044}, + 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).callonAttributeSubs74, - 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).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, - }, - }, - }, - }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonQuotesGroup48, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonQuotesGroup54, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -45899,412 +60514,492 @@ var g = &grammar{ }, }, }, - &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}, + &ruleRefExpr{ + pos: position{line: 2488, col: 7, offset: 83381}, + name: "Quote", + }, + &actionExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + run: (*parser).callonQuotesGroup57, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonQuotesGroup61, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, expr: &charClassMatcher{ - pos: position{line: 190, col: 29, offset: 6129}, - val: "[-0-9\\pL]", - chars: []rune{'-'}, + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", 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: 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: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", + }, + &actionExpr{ + pos: position{line: 2835, col: 12, offset: 93828}, + run: (*parser).callonQuotesGroup65, + expr: &anyMatcher{ + line: 2835, col: 12, offset: 93828, }, }, }, }, - &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: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, }, }, }, }, }, { - 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', ' '}, - ignoreCase: false, - inverted: false, + name: "ReplacementsGroup", + pos: position{line: 2495, col: 1, offset: 83618}, + expr: &actionExpr{ + pos: position{line: 2495, col: 22, offset: 83639}, + run: (*parser).callonReplacementsGroup1, + expr: &seqExpr{ + pos: position{line: 2495, col: 22, offset: 83639}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2495, col: 22, offset: 83639}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2495, col: 31, offset: 83648}, + expr: &choiceExpr{ + pos: position{line: 2496, col: 5, offset: 83654}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + run: (*parser).callonReplacementsGroup6, + expr: &seqExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + run: (*parser).callonReplacementsGroup9, + expr: &oneOrMoreExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + expr: &charClassMatcher{ + pos: position{line: 2820, col: 14, offset: 93380}, + 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, + }, + &andExpr{ + pos: position{line: 2823, col: 5, offset: 93461}, + expr: &choiceExpr{ + pos: position{line: 2823, col: 7, offset: 93463}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonReplacementsGroup15, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[.�0-9\\pL]", + chars: []rune{'.', '�'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonReplacementsGroup22, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, }, }, }, - }, - }, - &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', ' ', ',', ']'}, + &actionExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + run: (*parser).callonReplacementsGroup24, + expr: &seqExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + expr: &charClassMatcher{ + pos: position{line: 2809, col: 5, offset: 92974}, + 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, + }, + &andExpr{ + pos: position{line: 2809, col: 15, offset: 92984}, + expr: &choiceExpr{ + pos: position{line: 2809, col: 17, offset: 92986}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2809, col: 17, offset: 92986}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, }, }, }, }, - }, - }, - &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{'=', '*', '_', '`'}, + &actionExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + run: (*parser).callonReplacementsGroup33, + expr: &seqExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 9, offset: 93068}, + 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, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 19, offset: 93078}, + expr: &seqExpr{ + pos: position{line: 2811, col: 20, offset: 93079}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2811, col: 20, offset: 93079}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 27, offset: 93086}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 27, offset: 93086}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, }, }, }, }, }, }, - }, - }, - &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\"", + &actionExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + run: (*parser).callonReplacementsGroup42, + expr: &seqExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2829, col: 17, offset: 93606}, + val: "[.,;!?]", + chars: []rune{'.', ',', ';', '!', '?'}, + ignoreCase: false, + inverted: false, + }, + &andExpr{ + pos: position{line: 2829, col: 46, offset: 93635}, + expr: &choiceExpr{ + pos: position{line: 2829, col: 48, offset: 93637}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonReplacementsGroup48, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonReplacementsGroup54, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, }, }, }, - }, - }, - &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: "\"�\"", + &actionExpr{ + pos: position{line: 2576, col: 5, offset: 85805}, + run: (*parser).callonReplacementsGroup56, + expr: &seqExpr{ + pos: position{line: 2576, col: 5, offset: 85805}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2576, col: 5, offset: 85805}, + run: (*parser).callonReplacementsGroup58, + }, + &labeledExpr{ + pos: position{line: 2579, col: 5, offset: 85871}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2618, col: 11, offset: 87173}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2620, col: 15, offset: 87267}, + run: (*parser).callonReplacementsGroup61, + expr: &litMatcher{ + pos: position{line: 2620, col: 15, offset: 87267}, + val: "`'", + ignoreCase: false, + want: "\"`'\"", + }, + }, + &actionExpr{ + pos: position{line: 2626, col: 14, offset: 87382}, + run: (*parser).callonReplacementsGroup63, + expr: &litMatcher{ + pos: position{line: 2626, col: 14, offset: 87382}, + val: "(C)", + ignoreCase: false, + want: "\"(C)\"", + }, + }, + &actionExpr{ + pos: position{line: 2630, col: 14, offset: 87458}, + run: (*parser).callonReplacementsGroup65, + expr: &litMatcher{ + pos: position{line: 2630, col: 14, offset: 87458}, + val: "(TM)", + ignoreCase: false, + want: "\"(TM)\"", + }, + }, + &actionExpr{ + pos: position{line: 2634, col: 15, offset: 87536}, + run: (*parser).callonReplacementsGroup67, + expr: &litMatcher{ + pos: position{line: 2634, col: 15, offset: 87536}, + val: "(R)", + ignoreCase: false, + want: "\"(R)\"", + }, + }, + &actionExpr{ + pos: position{line: 2638, col: 13, offset: 87611}, + run: (*parser).callonReplacementsGroup69, + expr: &litMatcher{ + pos: position{line: 2638, col: 13, offset: 87611}, + val: "...", + ignoreCase: false, + want: "\"...\"", + }, + }, + &actionExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + run: (*parser).callonReplacementsGroup71, + expr: &seqExpr{ + pos: position{line: 2646, col: 22, offset: 87917}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &litMatcher{ + pos: position{line: 2646, col: 31, offset: 87926}, + val: "'", + ignoreCase: false, + want: "\"'\"", + }, + &andExpr{ + pos: position{line: 2646, col: 35, offset: 87930}, + expr: &charClassMatcher{ + pos: position{line: 2646, col: 36, offset: 87931}, + val: "[\\pL]", + classes: []*unicode.RangeTable{rangeTable("L")}, + 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).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: 947, col: 23, offset: 29896}, + run: (*parser).callonReplacementsGroup77, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonReplacementsGroup81, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", + }, + &actionExpr{ + pos: position{line: 2835, col: 12, offset: 93828}, + run: (*parser).callonReplacementsGroup85, + expr: &anyMatcher{ + line: 2835, col: 12, offset: 93828, }, }, }, }, - &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: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2890, col: 9, offset: 95286, }, }, }, @@ -46312,56 +61007,104 @@ var g = &grammar{ }, }, { - name: "MarkdownQuoteLine", - pos: position{line: 1995, col: 1, offset: 70649}, + name: "SpecialCharactersGroup", + pos: position{line: 2504, col: 1, offset: 83939}, expr: &actionExpr{ - pos: position{line: 1996, col: 5, offset: 70675}, - run: (*parser).callonMarkdownQuoteLine1, + pos: position{line: 2504, col: 27, offset: 83965}, + run: (*parser).callonSpecialCharactersGroup1, expr: &seqExpr{ - pos: position{line: 1996, col: 5, offset: 70675}, + pos: position{line: 2504, col: 27, offset: 83965}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1996, col: 5, offset: 70675}, + pos: position{line: 2504, col: 27, offset: 83965}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1996, col: 14, offset: 70684}, + pos: position{line: 2504, col: 36, offset: 83974}, expr: &choiceExpr{ - pos: position{line: 1996, col: 15, offset: 70685}, + pos: position{line: 2505, col: 5, offset: 83980}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, - run: (*parser).callonMarkdownQuoteLine6, + pos: position{line: 2820, col: 5, offset: 93371}, + run: (*parser).callonSpecialCharactersGroup6, expr: &seqExpr{ - pos: position{line: 2232, col: 5, offset: 78844}, + pos: position{line: 2820, col: 5, offset: 93371}, 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, + &labeledExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + run: (*parser).callonSpecialCharactersGroup9, + expr: &oneOrMoreExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + expr: &charClassMatcher{ + pos: position{line: 2820, col: 14, offset: 93380}, + 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}, + pos: position{line: 2823, col: 5, offset: 93461}, expr: &choiceExpr{ - pos: position{line: 2232, col: 21, offset: 78860}, + pos: position{line: 2823, col: 7, offset: 93463}, alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSpecialCharactersGroup15, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, &charClassMatcher{ - pos: position{line: 2232, col: 21, offset: 78860}, - val: "[\\r\\n ]", - chars: []rune{'\r', '\n', ' '}, + pos: position{line: 2797, col: 13, offset: 92519}, + 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}, + pos: position{line: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSpecialCharactersGroup22, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", }, }, }, @@ -46371,15 +61114,15 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, - run: (*parser).callonMarkdownQuoteLine15, + pos: position{line: 2809, col: 5, offset: 92974}, + run: (*parser).callonSpecialCharactersGroup24, expr: &seqExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, + pos: position{line: 2809, col: 5, offset: 92974}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 2225, col: 5, offset: 78563}, + pos: position{line: 2809, col: 5, offset: 92974}, expr: &charClassMatcher{ - pos: position{line: 2225, col: 5, offset: 78563}, + pos: position{line: 2809, col: 5, offset: 92974}, val: "[0-9\\pL]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, @@ -46388,21 +61131,21 @@ var g = &grammar{ }, }, &andExpr{ - pos: position{line: 2225, col: 15, offset: 78573}, + pos: position{line: 2809, col: 15, offset: 92984}, expr: &choiceExpr{ - pos: position{line: 2225, col: 17, offset: 78575}, + pos: position{line: 2809, col: 17, offset: 92986}, alternatives: []interface{}{ &charClassMatcher{ - pos: position{line: 2225, col: 17, offset: 78575}, + pos: position{line: 2809, col: 17, offset: 92986}, val: "[\\r\\n ,]]", chars: []rune{'\r', '\n', ' ', ',', ']'}, ignoreCase: false, inverted: false, }, ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, + pos: position{line: 2890, col: 8, offset: 95285}, expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + line: 2890, col: 9, offset: 95286, }, }, }, @@ -46412,15 +61155,15 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, - run: (*parser).callonMarkdownQuoteLine24, + pos: position{line: 2811, col: 9, offset: 93068}, + run: (*parser).callonSpecialCharactersGroup33, expr: &seqExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, + pos: position{line: 2811, col: 9, offset: 93068}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 2227, col: 9, offset: 78658}, + pos: position{line: 2811, col: 9, offset: 93068}, expr: &charClassMatcher{ - pos: position{line: 2227, col: 9, offset: 78658}, + pos: position{line: 2811, col: 9, offset: 93068}, val: "[0-9\\pL]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, @@ -46429,21 +61172,21 @@ var g = &grammar{ }, }, &oneOrMoreExpr{ - pos: position{line: 2227, col: 19, offset: 78668}, + pos: position{line: 2811, col: 19, offset: 93078}, expr: &seqExpr{ - pos: position{line: 2227, col: 20, offset: 78669}, + pos: position{line: 2811, col: 20, offset: 93079}, exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 2227, col: 20, offset: 78669}, + pos: position{line: 2811, col: 20, offset: 93079}, val: "[=*_`]", chars: []rune{'=', '*', '_', '`'}, ignoreCase: false, inverted: false, }, &oneOrMoreExpr{ - pos: position{line: 2227, col: 27, offset: 78676}, + pos: position{line: 2811, col: 27, offset: 93086}, expr: &charClassMatcher{ - pos: position{line: 2227, col: 27, offset: 78676}, + pos: position{line: 2811, col: 27, offset: 93086}, val: "[0-9\\pL]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, @@ -46457,1333 +61200,1839 @@ 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: 2829, col: 16, offset: 93605}, + run: (*parser).callonSpecialCharactersGroup42, expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 2829, col: 16, offset: 93605}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, - val: "�", + &charClassMatcher{ + pos: position{line: 2829, col: 17, offset: 93606}, + val: "[.,;!?]", + chars: []rune{'.', ',', ';', '!', '?'}, ignoreCase: false, - want: "\"�\"", + 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).callonMarkdownQuoteLine43, - 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'}, + &andExpr{ + pos: position{line: 2829, col: 46, offset: 93635}, + expr: &choiceExpr{ + pos: position{line: 2829, col: 48, offset: 93637}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", ignoreCase: false, - inverted: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSpecialCharactersGroup48, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonSpecialCharactersGroup54, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, }, }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", - }, }, }, }, &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, - }, - }, - }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: "MarkdownQuoteAttribution", - pos: position{line: 2004, col: 1, offset: 70889}, - expr: &actionExpr{ - pos: position{line: 2004, col: 29, offset: 70917}, - run: (*parser).callonMarkdownQuoteAttribution1, - expr: &seqExpr{ - pos: position{line: 2004, col: 29, offset: 70917}, - 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', ' '}, - 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, - }, - }, - }, - }, - }, - }, - }, - }, - &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, - }, - }, + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonSpecialCharactersGroup56, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonSpecialCharactersGroup58, }, - }, - }, - }, - }, - }, - &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: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonSpecialCharactersGroup61, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonSpecialCharactersGroup63, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonSpecialCharactersGroup67, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonSpecialCharactersGroup73, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonSpecialCharactersGroup79, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSpecialCharactersGroup84, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonSpecialCharactersGroup86, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonSpecialCharactersGroup89, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSpecialCharactersGroup93, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSpecialCharactersGroup100, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSpecialCharactersGroup105, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSpecialCharactersGroup107, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonSpecialCharactersGroup111, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSpecialCharactersGroup115, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonSpecialCharactersGroup122, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonSpecialCharactersGroup127, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonSpecialCharactersGroup129, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonSpecialCharactersGroup133, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonSpecialCharactersGroup137, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonSpecialCharactersGroup143, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonSpecialCharactersGroup146, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonSpecialCharactersGroup150, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonSpecialCharactersGroup154, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + 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).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: 947, col: 23, offset: 29896}, + run: (*parser).callonSpecialCharactersGroup156, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonSpecialCharactersGroup160, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, }, }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, }, }, - &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, - val: "�", - ignoreCase: false, - want: "\"�\"", + }, + &actionExpr{ + pos: position{line: 2835, col: 12, offset: 93828}, + run: (*parser).callonSpecialCharactersGroup164, + expr: &anyMatcher{ + line: 2835, col: 12, offset: 93828, }, }, }, }, - &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: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, }, }, }, }, }, { - 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', ' '}, - ignoreCase: false, - inverted: false, - }, - ¬Expr{ - pos: position{line: 2277, col: 8, offset: 80048}, - expr: &anyMatcher{ - line: 2277, col: 9, offset: 80049, + name: "VerbatimGroup", + pos: position{line: 2512, col: 1, offset: 84199}, + expr: &actionExpr{ + pos: position{line: 2512, col: 18, offset: 84216}, + run: (*parser).callonVerbatimGroup1, + expr: &seqExpr{ + pos: position{line: 2512, col: 18, offset: 84216}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2512, col: 18, offset: 84216}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2512, col: 27, offset: 84225}, + expr: &choiceExpr{ + pos: position{line: 2513, col: 5, offset: 84231}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + run: (*parser).callonVerbatimGroup6, + expr: &seqExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2820, col: 5, offset: 93371}, + label: "content", + expr: &actionExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + run: (*parser).callonVerbatimGroup9, + expr: &oneOrMoreExpr{ + pos: position{line: 2820, col: 14, offset: 93380}, + expr: &charClassMatcher{ + pos: position{line: 2820, col: 14, offset: 93380}, + val: "[,?!;0-9\\pL]", + chars: []rune{',', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, }, }, }, - }, - }, - }, - }, - }, - &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, + &andExpr{ + pos: position{line: 2823, col: 5, offset: 93461}, + expr: &choiceExpr{ + pos: position{line: 2823, col: 7, offset: 93463}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonVerbatimGroup15, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[.�0-9\\pL]", + chars: []rune{'.', '�'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonVerbatimGroup22, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, }, }, }, }, }, }, - }, - }, - &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{'=', '*', '_', '`'}, + &actionExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + run: (*parser).callonVerbatimGroup24, + expr: &seqExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2809, col: 5, offset: 92974}, + expr: &charClassMatcher{ + pos: position{line: 2809, col: 5, offset: 92974}, + 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, + }, + &andExpr{ + pos: position{line: 2809, col: 15, offset: 92984}, + expr: &choiceExpr{ + pos: position{line: 2809, col: 17, offset: 92986}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2809, col: 17, offset: 92986}, + val: "[\\r\\n ,]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, }, }, }, }, - }, - }, - &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}, + &actionExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + run: (*parser).callonVerbatimGroup33, + expr: &seqExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 2811, col: 9, offset: 93068}, expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, - val: "[0-9]", + pos: position{line: 2811, col: 9, offset: 93068}, + val: "[0-9\\pL]", ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 19, offset: 93078}, + expr: &seqExpr{ + pos: position{line: 2811, col: 20, offset: 93079}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2811, col: 20, offset: 93079}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 2811, col: 27, offset: 93086}, + expr: &charClassMatcher{ + pos: position{line: 2811, col: 27, offset: 93086}, + 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: "\"�\"", - }, }, - }, - }, - &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: " ", + &actionExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + run: (*parser).callonVerbatimGroup42, + expr: &seqExpr{ + pos: position{line: 2829, col: 16, offset: 93605}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 2829, col: 17, offset: 93606}, + val: "[.,;!?]", + chars: []rune{'.', ',', ';', '!', '?'}, ignoreCase: false, - want: "\" \"", + inverted: false, }, - &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\"", + &andExpr{ + pos: position{line: 2829, col: 46, offset: 93635}, + expr: &choiceExpr{ + pos: position{line: 2829, col: 48, offset: 93637}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonVerbatimGroup48, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonVerbatimGroup54, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, }, }, }, }, - &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\"", + }, + &ruleRefExpr{ + pos: position{line: 2514, col: 7, offset: 84248}, + name: "Callout", + }, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonVerbatimGroup57, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonVerbatimGroup59, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonVerbatimGroup62, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonVerbatimGroup64, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonVerbatimGroup68, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonVerbatimGroup74, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonVerbatimGroup80, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonVerbatimGroup85, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonVerbatimGroup87, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonVerbatimGroup90, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonVerbatimGroup94, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonVerbatimGroup101, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonVerbatimGroup106, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonVerbatimGroup108, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonVerbatimGroup112, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonVerbatimGroup116, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonVerbatimGroup123, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonVerbatimGroup128, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonVerbatimGroup130, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonVerbatimGroup134, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonVerbatimGroup138, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonVerbatimGroup144, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonVerbatimGroup147, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonVerbatimGroup151, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonVerbatimGroup155, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + 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: 947, col: 23, offset: 29896}, + run: (*parser).callonVerbatimGroup157, + expr: &seqExpr{ + pos: position{line: 947, col: 23, offset: 29896}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + val: "�", + ignoreCase: false, + want: "\"�\"", + }, + &labeledExpr{ + pos: position{line: 947, col: 51, offset: 29924}, + label: "ref", + expr: &actionExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonVerbatimGroup161, + expr: &oneOrMoreExpr{ + pos: position{line: 947, col: 56, offset: 29929}, + expr: &charClassMatcher{ + pos: position{line: 947, col: 56, offset: 29929}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, }, }, }, + &litMatcher{ + pos: position{line: 945, col: 32, offset: 29864}, + 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: 2835, col: 12, offset: 93828}, + run: (*parser).callonVerbatimGroup165, + expr: &anyMatcher{ + line: 2835, col: 12, offset: 93828, }, }, }, }, - &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: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, }, }, }, }, }, { - 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")}, - 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, - }, - }, - }, - }, - }, - }, + name: "InlineMacro", + pos: position{line: 2521, col: 1, offset: 84510}, + expr: &actionExpr{ + pos: position{line: 2523, col: 5, offset: 84592}, + run: (*parser).callonInlineMacro1, + expr: &seqExpr{ + pos: position{line: 2523, col: 5, offset: 84592}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2523, col: 5, offset: 84592}, + run: (*parser).callonInlineMacro3, + }, + &labeledExpr{ + pos: position{line: 2526, col: 5, offset: 84652}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2527, col: 9, offset: 84670}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 2527, col: 9, offset: 84670}, + name: "InlineIcon", }, - }, - &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")}, - 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, - }, - }, - }, - }, - }, - }, + &ruleRefExpr{ + pos: position{line: 2528, col: 11, offset: 84691}, + name: "InlineImage", }, - }, - &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")}, + &ruleRefExpr{ + pos: position{line: 2529, col: 11, offset: 84714}, + name: "Link", + }, + &ruleRefExpr{ + pos: position{line: 2530, col: 11, offset: 84730}, + name: "InlinePassthrough", + }, + &ruleRefExpr{ + pos: position{line: 2531, col: 11, offset: 84759}, + name: "InlineFootnote", + }, + &ruleRefExpr{ + pos: position{line: 2532, col: 11, offset: 84785}, + name: "CrossReference", + }, + &ruleRefExpr{ + pos: position{line: 2533, col: 11, offset: 84811}, + name: "InlineUserMacro", + }, + &actionExpr{ + pos: position{line: 1125, col: 20, offset: 35773}, + run: (*parser).callonInlineMacro13, + expr: &seqExpr{ + pos: position{line: 1125, col: 20, offset: 35773}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1125, col: 20, offset: 35773}, + 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}, + &labeledExpr{ + pos: position{line: 1125, col: 25, offset: 35778}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonInlineMacro17, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, 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: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, ignoreCase: false, - inverted: false, + inverted: true, }, }, }, }, - }, - }, - }, - }, - &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, - }, - }, - }, - }, - &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", + &litMatcher{ + pos: position{line: 1125, col: 33, offset: 35786}, + val: "]]", ignoreCase: false, - want: "\"\\t\"", + want: "\"]]\"", }, - }, - }, - }, - }, - &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, + &zeroOrMoreExpr{ + pos: position{line: 1125, col: 38, offset: 35791}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineMacro24, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, }, }, }, }, - &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'}, + &actionExpr{ + pos: position{line: 1142, col: 23, offset: 36485}, + run: (*parser).callonInlineMacro26, + expr: &seqExpr{ + pos: position{line: 1142, col: 23, offset: 36485}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1142, col: 23, offset: 36485}, + 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, + &labeledExpr{ + pos: position{line: 1142, col: 29, offset: 36491}, + label: "term1", + expr: &actionExpr{ + pos: position{line: 1149, col: 30, offset: 36822}, + run: (*parser).callonInlineMacro30, + expr: &oneOrMoreExpr{ + pos: position{line: 1149, col: 30, offset: 36822}, + expr: &choiceExpr{ + pos: position{line: 1149, col: 31, offset: 36823}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[ 0-9\\pL]", + chars: []rune{' '}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineMacro34, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, }, }, }, - }, - }, - }, - }, - }, - }, - }, - ¬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}, - expr: &actionExpr{ - pos: position{line: 2048, col: 10, offset: 72197}, - run: (*parser).callonTable1, - expr: &seqExpr{ - pos: position{line: 2048, col: 10, offset: 72197}, - 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).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: "\" \"", + &labeledExpr{ + pos: position{line: 1143, col: 5, offset: 36530}, + label: "term2", + expr: &zeroOrOneExpr{ + pos: position{line: 1143, col: 11, offset: 36536}, + expr: &actionExpr{ + pos: position{line: 1143, col: 12, offset: 36537}, + run: (*parser).callonInlineMacro38, + expr: &seqExpr{ + pos: position{line: 1143, col: 12, offset: 36537}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1143, col: 12, offset: 36537}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineMacro43, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1143, col: 19, offset: 36544}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1143, col: 23, offset: 36548}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineMacro49, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1143, col: 30, offset: 36555}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1149, col: 30, offset: 36822}, + run: (*parser).callonInlineMacro52, + expr: &oneOrMoreExpr{ + pos: position{line: 1149, col: 30, offset: 36822}, + expr: &choiceExpr{ + pos: position{line: 1149, col: 31, offset: 36823}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[ 0-9\\pL]", + chars: []rune{' '}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineMacro56, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, - &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\"", + }, + &labeledExpr{ + pos: position{line: 1144, col: 5, offset: 36622}, + label: "term3", + expr: &zeroOrOneExpr{ + pos: position{line: 1144, col: 11, offset: 36628}, + expr: &actionExpr{ + pos: position{line: 1144, col: 12, offset: 36629}, + run: (*parser).callonInlineMacro60, + expr: &seqExpr{ + pos: position{line: 1144, col: 12, offset: 36629}, + exprs: []interface{}{ + &zeroOrMoreExpr{ + pos: position{line: 1144, col: 12, offset: 36629}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineMacro65, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 1144, col: 19, offset: 36636}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &zeroOrMoreExpr{ + pos: position{line: 1144, col: 23, offset: 36640}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineMacro71, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 1144, col: 30, offset: 36647}, + label: "content", + expr: &actionExpr{ + pos: position{line: 1149, col: 30, offset: 36822}, + run: (*parser).callonInlineMacro74, + expr: &oneOrMoreExpr{ + pos: position{line: 1149, col: 30, offset: 36822}, + expr: &choiceExpr{ + pos: position{line: 1149, col: 31, offset: 36823}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[ 0-9\\pL]", + chars: []rune{' '}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlineMacro78, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + 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: 1145, col: 5, offset: 36714}, + 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, + &ruleRefExpr{ + pos: position{line: 2536, col: 11, offset: 84893}, + name: "IndexTerm", + }, + &ruleRefExpr{ + pos: position{line: 2537, col: 11, offset: 84913}, + name: "InlineUserMacro", }, }, }, @@ -47793,353 +63042,440 @@ var g = &grammar{ }, }, { - name: "TableLineHeader", - pos: position{line: 2060, col: 1, offset: 72559}, + name: "InlinePassthrough", + pos: position{line: 2541, col: 1, offset: 84975}, expr: &actionExpr{ - pos: position{line: 2060, col: 20, offset: 72578}, - run: (*parser).callonTableLineHeader1, + pos: position{line: 2543, col: 5, offset: 85063}, + run: (*parser).callonInlinePassthrough1, expr: &seqExpr{ - pos: position{line: 2060, col: 20, offset: 72578}, + pos: position{line: 2543, col: 5, offset: 85063}, 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: 2543, col: 5, offset: 85063}, + run: (*parser).callonInlinePassthrough3, }, &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{}{ + pos: position{line: 2546, col: 5, offset: 85135}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2547, col: 9, offset: 85153}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1211, col: 26, offset: 40004}, + run: (*parser).callonInlinePassthrough6, + expr: &seqExpr{ + pos: position{line: 1211, col: 26, offset: 40004}, + exprs: []interface{}{ &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 1209, col: 32, offset: 39972}, + val: "+++", ignoreCase: false, - want: "\" \"", + 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\"", + &labeledExpr{ + pos: position{line: 1211, col: 54, offset: 40032}, + label: "content", + expr: &choiceExpr{ + pos: position{line: 1215, col: 33, offset: 40245}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1215, col: 34, offset: 40246}, + run: (*parser).callonInlinePassthrough11, + expr: &zeroOrMoreExpr{ + pos: position{line: 1215, col: 34, offset: 40246}, + expr: &seqExpr{ + pos: position{line: 1215, col: 35, offset: 40247}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1215, col: 35, offset: 40247}, + expr: &litMatcher{ + pos: position{line: 1209, col: 32, offset: 39972}, + val: "+++", + ignoreCase: false, + want: "\"+++\"", + }, + }, + &anyMatcher{ + line: 1215, col: 64, offset: 40276, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1217, col: 11, offset: 40449}, + run: (*parser).callonInlinePassthrough17, + expr: &zeroOrOneExpr{ + pos: position{line: 1217, col: 11, offset: 40449}, + expr: &seqExpr{ + pos: position{line: 1217, col: 12, offset: 40450}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1217, col: 12, offset: 40450}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlinePassthrough23, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1217, col: 19, offset: 40457}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonInlinePassthrough29, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1217, col: 28, offset: 40466}, + expr: &litMatcher{ + pos: position{line: 1209, col: 32, offset: 39972}, + val: "+++", + ignoreCase: false, + want: "\"+++\"", + }, + }, + &anyMatcher{ + line: 1217, col: 57, offset: 40495, + }, + }, + }, + }, + }, + }, }, }, - }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - val: "\r\n", - ignoreCase: false, - want: "\"\\r\\n\"", - }, - &charClassMatcher{ - pos: position{line: 2275, col: 21, offset: 80028}, - val: "[\\r\\n]", - chars: []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: "TableLine", - pos: position{line: 2064, col: 1, offset: 72685}, - expr: &actionExpr{ - pos: position{line: 2064, col: 14, offset: 72698}, - run: (*parser).callonTableLine1, - expr: &seqExpr{ - pos: position{line: 2064, col: 14, offset: 72698}, - 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: " ", + pos: position{line: 1209, col: 32, offset: 39972}, + val: "+++", ignoreCase: false, - want: "\" \"", + 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", + ¬Expr{ + pos: position{line: 1211, col: 121, offset: 40099}, + expr: &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + 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, - }, - }, - }, - }, - }, - }, - }, - &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, + &actionExpr{ + pos: position{line: 1199, col: 26, offset: 39287}, + run: (*parser).callonInlinePassthrough37, + expr: &seqExpr{ + pos: position{line: 1199, col: 26, offset: 39287}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1197, col: 32, offset: 39257}, + 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).callonTableLine33, - expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", - ignoreCase: false, - want: "\"\\t\"", + &labeledExpr{ + pos: position{line: 1199, col: 54, offset: 39315}, + label: "content", + expr: &choiceExpr{ + pos: position{line: 1203, col: 33, offset: 39528}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1203, col: 34, offset: 39529}, + run: (*parser).callonInlinePassthrough42, + expr: &seqExpr{ + pos: position{line: 1203, col: 34, offset: 39529}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1203, col: 35, offset: 39530}, + expr: &litMatcher{ + pos: position{line: 1197, col: 32, offset: 39257}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + }, + ¬Expr{ + pos: position{line: 1203, col: 64, offset: 39559}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlinePassthrough49, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1203, col: 71, offset: 39566}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonInlinePassthrough55, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1203, col: 80, offset: 39575, + }, + &zeroOrMoreExpr{ + pos: position{line: 1203, col: 83, offset: 39578}, + expr: &seqExpr{ + pos: position{line: 1203, col: 84, offset: 39579}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1203, col: 84, offset: 39579}, + expr: &seqExpr{ + pos: position{line: 1203, col: 86, offset: 39581}, + exprs: []interface{}{ + &actionExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + run: (*parser).callonInlinePassthrough62, + expr: &oneOrMoreExpr{ + pos: position{line: 2882, col: 11, offset: 95109}, + expr: &charClassMatcher{ + pos: position{line: 2882, col: 12, offset: 95110}, + val: "[ \\t]", + chars: []rune{' ', '\t'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + &litMatcher{ + pos: position{line: 1197, col: 32, offset: 39257}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1203, col: 122, offset: 39617}, + expr: &litMatcher{ + pos: position{line: 1197, col: 32, offset: 39257}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + }, + ¬Expr{ + pos: position{line: 1203, col: 151, offset: 39646}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonInlinePassthrough72, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + &anyMatcher{ + line: 1203, col: 160, offset: 39655, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1205, col: 11, offset: 39805}, + run: (*parser).callonInlinePassthrough75, + expr: &seqExpr{ + pos: position{line: 1205, col: 12, offset: 39806}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1205, col: 12, offset: 39806}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonInlinePassthrough80, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1205, col: 19, offset: 39813}, + expr: &choiceExpr{ + pos: position{line: 2886, col: 12, offset: 95178}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", + }, + &litMatcher{ + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", + ignoreCase: false, + want: "\"\\r\\n\"", + }, + &actionExpr{ + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonInlinePassthrough86, + expr: &litMatcher{ + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", + ignoreCase: false, + want: "\"\\r\"", + }, + }, + }, + }, + }, + ¬Expr{ + pos: position{line: 1205, col: 28, offset: 39822}, + expr: &litMatcher{ + pos: position{line: 1197, col: 32, offset: 39257}, + val: "+", + ignoreCase: false, + want: "\"+\"", + }, + }, + &anyMatcher{ + line: 1205, col: 57, offset: 39851, + }, + }, + }, + }, }, }, }, - }, - }, - &choiceExpr{ - pos: position{line: 2279, col: 8, offset: 80059}, - alternatives: []interface{}{ &litMatcher{ - pos: position{line: 2275, col: 12, offset: 80019}, - 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: 1197, col: 32, offset: 39257}, + 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: 1199, col: 121, offset: 39382}, + expr: &charClassMatcher{ + pos: position{line: 2797, col: 13, offset: 92519}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, }, + &ruleRefExpr{ + pos: position{line: 2547, col: 57, offset: 85201}, + name: "PassthroughMacro", + }, }, }, }, @@ -48148,683 +63484,1358 @@ var g = &grammar{ }, }, { - name: "TableCell", - pos: position{line: 2068, col: 1, offset: 72806}, + name: "Quote", + pos: position{line: 2563, col: 1, offset: 85488}, expr: &actionExpr{ - pos: position{line: 2068, col: 14, offset: 72819}, - run: (*parser).callonTableCell1, + pos: position{line: 2565, col: 5, offset: 85564}, + run: (*parser).callonQuote1, expr: &seqExpr{ - pos: position{line: 2068, col: 14, offset: 72819}, + pos: position{line: 2565, col: 5, offset: 85564}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2055, col: 23, offset: 72447}, - val: "|", - ignoreCase: false, - want: "\"|\"", + &andCodeExpr{ + pos: position{line: 2565, col: 5, offset: 85564}, + run: (*parser).callonQuote3, }, - &zeroOrMoreExpr{ - pos: position{line: 2055, col: 27, offset: 72451}, + &labeledExpr{ + pos: position{line: 2568, col: 5, offset: 85624}, + label: "element", expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, + pos: position{line: 2569, col: 9, offset: 85642}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", - ignoreCase: false, - want: "\" \"", + &ruleRefExpr{ + pos: position{line: 2569, col: 9, offset: 85642}, + name: "QuotedText", }, - &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\"", - }, + &ruleRefExpr{ + pos: position{line: 2570, col: 11, offset: 85664}, + name: "QuotedString", }, }, }, }, + }, + }, + }, + }, + { + name: "TableColumnsAttribute", + pos: position{line: 2715, col: 1, offset: 89672}, + expr: &actionExpr{ + pos: position{line: 2715, col: 26, offset: 89697}, + run: (*parser).callonTableColumnsAttribute1, + expr: &seqExpr{ + pos: position{line: 2715, col: 26, offset: 89697}, + exprs: []interface{}{ &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: "\"|\"", + pos: position{line: 2715, col: 26, offset: 89697}, + label: "cols", + expr: &zeroOrMoreExpr{ + pos: position{line: 2715, col: 31, offset: 89702}, + expr: &actionExpr{ + pos: position{line: 2720, col: 5, offset: 89765}, + run: (*parser).callonTableColumnsAttribute5, + expr: &seqExpr{ + pos: position{line: 2720, col: 5, offset: 89765}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 2720, col: 5, offset: 89765}, + expr: ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, - &zeroOrMoreExpr{ - pos: position{line: 2055, col: 27, offset: 72451}, - expr: &choiceExpr{ - pos: position{line: 2271, col: 10, offset: 79961}, - alternatives: []interface{}{ + }, + }, + &labeledExpr{ + pos: position{line: 2723, col: 5, offset: 89889}, + label: "multiplier", + expr: &zeroOrOneExpr{ + pos: position{line: 2723, col: 16, offset: 89900}, + expr: &actionExpr{ + pos: position{line: 2723, col: 17, offset: 89901}, + run: (*parser).callonTableColumnsAttribute12, + expr: &seqExpr{ + pos: position{line: 2723, col: 17, offset: 89901}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2723, col: 17, offset: 89901}, + label: "n", + expr: &actionExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + run: (*parser).callonTableColumnsAttribute15, + expr: &seqExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + expr: &litMatcher{ + pos: position{line: 2874, col: 11, offset: 94970}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 16, offset: 94975}, + expr: &actionExpr{ + pos: position{line: 2870, col: 10, offset: 94910}, + run: (*parser).callonTableColumnsAttribute20, + expr: &charClassMatcher{ + pos: position{line: 2870, col: 10, offset: 94910}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2723, col: 26, offset: 89910}, + 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\"", - }, + want: "\"*\"", }, }, }, }, }, }, - }, - ¬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, + &labeledExpr{ + pos: position{line: 2724, col: 5, offset: 89938}, + label: "halign", + expr: &zeroOrOneExpr{ + pos: position{line: 2724, col: 12, offset: 89945}, + expr: &choiceExpr{ + pos: position{line: 2725, col: 9, offset: 89955}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2725, col: 9, offset: 89955}, + run: (*parser).callonTableColumnsAttribute26, + expr: &litMatcher{ + pos: position{line: 2725, col: 9, offset: 89955}, + val: "<", + ignoreCase: false, + want: "\"<\"", + }, + }, + &actionExpr{ + pos: position{line: 2726, col: 11, offset: 90002}, + run: (*parser).callonTableColumnsAttribute28, + expr: &litMatcher{ + pos: position{line: 2726, col: 11, offset: 90002}, + val: ">", + ignoreCase: false, + want: "\">\"", + }, + }, + &actionExpr{ + pos: position{line: 2727, col: 11, offset: 90050}, + run: (*parser).callonTableColumnsAttribute30, + expr: &litMatcher{ + pos: position{line: 2727, col: 11, offset: 90050}, + 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: 2729, col: 5, offset: 90100}, + label: "valign", + expr: &zeroOrOneExpr{ + pos: position{line: 2729, col: 12, offset: 90107}, + expr: &choiceExpr{ + pos: position{line: 2730, col: 9, offset: 90117}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2730, col: 9, offset: 90117}, + run: (*parser).callonTableColumnsAttribute35, + expr: &litMatcher{ + pos: position{line: 2730, col: 9, offset: 90117}, + val: ".<", + ignoreCase: false, + want: "\".<\"", + }, + }, + &actionExpr{ + pos: position{line: 2731, col: 11, offset: 90164}, + run: (*parser).callonTableColumnsAttribute37, + expr: &litMatcher{ + pos: position{line: 2731, col: 11, offset: 90164}, + val: ".>", + ignoreCase: false, + want: "\".>\"", + }, + }, + &actionExpr{ + pos: position{line: 2732, col: 11, offset: 90214}, + run: (*parser).callonTableColumnsAttribute39, + expr: &litMatcher{ + pos: position{line: 2732, col: 11, offset: 90214}, + val: ".^", + ignoreCase: false, + want: "\".^\"", + }, + }, }, }, }, }, - }, - &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: "\" \"", + &labeledExpr{ + pos: position{line: 2734, col: 5, offset: 90265}, + label: "weight", + expr: &zeroOrOneExpr{ + pos: position{line: 2734, col: 12, offset: 90272}, + expr: &choiceExpr{ + pos: position{line: 2734, col: 13, offset: 90273}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + run: (*parser).callonTableColumnsAttribute44, + expr: &seqExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + exprs: []interface{}{ + &zeroOrOneExpr{ + pos: position{line: 2874, col: 11, offset: 94970}, + expr: &litMatcher{ + pos: position{line: 2874, col: 11, offset: 94970}, + val: "-", + ignoreCase: false, + want: "\"-\"", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 2874, col: 16, offset: 94975}, + expr: &actionExpr{ + pos: position{line: 2870, col: 10, offset: 94910}, + run: (*parser).callonTableColumnsAttribute49, + expr: &charClassMatcher{ + pos: position{line: 2870, col: 10, offset: 94910}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2734, col: 23, offset: 90283}, + run: (*parser).callonTableColumnsAttribute51, + expr: &litMatcher{ + pos: position{line: 2734, col: 23, offset: 90283}, + 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", + }, + }, + &labeledExpr{ + pos: position{line: 2735, col: 5, offset: 90325}, + label: "style", + expr: &zeroOrOneExpr{ + pos: position{line: 2735, col: 11, offset: 90331}, + expr: &actionExpr{ + pos: position{line: 2735, col: 12, offset: 90332}, + run: (*parser).callonTableColumnsAttribute55, + expr: &charClassMatcher{ + pos: position{line: 2735, col: 12, offset: 90332}, + val: "[adehlms]", + chars: []rune{'a', 'd', 'e', 'h', 'l', 'm', 's'}, ignoreCase: false, - want: "\"\\t\"", + inverted: false, }, }, }, }, - }, - &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: " ", + &labeledExpr{ + pos: position{line: 2737, col: 5, offset: 90462}, + label: "comma", + expr: &zeroOrOneExpr{ + pos: position{line: 2737, col: 11, offset: 90468}, + expr: &litMatcher{ + pos: position{line: 2737, col: 12, offset: 90469}, + 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\"", - }, + want: "\",\"", }, }, }, + &andCodeExpr{ + pos: position{line: 2738, col: 5, offset: 90479}, + run: (*parser).callonTableColumnsAttribute60, + }, }, }, }, }, }, + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, + }, + }, }, }, }, }, { - name: "IndexTerm", - pos: position{line: 2137, col: 1, offset: 75620}, + name: "UserMacroBlock", + pos: position{line: 2762, col: 1, offset: 91409}, expr: &actionExpr{ - pos: position{line: 2137, col: 14, offset: 75633}, - run: (*parser).callonIndexTerm1, + pos: position{line: 2763, col: 5, offset: 91432}, + run: (*parser).callonUserMacroBlock1, expr: &seqExpr{ - pos: position{line: 2137, col: 14, offset: 75633}, + pos: position{line: 2763, col: 5, offset: 91432}, exprs: []interface{}{ - &litMatcher{ - pos: position{line: 2137, col: 14, offset: 75633}, - val: "((", - ignoreCase: false, - 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: 2763, col: 5, offset: 91432}, + label: "name", + expr: &actionExpr{ + pos: position{line: 2786, col: 18, offset: 92183}, + run: (*parser).callonUserMacroBlock4, + expr: &oneOrMoreExpr{ + pos: position{line: 2786, col: 19, offset: 92184}, + expr: &charClassMatcher{ + pos: position{line: 2786, col: 19, offset: 92184}, + val: "[_-0-9\\pL]", + chars: []rune{'_', '-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, }, }, + &andCodeExpr{ + pos: position{line: 2764, col: 5, offset: 91458}, + run: (*parser).callonUserMacroBlock7, + }, &litMatcher{ - pos: position{line: 2137, col: 43, offset: 75662}, - val: "))", + pos: position{line: 2768, col: 5, offset: 91598}, + val: "::", ignoreCase: false, - want: "\"))\"", + want: "\"::\"", }, - }, - }, - }, - }, - { - name: "IndexTermContent", - pos: position{line: 2141, col: 1, offset: 75727}, - expr: &actionExpr{ - pos: position{line: 2141, col: 21, offset: 75747}, - run: (*parser).callonIndexTermContent1, - expr: &labeledExpr{ - pos: position{line: 2141, col: 21, offset: 75747}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 2141, col: 30, offset: 75756}, - expr: &choiceExpr{ - pos: position{line: 2141, col: 31, offset: 75757}, - 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, - }, - }, - }, - }, - }, - }, + &labeledExpr{ + pos: position{line: 2769, col: 5, offset: 91608}, + label: "value", + expr: &actionExpr{ + pos: position{line: 2790, col: 19, offset: 92259}, + run: (*parser).callonUserMacroBlock10, + expr: &zeroOrMoreExpr{ + pos: position{line: 2790, col: 19, offset: 92259}, + expr: &charClassMatcher{ + pos: position{line: 2790, col: 19, offset: 92259}, + val: "[^:[ \\r\\n]", + chars: []rune{':', '[', ' ', '\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, - &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}, - 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: 2770, col: 5, offset: 91636}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 2770, col: 23, offset: 91654}, + name: "InlineAttributes", + }, + }, + &choiceExpr{ + pos: position{line: 2893, col: 8, offset: 95335}, + alternatives: []interface{}{ + ¬Expr{ + pos: position{line: 2890, col: 8, offset: 95285}, + expr: &anyMatcher{ + line: 2890, col: 9, offset: 95286, }, }, - &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: 2886, col: 12, offset: 95178}, + val: "\n", + ignoreCase: false, + want: "\"\\n\"", }, &litMatcher{ - pos: position{line: 2271, col: 10, offset: 79961}, - val: " ", + pos: position{line: 2886, col: 19, offset: 95185}, + val: "\r\n", ignoreCase: false, - want: "\" \"", + want: "\"\\r\\n\"", }, &actionExpr{ - pos: position{line: 2271, col: 16, offset: 79967}, - run: (*parser).callonIndexTermContent26, + pos: position{line: 2886, col: 28, offset: 95194}, + run: (*parser).callonUserMacroBlock20, expr: &litMatcher{ - pos: position{line: 2271, col: 16, offset: 79967}, - val: "\t", + pos: position{line: 2886, col: 28, offset: 95194}, + val: "\r", ignoreCase: false, - want: "\"\\t\"", + want: "\"\\r\"", }, }, - &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\"", - }, - }, - }, + }, + }, + }, + }, + }, + }, + { + name: "InlineUserMacro", + pos: position{line: 2774, col: 1, offset: 91789}, + expr: &actionExpr{ + pos: position{line: 2775, col: 5, offset: 91813}, + run: (*parser).callonInlineUserMacro1, + expr: &seqExpr{ + pos: position{line: 2775, col: 5, offset: 91813}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 2775, col: 5, offset: 91813}, + label: "name", + expr: &actionExpr{ + pos: position{line: 2786, col: 18, offset: 92183}, + run: (*parser).callonInlineUserMacro4, + expr: &oneOrMoreExpr{ + pos: position{line: 2786, col: 19, offset: 92184}, + expr: &charClassMatcher{ + pos: position{line: 2786, col: 19, offset: 92184}, + val: "[_-0-9\\pL]", + chars: []rune{'_', '-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + &andCodeExpr{ + pos: position{line: 2776, col: 5, offset: 91839}, + run: (*parser).callonInlineUserMacro7, + }, + &litMatcher{ + pos: position{line: 2780, col: 5, offset: 91979}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 2781, col: 5, offset: 91988}, + label: "value", + expr: &actionExpr{ + pos: position{line: 2790, col: 19, offset: 92259}, + run: (*parser).callonInlineUserMacro10, + expr: &zeroOrMoreExpr{ + pos: position{line: 2790, col: 19, offset: 92259}, + expr: &charClassMatcher{ + pos: position{line: 2790, col: 19, offset: 92259}, + val: "[^:[ \\r\\n]", + chars: []rune{':', '[', ' ', '\r', '\n'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 2782, col: 5, offset: 92016}, + label: "inlineAttributes", + expr: &ruleRefExpr{ + pos: position{line: 2782, col: 23, offset: 92034}, + name: "InlineAttributes", + }, + }, + }, + }, + }, + }, + { + name: "FileLocation", + pos: position{line: 2839, col: 1, offset: 93895}, + expr: &actionExpr{ + pos: position{line: 2839, col: 17, offset: 93911}, + run: (*parser).callonFileLocation1, + expr: &labeledExpr{ + pos: position{line: 2839, col: 17, offset: 93911}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 2839, col: 22, offset: 93916}, + expr: &choiceExpr{ + pos: position{line: 2839, col: 23, offset: 93917}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2851, col: 13, offset: 94316}, + run: (*parser).callonFileLocation5, + expr: &labeledExpr{ + pos: position{line: 2851, col: 13, offset: 94316}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 2851, col: 22, offset: 94325}, + expr: &choiceExpr{ + pos: position{line: 2852, col: 5, offset: 94331}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2852, col: 5, offset: 94331}, + run: (*parser).callonFileLocation9, + expr: &oneOrMoreExpr{ + pos: position{line: 2852, col: 5, offset: 94331}, + expr: &charClassMatcher{ + pos: position{line: 2852, col: 6, offset: 94332}, + val: "[^\\r\\n[]�&<>{ ]", + chars: []rune{'\r', '\n', '[', ']', '�', '&', '<', '>', '{', ' '}, + ignoreCase: false, + inverted: true, }, }, - &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, - }, - &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: 449, col: 5, offset: 14443}, + run: (*parser).callonFileLocation12, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonFileLocation14, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonFileLocation17, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", ignoreCase: false, - inverted: true, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonFileLocation21, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonFileLocation28, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonFileLocation33, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonFileLocation35, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + 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, - 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{'-'}, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonFileLocation39, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonFileLocation43, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, inverted: false, }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + 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: "\"}\"", + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonFileLocation50, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonFileLocation55, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonFileLocation57, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + 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: 456, col: 31, offset: 14633}, + run: (*parser).callonFileLocation61, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonFileLocation65, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + 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).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, + &actionExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonFileLocation71, + expr: &seqExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 2587, col: 5, offset: 86026}, + run: (*parser).callonFileLocation73, + }, + &labeledExpr{ + pos: position{line: 2590, col: 5, offset: 86097}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 2592, col: 9, offset: 86195}, + run: (*parser).callonFileLocation76, + expr: &choiceExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + run: (*parser).callonFileLocation78, + expr: &seqExpr{ + pos: position{line: 491, col: 27, offset: 15997}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 491, col: 27, offset: 15997}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 32, offset: 16002}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonFileLocation82, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 491, col: 40, offset: 16010}, + expr: &choiceExpr{ + pos: position{line: 2878, col: 10, offset: 95044}, + alternatives: []interface{}{ + &litMatcher{ + pos: position{line: 2878, col: 10, offset: 95044}, + val: " ", + ignoreCase: false, + want: "\" \"", + }, + &actionExpr{ + pos: position{line: 2878, col: 16, offset: 95050}, + run: (*parser).callonFileLocation88, + expr: &litMatcher{ + pos: position{line: 2878, col: 16, offset: 95050}, + val: "\t", + ignoreCase: false, + want: "\"\\t\"", + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 47, offset: 16017}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + &labeledExpr{ + pos: position{line: 491, col: 51, offset: 16021}, + label: "label", + expr: &oneOrMoreExpr{ + pos: position{line: 501, col: 24, offset: 16434}, + expr: &choiceExpr{ + pos: position{line: 502, col: 5, offset: 16440}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + run: (*parser).callonFileLocation94, + expr: &seqExpr{ + pos: position{line: 502, col: 6, offset: 16441}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 502, col: 6, offset: 16441}, + val: "[0-9\\pL]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 502, col: 14, offset: 16449}, + expr: &charClassMatcher{ + pos: position{line: 502, col: 14, offset: 16449}, + val: "[^\\r\\n{<>]", + chars: []rune{'\r', '\n', '{', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonFileLocation99, + expr: &seqExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + exprs: []interface{}{ + &andCodeExpr{ + pos: position{line: 449, col: 5, offset: 14443}, + run: (*parser).callonFileLocation101, + }, + &labeledExpr{ + pos: position{line: 452, col: 5, offset: 14507}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 452, col: 14, offset: 14516}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + run: (*parser).callonFileLocation104, + expr: &seqExpr{ + pos: position{line: 463, col: 25, offset: 14978}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 463, col: 25, offset: 14978}, + val: "{counter:", + ignoreCase: false, + want: "\"{counter:\"", + }, + &labeledExpr{ + pos: position{line: 463, col: 37, offset: 14990}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonFileLocation108, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 463, col: 56, offset: 15009}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 463, col: 62, offset: 15015}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonFileLocation115, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonFileLocation120, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonFileLocation122, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 463, col: 78, offset: 15031}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + run: (*parser).callonFileLocation126, + expr: &seqExpr{ + pos: position{line: 467, col: 25, offset: 15133}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 467, col: 25, offset: 15133}, + val: "{counter2:", + ignoreCase: false, + want: "\"{counter2:\"", + }, + &labeledExpr{ + pos: position{line: 467, col: 38, offset: 15146}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonFileLocation130, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &labeledExpr{ + pos: position{line: 467, col: 57, offset: 15165}, + label: "start", + expr: &zeroOrOneExpr{ + pos: position{line: 467, col: 63, offset: 15171}, + expr: &actionExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + run: (*parser).callonFileLocation137, + expr: &seqExpr{ + pos: position{line: 471, col: 17, offset: 15278}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 471, col: 17, offset: 15278}, + val: ":", + ignoreCase: false, + want: "\":\"", + }, + &labeledExpr{ + pos: position{line: 471, col: 21, offset: 15282}, + label: "start", + expr: &choiceExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 471, col: 28, offset: 15289}, + run: (*parser).callonFileLocation142, + expr: &charClassMatcher{ + pos: position{line: 471, col: 28, offset: 15289}, + val: "[A-Za-z]", + ranges: []rune{'A', 'Z', 'a', 'z'}, + ignoreCase: false, + inverted: false, + }, + }, + &actionExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + run: (*parser).callonFileLocation144, + expr: &oneOrMoreExpr{ + pos: position{line: 473, col: 9, offset: 15343}, + expr: &charClassMatcher{ + pos: position{line: 473, col: 9, offset: 15343}, + val: "[0-9]", + ranges: []rune{'0', '9'}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 467, col: 79, offset: 15187}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + run: (*parser).callonFileLocation148, + expr: &seqExpr{ + pos: position{line: 456, col: 31, offset: 14633}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 456, col: 31, offset: 14633}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + &labeledExpr{ + pos: position{line: 456, col: 35, offset: 14637}, + label: "name", + expr: &actionExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + run: (*parser).callonFileLocation152, + expr: &seqExpr{ + pos: position{line: 118, col: 18, offset: 3399}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 118, col: 18, offset: 3399}, + val: "[_0-9\\pL]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 118, col: 28, offset: 3409}, + expr: &charClassMatcher{ + pos: position{line: 118, col: 29, offset: 3410}, + val: "[-0-9\\pL]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 456, col: 54, offset: 14656}, + val: "}", + ignoreCase: false, + want: "\"}\"", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 506, col: 8, offset: 16673}, + run: (*parser).callonFileLocation158, + expr: &litMatcher{ + pos: position{line: 506, col: 8, offset: 16673}, + val: "{", + ignoreCase: false, + want: "\"{\"", + }, + }, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 491, col: 79, offset: 16049}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + run: (*parser).callonFileLocation161, + expr: &seqExpr{ + pos: position{line: 493, col: 9, offset: 16122}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 493, col: 9, offset: 16122}, + val: "<<", + ignoreCase: false, + want: "\"<<\"", + }, + &labeledExpr{ + pos: position{line: 493, col: 14, offset: 16127}, + label: "id", + expr: &actionExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + run: (*parser).callonFileLocation165, + expr: &oneOrMoreExpr{ + pos: position{line: 2866, col: 7, offset: 94768}, + expr: &charClassMatcher{ + pos: position{line: 2866, col: 7, offset: 94768}, + val: "[^[]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 493, col: 22, offset: 16135}, + val: ">>", + ignoreCase: false, + want: "\">>\"", + }, + }, + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 2595, col: 11, offset: 86299}, + run: (*parser).callonFileLocation169, + expr: &charClassMatcher{ + pos: position{line: 2595, col: 12, offset: 86300}, + val: "[<>&]", + chars: []rune{'<', '>', '&'}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, }, - &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: 2858, col: 7, offset: 94556}, + run: (*parser).callonFileLocation171, + expr: &litMatcher{ + pos: position{line: 2858, col: 7, offset: 94556}, + 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: 947, col: 23, offset: 29896}, + run: (*parser).callonFileLocation173, expr: &seqExpr{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 947, col: 23, offset: 29896}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1940, col: 23, offset: 69003}, + pos: position{line: 945, col: 32, offset: 29864}, val: "�", ignoreCase: false, want: "\"�\"", }, &labeledExpr{ - pos: position{line: 1940, col: 32, offset: 69012}, + pos: position{line: 947, col: 51, offset: 29924}, label: "ref", expr: &actionExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, - run: (*parser).callonFileLocation12, + pos: position{line: 947, col: 56, offset: 29929}, + run: (*parser).callonFileLocation177, expr: &oneOrMoreExpr{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 947, col: 56, offset: 29929}, expr: &charClassMatcher{ - pos: position{line: 1940, col: 37, offset: 69017}, + pos: position{line: 947, col: 56, offset: 29929}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -48834,7 +64845,7 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 1940, col: 76, offset: 69056}, + pos: position{line: 945, col: 32, offset: 29864}, val: "�", ignoreCase: false, want: "\"�\"", @@ -48851,16178 +64862,32963 @@ var g = &grammar{ }, } -func (c *current) onRawSource9() (interface{}, error) { +func (c *current) onDocumentFragment10() (bool, error) { + return c.isFrontMatterAllowed(), nil + +} + +func (p *parser) callonDocumentFragment10() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment10() +} + +func (c *current) onDocumentFragment18() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment18() +} + +func (c *current) onDocumentFragment25() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment25() +} + +func (c *current) onDocumentFragment39() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment39() +} + +func (c *current) onDocumentFragment46() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment46() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment46() +} + +func (c *current) onDocumentFragment29() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment29() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment29() +} + +func (c *current) onDocumentFragment53() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment53() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment53() +} + +func (c *current) onDocumentFragment60() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment60() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment60() +} + +func (c *current) onDocumentFragment12(content interface{}) (interface{}, error) { + return types.NewYamlFrontMatter(content.(string)) +} + +func (p *parser) callonDocumentFragment12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment12(stack["content"]) +} + +func (c *current) onDocumentFragment8(frontmatter interface{}) (interface{}, error) { + c.setFrontMatterAllowed(false) // not allowed anymore + return frontmatter, nil + +} + +func (p *parser) callonDocumentFragment8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment8(stack["frontmatter"]) +} + +func (c *current) onDocumentFragment64() (bool, error) { + return c.isDocumentHeaderAllowed(), nil + +} + +func (p *parser) callonDocumentFragment64() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment64() +} + +func (c *current) onDocumentFragment74() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment74() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment74() +} + +func (c *current) onDocumentFragment81() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment81() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment81() +} + +func (c *current) onDocumentFragment66() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment66() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment66() +} + +func (c *current) onDocumentFragment87() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment87() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment87() +} + +func (c *current) onDocumentFragment91() (interface{}, error) { + + return []interface{}{ + types.RawLine(c.text), + }, nil +} + +func (p *parser) callonDocumentFragment91() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment91() +} + +func (c *current) onDocumentFragment99() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment99() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment99() +} + +func (c *current) onDocumentFragment84(title interface{}) (interface{}, error) { + return title, nil + +} + +func (p *parser) callonDocumentFragment84() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment84(stack["title"]) +} + +func (c *current) onDocumentFragment114() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment114() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment114() +} + +func (c *current) onDocumentFragment121() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment121() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment121() +} + +func (c *current) onDocumentFragment106() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment106() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment106() +} + +func (c *current) onDocumentFragment131() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment131() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment131() +} + +func (c *current) onDocumentFragment139() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment139() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment139() +} + +func (c *current) onDocumentFragment125(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + +} + +func (p *parser) callonDocumentFragment125() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment125(stack["content"]) +} + +func (c *current) onDocumentFragment143() (bool, error) { + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Comment), nil + +} + +func (p *parser) callonDocumentFragment143() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment143() +} + +func (c *current) onDocumentFragment148() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment148() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment148() +} + +func (c *current) onDocumentFragment155() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment155() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment155() +} + +func (c *current) onDocumentFragment157() (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) callonDocumentFragment157() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment157() +} + +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) onDocumentFragment176() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment176() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment176() +} + +func (c *current) onDocumentFragment187() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment187() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment187() +} + +func (c *current) onDocumentFragment195() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment195() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment195() +} + +func (c *current) onDocumentFragment181(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment181() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment181(stack["content"]) +} + +func (c *current) onDocumentFragment160(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonDocumentFragment160() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment160(stack["line"]) +} + +func (c *current) onDocumentFragment204() (interface{}, error) { + 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) onDocumentFragment211() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment211() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment211() +} + +func (c *current) onDocumentFragment141(content interface{}) (interface{}, error) { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Comment, content.([]interface{})) + +} + +func (p *parser) callonDocumentFragment141() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment141(stack["content"]) +} + +func (c *current) onDocumentFragment221() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment221() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment221() +} + +func (c *current) onDocumentFragment238() (interface{}, error) { + // no space allowed + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment238() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment238() +} + +func (c *current) onDocumentFragment244() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment244() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment244() +} + +func (c *current) onDocumentFragment248() (interface{}, error) { + // no space allowed + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment248() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment248() +} + +func (c *current) onDocumentFragment254() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment254() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment254() +} + +func (c *current) onDocumentFragment258() (interface{}, error) { + // spaces allowed + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment258() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment258() +} + +func (c *current) onDocumentFragment264() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment264() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment264() +} + +func (c *current) onDocumentFragment235(part1, part2, part3 interface{}) (interface{}, error) { + return types.NewDocumentAuthorFullName(part1.(string), part2, part3) + +} + +func (p *parser) callonDocumentFragment235() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment235(stack["part1"], stack["part2"], stack["part3"]) +} + +func (c *current) onDocumentFragment275() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment275() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment275() +} + +func (c *current) onDocumentFragment268(email interface{}) (interface{}, error) { + return email, nil + +} + +func (p *parser) callonDocumentFragment268() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment268(stack["email"]) +} + +func (c *current) onDocumentFragment282() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment282() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment282() +} + +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) onDocumentFragment291(fullName, email interface{}) (bool, error) { + // at least 1 of [fullName, email] must be defined + return fullName != nil || email != nil, nil + +} + +func (p *parser) callonDocumentFragment291() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment291(stack["fullName"], stack["email"]) +} + +func (c *current) onDocumentFragment231(fullName, email interface{}) (interface{}, error) { + return types.NewDocumentAuthor(fullName, email) + +} + +func (p *parser) callonDocumentFragment231() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment231(stack["fullName"], stack["email"]) +} + +func (c *current) onDocumentFragment225(authors interface{}) (interface{}, error) { + return types.NewDocumentAuthors(authors.([]interface{})...) +} + +func (p *parser) callonDocumentFragment225() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment225(stack["authors"]) +} + +func (c *current) onDocumentFragment298() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment298() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment298() +} + +func (c *current) onDocumentFragment308() (interface{}, error) { + // no space allowed + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment308() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment308() +} + +func (c *current) onDocumentFragment314() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment314() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment314() +} + +func (c *current) onDocumentFragment318() (interface{}, error) { + // no space allowed + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment318() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment318() +} + +func (c *current) onDocumentFragment324() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment324() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment324() +} + +func (c *current) onDocumentFragment328() (interface{}, error) { + // spaces allowed + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment328() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment328() +} + +func (c *current) onDocumentFragment334() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment334() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment334() +} + +func (c *current) onDocumentFragment305(part1, part2, part3 interface{}) (interface{}, error) { + return types.NewDocumentAuthorFullName(part1.(string), part2, part3) + +} + +func (p *parser) callonDocumentFragment305() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment305(stack["part1"], stack["part2"], stack["part3"]) +} + +func (c *current) onDocumentFragment345() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment345() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment345() +} + +func (c *current) onDocumentFragment338(email interface{}) (interface{}, error) { + return email, nil + +} + +func (p *parser) callonDocumentFragment338() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment338(stack["email"]) +} + +func (c *current) onDocumentFragment352() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment352() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment352() +} + +func (c *current) onDocumentFragment359() (interface{}, error) { + 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) onDocumentFragment361(fullName, email interface{}) (bool, error) { + // at least 1 of [fullName, email] must be defined + return fullName != nil || email != nil, nil + +} + +func (p *parser) callonDocumentFragment361() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment361(stack["fullName"], stack["email"]) +} + +func (c *current) onDocumentFragment301(fullName, email interface{}) (interface{}, error) { + return types.NewDocumentAuthor(fullName, email) + +} + +func (p *parser) callonDocumentFragment301() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment301(stack["fullName"], stack["email"]) +} + +func (c *current) onDocumentFragment292(author interface{}) (interface{}, error) { + return types.NewDocumentAuthors(author) +} + +func (p *parser) callonDocumentFragment292() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment292(stack["author"]) +} + +func (c *current) onDocumentFragment367() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment367() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment367() +} + +func (c *current) onDocumentFragment216(authors interface{}) (interface{}, error) { + return authors, nil +} + +func (p *parser) callonDocumentFragment216() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment216(stack["authors"]) +} + +func (c *current) onDocumentFragment377() (interface{}, error) { + 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) onDocumentFragment385() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment385() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment385() +} + +func (c *current) onDocumentFragment371(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + +} + +func (p *parser) callonDocumentFragment371() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment371(stack["content"]) +} + +func (c *current) onDocumentFragment389() (bool, error) { + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Comment), nil + +} + +func (p *parser) callonDocumentFragment389() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment389() +} + +func (c *current) onDocumentFragment394() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment394() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment394() +} + +func (c *current) onDocumentFragment401() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment401() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment401() +} + +func (c *current) onDocumentFragment403() (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) callonDocumentFragment403() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment403() +} + +func (c *current) onDocumentFragment415() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment415() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment415() +} + +func (c *current) onDocumentFragment422() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment422() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment422() +} + +func (c *current) onDocumentFragment433() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment433() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment433() +} + +func (c *current) onDocumentFragment441() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment441() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment441() +} + +func (c *current) onDocumentFragment427(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment427() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment427(stack["content"]) +} + +func (c *current) onDocumentFragment406(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonDocumentFragment406() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment406(stack["line"]) +} + +func (c *current) onDocumentFragment450() (interface{}, error) { + 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) onDocumentFragment457() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment457() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment457() +} + +func (c *current) onDocumentFragment387(content interface{}) (interface{}, error) { + c.unsetWithinDelimitedBlock() + return types.NewDelimitedBlock(types.Comment, content.([]interface{})) + +} + +func (p *parser) callonDocumentFragment387() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment387(stack["content"]) +} + +func (c *current) onDocumentFragment468() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment468() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment468() +} + +func (c *current) onDocumentFragment481() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment481() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment481() +} + +func (c *current) onDocumentFragment478() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment478() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment478() +} + +func (c *current) onDocumentFragment489() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment489() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment489() +} + +func (c *current) onDocumentFragment496() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment496() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment496() +} + +func (c *current) onDocumentFragment485() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment485() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment485() +} + +func (c *current) onDocumentFragment504() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment504() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment504() +} + +func (c *current) onDocumentFragment511() (interface{}, error) { + 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) onDocumentFragment474(revnumber, revdate, revremark interface{}) (interface{}, error) { + return types.NewDocumentRevision(revnumber, revdate, revremark) + +} + +func (p *parser) callonDocumentFragment474() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment474(stack["revnumber"], stack["revdate"], stack["revremark"]) +} + +func (c *current) onDocumentFragment517() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment517() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment517() +} + +func (c *current) onDocumentFragment524() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonDocumentFragment524() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment524() +} + +func (c *current) onDocumentFragment514(revdate, revremark interface{}) (interface{}, error) { + return types.NewDocumentRevision(nil, revdate, revremark) + +} + +func (p *parser) callonDocumentFragment514() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment514(stack["revdate"], stack["revremark"]) +} + +func (c *current) onDocumentFragment532() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment532() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment532() +} + +func (c *current) onDocumentFragment463(revision interface{}) (interface{}, error) { + return revision, nil +} + +func (p *parser) callonDocumentFragment463() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment463(stack["revision"]) +} + +func (c *current) onDocumentFragment103(authors, revision interface{}) (interface{}, error) { + return types.NewDocumentInformation(authors.(types.DocumentAuthors), revision) + +} + +func (p *parser) callonDocumentFragment103() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment103(stack["authors"], stack["revision"]) +} + +func (c *current) onDocumentFragment541() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment541() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment541() +} + +func (c *current) onDocumentFragment551() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment551() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment551() +} + +func (c *current) onDocumentFragment564() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment564() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment564() +} + +func (c *current) onDocumentFragment568() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonDocumentFragment568() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment568() +} + +func (c *current) onDocumentFragment573() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonDocumentFragment573() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment573() +} + +func (c *current) onDocumentFragment580() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment580() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment580() +} + +func (c *current) onDocumentFragment592() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment592() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment592() +} + +func (c *current) onDocumentFragment594() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonDocumentFragment594() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment594() +} + +func (c *current) onDocumentFragment587(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonDocumentFragment587() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment587(stack["start"]) +} + +func (c *current) onDocumentFragment576(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonDocumentFragment576() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment576(stack["name"], stack["start"]) +} + +func (c *current) onDocumentFragment602() (interface{}, error) { + 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) onDocumentFragment614() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment614() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment614() +} + +func (c *current) onDocumentFragment616() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonDocumentFragment616() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment616() +} + +func (c *current) onDocumentFragment609(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonDocumentFragment609() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment609(stack["start"]) +} + +func (c *current) onDocumentFragment598(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonDocumentFragment598() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment598(stack["name"], stack["start"]) +} + +func (c *current) onDocumentFragment624() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment624() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment624() +} + +func (c *current) onDocumentFragment620(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonDocumentFragment620() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment620(stack["name"]) +} + +func (c *current) onDocumentFragment571(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonDocumentFragment571() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment571(stack["element"]) +} + +func (c *current) onDocumentFragment630() (interface{}, error) { + // standalone '{' + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonDocumentFragment630() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment630() +} + +func (c *current) onDocumentFragment556(element interface{}) (interface{}, error) { + + return element, nil + +} + +func (p *parser) callonDocumentFragment556() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment556(stack["element"]) +} + +func (c *current) onDocumentFragment549(elements interface{}) (interface{}, error) { + return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil + +} + +func (p *parser) callonDocumentFragment549() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment549(stack["elements"]) +} + +func (c *current) onDocumentFragment637() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment637() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment637() +} + +func (c *current) onDocumentFragment537(name, value interface{}) (interface{}, error) { + d := types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) + return d, nil + +} + +func (p *parser) callonDocumentFragment537() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment537(stack["name"], stack["value"]) +} + +func (c *current) onDocumentFragment643() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment643() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment643() +} + +func (c *current) onDocumentFragment652() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment652() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment652() +} + +func (c *current) onDocumentFragment659() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment659() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment659() +} + +func (c *current) onDocumentFragment639(name interface{}) (interface{}, error) { + return types.NewAttributeReset(name.(string)) +} + +func (p *parser) callonDocumentFragment639() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment639(stack["name"]) +} + +func (c *current) onDocumentFragment665() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment665() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment665() +} + +func (c *current) onDocumentFragment674() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment674() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment674() +} + +func (c *current) onDocumentFragment681() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment681() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment681() +} + +func (c *current) onDocumentFragment661(name interface{}) (interface{}, error) { + return types.NewAttributeReset(name.(string)) +} + +func (p *parser) callonDocumentFragment661() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment661(stack["name"]) +} + +func (c *current) onDocumentFragment62(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) callonDocumentFragment62() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment62(stack["title"], stack["info"], stack["extraAttrs"]) +} + +func (c *current) onDocumentFragment691() (interface{}, error) { + 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) onDocumentFragment698() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment698() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment698() +} + +func (c *current) onDocumentFragment683() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment683() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment683() +} + +func (c *current) onDocumentFragment704() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment704() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment704() +} + +func (c *current) onDocumentFragment714() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment714() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment714() +} + +func (c *current) onDocumentFragment727() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment727() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment727() +} + +func (c *current) onDocumentFragment731() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonDocumentFragment731() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment731() +} + +func (c *current) onDocumentFragment736() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonDocumentFragment736() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment736() +} + +func (c *current) onDocumentFragment743() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment743() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment743() +} + +func (c *current) onDocumentFragment755() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment755() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment755() +} + +func (c *current) onDocumentFragment757() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonDocumentFragment757() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment757() +} + +func (c *current) onDocumentFragment750(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonDocumentFragment750() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment750(stack["start"]) +} + +func (c *current) onDocumentFragment739(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonDocumentFragment739() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment739(stack["name"], stack["start"]) +} + +func (c *current) onDocumentFragment765() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment765() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment765() +} + +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) onDocumentFragment779() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonDocumentFragment779() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment779() +} + +func (c *current) onDocumentFragment772(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonDocumentFragment772() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment772(stack["start"]) +} + +func (c *current) onDocumentFragment761(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonDocumentFragment761() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment761(stack["name"], stack["start"]) +} + +func (c *current) onDocumentFragment787() (interface{}, error) { + 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) onDocumentFragment783(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonDocumentFragment783() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment783(stack["name"]) +} + +func (c *current) onDocumentFragment734(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonDocumentFragment734() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment734(stack["element"]) +} + +func (c *current) onDocumentFragment793() (interface{}, error) { + // standalone '{' + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonDocumentFragment793() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment793() +} + +func (c *current) onDocumentFragment719(element interface{}) (interface{}, error) { + + return element, nil + +} + +func (p *parser) callonDocumentFragment719() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment719(stack["element"]) +} + +func (c *current) onDocumentFragment712(elements interface{}) (interface{}, error) { + return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil + +} + +func (p *parser) callonDocumentFragment712() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment712(stack["elements"]) +} + +func (c *current) onDocumentFragment800() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment800() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment800() +} + +func (c *current) onDocumentFragment700(name, value interface{}) (interface{}, error) { + d := types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) + return d, nil + +} + +func (p *parser) callonDocumentFragment700() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment700(stack["name"], stack["value"]) +} + +func (c *current) onDocumentFragment806() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment806() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment806() +} + +func (c *current) onDocumentFragment815() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment815() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment815() +} + +func (c *current) onDocumentFragment822() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment822() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment822() +} + +func (c *current) onDocumentFragment802(name interface{}) (interface{}, error) { + return types.NewAttributeReset(name.(string)) +} + +func (p *parser) callonDocumentFragment802() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment802(stack["name"]) +} + +func (c *current) onDocumentFragment828() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment828() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment828() +} + +func (c *current) onDocumentFragment837() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment837() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment837() +} + +func (c *current) onDocumentFragment844() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment844() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment844() +} + +func (c *current) onDocumentFragment824(name interface{}) (interface{}, error) { + return types.NewAttributeReset(name.(string)) +} + +func (p *parser) callonDocumentFragment824() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment824(stack["name"]) +} + +func (c *current) onDocumentFragment849() (bool, error) { + + return !c.isWithinDelimitedBlock(), nil + +} + +func (p *parser) callonDocumentFragment849() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment849() +} + +func (c *current) onDocumentFragment851() (interface{}, error) { + + // `=` is level 0, `==` is level 1, etc. + return (len(c.text) - 1), nil + +} + +func (p *parser) callonDocumentFragment851() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment851() +} + +func (c *current) onDocumentFragment854(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) callonDocumentFragment854() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment854(stack["level"]) +} + +func (c *current) onDocumentFragment855(level interface{}) (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment855() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment855(stack["level"]) +} + +func (c *current) onDocumentFragment859() (interface{}, error) { + + return []interface{}{ + types.RawLine(c.text), + }, nil +} + +func (p *parser) callonDocumentFragment859() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment859() +} + +func (c *current) onDocumentFragment867() (interface{}, error) { + // TODO: just use "\n" + 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) onDocumentFragment847(level, title interface{}) (interface{}, error) { + return types.NewRawSection(level.(int), title.([]interface{})) + +} + +func (p *parser) callonDocumentFragment847() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment847(stack["level"], stack["title"]) +} + +func (c *current) onDocumentFragment869() (interface{}, error) { + // TODO: Space* before EOF + return types.NewThematicBreak() + +} + +func (p *parser) callonDocumentFragment869() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment869() +} + +func (c *current) onDocumentFragment889() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment889() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment889() +} + +func (c *current) onDocumentFragment896() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment896() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment896() +} + +func (c *current) onDocumentFragment910() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment910() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment910() +} + +func (c *current) onDocumentFragment916() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment916() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment916() +} + +func (c *current) onDocumentFragment914(content interface{}) (interface{}, error) { + return types.NewRawContent(content.(string)) + +} + +func (p *parser) callonDocumentFragment914() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment914(stack["content"]) +} + +func (c *current) onDocumentFragment904(content interface{}) (interface{}, error) { + return types.NewTableCell(content.(types.RawContent)) + +} + +func (p *parser) callonDocumentFragment904() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment904(stack["content"]) +} + +func (c *current) onDocumentFragment924() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment924() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment924() +} + +func (c *current) onDocumentFragment935() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment935() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment935() +} + +func (c *current) onDocumentFragment942() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment942() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment942() +} + +func (c *current) onDocumentFragment927() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment927() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment927() +} + +func (c *current) onDocumentFragment900(cells interface{}) (interface{}, error) { + return types.NewTableRow(cells.([]interface{})) + +} + +func (p *parser) callonDocumentFragment900() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment900(stack["cells"]) +} + +func (c *current) onDocumentFragment956() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment956() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment956() +} + +func (c *current) onDocumentFragment963() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment963() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment963() +} + +func (c *current) onDocumentFragment981() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment981() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment981() +} + +func (c *current) onDocumentFragment988() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment988() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment988() +} + +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) onDocumentFragment1008() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1008() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1008() +} + +func (c *current) onDocumentFragment993() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment993() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment993() +} + +func (c *current) onDocumentFragment1014() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1014() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1014() +} + +func (c *current) onDocumentFragment1020() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1020() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1020() +} + +func (c *current) onDocumentFragment1018(content interface{}) (interface{}, error) { + return types.NewRawContent(content.(string)) + +} + +func (p *parser) callonDocumentFragment1018() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1018(stack["content"]) +} + +func (c *current) onDocumentFragment972(content interface{}) (interface{}, error) { + return types.NewTableCell(content.(types.RawContent)) + +} + +func (p *parser) callonDocumentFragment972() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment972(stack["content"]) +} + +func (c *current) onDocumentFragment1028() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1028() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1028() +} + +func (c *current) onDocumentFragment969(cell interface{}) (interface{}, error) { + return cell, nil + +} + +func (p *parser) callonDocumentFragment969() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment969(stack["cell"]) +} + +func (c *current) onDocumentFragment1040() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1040() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1040() +} + +func (c *current) onDocumentFragment1047() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1047() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1047() +} + +func (c *current) onDocumentFragment1032() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment1032() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1032() +} + +func (c *current) onDocumentFragment1056() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1056() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1056() +} + +func (c *current) onDocumentFragment1063() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1063() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1063() +} + +func (c *current) onDocumentFragment947(cells interface{}) (interface{}, error) { + return types.NewTableRow(cells.([]interface{})) + +} + +func (p *parser) callonDocumentFragment947() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment947(stack["cells"]) +} + +func (c *current) onDocumentFragment1076() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1076() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1076() +} + +func (c *current) onDocumentFragment1083() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1083() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1083() +} + +func (c *current) onDocumentFragment1098() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1098() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1098() +} + +func (c *current) onDocumentFragment1105() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1105() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1105() +} + +func (c *current) onDocumentFragment1118() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1118() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1118() +} + +func (c *current) onDocumentFragment1125() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1125() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1125() +} + +func (c *current) onDocumentFragment1110() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment1110() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1110() +} + +func (c *current) onDocumentFragment1131() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1131() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1131() +} + +func (c *current) onDocumentFragment1137() (interface{}, error) { + 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) onDocumentFragment1135(content interface{}) (interface{}, error) { + return types.NewRawContent(content.(string)) + +} + +func (p *parser) callonDocumentFragment1135() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1135(stack["content"]) +} + +func (c *current) onDocumentFragment1089(content interface{}) (interface{}, error) { + return types.NewTableCell(content.(types.RawContent)) + +} + +func (p *parser) callonDocumentFragment1089() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1089(stack["content"]) +} + +func (c *current) onDocumentFragment1145() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1145() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1145() +} + +func (c *current) onDocumentFragment1156() (interface{}, error) { + 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) onDocumentFragment1163() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1163() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1163() +} + +func (c *current) onDocumentFragment1148() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDocumentFragment1148() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1148() +} + +func (c *current) onDocumentFragment1067(cells interface{}) (interface{}, error) { + return types.NewTableRow(cells.([]interface{})) + +} + +func (p *parser) callonDocumentFragment1067() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1067(stack["cells"]) +} + +func (c *current) onDocumentFragment1171() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1171() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1171() +} + +func (c *current) onDocumentFragment1178() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1178() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1178() +} + +func (c *current) onDocumentFragment883(header, rows interface{}) (interface{}, error) { + return types.NewTable(header, rows.([]interface{})) + +} + +func (p *parser) callonDocumentFragment883() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment883(stack["header"], stack["rows"]) +} + +func (c *current) onDocumentFragment1188() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1188() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1188() +} + +func (c *current) onDocumentFragment1196() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1196() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1196() +} + +func (c *current) onDocumentFragment1182(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + +} + +func (p *parser) callonDocumentFragment1182() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1182(stack["content"]) +} + +func (c *current) onDocumentFragment1202() (interface{}, error) { + return types.Tip, nil +} + +func (p *parser) callonDocumentFragment1202() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1202() +} + +func (c *current) onDocumentFragment1204() (interface{}, error) { + return types.Note, nil +} + +func (p *parser) callonDocumentFragment1204() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1204() +} + +func (c *current) onDocumentFragment1206() (interface{}, error) { + return types.Important, nil +} + +func (p *parser) callonDocumentFragment1206() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1206() +} + +func (c *current) onDocumentFragment1208() (interface{}, error) { + return types.Warning, nil +} + +func (p *parser) callonDocumentFragment1208() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1208() +} + +func (c *current) onDocumentFragment1210() (interface{}, error) { + return types.Caution, nil +} + +func (p *parser) callonDocumentFragment1210() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1210() +} + +func (c *current) onDocumentFragment1217() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1217() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1217() +} + +func (c *current) onDocumentFragment1220(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment1220() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1220(stack["content"]) +} + +func (c *current) onDocumentFragment1226() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1226() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1226() +} + +func (c *current) onDocumentFragment1214(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment1214() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1214(stack["content"]) +} + +func (c *current) onDocumentFragment1238() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1238() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1238() +} + +func (c *current) onDocumentFragment1243() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1243() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1243() +} + +func (c *current) onDocumentFragment1253() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1253() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1253() +} + +func (c *current) onDocumentFragment1261() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1261() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1261() +} + +func (c *current) onDocumentFragment1247(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + +} + +func (p *parser) callonDocumentFragment1247() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1247(stack["content"]) +} + +func (c *current) onDocumentFragment1266() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1266() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1266() +} + +func (c *current) onDocumentFragment1269(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment1269() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1269(stack["content"]) +} + +func (c *current) onDocumentFragment1275() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1275() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1275() +} + +func (c *current) onDocumentFragment1263(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment1263() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1263(stack["content"]) +} + +func (c *current) onDocumentFragment1230(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonDocumentFragment1230() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1230(stack["line"]) +} + +func (c *current) onDocumentFragment1198(kind, firstLine, otherLines interface{}) (interface{}, error) { + + return types.NewAdmonitionParagraph(kind.(string), append([]interface{}{firstLine}, otherLines.([]interface{})...)) + +} + +func (p *parser) callonDocumentFragment1198() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1198(stack["kind"], stack["firstLine"], stack["otherLines"]) +} + +func (c *current) onDocumentFragment1285() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1285() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1285() +} + +func (c *current) onDocumentFragment1283() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1283() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1283() +} + +func (c *current) onDocumentFragment1290(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment1290() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1290(stack["content"]) +} + +func (c *current) onDocumentFragment1296() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1296() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1296() +} + +func (c *current) onDocumentFragment1280(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment1280() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1280(stack["content"]) +} + +func (c *current) onDocumentFragment1307() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1307() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1307() +} + +func (c *current) onDocumentFragment1315() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1315() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1315() +} + +func (c *current) onDocumentFragment1301(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + +} + +func (p *parser) callonDocumentFragment1301() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1301(stack["content"]) +} + +func (c *current) onDocumentFragment1320() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1320() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1320() +} + +func (c *current) onDocumentFragment1323(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment1323() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1323(stack["content"]) +} + +func (c *current) onDocumentFragment1329() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1329() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1329() +} + +func (c *current) onDocumentFragment1317(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment1317() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1317(stack["content"]) +} + +func (c *current) onDocumentFragment1277(firstLine, otherLines interface{}) (interface{}, error) { + + return types.NewLiteralParagraph(types.LiteralBlockWithSpacesOnFirstLine, append([]interface{}{firstLine}, otherLines.([]interface{})...)) + +} + +func (p *parser) callonDocumentFragment1277() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1277(stack["firstLine"], stack["otherLines"]) +} + +func (c *current) onDocumentFragment1338() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1338() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1338() +} + +func (c *current) onDocumentFragment1341(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment1341() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1341(stack["content"]) +} + +func (c *current) onDocumentFragment1347() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1347() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1347() +} + +func (c *current) onDocumentFragment1335(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment1335() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1335(stack["content"]) +} + +func (c *current) onDocumentFragment1362() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1362() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1362() +} + +func (c *current) onDocumentFragment1367() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1367() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1367() +} + +func (c *current) onDocumentFragment1377() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1377() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1377() +} + +func (c *current) onDocumentFragment1385() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1385() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1385() +} + +func (c *current) onDocumentFragment1371(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + +} + +func (p *parser) callonDocumentFragment1371() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1371(stack["content"]) +} + +func (c *current) onDocumentFragment1390() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDocumentFragment1390() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1390() +} + +func (c *current) onDocumentFragment1393(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDocumentFragment1393() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1393(stack["content"]) +} + +func (c *current) onDocumentFragment1399() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragment1399() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1399() +} + +func (c *current) onDocumentFragment1387(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDocumentFragment1387() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1387(stack["content"]) +} + +func (c *current) onDocumentFragment1351(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonDocumentFragment1351() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1351(stack["line"]) +} + +func (c *current) onDocumentFragment1332(firstLine, otherLines interface{}) (interface{}, error) { + return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...)...) + +} + +func (p *parser) callonDocumentFragment1332() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragment1332(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) onDocumentFragmentWithinVerbatimBlock21() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDocumentFragmentWithinVerbatimBlock21() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDocumentFragmentWithinVerbatimBlock21() +} + +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) onBlockAttributes92() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes92() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes92() +} + +func (c *current) onBlockAttributes99() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonBlockAttributes99() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes99() +} + +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) onBlockAttributes115() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonBlockAttributes115() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes115() +} + +func (c *current) onBlockAttributes122() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonBlockAttributes122() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes122() +} + +func (c *current) onBlockAttributes118(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonBlockAttributes118() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes118(stack["ref"]) +} + +func (c *current) onBlockAttributes128() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonBlockAttributes128() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes128() +} + +func (c *current) onBlockAttributes135() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes135() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes135() +} + +func (c *current) onBlockAttributes147() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes147() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes147() +} + +func (c *current) onBlockAttributes149() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonBlockAttributes149() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes149() +} + +func (c *current) onBlockAttributes142(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonBlockAttributes142() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes142(stack["start"]) +} + +func (c *current) onBlockAttributes131(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonBlockAttributes131() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes131(stack["name"], stack["start"]) +} + +func (c *current) onBlockAttributes157() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes157() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes157() +} + +func (c *current) onBlockAttributes169() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes169() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes169() +} + +func (c *current) onBlockAttributes171() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonBlockAttributes171() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes171() +} + +func (c *current) onBlockAttributes164(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonBlockAttributes164() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes164(stack["start"]) +} + +func (c *current) onBlockAttributes153(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonBlockAttributes153() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes153(stack["name"], stack["start"]) +} + +func (c *current) onBlockAttributes179() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes179() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes179() +} + +func (c *current) onBlockAttributes175(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonBlockAttributes175() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes175(stack["name"]) +} + +func (c *current) onBlockAttributes126(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonBlockAttributes126() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes126(stack["element"]) +} + +func (c *current) onBlockAttributes185() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonBlockAttributes185() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes185() +} + +func (c *current) onBlockAttributes108(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + +} + +func (p *parser) callonBlockAttributes108() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes108(stack["elements"]) +} + +func (c *current) onBlockAttributes104(title interface{}) (interface{}, error) { + return types.NewTitleAttribute(title) + +} + +func (p *parser) callonBlockAttributes104() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes104(stack["title"]) +} + +func (c *current) onBlockAttributes190() (interface{}, error) { + 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) onBlockAttributes197() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonBlockAttributes197() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes197() +} + +func (c *current) onBlockAttributes101(title interface{}) (interface{}, error) { + return title, nil + +} + +func (p *parser) callonBlockAttributes101() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes101(stack["title"]) +} + +func (c *current) onBlockAttributes206() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonBlockAttributes206() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes206() +} + +func (c *current) onBlockAttributes213() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonBlockAttributes213() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes213() +} + +func (c *current) onBlockAttributes199(attributes interface{}) (interface{}, error) { + return attributes, nil + +} + +func (p *parser) callonBlockAttributes199() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onBlockAttributes199(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) onLongHandAttributes29() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes29() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes29() +} + +func (c *current) onLongHandAttributes33() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes33() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes33() +} + +func (c *current) onLongHandAttributes40() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes40() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes40() +} + +func (c *current) onLongHandAttributes52() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes52() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes52() +} + +func (c *current) onLongHandAttributes54() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes54() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes54() +} + +func (c *current) onLongHandAttributes47(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes47() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes47(stack["start"]) +} + +func (c *current) onLongHandAttributes36(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes36() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes36(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes62() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes62() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes62() +} + +func (c *current) onLongHandAttributes74() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes74() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes74() +} + +func (c *current) onLongHandAttributes76() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes76() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes76() +} + +func (c *current) onLongHandAttributes69(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes69() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes69(stack["start"]) +} + +func (c *current) onLongHandAttributes58(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes58() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes58(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes84() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes84() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes84() +} + +func (c *current) onLongHandAttributes80(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes80() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes80(stack["name"]) +} + +func (c *current) onLongHandAttributes31(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes31() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes31(stack["element"]) +} + +func (c *current) onLongHandAttributes90() (interface{}, error) { + + return types.NewStringElement(`'`) // escaped single quote + +} + +func (p *parser) callonLongHandAttributes90() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes90() +} + +func (c *current) onLongHandAttributes94() (interface{}, error) { + // quoted string delimiters or standalone backslash + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonLongHandAttributes94() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes94() +} + +func (c *current) onLongHandAttributes96() (interface{}, error) { + // = and , signs are allowed within '' quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes96() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes96() +} + +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) onLongHandAttributes110() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes110() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes110() +} + +func (c *current) onLongHandAttributes114() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes114() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes114() +} + +func (c *current) onLongHandAttributes118() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes118() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes118() +} + +func (c *current) onLongHandAttributes125() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes125() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes125() +} + +func (c *current) onLongHandAttributes137() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes137() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes137() +} + +func (c *current) onLongHandAttributes139() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes139() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes139() +} + +func (c *current) onLongHandAttributes132(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes132() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes132(stack["start"]) +} + +func (c *current) onLongHandAttributes121(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes121() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes121(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes147() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes147() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes147() +} + +func (c *current) onLongHandAttributes159() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes159() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes159() +} + +func (c *current) onLongHandAttributes161() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes161() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes161() +} + +func (c *current) onLongHandAttributes154(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes154() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes154(stack["start"]) +} + +func (c *current) onLongHandAttributes143(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes143() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes143(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes169() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes169() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes169() +} + +func (c *current) onLongHandAttributes165(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes165() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes165(stack["name"]) +} + +func (c *current) onLongHandAttributes116(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes116() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes116(stack["element"]) +} + +func (c *current) onLongHandAttributes175() (interface{}, error) { + + return types.NewStringElement(`"`) // escaped double quote + +} + +func (p *parser) callonLongHandAttributes175() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes175() +} + +func (c *current) onLongHandAttributes180() (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) callonLongHandAttributes180() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes180() +} + +func (c *current) onLongHandAttributes182() (interface{}, error) { + // = and , signs are allowed within " quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes182() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes182() +} + +func (c *current) onLongHandAttributes106(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes106() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes106(stack["elements"]) +} + +func (c *current) onLongHandAttributes192() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes192() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes192() +} + +func (c *current) onLongHandAttributes100(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes100() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes100(stack["content"]) +} + +func (c *current) onLongHandAttributes200() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes200() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes200() +} + +func (c *current) onLongHandAttributes207() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonLongHandAttributes207() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes207() +} + +func (c *current) onLongHandAttributes203(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonLongHandAttributes203() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes203(stack["ref"]) +} + +func (c *current) onLongHandAttributes213() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes213() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes213() +} + +func (c *current) onLongHandAttributes220() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes220() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes220() +} + +func (c *current) onLongHandAttributes232() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes232() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes232() +} + +func (c *current) onLongHandAttributes234() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes234() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes234() +} + +func (c *current) onLongHandAttributes227(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes227() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes227(stack["start"]) +} + +func (c *current) onLongHandAttributes216(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes216() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes216(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes242() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes242() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes242() +} + +func (c *current) onLongHandAttributes254() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes254() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes254() +} + +func (c *current) onLongHandAttributes256() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes256() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes256() +} + +func (c *current) onLongHandAttributes249(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes249() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes249(stack["start"]) +} + +func (c *current) onLongHandAttributes238(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes238() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes238(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes264() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes264() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes264() +} + +func (c *current) onLongHandAttributes260(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes260() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes260(stack["name"]) +} + +func (c *current) onLongHandAttributes211(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes211() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes211(stack["element"]) +} + +func (c *current) onLongHandAttributes270() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes270() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes270() +} + +func (c *current) onLongHandAttributes278() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes278() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes278() +} + +func (c *current) onLongHandAttributes195(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + +} + +func (p *parser) callonLongHandAttributes195() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes195(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) onLongHandAttributes306() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes306() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes306() +} + +func (c *current) onLongHandAttributes310() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes310() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes310() +} + +func (c *current) onLongHandAttributes314() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes314() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes314() +} + +func (c *current) onLongHandAttributes321() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes321() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes321() +} + +func (c *current) onLongHandAttributes333() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes333() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes333() +} + +func (c *current) onLongHandAttributes335() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes335() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes335() +} + +func (c *current) onLongHandAttributes328(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes328() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes328(stack["start"]) +} + +func (c *current) onLongHandAttributes317(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes317() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes317(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes343() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes343() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes343() +} + +func (c *current) onLongHandAttributes355() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes355() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes355() +} + +func (c *current) onLongHandAttributes357() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes357() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes357() +} + +func (c *current) onLongHandAttributes350(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes350() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes350(stack["start"]) +} + +func (c *current) onLongHandAttributes339(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes339() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes339(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes365() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes365() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes365() +} + +func (c *current) onLongHandAttributes361(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes361() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes361(stack["name"]) +} + +func (c *current) onLongHandAttributes312(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes312() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes312(stack["element"]) +} + +func (c *current) onLongHandAttributes371() (interface{}, error) { + + return types.NewStringElement(`'`) // escaped single quote + +} + +func (p *parser) callonLongHandAttributes371() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes371() +} + +func (c *current) onLongHandAttributes375() (interface{}, error) { + // quoted string delimiters or standalone backslash + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonLongHandAttributes375() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes375() +} + +func (c *current) onLongHandAttributes377() (interface{}, error) { + // = and , signs are allowed within '' quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes377() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes377() +} + +func (c *current) onLongHandAttributes302(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes302() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes302(stack["elements"]) +} + +func (c *current) onLongHandAttributes296(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes296() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes296(stack["content"]) +} + +func (c *current) onLongHandAttributes391() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes391() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes391() +} + +func (c *current) onLongHandAttributes395() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes395() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes395() +} + +func (c *current) onLongHandAttributes399() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes399() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes399() +} + +func (c *current) onLongHandAttributes406() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes406() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes406() +} + +func (c *current) onLongHandAttributes418() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes418() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes418() +} + +func (c *current) onLongHandAttributes420() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes420() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes420() +} + +func (c *current) onLongHandAttributes413(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes413() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes413(stack["start"]) +} + +func (c *current) onLongHandAttributes402(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes402() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes402(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes428() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes428() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes428() +} + +func (c *current) onLongHandAttributes440() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes440() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes440() +} + +func (c *current) onLongHandAttributes442() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes442() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes442() +} + +func (c *current) onLongHandAttributes435(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes435() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes435(stack["start"]) +} + +func (c *current) onLongHandAttributes424(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes424() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes424(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes450() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes450() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes450() +} + +func (c *current) onLongHandAttributes446(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes446() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes446(stack["name"]) +} + +func (c *current) onLongHandAttributes397(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes397() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes397(stack["element"]) +} + +func (c *current) onLongHandAttributes456() (interface{}, error) { + + return types.NewStringElement(`"`) // escaped double quote + +} + +func (p *parser) callonLongHandAttributes456() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes456() +} + +func (c *current) onLongHandAttributes461() (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) callonLongHandAttributes461() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes461() +} + +func (c *current) onLongHandAttributes463() (interface{}, error) { + // = and , signs are allowed within " quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes463() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes463() +} + +func (c *current) onLongHandAttributes387(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes387() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes387(stack["elements"]) +} + +func (c *current) onLongHandAttributes473() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes473() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes473() +} + +func (c *current) onLongHandAttributes381(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes381() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes381(stack["content"]) +} + +func (c *current) onLongHandAttributes481() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes481() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes481() +} + +func (c *current) onLongHandAttributes488() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonLongHandAttributes488() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes488() +} + +func (c *current) onLongHandAttributes484(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonLongHandAttributes484() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes484(stack["ref"]) +} + +func (c *current) onLongHandAttributes494() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes494() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes494() +} + +func (c *current) onLongHandAttributes501() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes501() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes501() +} + +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) onLongHandAttributes515() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes515() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes515() +} + +func (c *current) onLongHandAttributes508(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes508() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes508(stack["start"]) +} + +func (c *current) onLongHandAttributes497(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes497() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes497(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes523() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes523() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes523() +} + +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) onLongHandAttributes537() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes537() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes537() +} + +func (c *current) onLongHandAttributes530(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes530() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes530(stack["start"]) +} + +func (c *current) onLongHandAttributes519(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes519() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes519(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes545() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes545() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes545() +} + +func (c *current) onLongHandAttributes541(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes541() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes541(stack["name"]) +} + +func (c *current) onLongHandAttributes492(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes492() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes492(stack["element"]) +} + +func (c *current) onLongHandAttributes551() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes551() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes551() +} + +func (c *current) onLongHandAttributes559() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes559() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes559() +} + +func (c *current) onLongHandAttributes476(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + +} + +func (p *parser) callonLongHandAttributes476() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes476(stack["elements"]) +} + +func (c *current) onLongHandAttributes291(id interface{}) (interface{}, error) { + return types.NewIDAttribute(id) + +} + +func (p *parser) callonLongHandAttributes291() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes291(stack["id"]) +} + +func (c *current) onLongHandAttributes577() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes577() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes577() +} + +func (c *current) onLongHandAttributes581() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes581() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes581() +} + +func (c *current) onLongHandAttributes585() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes585() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes585() +} + +func (c *current) onLongHandAttributes592() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes592() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes592() +} + +func (c *current) onLongHandAttributes604() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes604() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes604() +} + +func (c *current) onLongHandAttributes606() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes606() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes606() +} + +func (c *current) onLongHandAttributes599(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes599() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes599(stack["start"]) +} + +func (c *current) onLongHandAttributes588(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes588() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes588(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes614() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes614() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes614() +} + +func (c *current) onLongHandAttributes626() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes626() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes626() +} + +func (c *current) onLongHandAttributes628() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes628() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes628() +} + +func (c *current) onLongHandAttributes621(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes621() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes621(stack["start"]) +} + +func (c *current) onLongHandAttributes610(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes610() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes610(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes636() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes636() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes636() +} + +func (c *current) onLongHandAttributes632(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes632() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes632(stack["name"]) +} + +func (c *current) onLongHandAttributes583(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes583() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes583(stack["element"]) +} + +func (c *current) onLongHandAttributes642() (interface{}, error) { + + return types.NewStringElement(`'`) // escaped single quote + +} + +func (p *parser) callonLongHandAttributes642() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes642() +} + +func (c *current) onLongHandAttributes646() (interface{}, error) { + // quoted string delimiters or standalone backslash + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonLongHandAttributes646() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes646() +} + +func (c *current) onLongHandAttributes648() (interface{}, error) { + // = and , signs are allowed within '' quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes648() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes648() +} + +func (c *current) onLongHandAttributes573(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes573() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes573(stack["elements"]) +} + +func (c *current) onLongHandAttributes567(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes567() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes567(stack["content"]) +} + +func (c *current) onLongHandAttributes662() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes662() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes662() +} + +func (c *current) onLongHandAttributes666() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes666() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes666() +} + +func (c *current) onLongHandAttributes670() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes670() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes670() +} + +func (c *current) onLongHandAttributes677() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes677() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes677() +} + +func (c *current) onLongHandAttributes689() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes689() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes689() +} + +func (c *current) onLongHandAttributes691() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes691() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes691() +} + +func (c *current) onLongHandAttributes684(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes684() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes684(stack["start"]) +} + +func (c *current) onLongHandAttributes673(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes673() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes673(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes699() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes699() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes699() +} + +func (c *current) onLongHandAttributes711() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes711() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes711() +} + +func (c *current) onLongHandAttributes713() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes713() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes713() +} + +func (c *current) onLongHandAttributes706(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes706() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes706(stack["start"]) +} + +func (c *current) onLongHandAttributes695(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes695() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes695(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes721() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes721() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes721() +} + +func (c *current) onLongHandAttributes717(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes717() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes717(stack["name"]) +} + +func (c *current) onLongHandAttributes668(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes668() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes668(stack["element"]) +} + +func (c *current) onLongHandAttributes727() (interface{}, error) { + + return types.NewStringElement(`"`) // escaped double quote + +} + +func (p *parser) callonLongHandAttributes727() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes727() +} + +func (c *current) onLongHandAttributes732() (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) callonLongHandAttributes732() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes732() +} + +func (c *current) onLongHandAttributes734() (interface{}, error) { + // = and , signs are allowed within " quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes734() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes734() +} + +func (c *current) onLongHandAttributes658(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes658() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes658(stack["elements"]) +} + +func (c *current) onLongHandAttributes744() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes744() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes744() +} + +func (c *current) onLongHandAttributes652(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes652() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes652(stack["content"]) +} + +func (c *current) onLongHandAttributes752() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes752() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes752() +} + +func (c *current) onLongHandAttributes759() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonLongHandAttributes759() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes759() +} + +func (c *current) onLongHandAttributes755(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonLongHandAttributes755() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes755(stack["ref"]) +} + +func (c *current) onLongHandAttributes765() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes765() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes765() +} + +func (c *current) onLongHandAttributes772() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes772() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes772() +} + +func (c *current) onLongHandAttributes784() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes784() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes784() +} + +func (c *current) onLongHandAttributes786() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes786() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes786() +} + +func (c *current) onLongHandAttributes779(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes779() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes779(stack["start"]) +} + +func (c *current) onLongHandAttributes768(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes768() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes768(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes794() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes794() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes794() +} + +func (c *current) onLongHandAttributes806() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes806() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes806() +} + +func (c *current) onLongHandAttributes808() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes808() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes808() +} + +func (c *current) onLongHandAttributes801(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes801() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes801(stack["start"]) +} + +func (c *current) onLongHandAttributes790(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes790() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes790(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes816() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes816() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes816() +} + +func (c *current) onLongHandAttributes812(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes812() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes812(stack["name"]) +} + +func (c *current) onLongHandAttributes763(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes763() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes763(stack["element"]) +} + +func (c *current) onLongHandAttributes822() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes822() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes822() +} + +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) onLongHandAttributes747(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + +} + +func (p *parser) callonLongHandAttributes747() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes747(stack["elements"]) +} + +func (c *current) onLongHandAttributes562(option interface{}) (interface{}, error) { + return types.NewOptionAttribute(option) + +} + +func (p *parser) callonLongHandAttributes562() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes562(stack["option"]) +} + +func (c *current) onLongHandAttributes848() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes848() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes848() +} + +func (c *current) onLongHandAttributes852() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes852() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes852() +} + +func (c *current) onLongHandAttributes856() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes856() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes856() +} + +func (c *current) onLongHandAttributes863() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes863() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes863() +} + +func (c *current) onLongHandAttributes875() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes875() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes875() +} + +func (c *current) onLongHandAttributes877() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes877() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes877() +} + +func (c *current) onLongHandAttributes870(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes870() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes870(stack["start"]) +} + +func (c *current) onLongHandAttributes859(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes859() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes859(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes885() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes885() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes885() +} + +func (c *current) onLongHandAttributes897() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes897() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes897() +} + +func (c *current) onLongHandAttributes899() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes899() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes899() +} + +func (c *current) onLongHandAttributes892(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes892() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes892(stack["start"]) +} + +func (c *current) onLongHandAttributes881(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes881() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes881(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes907() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes907() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes907() +} + +func (c *current) onLongHandAttributes903(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes903() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes903(stack["name"]) +} + +func (c *current) onLongHandAttributes854(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes854() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes854(stack["element"]) +} + +func (c *current) onLongHandAttributes913() (interface{}, error) { + + return types.NewStringElement(`'`) // escaped single quote + +} + +func (p *parser) callonLongHandAttributes913() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes913() +} + +func (c *current) onLongHandAttributes917() (interface{}, error) { + // quoted string delimiters or standalone backslash + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonLongHandAttributes917() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes917() +} + +func (c *current) onLongHandAttributes919() (interface{}, error) { + // = and , signs are allowed within '' quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes919() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes919() +} + +func (c *current) onLongHandAttributes844(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes844() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes844(stack["elements"]) +} + +func (c *current) onLongHandAttributes838(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes838() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes838(stack["content"]) +} + +func (c *current) onLongHandAttributes933() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes933() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes933() +} + +func (c *current) onLongHandAttributes937() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes937() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes937() +} + +func (c *current) onLongHandAttributes941() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes941() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes941() +} + +func (c *current) onLongHandAttributes948() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes948() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes948() +} + +func (c *current) onLongHandAttributes960() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes960() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes960() +} + +func (c *current) onLongHandAttributes962() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes962() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes962() +} + +func (c *current) onLongHandAttributes955(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes955() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes955(stack["start"]) +} + +func (c *current) onLongHandAttributes944(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonLongHandAttributes944() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes944(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes970() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes970() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes970() +} + +func (c *current) onLongHandAttributes982() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes982() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes982() +} + +func (c *current) onLongHandAttributes984() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes984() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes984() +} + +func (c *current) onLongHandAttributes977(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes977() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes977(stack["start"]) +} + +func (c *current) onLongHandAttributes966(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes966() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes966(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes992() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes992() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes992() +} + +func (c *current) onLongHandAttributes988(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes988() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes988(stack["name"]) +} + +func (c *current) onLongHandAttributes939(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes939() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes939(stack["element"]) +} + +func (c *current) onLongHandAttributes998() (interface{}, error) { + + return types.NewStringElement(`"`) // escaped double quote + +} + +func (p *parser) callonLongHandAttributes998() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes998() +} + +func (c *current) onLongHandAttributes1003() (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) callonLongHandAttributes1003() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1003() +} + +func (c *current) onLongHandAttributes1005() (interface{}, error) { + // = and , signs are allowed within " quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes1005() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1005() +} + +func (c *current) onLongHandAttributes929(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonLongHandAttributes929() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes929(stack["elements"]) +} + +func (c *current) onLongHandAttributes1015() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes1015() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1015() +} + +func (c *current) onLongHandAttributes923(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonLongHandAttributes923() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes923(stack["content"]) +} + +func (c *current) onLongHandAttributes1023() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes1023() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1023() +} + +func (c *current) onLongHandAttributes1030() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonLongHandAttributes1030() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1030() +} + +func (c *current) onLongHandAttributes1026(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonLongHandAttributes1026() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1026(stack["ref"]) +} + +func (c *current) onLongHandAttributes1036() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonLongHandAttributes1036() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1036() +} + +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), false, start) +} + +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) onLongHandAttributes1077() (interface{}, error) { + 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) onLongHandAttributes1079() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes1079() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1079() +} + +func (c *current) onLongHandAttributes1072(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonLongHandAttributes1072() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1072(stack["start"]) +} + +func (c *current) onLongHandAttributes1061(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonLongHandAttributes1061() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1061(stack["name"], stack["start"]) +} + +func (c *current) onLongHandAttributes1087() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes1087() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1087() +} + +func (c *current) onLongHandAttributes1083(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonLongHandAttributes1083() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1083(stack["name"]) +} + +func (c *current) onLongHandAttributes1034(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonLongHandAttributes1034() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1034(stack["element"]) +} + +func (c *current) onLongHandAttributes1093() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonLongHandAttributes1093() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1093() +} + +func (c *current) onLongHandAttributes1101() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes1101() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1101() +} + +func (c *current) onLongHandAttributes1018(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + +} + +func (p *parser) callonLongHandAttributes1018() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1018(stack["elements"]) +} + +func (c *current) onLongHandAttributes833(role interface{}) (interface{}, error) { + return types.NewRoleAttribute(role) + +} + +func (p *parser) callonLongHandAttributes833() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes833(stack["role"]) +} + +func (c *current) onLongHandAttributes283(extra interface{}) (interface{}, error) { + return extra, nil + +} + +func (p *parser) callonLongHandAttributes283() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes283(stack["extra"]) +} + +func (c *current) onLongHandAttributes1110() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLongHandAttributes1110() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1110() +} + +func (c *current) onLongHandAttributes1112(main, extras interface{}) (bool, error) { + // make sure there was a match + return main != nil || len(extras.([]interface{})) > 0, nil + +} + +func (p *parser) callonLongHandAttributes1112() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLongHandAttributes1112(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) onPositionalAttribute13() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonPositionalAttribute13() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPositionalAttribute13() +} + +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) onPositionalAttribute24() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonPositionalAttribute24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPositionalAttribute24() +} + +func (c *current) onPositionalAttribute32() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonPositionalAttribute32() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPositionalAttribute32() +} + +func (c *current) onPositionalAttribute36(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) callonPositionalAttribute36() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPositionalAttribute36(stack["value"]) +} + +func (c *current) onPositionalAttribute17(value interface{}) (interface{}, error) { + + return types.NewPositionalAttribute(nil) + +} + +func (p *parser) callonPositionalAttribute17() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPositionalAttribute17(stack["value"]) +} + +func (c *current) onNamedAttribute9() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonNamedAttribute9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onNamedAttribute9() +} + +func (c *current) onNamedAttribute16() (interface{}, error) { + 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) 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) onNamedAttribute22() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonNamedAttribute22() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onNamedAttribute22() +} + +func (c *current) onNamedAttribute32() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonNamedAttribute32() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onNamedAttribute32() +} + +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) onAttributeRawValue19() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue19() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue19() +} + +func (c *current) onAttributeRawValue23() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonAttributeRawValue23() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue23() +} + +func (c *current) onAttributeRawValue30() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue30() +} + +func (c *current) onAttributeRawValue42() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue42() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue42() +} + +func (c *current) onAttributeRawValue44() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonAttributeRawValue44() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue44() +} + +func (c *current) onAttributeRawValue37(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonAttributeRawValue37() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue37(stack["start"]) +} + +func (c *current) onAttributeRawValue26(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonAttributeRawValue26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue26(stack["name"], stack["start"]) +} + +func (c *current) onAttributeRawValue52() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue52() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue52() +} + +func (c *current) onAttributeRawValue64() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue64() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue64() +} + +func (c *current) onAttributeRawValue66() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonAttributeRawValue66() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue66() +} + +func (c *current) onAttributeRawValue59(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonAttributeRawValue59() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue59(stack["start"]) +} + +func (c *current) onAttributeRawValue48(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonAttributeRawValue48() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue48(stack["name"], stack["start"]) +} + +func (c *current) onAttributeRawValue74() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue74() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue74() +} + +func (c *current) onAttributeRawValue70(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonAttributeRawValue70() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue70(stack["name"]) +} + +func (c *current) onAttributeRawValue21(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonAttributeRawValue21() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue21(stack["element"]) +} + +func (c *current) onAttributeRawValue80() (interface{}, error) { + + return types.NewStringElement(`'`) // escaped single quote + +} + +func (p *parser) callonAttributeRawValue80() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue80() +} + +func (c *current) onAttributeRawValue84() (interface{}, error) { + // quoted string delimiters or standalone backslash + return types.NewStringElement(string(c.text)) // keep as-is for now + +} + +func (p *parser) callonAttributeRawValue84() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue84() +} + +func (c *current) onAttributeRawValue86() (interface{}, error) { + // = and , signs are allowed within '' quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonAttributeRawValue86() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue86() +} + +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) onAttributeRawValue100() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue100() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue100() +} + +func (c *current) onAttributeRawValue104() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue104() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue104() +} + +func (c *current) onAttributeRawValue108() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonAttributeRawValue108() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue108() +} + +func (c *current) onAttributeRawValue115() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue115() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue115() +} + +func (c *current) onAttributeRawValue127() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue127() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue127() +} + +func (c *current) onAttributeRawValue129() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonAttributeRawValue129() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue129() +} + +func (c *current) onAttributeRawValue122(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonAttributeRawValue122() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue122(stack["start"]) +} + +func (c *current) onAttributeRawValue111(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonAttributeRawValue111() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue111(stack["name"], stack["start"]) +} + +func (c *current) onAttributeRawValue137() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue137() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue137() +} + +func (c *current) onAttributeRawValue149() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue149() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue149() +} + +func (c *current) onAttributeRawValue151() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonAttributeRawValue151() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue151() +} + +func (c *current) onAttributeRawValue144(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonAttributeRawValue144() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue144(stack["start"]) +} + +func (c *current) onAttributeRawValue133(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonAttributeRawValue133() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue133(stack["name"], stack["start"]) +} + +func (c *current) onAttributeRawValue159() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue159() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue159() +} + +func (c *current) onAttributeRawValue155(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonAttributeRawValue155() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue155(stack["name"]) +} + +func (c *current) onAttributeRawValue106(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonAttributeRawValue106() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue106(stack["element"]) +} + +func (c *current) onAttributeRawValue165() (interface{}, error) { + + return types.NewStringElement(`"`) // escaped double quote + +} + +func (p *parser) callonAttributeRawValue165() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue165() +} + +func (c *current) onAttributeRawValue170() (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) callonAttributeRawValue170() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue170() +} + +func (c *current) onAttributeRawValue172() (interface{}, error) { + // = and , signs are allowed within " quoted values + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonAttributeRawValue172() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue172() +} + +func (c *current) onAttributeRawValue96(elements interface{}) (interface{}, error) { + return types.Reduce(elements), nil + +} + +func (p *parser) callonAttributeRawValue96() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue96(stack["elements"]) +} + +func (c *current) onAttributeRawValue182() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue182() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue182() +} + +func (c *current) onAttributeRawValue90(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonAttributeRawValue90() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue90(stack["content"]) +} + +func (c *current) onAttributeRawValue192() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonAttributeRawValue192() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onAttributeRawValue192() +} + +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) onUnquotedAttributeRawValue6() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue6() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue6() +} + +func (c *current) onUnquotedAttributeRawValue19() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonUnquotedAttributeRawValue19() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue19() +} + +func (c *current) onUnquotedAttributeRawValue15(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonUnquotedAttributeRawValue15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue15(stack["ref"]) +} + +func (c *current) onUnquotedAttributeRawValue25() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonUnquotedAttributeRawValue25() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue25() +} + +func (c *current) onUnquotedAttributeRawValue32() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue32() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue32() +} + +func (c *current) onUnquotedAttributeRawValue44() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue44() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue44() +} + +func (c *current) onUnquotedAttributeRawValue46() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonUnquotedAttributeRawValue46() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue46() +} + +func (c *current) onUnquotedAttributeRawValue39(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonUnquotedAttributeRawValue39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue39(stack["start"]) +} + +func (c *current) onUnquotedAttributeRawValue28(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonUnquotedAttributeRawValue28() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue28(stack["name"], stack["start"]) +} + +func (c *current) onUnquotedAttributeRawValue54() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue54() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue54() +} + +func (c *current) onUnquotedAttributeRawValue66() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue66() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue66() +} + +func (c *current) onUnquotedAttributeRawValue68() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonUnquotedAttributeRawValue68() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue68() +} + +func (c *current) onUnquotedAttributeRawValue61(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonUnquotedAttributeRawValue61() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue61(stack["start"]) +} + +func (c *current) onUnquotedAttributeRawValue50(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonUnquotedAttributeRawValue50() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue50(stack["name"], stack["start"]) +} + +func (c *current) onUnquotedAttributeRawValue76() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue76() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue76() +} + +func (c *current) onUnquotedAttributeRawValue72(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonUnquotedAttributeRawValue72() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue72(stack["name"]) +} + +func (c *current) onUnquotedAttributeRawValue23(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonUnquotedAttributeRawValue23() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue23(stack["element"]) +} + +func (c *current) onUnquotedAttributeRawValue82() (interface{}, error) { + // not within brackets and stop on space + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue82() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue82() +} + +func (c *current) onUnquotedAttributeRawValue86() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonUnquotedAttributeRawValue86() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onUnquotedAttributeRawValue86() +} + +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) onCrossReference12() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonCrossReference12() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference12() +} + +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 (p *parser) callonCrossReference18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference18() +} + +func (c *current) onCrossReference25() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonCrossReference25() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference25() +} + +func (c *current) onCrossReference32() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonCrossReference32() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference32() +} + +func (c *current) onCrossReference44() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonCrossReference44() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference44() +} + +func (c *current) onCrossReference46() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonCrossReference46() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference46() +} + +func (c *current) onCrossReference39(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonCrossReference39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference39(stack["start"]) +} + +func (c *current) onCrossReference28(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonCrossReference28() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference28(stack["name"], stack["start"]) +} + +func (c *current) onCrossReference54() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonCrossReference54() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference54() +} + +func (c *current) onCrossReference66() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonCrossReference66() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference66() +} + +func (c *current) onCrossReference68() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonCrossReference68() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference68() +} + +func (c *current) onCrossReference61(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonCrossReference61() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference61(stack["start"]) +} + +func (c *current) onCrossReference50(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonCrossReference50() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference50(stack["name"], stack["start"]) +} + +func (c *current) onCrossReference76() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonCrossReference76() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference76() +} + +func (c *current) onCrossReference72(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonCrossReference72() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference72(stack["name"]) +} + +func (c *current) onCrossReference23(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonCrossReference23() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference23(stack["element"]) +} + +func (c *current) onCrossReference82() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonCrossReference82() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference82() +} + +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) onCrossReference89() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonCrossReference89() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference89() +} + +func (c *current) onCrossReference85(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonCrossReference85() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCrossReference85(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) onExternalCrossReference92() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference92() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference92() +} + +func (c *current) onExternalCrossReference98() (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) callonExternalCrossReference98() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference98() +} + +func (c *current) onExternalCrossReference105() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonExternalCrossReference105() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference105() +} + +func (c *current) onExternalCrossReference112() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference112() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference112() +} + +func (c *current) onExternalCrossReference124() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference124() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference124() +} + +func (c *current) onExternalCrossReference126() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference126() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference126() +} + +func (c *current) onExternalCrossReference119(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonExternalCrossReference119() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference119(stack["start"]) +} + +func (c *current) onExternalCrossReference108(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonExternalCrossReference108() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference108(stack["name"], stack["start"]) +} + +func (c *current) onExternalCrossReference134() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference134() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference134() +} + +func (c *current) onExternalCrossReference146() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference146() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference146() +} + +func (c *current) onExternalCrossReference148() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference148() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference148() +} + +func (c *current) onExternalCrossReference141(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonExternalCrossReference141() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference141(stack["start"]) +} + +func (c *current) onExternalCrossReference130(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonExternalCrossReference130() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference130(stack["name"], stack["start"]) +} + +func (c *current) onExternalCrossReference156() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference156() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference156() +} + +func (c *current) onExternalCrossReference152(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonExternalCrossReference152() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference152(stack["name"]) +} + +func (c *current) onExternalCrossReference103(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonExternalCrossReference103() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference103(stack["element"]) +} + +func (c *current) onExternalCrossReference162() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference162() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference162() +} + +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) onExternalCrossReference169() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonExternalCrossReference169() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference169() +} + +func (c *current) onExternalCrossReference165(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonExternalCrossReference165() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference165(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) onExternalCrossReference173() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference173() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference173() +} + +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) onExternalCrossReference175() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalCrossReference175() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference175() +} + +func (c *current) onExternalCrossReference9(elements interface{}) (interface{}, error) { + return types.Merge(elements.([]interface{})...), nil + +} + +func (p *parser) callonExternalCrossReference9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference9(stack["elements"]) +} + +func (c *current) onExternalCrossReference181() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonExternalCrossReference181() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference181() +} + +func (c *current) onExternalCrossReference177(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonExternalCrossReference177() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalCrossReference177(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) onDelimitedBlock9() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock9() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock9() +} + +func (c *current) onDelimitedBlock16() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDelimitedBlock16() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock16() +} + +func (c *current) onDelimitedBlock18() (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) callonDelimitedBlock18() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock18() +} + +func (c *current) onDelimitedBlock30() (interface{}, error) { + 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) onDelimitedBlock37() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDelimitedBlock37() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock37() +} + +func (c *current) onDelimitedBlock48() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock48() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock48() +} + +func (c *current) onDelimitedBlock56() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDelimitedBlock56() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock56() +} + +func (c *current) onDelimitedBlock42(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDelimitedBlock42() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock42(stack["content"]) +} + +func (c *current) onDelimitedBlock21(line interface{}) (interface{}, error) { + return line, nil + +} + +func (p *parser) callonDelimitedBlock21() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock21(stack["line"]) +} + +func (c *current) onDelimitedBlock65() (interface{}, error) { + 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) onDelimitedBlock72() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDelimitedBlock72() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock72() +} + +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) onDelimitedBlock94() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock94() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock94() +} + +func (c *current) onDelimitedBlock101() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDelimitedBlock101() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock101() +} + +func (c *current) onDelimitedBlock86() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDelimitedBlock86() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock86() +} + +func (c *current) onDelimitedBlock105() (interface{}, error) { + + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock105() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock105() +} + +func (c *current) onDelimitedBlock113() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDelimitedBlock113() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock113() +} + +func (c *current) onDelimitedBlock83(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDelimitedBlock83() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock83(stack["content"]) +} + +func (c *current) onDelimitedBlock129() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock129() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock129() +} + +func (c *current) onDelimitedBlock136() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDelimitedBlock136() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock136() +} + +func (c *current) onDelimitedBlock121() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonDelimitedBlock121() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock121() +} + +func (c *current) onDelimitedBlock140() (interface{}, error) { + + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock140() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock140() +} + +func (c *current) onDelimitedBlock148() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDelimitedBlock148() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock148() +} + +func (c *current) onDelimitedBlock118(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDelimitedBlock118() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock118(stack["content"]) +} + +func (c *current) onDelimitedBlock153() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonDelimitedBlock153() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock153() +} + +func (c *current) onDelimitedBlock156(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + +} + +func (p *parser) callonDelimitedBlock156() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock156(stack["content"]) +} + +func (c *current) onDelimitedBlock162() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDelimitedBlock162() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock162() +} + +func (c *current) onDelimitedBlock150(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonDelimitedBlock150() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock150(stack["content"]) +} + +func (c *current) onDelimitedBlock80(firstLine, otherLines interface{}) (interface{}, error) { + return types.NewDelimitedBlock(types.MarkdownQuote, append([]interface{}{firstLine}, otherLines.([]interface{})...)) + +} + +func (p *parser) callonDelimitedBlock80() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDelimitedBlock80(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) onExampleBlock8() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExampleBlock8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlock8() +} + +func (c *current) onExampleBlock15() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonExampleBlock15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlock15() +} + +func (c *current) onExampleBlock17() (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) callonExampleBlock17() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlock17() +} + +func (c *current) onExampleBlock26() (interface{}, error) { + 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) onExampleBlock33() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonExampleBlock33() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlock33() +} + +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) onExampleBlockContent11() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExampleBlockContent11() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlockContent11() +} + +func (c *current) onExampleBlockContent18() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonExampleBlockContent18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlockContent18() +} + +func (c *current) onExampleBlockContent31() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonExampleBlockContent31() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlockContent31() +} + +func (c *current) onExampleBlockContent39() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonExampleBlockContent39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlockContent39() +} + +func (c *current) onExampleBlockContent25(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonExampleBlockContent25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExampleBlockContent25(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) onFencedBlock8() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFencedBlock8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlock8() +} + +func (c *current) onFencedBlock15() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonFencedBlock15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlock15() +} + +func (c *current) onFencedBlock17() (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) callonFencedBlock17() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlock17() +} + +func (c *current) onFencedBlock26() (interface{}, error) { + 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) onFencedBlock33() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonFencedBlock33() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlock33() +} + +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) onFencedBlockContent11() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFencedBlockContent11() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlockContent11() +} + +func (c *current) onFencedBlockContent18() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonFencedBlockContent18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlockContent18() +} + +func (c *current) onFencedBlockContent31() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonFencedBlockContent31() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlockContent31() +} + +func (c *current) onFencedBlockContent39() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonFencedBlockContent39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlockContent39() +} + +func (c *current) onFencedBlockContent25(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonFencedBlockContent25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFencedBlockContent25(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) onListingBlock8() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListingBlock8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlock8() +} + +func (c *current) onListingBlock15() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListingBlock15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlock15() +} + +func (c *current) onListingBlock17() (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) callonListingBlock17() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlock17() +} + +func (c *current) onListingBlock26() (interface{}, error) { + 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) onListingBlock33() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListingBlock33() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlock33() +} + +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) onListingBlockContent11() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListingBlockContent11() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlockContent11() +} + +func (c *current) onListingBlockContent18() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListingBlockContent18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlockContent18() +} + +func (c *current) onListingBlockContent31() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonListingBlockContent31() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlockContent31() +} + +func (c *current) onListingBlockContent39() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListingBlockContent39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlockContent39() +} + +func (c *current) onListingBlockContent25(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonListingBlockContent25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListingBlockContent25(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) onLiteralBlock7() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLiteralBlock7() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlock7() +} + +func (c *current) onLiteralBlock14() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonLiteralBlock14() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlock14() +} + +func (c *current) onLiteralBlock16() (bool, error) { + // only accept if not already in a delimited block of this kind + return !c.isWithinDelimitedBlockOfKind(types.Literal), nil + +} + +func (p *parser) callonLiteralBlock16() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlock16() +} + +func (c *current) onLiteralBlock19(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) callonLiteralBlock19() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlock19(stack["content"]) +} + +func (c *current) onLiteralBlock27() (interface{}, error) { + 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) onLiteralBlock34() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonLiteralBlock34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlock34() +} + +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) onLiteralBlockContent11() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonLiteralBlockContent11() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlockContent11() +} + +func (c *current) onLiteralBlockContent18() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonLiteralBlockContent18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlockContent18() +} + +func (c *current) onLiteralBlockContent31() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonLiteralBlockContent31() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlockContent31() +} + +func (c *current) onLiteralBlockContent39() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonLiteralBlockContent39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlockContent39() +} + +func (c *current) onLiteralBlockContent25(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonLiteralBlockContent25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLiteralBlockContent25(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) onMarkdownQuoteAttribution13() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonMarkdownQuoteAttribution13() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onMarkdownQuoteAttribution13() +} + +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) onPassthroughBlock8() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonPassthroughBlock8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlock8() +} + +func (c *current) onPassthroughBlock15() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonPassthroughBlock15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlock15() +} + +func (c *current) onPassthroughBlock17() (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) callonPassthroughBlock17() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlock17() +} + +func (c *current) onPassthroughBlock27() (interface{}, error) { + 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) onPassthroughBlock34() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonPassthroughBlock34() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlock34() +} + +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) onPassthroughBlockContent11() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonPassthroughBlockContent11() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlockContent11() +} + +func (c *current) onPassthroughBlockContent18() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonPassthroughBlockContent18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlockContent18() +} + +func (c *current) onPassthroughBlockContent31() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonPassthroughBlockContent31() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlockContent31() +} + +func (c *current) onPassthroughBlockContent39() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonPassthroughBlockContent39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlockContent39() +} + +func (c *current) onPassthroughBlockContent25(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonPassthroughBlockContent25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onPassthroughBlockContent25(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) onQuoteBlock8() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonQuoteBlock8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlock8() +} + +func (c *current) onQuoteBlock15() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonQuoteBlock15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlock15() +} + +func (c *current) onQuoteBlock17() (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) callonQuoteBlock17() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlock17() +} + +func (c *current) onQuoteBlock26() (interface{}, error) { + 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) onQuoteBlock33() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonQuoteBlock33() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlock33() +} + +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) onQuoteBlockContent11() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonQuoteBlockContent11() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlockContent11() +} + +func (c *current) onQuoteBlockContent18() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonQuoteBlockContent18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlockContent18() +} + +func (c *current) onQuoteBlockContent31() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonQuoteBlockContent31() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlockContent31() +} + +func (c *current) onQuoteBlockContent39() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonQuoteBlockContent39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlockContent39() +} + +func (c *current) onQuoteBlockContent25(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonQuoteBlockContent25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onQuoteBlockContent25(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) onSidebarBlock8() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonSidebarBlock8() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlock8() +} + +func (c *current) onSidebarBlock15() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonSidebarBlock15() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlock15() +} + +func (c *current) onSidebarBlock17() (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) callonSidebarBlock17() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlock17() +} + +func (c *current) onSidebarBlock26() (interface{}, error) { + 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) onSidebarBlock33() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonSidebarBlock33() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlock33() +} + +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) onSidebarBlockContent11() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonSidebarBlockContent11() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlockContent11() +} + +func (c *current) onSidebarBlockContent18() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonSidebarBlockContent18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlockContent18() +} + +func (c *current) onSidebarBlockContent31() (interface{}, error) { + // content is NOT mandatory + return string(c.text), nil + +} + +func (p *parser) callonSidebarBlockContent31() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlockContent31() +} + +func (c *current) onSidebarBlockContent39() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonSidebarBlockContent39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlockContent39() +} + +func (c *current) onSidebarBlockContent25(content interface{}) (interface{}, error) { + + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonSidebarBlockContent25() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSidebarBlockContent25(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) onFileInclusion97() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion97() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion97() +} + +func (c *current) onFileInclusion103() (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) callonFileInclusion103() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion103() +} + +func (c *current) onFileInclusion110() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonFileInclusion110() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion110() +} + +func (c *current) onFileInclusion117() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion117() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion117() +} + +func (c *current) onFileInclusion129() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion129() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion129() +} + +func (c *current) onFileInclusion131() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonFileInclusion131() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion131() +} + +func (c *current) onFileInclusion124(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonFileInclusion124() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion124(stack["start"]) +} + +func (c *current) onFileInclusion113(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonFileInclusion113() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion113(stack["name"], stack["start"]) +} + +func (c *current) onFileInclusion139() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion139() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion139() +} + +func (c *current) onFileInclusion151() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion151() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion151() +} + +func (c *current) onFileInclusion153() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonFileInclusion153() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion153() +} + +func (c *current) onFileInclusion146(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonFileInclusion146() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion146(stack["start"]) +} + +func (c *current) onFileInclusion135(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonFileInclusion135() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion135(stack["name"], stack["start"]) +} + +func (c *current) onFileInclusion161() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion161() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion161() +} + +func (c *current) onFileInclusion157(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonFileInclusion157() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion157(stack["name"]) +} + +func (c *current) onFileInclusion108(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonFileInclusion108() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion108(stack["element"]) +} + +func (c *current) onFileInclusion167() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonFileInclusion167() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion167() +} + +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) onFileInclusion174() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion174() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion174() +} + +func (c *current) onFileInclusion170(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonFileInclusion170() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion170(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) onFileInclusion178() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonFileInclusion178() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion178() +} + +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) onFileInclusion180() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonFileInclusion180() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion180() +} + +func (c *current) onFileInclusion14(elements interface{}) (interface{}, error) { + return types.Merge(elements.([]interface{})...), nil + +} + +func (p *parser) callonFileInclusion14() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion14(stack["elements"]) +} + +func (c *current) onFileInclusion186() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonFileInclusion186() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion186() +} + +func (c *current) onFileInclusion182(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonFileInclusion182() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion182(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) onFileInclusion195() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonFileInclusion195() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion195() +} + +func (c *current) onFileInclusion202() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonFileInclusion202() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFileInclusion202() +} + +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) onIncludedFileLine31() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonIncludedFileLine31() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIncludedFileLine31() +} + +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) onInlineElement7() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineElement7() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement7() +} + +func (c *current) onInlineElement13() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement13() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement13() +} + +func (c *current) onInlineElement20() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonInlineElement20() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement20() +} + +func (c *current) onInlineElement4(content interface{}) (interface{}, error) { + return content, nil + +} + +func (p *parser) callonInlineElement4() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement4(stack["content"]) +} + +func (c *current) onInlineElement22() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineElement22() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement22() +} + +func (c *current) onInlineElement31() (interface{}, error) { + // allow ` + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineElement31() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement31() +} + +func (c *current) onInlineElement46() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement46() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement46() +} + +func (c *current) onInlineElement52() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonInlineElement52() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement52() +} + +func (c *current) onInlineElement40() (interface{}, error) { + return types.NewString(string(c.text)) +} + +func (p *parser) callonInlineElement40() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement40() +} + +func (c *current) onInlineElement58() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement58() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement58() +} + +func (c *current) onInlineElement64() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement64() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement64() +} + +func (c *current) onInlineElement72() (interface{}, error) { + // TODO: just use "\n" + 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) onInlineElement54() (interface{}, error) { + return types.NewLineBreak() + +} + +func (p *parser) callonInlineElement54() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement54() +} + +func (c *current) onInlineElement74() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement74() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement74() +} + +func (c *current) onInlineElement84() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonInlineElement84() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement84() +} + +func (c *current) onInlineElement89() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + +} + +func (p *parser) callonInlineElement89() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement89() +} + +func (c *current) onInlineElement98() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + 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) onInlineElement104() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement104() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement104() +} + +func (c *current) onInlineElement110() (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) callonInlineElement110() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement110() +} + +func (c *current) onInlineElement117() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonInlineElement117() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement117() +} + +func (c *current) onInlineElement124() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement124() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement124() +} + +func (c *current) onInlineElement136() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement136() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement136() +} + +func (c *current) onInlineElement138() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineElement138() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement138() +} + +func (c *current) onInlineElement131(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineElement131() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement131(stack["start"]) +} + +func (c *current) onInlineElement120(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonInlineElement120() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement120(stack["name"], stack["start"]) +} + +func (c *current) onInlineElement146() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement146() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement146() +} + +func (c *current) onInlineElement158() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement158() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement158() +} + +func (c *current) onInlineElement160() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineElement160() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement160() +} + +func (c *current) onInlineElement153(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineElement153() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement153(stack["start"]) +} + +func (c *current) onInlineElement142(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonInlineElement142() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement142(stack["name"], stack["start"]) +} + +func (c *current) onInlineElement168() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement168() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement168() +} + +func (c *current) onInlineElement164(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonInlineElement164() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement164(stack["name"]) +} + +func (c *current) onInlineElement115(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonInlineElement115() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement115(stack["element"]) +} + +func (c *current) onInlineElement174() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineElement174() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement174() +} + +func (c *current) onInlineElement94(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + +} + +func (p *parser) callonInlineElement94() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement94(stack["id"], stack["label"]) +} + +func (c *current) onInlineElement181() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + 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) onInlineElement177(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonInlineElement177() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement177(stack["id"]) +} + +func (c *current) onInlineElement92() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineElement92() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement92() +} + +func (c *current) onInlineElement185() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonInlineElement185() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement185() +} + +func (c *current) onInlineElement87(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonInlineElement87() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement87(stack["element"]) +} + +func (c *current) onInlineElement190() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonInlineElement190() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement190() +} + +func (c *current) onInlineElement197() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement197() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement197() +} + +func (c *current) onInlineElement209() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement209() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement209() +} + +func (c *current) onInlineElement211() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineElement211() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement211() +} + +func (c *current) onInlineElement204(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineElement204() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement204(stack["start"]) +} + +func (c *current) onInlineElement193(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonInlineElement193() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement193(stack["name"], stack["start"]) +} + +func (c *current) onInlineElement219() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement219() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement219() +} + +func (c *current) onInlineElement231() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement231() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement231() +} + +func (c *current) onInlineElement233() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineElement233() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement233() +} + +func (c *current) onInlineElement226(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineElement226() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement226(stack["start"]) +} + +func (c *current) onInlineElement215(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonInlineElement215() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement215(stack["name"], stack["start"]) +} + +func (c *current) onInlineElement241() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement241() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement241() +} + +func (c *current) onInlineElement237(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonInlineElement237() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement237(stack["name"]) +} + +func (c *current) onInlineElement188(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonInlineElement188() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement188(stack["element"]) +} + +func (c *current) onInlineElement249() (bool, error) { + return c.isSubstitutionEnabled(Replacements) + +} + +func (p *parser) callonInlineElement249() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement249() +} + +func (c *current) onInlineElement252() (interface{}, error) { + return types.NewStringElement("\u2019") + +} + +func (p *parser) callonInlineElement252() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement252() +} + +func (c *current) onInlineElement254() (interface{}, error) { + return types.NewStringElement("\u00a9") + +} + +func (p *parser) callonInlineElement254() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement254() +} + +func (c *current) onInlineElement256() (interface{}, error) { + return types.NewStringElement("\u2122") + +} + +func (p *parser) callonInlineElement256() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement256() +} + +func (c *current) onInlineElement258() (interface{}, error) { + return types.NewStringElement("\u00ae") + +} + +func (p *parser) callonInlineElement258() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement258() +} + +func (c *current) onInlineElement260() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + +} + +func (p *parser) callonInlineElement260() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement260() +} + +func (c *current) onInlineElement262() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + +} + +func (p *parser) callonInlineElement262() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement262() +} + +func (c *current) onInlineElement247(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonInlineElement247() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement247(stack["element"]) +} + +func (c *current) onInlineElement271() (bool, error) { + return c.isSubstitutionEnabled(PostReplacements) + +} + +func (p *parser) callonInlineElement271() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement271() +} + +func (c *current) onInlineElement277() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement277() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement277() +} + +func (c *current) onInlineElement283() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineElement283() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement283() +} + +func (c *current) onInlineElement291() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonInlineElement291() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement291() +} + +func (c *current) onInlineElement273() (interface{}, error) { + return types.NewLineBreak() + +} + +func (p *parser) callonInlineElement273() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement273() +} + +func (c *current) onInlineElement269(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonInlineElement269() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement269(stack["element"]) +} + +func (c *current) onInlineElement297() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonInlineElement297() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement297() +} + +func (c *current) onInlineElement293(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonInlineElement293() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement293(stack["ref"]) +} + +func (c *current) onInlineElement301() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineElement301() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineElement301() +} + +func (c *current) onInlineElement1(element interface{}) (interface{}, error) { + 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.(types.InlineElements)) +} + +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) onIndexTermContent26() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent26() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent26() +} + +func (c *current) onIndexTermContent30() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + +} + +func (p *parser) callonIndexTermContent30() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent30() +} + +func (c *current) onIndexTermContent39() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent39() +} + +func (c *current) onIndexTermContent45() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent45() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent45() +} + +func (c *current) onIndexTermContent51() (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) callonIndexTermContent51() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent51() +} + +func (c *current) onIndexTermContent58() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonIndexTermContent58() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent58() +} + +func (c *current) onIndexTermContent65() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent65() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent65() +} + +func (c *current) onIndexTermContent77() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent77() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent77() +} + +func (c *current) onIndexTermContent79() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonIndexTermContent79() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent79() +} + +func (c *current) onIndexTermContent72(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonIndexTermContent72() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent72(stack["start"]) +} + +func (c *current) onIndexTermContent61(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonIndexTermContent61() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent61(stack["name"], stack["start"]) +} + +func (c *current) onIndexTermContent87() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent87() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent87() +} + +func (c *current) onIndexTermContent99() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent99() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent99() +} + +func (c *current) onIndexTermContent101() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonIndexTermContent101() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent101() +} + +func (c *current) onIndexTermContent94(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonIndexTermContent94() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent94(stack["start"]) +} + +func (c *current) onIndexTermContent83(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonIndexTermContent83() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent83(stack["name"], stack["start"]) +} + +func (c *current) onIndexTermContent109() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent109() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent109() +} + +func (c *current) onIndexTermContent105(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonIndexTermContent105() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent105(stack["name"]) +} + +func (c *current) onIndexTermContent56(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonIndexTermContent56() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent56(stack["element"]) +} + +func (c *current) onIndexTermContent115() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonIndexTermContent115() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent115() +} + +func (c *current) onIndexTermContent35(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + +} + +func (p *parser) callonIndexTermContent35() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent35(stack["id"], stack["label"]) +} + +func (c *current) onIndexTermContent122() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonIndexTermContent122() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent122() +} + +func (c *current) onIndexTermContent118(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonIndexTermContent118() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent118(stack["id"]) +} + +func (c *current) onIndexTermContent33() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonIndexTermContent33() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent33() +} + +func (c *current) onIndexTermContent126() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonIndexTermContent126() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent126() +} + +func (c *current) onIndexTermContent28(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonIndexTermContent28() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent28(stack["element"]) +} + +func (c *current) onIndexTermContent132() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonIndexTermContent132() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent132() +} + +func (c *current) onIndexTermContent128(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonIndexTermContent128() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent128(stack["ref"]) +} + +func (c *current) onIndexTermContent136() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonIndexTermContent136() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onIndexTermContent136() +} + +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) onImageBlock102() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock102() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock102() +} + +func (c *current) onImageBlock108() (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) callonImageBlock108() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock108() +} + +func (c *current) onImageBlock115() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonImageBlock115() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock115() +} + +func (c *current) onImageBlock122() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock122() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock122() +} + +func (c *current) onImageBlock134() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock134() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock134() +} + +func (c *current) onImageBlock136() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonImageBlock136() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock136() +} + +func (c *current) onImageBlock129(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonImageBlock129() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock129(stack["start"]) +} + +func (c *current) onImageBlock118(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonImageBlock118() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock118(stack["name"], stack["start"]) +} + +func (c *current) onImageBlock144() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock144() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock144() +} + +func (c *current) onImageBlock156() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock156() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock156() +} + +func (c *current) onImageBlock158() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonImageBlock158() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock158() +} + +func (c *current) onImageBlock151(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonImageBlock151() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock151(stack["start"]) +} + +func (c *current) onImageBlock140(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonImageBlock140() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock140(stack["name"], stack["start"]) +} + +func (c *current) onImageBlock166() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock166() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock166() +} + +func (c *current) onImageBlock162(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonImageBlock162() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock162(stack["name"]) +} + +func (c *current) onImageBlock113(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonImageBlock113() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock113(stack["element"]) +} + +func (c *current) onImageBlock172() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonImageBlock172() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock172() +} + +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) onImageBlock179() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonImageBlock179() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock179() +} + +func (c *current) onImageBlock175(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonImageBlock175() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock175(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) onImageBlock183() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonImageBlock183() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock183() +} + +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) onImageBlock185() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonImageBlock185() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock185() +} + +func (c *current) onImageBlock19(elements interface{}) (interface{}, error) { + return types.Merge(elements.([]interface{})...), nil + +} + +func (p *parser) callonImageBlock19() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock19(stack["elements"]) +} + +func (c *current) onImageBlock191() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonImageBlock191() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock191() +} + +func (c *current) onImageBlock187(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonImageBlock187() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock187(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) onImageBlock200() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonImageBlock200() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock200() +} + +func (c *current) onImageBlock207() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonImageBlock207() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onImageBlock207() +} + +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) onInlineImage103() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage103() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage103() +} + +func (c *current) onInlineImage109() (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) callonInlineImage109() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage109() +} + +func (c *current) onInlineImage116() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonInlineImage116() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage116() +} + +func (c *current) onInlineImage123() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage123() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage123() +} + +func (c *current) onInlineImage135() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage135() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage135() +} + +func (c *current) onInlineImage137() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineImage137() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage137() +} + +func (c *current) onInlineImage130(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineImage130() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage130(stack["start"]) +} + +func (c *current) onInlineImage119(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonInlineImage119() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage119(stack["name"], stack["start"]) +} + +func (c *current) onInlineImage145() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage145() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage145() +} + +func (c *current) onInlineImage157() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage157() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage157() +} + +func (c *current) onInlineImage159() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonInlineImage159() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage159() +} + +func (c *current) onInlineImage152(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonInlineImage152() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage152(stack["start"]) +} + +func (c *current) onInlineImage141(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonInlineImage141() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage141(stack["name"], stack["start"]) +} + +func (c *current) onInlineImage167() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonInlineImage167() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage167() +} + +func (c *current) onInlineImage163(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonInlineImage163() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage163(stack["name"]) +} + +func (c *current) onInlineImage114(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonInlineImage114() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage114(stack["element"]) +} + +func (c *current) onInlineImage173() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineImage173() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage173() +} + +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) onInlineImage180() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonInlineImage180() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage180() +} + +func (c *current) onInlineImage176(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonInlineImage176() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage176(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) onInlineImage184() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonInlineImage184() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage184() +} + +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) onInlineImage186() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonInlineImage186() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage186() +} + +func (c *current) onInlineImage20(elements interface{}) (interface{}, error) { + return types.Merge(elements.([]interface{})...), nil + +} + +func (p *parser) callonInlineImage20() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage20(stack["elements"]) +} + +func (c *current) onInlineImage192() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonInlineImage192() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage192() +} + +func (c *current) onInlineImage188(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonInlineImage188() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onInlineImage188(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) onRelativeLink101() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink101() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink101() +} + +func (c *current) onRelativeLink107() (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) callonRelativeLink107() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink107() +} + +func (c *current) onRelativeLink114() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonRelativeLink114() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink114() +} + +func (c *current) onRelativeLink121() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink121() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink121() +} + +func (c *current) onRelativeLink133() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink133() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink133() +} + +func (c *current) onRelativeLink135() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonRelativeLink135() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink135() +} + +func (c *current) onRelativeLink128(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonRelativeLink128() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink128(stack["start"]) +} + +func (c *current) onRelativeLink117(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonRelativeLink117() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink117(stack["name"], stack["start"]) +} + +func (c *current) onRelativeLink143() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink143() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink143() +} + +func (c *current) onRelativeLink155() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink155() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink155() +} + +func (c *current) onRelativeLink157() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonRelativeLink157() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink157() +} + +func (c *current) onRelativeLink150(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonRelativeLink150() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink150(stack["start"]) +} + +func (c *current) onRelativeLink139(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonRelativeLink139() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink139(stack["name"], stack["start"]) +} + +func (c *current) onRelativeLink165() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink165() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink165() +} + +func (c *current) onRelativeLink161(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonRelativeLink161() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink161(stack["name"]) +} + +func (c *current) onRelativeLink112(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonRelativeLink112() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink112(stack["element"]) +} + +func (c *current) onRelativeLink171() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonRelativeLink171() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink171() +} + +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) onRelativeLink178() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonRelativeLink178() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink178() +} + +func (c *current) onRelativeLink174(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + +} + +func (p *parser) callonRelativeLink174() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink174(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) onRelativeLink182() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + +} + +func (p *parser) callonRelativeLink182() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink182() +} + +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) onRelativeLink184() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonRelativeLink184() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink184() +} + +func (c *current) onRelativeLink18(elements interface{}) (interface{}, error) { + return types.Merge(elements.([]interface{})...), nil + +} + +func (p *parser) callonRelativeLink18() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink18(stack["elements"]) +} + +func (c *current) onRelativeLink190() (interface{}, error) { + return string(c.text), nil +} + +func (p *parser) callonRelativeLink190() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink190() +} + +func (c *current) onRelativeLink186(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) +} + +func (p *parser) callonRelativeLink186() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onRelativeLink186(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) onExternalLink20() (interface{}, error) { + // not supported for now: EOL, space, "{", "[", "]" + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalLink20() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink20() +} + +func (c *current) onExternalLink25() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonExternalLink25() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink25() +} + +func (c *current) onExternalLink32() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink32() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink32() +} + +func (c *current) onExternalLink44() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink44() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink44() +} + +func (c *current) onExternalLink46() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonExternalLink46() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink46() +} + +func (c *current) onExternalLink39(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonExternalLink39() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink39(stack["start"]) +} + +func (c *current) onExternalLink28(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) +} + +func (p *parser) callonExternalLink28() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink28(stack["name"], stack["start"]) +} + +func (c *current) onExternalLink54() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink54() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink54() +} + +func (c *current) onExternalLink66() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink66() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink66() +} + +func (c *current) onExternalLink68() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + +} + +func (p *parser) callonExternalLink68() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink68() +} + +func (c *current) onExternalLink61(start interface{}) (interface{}, error) { + return start, nil + +} + +func (p *parser) callonExternalLink61() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink61(stack["start"]) +} + +func (c *current) onExternalLink50(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) +} + +func (p *parser) callonExternalLink50() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink50(stack["name"], stack["start"]) +} + +func (c *current) onExternalLink76() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonExternalLink76() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink76() +} + +func (c *current) onExternalLink72(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) +} + +func (p *parser) callonExternalLink72() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink72(stack["name"]) +} + +func (c *current) onExternalLink23(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonExternalLink23() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink23(stack["element"]) +} + +func (c *current) onExternalLink84() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + +} + +func (p *parser) callonExternalLink84() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink84() +} + +func (c *current) onExternalLink93() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + +} + +func (p *parser) callonExternalLink93() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink93() +} + +func (c *current) onExternalLink99() (interface{}, error) { + 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) onExternalLink89(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + +} + +func (p *parser) callonExternalLink89() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink89(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) onExternalLink87() (interface{}, error) { + return types.NewStringElement(string(c.text)) + +} + +func (p *parser) callonExternalLink87() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink87() +} + +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) onExternalLink82(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonExternalLink82() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink82(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) onExternalLink16(elements interface{}) (interface{}, error) { + return types.Merge(elements.([]interface{})...), nil + +} + +func (p *parser) callonExternalLink16() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onExternalLink16(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) onListElements13() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements13() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements13() +} + +func (c *current) onListElements20() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonListElements20() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements20() +} + +func (c *current) onListElements23(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonListElements23() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements23(stack["depth"]) +} + +func (c *current) onListElements17(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) callonListElements17() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements17(stack["depth"]) +} + +func (c *current) onListElements24() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + +} + +func (p *parser) callonListElements24() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements24() +} + +func (c *current) onListElements29() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + +} + +func (p *parser) callonListElements29() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements29() +} + +func (c *current) onListElements33() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + +} + +func (p *parser) callonListElements33() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements33() +} + +func (c *current) onListElements37() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + +} + +func (p *parser) callonListElements37() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements37() +} + +func (c *current) onListElements42() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + +} + +func (p *parser) callonListElements42() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements42() +} + +func (c *current) onListElements47(prefix interface{}) (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements47() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements47(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) onListElements54() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonListElements54() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements54() +} + +func (c *current) onListElements62() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements62() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements62() +} + +func (c *current) onListElements51(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) + +} + +func (p *parser) callonListElements51() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements51(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) onListElements72() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements72() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements72() +} + +func (c *current) onListElements79() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonListElements79() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements79() +} + +func (c *current) onListElements82(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonListElements82() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements82(stack["depth"]) +} + +func (c *current) onListElements76(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) callonListElements76() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements76(stack["depth"]) +} + +func (c *current) onListElements84() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + +} + +func (p *parser) callonListElements84() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements84() +} + +func (c *current) onListElements86(prefix interface{}) (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements86() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements86(stack["prefix"]) +} + +func (c *current) onListElements67(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonListElements67() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements67(stack["prefix"]) +} + +func (c *current) onListElements97() (interface{}, error) { + return types.Unchecked, nil +} + +func (p *parser) callonListElements97() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements97() +} + +func (c *current) onListElements99() (interface{}, error) { + return types.Checked, nil +} + +func (p *parser) callonListElements99() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements99() +} + +func (c *current) onListElements101() (interface{}, error) { + return types.Checked, nil +} + +func (p *parser) callonListElements101() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements101() +} + +func (c *current) onListElements103(style interface{}) (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements103() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements103(stack["style"]) +} + +func (c *current) onListElements91(style interface{}) (interface{}, error) { + return style, nil + +} + +func (p *parser) callonListElements91() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements91(stack["style"]) +} + +func (c *current) onListElements110() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonListElements110() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements110() +} + +func (c *current) onListElements118() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements118() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements118() +} + +func (c *current) onListElements107(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) + +} + +func (p *parser) callonListElements107() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements107(stack["rawline"]) +} + +func (c *current) onListElements64(prefix, checkstyle, content interface{}) (interface{}, error) { + return types.NewUnorderedListElement(prefix.(types.UnorderedListElementPrefix), checkstyle, content) + +} + +func (p *parser) callonListElements64() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements64(stack["prefix"], stack["checkstyle"], stack["content"]) +} + +func (c *current) onListElements127() (interface{}, error) { + return strconv.Atoi(string(c.text)) +} + +func (p *parser) callonListElements127() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements127() +} + +func (c *current) onListElements131(ref interface{}) (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements131() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements131(stack["ref"]) +} + +func (c *current) onListElements123(ref interface{}) (interface{}, error) { + return ref, nil + +} + +func (p *parser) callonListElements123() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements123(stack["ref"]) +} + +func (c *current) onListElements138() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements138() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements138() +} + +func (c *current) onListElements146() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements146() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements146() +} + +func (c *current) onListElements135(rawline interface{}) (interface{}, error) { + return types.NewRawLine(rawline.(string)) + +} + +func (p *parser) callonListElements135() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements135(stack["rawline"]) +} + +func (c *current) onListElements120(ref, description interface{}) (interface{}, error) { + return types.NewCalloutListElement(ref.(int), description.(types.RawLine)) + +} + +func (p *parser) callonListElements120() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements120(stack["ref"], stack["description"]) +} + +func (c *current) onListElements158() (interface{}, error) { + + return string(c.text), nil + +} + +func (p *parser) callonListElements158() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements158() +} + +func (c *current) onListElements161(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) callonListElements161() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements161(stack["separator"]) +} + +func (c *current) onListElements155(separator interface{}) (interface{}, error) { + return separator, nil + +} + +func (p *parser) callonListElements155() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements155(stack["separator"]) +} + +func (c *current) onListElements168() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements168() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements168() +} + +func (c *current) onListElements151() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonListElements151() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements151() +} + +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) onListElements186() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements186() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements186() +} + +func (c *current) onListElements193() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements193() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements193() +} + +func (c *current) onListElements204() (interface{}, error) { + 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) onListElements211() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements211() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements211() +} + +func (c *current) onListElements196() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonListElements196() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements196() +} + +func (c *current) onListElements226() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements226() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements226() +} + +func (c *current) onListElements233() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements233() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements233() +} + +func (c *current) onListElements218() (interface{}, error) { + return types.NewBlankLine() + +} + +func (p *parser) callonListElements218() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements218() +} + +func (c *current) onListElements241() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements241() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements241() +} + +func (c *current) onListElements246() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements246() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements246() +} + +func (c *current) onListElements254() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements254() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements254() +} + +func (c *current) onListElements261() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonListElements261() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements261() +} + +func (c *current) onListElements264(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonListElements264() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements264(stack["depth"]) +} + +func (c *current) onListElements258(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) callonListElements258() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements258(stack["depth"]) +} + +func (c *current) onListElements265() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + +} + +func (p *parser) callonListElements265() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements265() +} + +func (c *current) onListElements270() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + +} + +func (p *parser) callonListElements270() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements270() +} + +func (c *current) onListElements274() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + +} + +func (p *parser) callonListElements274() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements274() +} + +func (c *current) onListElements278() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + +} + +func (p *parser) callonListElements278() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements278() +} + +func (c *current) onListElements283() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + +} + +func (p *parser) callonListElements283() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements283() +} + +func (c *current) onListElements288(prefix interface{}) (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements288() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements288(stack["prefix"]) +} + +func (c *current) onListElements249(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonListElements249() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements249(stack["prefix"]) +} + +func (c *current) onListElements297() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements297() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements297() +} + +func (c *current) onListElements304() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonListElements304() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements304() +} + +func (c *current) onListElements307(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonListElements307() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements307(stack["depth"]) +} + +func (c *current) onListElements301(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) callonListElements301() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements301(stack["depth"]) +} + +func (c *current) onListElements309() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + +} + +func (p *parser) callonListElements309() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements309() +} + +func (c *current) onListElements311(prefix interface{}) (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements311() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements311(stack["prefix"]) +} + +func (c *current) onListElements292(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonListElements292() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements292(stack["prefix"]) +} + +func (c *current) onListElements319() (interface{}, error) { + return strconv.Atoi(string(c.text)) +} + +func (p *parser) callonListElements319() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements319() +} + +func (c *current) onListElements323(ref interface{}) (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements323() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements323(stack["ref"]) +} + +func (c *current) onListElements315(ref interface{}) (interface{}, error) { + return ref, nil + +} + +func (p *parser) callonListElements315() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements315(stack["ref"]) +} + +func (c *current) onListElements335() (interface{}, error) { + + return string(c.text), nil + +} + +func (p *parser) callonListElements335() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements335() +} + +func (c *current) onListElements338(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) callonListElements338() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements338(stack["separator"]) +} + +func (c *current) onListElements332(separator interface{}) (interface{}, error) { + return separator, nil + +} + +func (p *parser) callonListElements332() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements332(stack["separator"]) +} + +func (c *current) onListElements345() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements345() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements345() +} + +func (c *current) onListElements328() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonListElements328() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements328() +} + +func (c *current) onListElements351() (interface{}, error) { + + return string(c.text), nil + +} + +func (p *parser) callonListElements351() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements351() +} + +func (c *current) onListElements354(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) callonListElements354() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements354(stack["separator"]) +} + +func (c *current) onListElements348(separator interface{}) (interface{}, error) { + return separator, nil + +} + +func (p *parser) callonListElements348() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements348(stack["separator"]) +} + +func (c *current) onListElements367() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements367() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements367() +} + +func (c *current) onListElements374() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements374() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements374() +} + +func (c *current) onListElements381() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements381() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements381() +} + +func (c *current) onListElements388() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements388() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements388() +} + +func (c *current) onListElements395() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements395() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements395() +} + +func (c *current) onListElements402() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements402() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements402() +} + +func (c *current) onListElements409() (interface{}, error) { + 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) onListElements416() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements416() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements416() +} + +func (c *current) onListElements423() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements423() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements423() +} + +func (c *current) onListElements430() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements430() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements430() +} + +func (c *current) onListElements437() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements437() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements437() +} + +func (c *current) onListElements444() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements444() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements444() +} + +func (c *current) onListElements451() (interface{}, error) { + 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) onListElements458() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements458() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements458() +} + +func (c *current) onListElements465() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements465() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements465() +} + +func (c *current) onListElements472() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements472() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements472() +} + +func (c *current) onListElements356(delimiter interface{}) (interface{}, error) { + return delimiter, nil + +} + +func (p *parser) callonListElements356() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements356(stack["delimiter"]) +} + +func (c *current) onListElements475() (interface{}, error) { + return strings.TrimSpace(string(c.text)), nil + +} + +func (p *parser) callonListElements475() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements475() +} + +func (c *current) onListElements483() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements483() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements483() +} + +func (c *current) onListElements215(content interface{}) (interface{}, error) { + // do not retain the EOL chars + return types.NewRawLine(content.(string)) + +} + +func (p *parser) callonListElements215() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements215(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) onListElements487() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonListElements487() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements487() +} + +func (c *current) onListElements491() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonListElements491() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements491() +} + +func (c *current) onListElements499() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonListElements499() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements499() +} + +func (c *current) onListElements485(content interface{}) (interface{}, error) { + return types.NewParagraph(content) + +} + +func (p *parser) callonListElements485() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements485(stack["content"]) +} + +func (c *current) onListElements148(term, separator, description interface{}) (interface{}, error) { + return types.NewLabeledListElement(len(separator.(string))-1, term, description) + +} + +func (p *parser) callonListElements148() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements148(stack["term"], stack["separator"], stack["description"]) +} + +func (c *current) onListElements1(firstElement, otherElements interface{}) (interface{}, error) { + return types.NewListElements(append([]interface{}{firstElement}, otherElements.([]interface{})...)) + +} + +func (p *parser) callonListElements1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onListElements1(stack["firstElement"], stack["otherElements"]) +} + +func (c *current) onOtherListElements1(otherElements interface{}) (interface{}, error) { + return types.Flatten(otherElements.([]interface{})), nil +} + +func (p *parser) callonOtherListElements1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElements1(stack["otherElements"]) +} + +func (c *current) onOtherListElement19() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonRawSource9() (interface{}, error) { +func (p *parser) callonOtherListElement19() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource9() + return p.cur.onOtherListElement19() } -func (c *current) onRawSource22() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement26() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonRawSource22() (interface{}, error) { +func (p *parser) callonOtherListElement26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource22() + return p.cur.onOtherListElement26() } -func (c *current) onRawSource27() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onOtherListElement11() (interface{}, error) { + return types.NewBlankLine() } -func (p *parser) callonRawSource27() (interface{}, error) { +func (p *parser) callonOtherListElement11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource27() + return p.cur.onOtherListElement11() } -func (c *current) onRawSource34() (interface{}, error) { +func (c *current) onOtherListElement37() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonRawSource34() (interface{}, error) { +func (p *parser) callonOtherListElement37() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource34() + return p.cur.onOtherListElement37() } -func (c *current) onRawSource46() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement44() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil } -func (p *parser) callonRawSource46() (interface{}, error) { +func (p *parser) callonOtherListElement44() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource46() + return p.cur.onOtherListElement44() } -func (c *current) onRawSource48() (interface{}, error) { +func (c *current) onOtherListElement47(depth interface{}) (bool, error) { - return strconv.Atoi(string(c.text)) + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil } -func (p *parser) callonRawSource48() (interface{}, error) { +func (p *parser) callonOtherListElement47() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource48() + return p.cur.onOtherListElement47(stack["depth"]) } -func (c *current) onRawSource41(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onOtherListElement41(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) callonRawSource41() (interface{}, error) { +func (p *parser) callonOtherListElement41() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource41(stack["start"]) + return p.cur.onOtherListElement41(stack["depth"]) } -func (c *current) onRawSource30(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), false, start) +func (c *current) onOtherListElement48() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + +} + +func (p *parser) callonOtherListElement48() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement48() +} + +func (c *current) onOtherListElement53() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + +} + +func (p *parser) callonOtherListElement53() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement53() +} + +func (c *current) onOtherListElement57() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + +} + +func (p *parser) callonOtherListElement57() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement57() +} + +func (c *current) onOtherListElement61() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + +} + +func (p *parser) callonOtherListElement61() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement61() } -func (p *parser) callonRawSource30() (interface{}, error) { +func (c *current) onOtherListElement66() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + +} + +func (p *parser) callonOtherListElement66() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource30(stack["name"], stack["start"]) + return p.cur.onOtherListElement66() } -func (c *current) onRawSource56() (interface{}, error) { +func (c *current) onOtherListElement71(prefix interface{}) (interface{}, error) { return string(c.text), nil + +} + +func (p *parser) callonOtherListElement71() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement71(stack["prefix"]) +} + +func (c *current) onOtherListElement32(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonOtherListElement32() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement32(stack["prefix"]) +} + +func (c *current) onOtherListElement78() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonOtherListElement78() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement78() +} + +func (c *current) onOtherListElement86() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonOtherListElement86() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement86() +} + +func (c *current) onOtherListElement75(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) + +} + +func (p *parser) callonOtherListElement75() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement75(stack["rawline"]) +} + +func (c *current) onOtherListElement29(prefix, content interface{}) (interface{}, error) { + return types.NewOrderedListElement(prefix.(types.OrderedListElementPrefix), content) + +} + +func (p *parser) callonOtherListElement29() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement29(stack["prefix"], stack["content"]) +} + +func (c *current) onOtherListElement8(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonRawSource56() (interface{}, error) { +func (p *parser) callonOtherListElement8() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource56() + return p.cur.onOtherListElement8(stack["element"]) } -func (c *current) onRawSource68() (interface{}, error) { +func (c *current) onOtherListElement102() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonRawSource68() (interface{}, error) { +func (p *parser) callonOtherListElement102() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource68() + return p.cur.onOtherListElement102() } -func (c *current) onRawSource70() (interface{}, error) { +func (c *current) onOtherListElement109() (interface{}, error) { - return strconv.Atoi(string(c.text)) + // `.` is 1, etc. + return (len(c.text)), nil } -func (p *parser) callonRawSource70() (interface{}, error) { +func (p *parser) callonOtherListElement109() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource70() + return p.cur.onOtherListElement109() } -func (c *current) onRawSource63(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onOtherListElement112(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil } -func (p *parser) callonRawSource63() (interface{}, error) { +func (p *parser) callonOtherListElement112() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource63(stack["start"]) + return p.cur.onOtherListElement112(stack["depth"]) } -func (c *current) onRawSource52(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), true, nil) +func (c *current) onOtherListElement106(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) callonOtherListElement106() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement106(stack["depth"]) +} + +func (c *current) onOtherListElement113() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + +} + +func (p *parser) callonOtherListElement113() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement113() +} + +func (c *current) onOtherListElement118() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + +} + +func (p *parser) callonOtherListElement118() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement118() +} + +func (c *current) onOtherListElement122() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + +} + +func (p *parser) callonOtherListElement122() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement122() +} + +func (c *current) onOtherListElement126() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + +} + +func (p *parser) callonOtherListElement126() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement126() } -func (p *parser) callonRawSource52() (interface{}, error) { +func (c *current) onOtherListElement131() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + +} + +func (p *parser) callonOtherListElement131() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource52(stack["name"], stack["start"]) + return p.cur.onOtherListElement131() } -func (c *current) onRawSource78() (interface{}, error) { +func (c *current) onOtherListElement136(prefix interface{}) (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonRawSource78() (interface{}, error) { +func (p *parser) callonOtherListElement136() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource78() + return p.cur.onOtherListElement136(stack["prefix"]) } -func (c *current) onRawSource74(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onOtherListElement97(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonRawSource74() (interface{}, error) { +func (p *parser) callonOtherListElement97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource74(stack["name"]) + return p.cur.onOtherListElement97(stack["prefix"]) } -func (c *current) onRawSource84() (interface{}, error) { - // standalone '{' - return types.NewStringElement(string(c.text)) +func (c *current) onOtherListElement143() (interface{}, error) { + return types.NewRawLine(string(c.text)) } -func (p *parser) callonRawSource84() (interface{}, error) { +func (p *parser) callonOtherListElement143() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource84() + return p.cur.onOtherListElement143() } -func (c *current) onRawSource17(elements interface{}) (interface{}, error) { - return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil +func (c *current) onOtherListElement151() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonRawSource17() (interface{}, error) { +func (p *parser) callonOtherListElement151() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource17(stack["elements"]) + return p.cur.onOtherListElement151() } -func (c *current) onRawSource5(name, value interface{}) (interface{}, error) { - return types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) +func (c *current) onOtherListElement140(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) + } -func (p *parser) callonRawSource5() (interface{}, error) { +func (p *parser) callonOtherListElement140() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource5(stack["name"], stack["value"]) + return p.cur.onOtherListElement140(stack["rawline"]) } -func (c *current) onRawSource94() (interface{}, error) { +func (c *current) onOtherListElement94(prefix, content interface{}) (interface{}, error) { + return types.NewOrderedListElement(prefix.(types.OrderedListElementPrefix), content) - // `=` is level 0, etc. - return (len(c.text) - 1), nil +} + +func (p *parser) callonOtherListElement94() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement94(stack["prefix"], stack["content"]) +} + +func (c *current) onOtherListElement88(attributes, element interface{}) (interface{}, error) { + return append(attributes.([]interface{}), element), nil } -func (p *parser) callonRawSource94() (interface{}, error) { +func (p *parser) callonOtherListElement88() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource94() + return p.cur.onOtherListElement88(stack["attributes"], stack["element"]) } -func (c *current) onRawSource97(level interface{}) (bool, error) { +func (c *current) onOtherListElement164() (interface{}, error) { + 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) callonOtherListElement164() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement164() +} + +func (c *current) onOtherListElement171() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonOtherListElement171() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement171() +} + +func (c *current) onOtherListElement156() (interface{}, error) { + return types.NewBlankLine() } -func (p *parser) callonRawSource97() (bool, error) { +func (p *parser) callonOtherListElement156() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource97(stack["level"]) + return p.cur.onOtherListElement156() } -func (c *current) onRawSource101() (interface{}, error) { +func (c *current) onOtherListElement182() (interface{}, error) { return string(c.text), nil + +} + +func (p *parser) callonOtherListElement182() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement182() +} + +func (c *current) onOtherListElement189() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonOtherListElement189() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement189() +} + +func (c *current) onOtherListElement192(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonOtherListElement192() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement192(stack["depth"]) +} + +func (c *current) onOtherListElement186(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) callonRawSource101() (interface{}, error) { +func (p *parser) callonOtherListElement186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource101() + return p.cur.onOtherListElement186(stack["depth"]) +} + +func (c *current) onOtherListElement194() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + } -func (c *current) onRawSource104() (interface{}, error) { +func (p *parser) callonOtherListElement194() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement194() +} +func (c *current) onOtherListElement196(prefix interface{}) (interface{}, error) { return string(c.text), nil + +} + +func (p *parser) callonOtherListElement196() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement196(stack["prefix"]) +} + +func (c *current) onOtherListElement177(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonOtherListElement177() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement177(stack["prefix"]) +} + +func (c *current) onOtherListElement207() (interface{}, error) { + return types.Unchecked, nil } -func (p *parser) callonRawSource104() (interface{}, error) { +func (p *parser) callonOtherListElement207() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource104() + return p.cur.onOtherListElement207() } -func (c *current) onRawSource91(level, title interface{}) (interface{}, error) { - return types.NewRawSection(level.(int), title.(string)) +func (c *current) onOtherListElement209() (interface{}, error) { + return types.Checked, nil } -func (p *parser) callonRawSource91() (interface{}, error) { +func (p *parser) callonOtherListElement209() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource91(stack["level"], stack["title"]) + return p.cur.onOtherListElement209() +} + +func (c *current) onOtherListElement211() (interface{}, error) { + return types.Checked, nil } -func (c *current) onRawSource119() (interface{}, error) { +func (p *parser) callonOtherListElement211() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement211() +} +func (c *current) onOtherListElement213(style interface{}) (interface{}, error) { return string(c.text), nil } -func (p *parser) callonRawSource119() (interface{}, error) { +func (p *parser) callonOtherListElement213() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource119() + return p.cur.onOtherListElement213(stack["style"]) } -func (c *current) onRawSource113(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onOtherListElement201(style interface{}) (interface{}, error) { + return style, nil + +} + +func (p *parser) callonOtherListElement201() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement201(stack["style"]) +} + +func (c *current) onOtherListElement220() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonOtherListElement220() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement220() +} + +func (c *current) onOtherListElement228() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonOtherListElement228() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement228() +} + +func (c *current) onOtherListElement217(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) + +} + +func (p *parser) callonOtherListElement217() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement217(stack["rawline"]) +} + +func (c *current) onOtherListElement174(prefix, checkstyle, content interface{}) (interface{}, error) { + return types.NewUnorderedListElement(prefix.(types.UnorderedListElementPrefix), checkstyle, content) } -func (p *parser) callonRawSource113() (interface{}, error) { +func (p *parser) callonOtherListElement174() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource113(stack["content"]) + return p.cur.onOtherListElement174(stack["prefix"], stack["checkstyle"], stack["content"]) } -func (c *current) onRawSource1(lines interface{}) (interface{}, error) { - return lines.([]interface{}), nil +func (c *current) onOtherListElement153(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonRawSource1() (interface{}, error) { +func (p *parser) callonOtherListElement153() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawSource1(stack["lines"]) + return p.cur.onOtherListElement153(stack["element"]) } -func (c *current) onRawDocument11() (interface{}, error) { +func (c *current) onOtherListElement244() (interface{}, error) { return string(c.text), nil + +} + +func (p *parser) callonOtherListElement244() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement244() +} + +func (c *current) onOtherListElement251() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + +} + +func (p *parser) callonOtherListElement251() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement251() +} + +func (c *current) onOtherListElement254(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + +} + +func (p *parser) callonOtherListElement254() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement254(stack["depth"]) +} + +func (c *current) onOtherListElement248(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) callonOtherListElement248() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement248(stack["depth"]) +} + +func (c *current) onOtherListElement256() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + } -func (p *parser) callonRawDocument11() (interface{}, error) { +func (p *parser) callonOtherListElement256() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawDocument11() + return p.cur.onOtherListElement256() } -func (c *current) onRawDocument30() (interface{}, error) { +func (c *current) onOtherListElement258(prefix interface{}) (interface{}, error) { return string(c.text), nil + +} + +func (p *parser) callonOtherListElement258() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement258(stack["prefix"]) +} + +func (c *current) onOtherListElement239(prefix interface{}) (interface{}, error) { + return prefix, nil +} + +func (p *parser) callonOtherListElement239() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement239(stack["prefix"]) +} + +func (c *current) onOtherListElement269() (interface{}, error) { + return types.Unchecked, nil +} + +func (p *parser) callonOtherListElement269() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement269() +} + +func (c *current) onOtherListElement271() (interface{}, error) { + return types.Checked, nil +} + +func (p *parser) callonOtherListElement271() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement271() } -func (p *parser) callonRawDocument30() (interface{}, error) { +func (c *current) onOtherListElement273() (interface{}, error) { + return types.Checked, nil +} + +func (p *parser) callonOtherListElement273() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawDocument30() + return p.cur.onOtherListElement273() } -func (c *current) onRawDocument20() (interface{}, error) { +func (c *current) onOtherListElement275(style interface{}) (interface{}, error) { return string(c.text), nil + +} + +func (p *parser) callonOtherListElement275() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement275(stack["style"]) +} + +func (c *current) onOtherListElement263(style interface{}) (interface{}, error) { + return style, nil + +} + +func (p *parser) callonOtherListElement263() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement263(stack["style"]) +} + +func (c *current) onOtherListElement282() (interface{}, error) { + return types.NewRawLine(string(c.text)) + +} + +func (p *parser) callonOtherListElement282() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement282() +} + +func (c *current) onOtherListElement290() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonOtherListElement290() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement290() +} + +func (c *current) onOtherListElement279(rawline interface{}) (interface{}, error) { + return types.NewParagraph(rawline) + +} + +func (p *parser) callonOtherListElement279() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement279(stack["rawline"]) +} + +func (c *current) onOtherListElement236(prefix, checkstyle, content interface{}) (interface{}, error) { + return types.NewUnorderedListElement(prefix.(types.UnorderedListElementPrefix), checkstyle, content) + +} + +func (p *parser) callonOtherListElement236() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement236(stack["prefix"], stack["checkstyle"], stack["content"]) +} + +func (c *current) onOtherListElement230(attributes, element interface{}) (interface{}, error) { + return append(attributes.([]interface{}), element), nil + } -func (p *parser) callonRawDocument20() (interface{}, error) { +func (p *parser) callonOtherListElement230() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawDocument20() + return p.cur.onOtherListElement230(stack["attributes"], stack["element"]) } -func (c *current) onRawDocument42() (interface{}, error) { +func (c *current) onOtherListElement303() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonRawDocument42() (interface{}, error) { +func (p *parser) callonOtherListElement303() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawDocument42() + return p.cur.onOtherListElement303() } -func (c *current) onRawDocument5(content interface{}) (interface{}, error) { - return types.NewYamlFrontMatter(content.(string)) +func (c *current) onOtherListElement310() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonOtherListElement310() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement310() +} + +func (c *current) onOtherListElement295() (interface{}, error) { + return types.NewBlankLine() + } -func (p *parser) callonRawDocument5() (interface{}, error) { +func (p *parser) callonOtherListElement295() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawDocument5(stack["content"]) + return p.cur.onOtherListElement295() } -func (c *current) onRawDocument1(frontmatter, blocks interface{}) (interface{}, error) { - return types.NewRawDocument(frontmatter, blocks.([]interface{})) +func (c *current) onOtherListElement320() (interface{}, error) { + return strconv.Atoi(string(c.text)) } -func (p *parser) callonRawDocument1() (interface{}, error) { +func (p *parser) callonOtherListElement320() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRawDocument1(stack["frontmatter"], stack["blocks"]) + return p.cur.onOtherListElement320() } -func (c *current) onDocumentBlocks15() (interface{}, error) { +func (c *current) onOtherListElement324(ref interface{}) (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks15() (interface{}, error) { +func (p *parser) callonOtherListElement324() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks15() + return p.cur.onOtherListElement324(stack["ref"]) } -func (c *current) onDocumentBlocks31() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ +func (c *current) onOtherListElement316(ref interface{}) (interface{}, error) { + return ref, nil + +} + +func (p *parser) callonOtherListElement316() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement316(stack["ref"]) +} + +func (c *current) onOtherListElement331() (interface{}, error) { return string(c.text), nil + +} + +func (p *parser) callonOtherListElement331() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement331() +} + +func (c *current) onOtherListElement339() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonOtherListElement339() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement339() +} + +func (c *current) onOtherListElement328(rawline interface{}) (interface{}, error) { + return types.NewRawLine(rawline.(string)) + +} + +func (p *parser) callonOtherListElement328() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement328(stack["rawline"]) +} + +func (c *current) onOtherListElement313(ref, description interface{}) (interface{}, error) { + return types.NewCalloutListElement(ref.(int), description.(types.RawLine)) + +} + +func (p *parser) callonOtherListElement313() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement313(stack["ref"], stack["description"]) +} + +func (c *current) onOtherListElement292(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonOtherListElement292() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement292(stack["element"]) } -func (p *parser) callonDocumentBlocks31() (interface{}, error) { +func (c *current) onOtherListElement354() (interface{}, error) { + return strconv.Atoi(string(c.text)) +} + +func (p *parser) callonOtherListElement354() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks31() + return p.cur.onOtherListElement354() } -func (c *current) onDocumentBlocks38() (interface{}, error) { +func (c *current) onOtherListElement358(ref interface{}) (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks38() (interface{}, error) { +func (p *parser) callonOtherListElement358() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks38() + return p.cur.onOtherListElement358(stack["ref"]) } -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) onOtherListElement350(ref interface{}) (interface{}, error) { + return ref, nil + } -func (p *parser) callonDocumentBlocks27() (interface{}, error) { +func (p *parser) callonOtherListElement350() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks27(stack["id"]) + return p.cur.onOtherListElement350(stack["ref"]) } -func (c *current) onDocumentBlocks43() (interface{}, error) { +func (c *current) onOtherListElement365() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonOtherListElement365() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement365() +} +func (c *current) onOtherListElement373() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonOtherListElement373() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement373() +} + +func (c *current) onOtherListElement362(rawline interface{}) (interface{}, error) { + return types.NewRawLine(rawline.(string)) } -func (p *parser) callonDocumentBlocks43() (interface{}, error) { +func (p *parser) callonOtherListElement362() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks43() + return p.cur.onOtherListElement362(stack["rawline"]) } -func (c *current) onDocumentBlocks52() (interface{}, error) { - // allow ` +func (c *current) onOtherListElement347(ref, description interface{}) (interface{}, error) { + return types.NewCalloutListElement(ref.(int), description.(types.RawLine)) + +} + +func (p *parser) callonOtherListElement347() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement347(stack["ref"], stack["description"]) +} + +func (c *current) onOtherListElement341(attributes, element interface{}) (interface{}, error) { + return append(attributes.([]interface{}), element), nil + +} + +func (p *parser) callonOtherListElement341() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement341(stack["attributes"], stack["element"]) +} + +func (c *current) onOtherListElement387() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonOtherListElement387() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement387() +} + +func (c *current) onOtherListElement394() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonOtherListElement394() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement394() +} + +func (c *current) onOtherListElement379() (interface{}, error) { + return types.NewBlankLine() } -func (p *parser) callonDocumentBlocks52() (interface{}, error) { +func (p *parser) callonOtherListElement379() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks52() + return p.cur.onOtherListElement379() } -func (c *current) onDocumentBlocks65() (interface{}, error) { +func (c *current) onOtherListElement407() (interface{}, error) { + return string(c.text), nil + +} + +func (p *parser) callonOtherListElement407() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherListElement407() +} + +func (c *current) onOtherListElement410(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) callonDocumentBlocks65() (interface{}, error) { +func (p *parser) callonOtherListElement410() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks65() + return p.cur.onOtherListElement410(stack["separator"]) } -func (c *current) onDocumentBlocks71() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement404(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlocks71() (interface{}, error) { +func (p *parser) callonOtherListElement404() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks71() + return p.cur.onOtherListElement404(stack["separator"]) } -func (c *current) onDocumentBlocks61() (interface{}, error) { - return types.NewLineBreak() +func (c *current) onOtherListElement417() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks61() (interface{}, error) { +func (p *parser) callonOtherListElement417() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks61() + return p.cur.onOtherListElement417() } -func (c *current) onDocumentBlocks82() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement400() (interface{}, error) { + return types.NewRawLine(string(c.text)) + } -func (p *parser) callonDocumentBlocks82() (interface{}, error) { +func (p *parser) callonOtherListElement400() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks82() + return p.cur.onOtherListElement400() } -func (c *current) onDocumentBlocks88() (interface{}, error) { +func (c *current) onOtherListElement424() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlocks88() (interface{}, error) { +func (p *parser) callonOtherListElement424() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks88() + return p.cur.onOtherListElement424() } -func (c *current) onDocumentBlocks84(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onOtherListElement427(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) callonDocumentBlocks84() (interface{}, error) { +func (p *parser) callonOtherListElement427() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks84(stack["ref"]) + return p.cur.onOtherListElement427(stack["separator"]) } -func (c *current) onDocumentBlocks92() (interface{}, error) { +func (c *current) onOtherListElement421(separator interface{}) (interface{}, error) { + return separator, nil - return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks92() (interface{}, error) { +func (p *parser) callonOtherListElement421() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks92() + return p.cur.onOtherListElement421(stack["separator"]) } -func (c *current) onDocumentBlocks40(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onOtherListElement435() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlocks40() (interface{}, error) { +func (p *parser) callonOtherListElement435() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks40(stack["element"]) + return p.cur.onOtherListElement435() } -func (c *current) onDocumentBlocks18(elements interface{}) (interface{}, error) { - // absorbs heading and trailing spaces - return types.NewInlineElements(elements.([]interface{})) +func (c *current) onOtherListElement442() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks18() (interface{}, error) { +func (p *parser) callonOtherListElement442() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks18(stack["elements"]) + return p.cur.onOtherListElement442() } -func (c *current) onDocumentBlocks100() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ +func (c *current) onOtherListElement453() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks100() (interface{}, error) { +func (p *parser) callonOtherListElement453() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks100() + return p.cur.onOtherListElement453() } -func (c *current) onDocumentBlocks107() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement460() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks107() (interface{}, error) { +func (p *parser) callonOtherListElement460() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks107() + return p.cur.onOtherListElement460() } -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) onOtherListElement445() (interface{}, error) { + return types.NewBlankLine() + } -func (p *parser) callonDocumentBlocks96() (interface{}, error) { +func (p *parser) callonOtherListElement445() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks96(stack["id"]) + return p.cur.onOtherListElement445() } -func (c *current) onDocumentBlocks120() (interface{}, error) { +func (c *current) onOtherListElement475() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks120() (interface{}, error) { +func (p *parser) callonOtherListElement475() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks120() + return p.cur.onOtherListElement475() } -func (c *current) onDocumentBlocks130() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement482() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks130() (interface{}, error) { +func (p *parser) callonOtherListElement482() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks130() + return p.cur.onOtherListElement482() } -func (c *current) onDocumentBlocks139() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement467() (interface{}, error) { + return types.NewBlankLine() + } -func (p *parser) callonDocumentBlocks139() (interface{}, error) { +func (p *parser) callonOtherListElement467() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks139() + return p.cur.onOtherListElement467() } -func (c *current) onDocumentBlocks122(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onOtherListElement490() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlocks122() (interface{}, error) { +func (p *parser) callonOtherListElement490() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks122(stack["content"]) + return p.cur.onOtherListElement490() } -func (c *current) onDocumentBlocks153() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement495() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks153() (interface{}, error) { +func (p *parser) callonOtherListElement495() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks153() + return p.cur.onOtherListElement495() } -func (c *current) onDocumentBlocks171() (interface{}, error) { +func (c *current) onOtherListElement503() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks171() (interface{}, error) { +func (p *parser) callonOtherListElement503() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks171() + return p.cur.onOtherListElement503() } -func (c *current) onDocumentBlocks187() (interface{}, error) { +func (c *current) onOtherListElement510() (interface{}, error) { - return string(c.text), nil + // `.` is 1, etc. + return (len(c.text)), nil } -func (p *parser) callonDocumentBlocks187() (interface{}, error) { +func (p *parser) callonOtherListElement510() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks187() + return p.cur.onOtherListElement510() } -func (c *current) onDocumentBlocks181(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onOtherListElement513(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil } -func (p *parser) callonDocumentBlocks181() (interface{}, error) { +func (p *parser) callonOtherListElement513() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks181(stack["content"]) + return p.cur.onOtherListElement513(stack["depth"]) } -func (c *current) onDocumentBlocks162(line interface{}) (interface{}, error) { +func (c *current) onOtherListElement507(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 line, nil } -func (p *parser) callonDocumentBlocks162() (interface{}, error) { +func (p *parser) callonOtherListElement507() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks162(stack["line"]) + return p.cur.onOtherListElement507(stack["depth"]) } -func (c *current) onDocumentBlocks201() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement514() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + } -func (p *parser) callonDocumentBlocks201() (interface{}, error) { +func (p *parser) callonOtherListElement514() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks201() + return p.cur.onOtherListElement514() } -func (c *current) onDocumentBlocks147(content interface{}) (interface{}, error) { - return types.NewCommentBlock(content.([]interface{}), nil) +func (c *current) onOtherListElement519() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + } -func (p *parser) callonDocumentBlocks147() (interface{}, error) { +func (p *parser) callonOtherListElement519() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks147(stack["content"]) + return p.cur.onOtherListElement519() } -func (c *current) onDocumentBlocks218() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement523() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + } -func (p *parser) callonDocumentBlocks218() (interface{}, error) { +func (p *parser) callonOtherListElement523() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks218() + return p.cur.onOtherListElement523() } -func (c *current) onDocumentBlocks229() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement527() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + } -func (p *parser) callonDocumentBlocks229() (interface{}, error) { +func (p *parser) callonOtherListElement527() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks229() + return p.cur.onOtherListElement527() } -func (c *current) onDocumentBlocks232() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement532() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + } -func (p *parser) callonDocumentBlocks232() (interface{}, error) { +func (p *parser) callonOtherListElement532() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks232() + return p.cur.onOtherListElement532() } -func (c *current) onDocumentBlocks241() (interface{}, error) { +func (c *current) onOtherListElement537(prefix interface{}) (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks241() (interface{}, error) { +func (p *parser) callonOtherListElement537() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks241() + return p.cur.onOtherListElement537(stack["prefix"]) } -func (c *current) onDocumentBlocks237(email interface{}) (interface{}, error) { - return email, nil +func (c *current) onOtherListElement498(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonDocumentBlocks237() (interface{}, error) { +func (p *parser) callonOtherListElement498() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks237(stack["email"]) + return p.cur.onOtherListElement498(stack["prefix"]) } -func (c *current) onDocumentBlocks248() (interface{}, error) { +func (c *current) onOtherListElement546() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks248() (interface{}, error) { +func (p *parser) callonOtherListElement546() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks248() + return p.cur.onOtherListElement546() } -func (c *current) onDocumentBlocks255() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement553() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + } -func (p *parser) callonDocumentBlocks255() (interface{}, error) { +func (p *parser) callonOtherListElement553() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks255() + return p.cur.onOtherListElement553() } -func (c *current) onDocumentBlocks224(fullname, email interface{}) (interface{}, error) { - return types.NewDocumentAuthor(fullname, email) +func (c *current) onOtherListElement556(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + } -func (p *parser) callonDocumentBlocks224() (interface{}, error) { +func (p *parser) callonOtherListElement556() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks224(stack["fullname"], stack["email"]) + return p.cur.onOtherListElement556(stack["depth"]) } -func (c *current) onDocumentBlocks213(authors interface{}) (interface{}, error) { - return types.NewDocumentAuthors(authors.([]interface{})) +func (c *current) onOtherListElement550(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) callonDocumentBlocks213() (interface{}, error) { +func (p *parser) callonOtherListElement550() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks213(stack["authors"]) + return p.cur.onOtherListElement550(stack["depth"]) } -func (c *current) onDocumentBlocks267() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement558() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + } -func (p *parser) callonDocumentBlocks267() (interface{}, error) { +func (p *parser) callonOtherListElement558() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks267() + return p.cur.onOtherListElement558() } -func (c *current) onDocumentBlocks276() (interface{}, error) { +func (c *current) onOtherListElement560(prefix interface{}) (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks276() (interface{}, error) { +func (p *parser) callonOtherListElement560() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks276() + return p.cur.onOtherListElement560(stack["prefix"]) } -func (c *current) onDocumentBlocks279() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement541(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonDocumentBlocks279() (interface{}, error) { +func (p *parser) callonOtherListElement541() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks279() + return p.cur.onOtherListElement541(stack["prefix"]) } -func (c *current) onDocumentBlocks288() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement568() (interface{}, error) { + return strconv.Atoi(string(c.text)) } -func (p *parser) callonDocumentBlocks288() (interface{}, error) { +func (p *parser) callonOtherListElement568() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks288() + return p.cur.onOtherListElement568() } -func (c *current) onDocumentBlocks284(email interface{}) (interface{}, error) { - return email, nil +func (c *current) onOtherListElement572(ref interface{}) (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlocks284() (interface{}, error) { +func (p *parser) callonOtherListElement572() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks284(stack["email"]) + return p.cur.onOtherListElement572(stack["ref"]) } -func (c *current) onDocumentBlocks295() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement564(ref interface{}) (interface{}, error) { + return ref, nil + } -func (p *parser) callonDocumentBlocks295() (interface{}, error) { +func (p *parser) callonOtherListElement564() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks295() + return p.cur.onOtherListElement564(stack["ref"]) } -func (c *current) onDocumentBlocks302() (interface{}, error) { +func (c *current) onOtherListElement584() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlocks302() (interface{}, error) { +func (p *parser) callonOtherListElement584() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks302() + return p.cur.onOtherListElement584() } -func (c *current) onDocumentBlocks271(fullname, email interface{}) (interface{}, error) { - return types.NewDocumentAuthor(fullname, email) +func (c *current) onOtherListElement587(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) callonDocumentBlocks271() (interface{}, error) { +func (p *parser) callonOtherListElement587() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks271(stack["fullname"], stack["email"]) + return p.cur.onOtherListElement587(stack["separator"]) } -func (c *current) onDocumentBlocks262(author interface{}) (interface{}, error) { - return []types.DocumentAuthor{author.(types.DocumentAuthor)}, nil +func (c *current) onOtherListElement581(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlocks262() (interface{}, error) { +func (p *parser) callonOtherListElement581() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks262(stack["author"]) + return p.cur.onOtherListElement581(stack["separator"]) } -func (c *current) onDocumentBlocks315() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement594() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks315() (interface{}, error) { +func (p *parser) callonOtherListElement594() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks315() + return p.cur.onOtherListElement594() } -func (c *current) onDocumentBlocks325() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement577() (interface{}, error) { + return types.NewRawLine(string(c.text)) + } -func (p *parser) callonDocumentBlocks325() (interface{}, error) { +func (p *parser) callonOtherListElement577() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks325() + return p.cur.onOtherListElement577() } -func (c *current) onDocumentBlocks334() (interface{}, error) { +func (c *current) onOtherListElement600() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlocks334() (interface{}, error) { +func (p *parser) callonOtherListElement600() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks334() + return p.cur.onOtherListElement600() } -func (c *current) onDocumentBlocks317(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onOtherListElement603(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) callonDocumentBlocks317() (interface{}, error) { +func (p *parser) callonOtherListElement603() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks317(stack["content"]) + return p.cur.onOtherListElement603(stack["separator"]) } -func (c *current) onDocumentBlocks348() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement597(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlocks348() (interface{}, error) { +func (p *parser) callonOtherListElement597() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks348() + return p.cur.onOtherListElement597(stack["separator"]) } -func (c *current) onDocumentBlocks366() (interface{}, error) { +func (c *current) onOtherListElement616() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks366() (interface{}, error) { +func (p *parser) callonOtherListElement616() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks366() + return p.cur.onOtherListElement616() } -func (c *current) onDocumentBlocks382() (interface{}, error) { - - return string(c.text), nil - +func (c *current) onOtherListElement623() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks382() (interface{}, error) { +func (p *parser) callonOtherListElement623() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks382() + return p.cur.onOtherListElement623() } -func (c *current) onDocumentBlocks376(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onOtherListElement630() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDocumentBlocks376() (interface{}, error) { +func (p *parser) callonOtherListElement630() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks376(stack["content"]) + return p.cur.onOtherListElement630() } -func (c *current) onDocumentBlocks357(line interface{}) (interface{}, error) { - - return line, nil +func (c *current) onOtherListElement637() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks357() (interface{}, error) { +func (p *parser) callonOtherListElement637() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks357(stack["line"]) + return p.cur.onOtherListElement637() } -func (c *current) onDocumentBlocks396() (interface{}, error) { +func (c *current) onOtherListElement644() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks396() (interface{}, error) { +func (p *parser) callonOtherListElement644() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks396() + return p.cur.onOtherListElement644() } -func (c *current) onDocumentBlocks342(content interface{}) (interface{}, error) { - return types.NewCommentBlock(content.([]interface{}), nil) +func (c *current) onOtherListElement651() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks342() (interface{}, error) { +func (p *parser) callonOtherListElement651() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks342(stack["content"]) + return p.cur.onOtherListElement651() } -func (c *current) onDocumentBlocks412() (interface{}, error) { +func (c *current) onOtherListElement658() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks412() (interface{}, error) { +func (p *parser) callonOtherListElement658() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks412() + return p.cur.onOtherListElement658() } -func (c *current) onDocumentBlocks425() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement665() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks425() (interface{}, error) { +func (p *parser) callonOtherListElement665() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks425() + return p.cur.onOtherListElement665() } -func (c *current) onDocumentBlocks422() (interface{}, error) { +func (c *current) onOtherListElement672() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks422() (interface{}, error) { +func (p *parser) callonOtherListElement672() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks422() + return p.cur.onOtherListElement672() } -func (c *current) onDocumentBlocks433() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement679() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks433() (interface{}, error) { +func (p *parser) callonOtherListElement679() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks433() + return p.cur.onOtherListElement679() } -func (c *current) onDocumentBlocks440() (interface{}, error) { +func (c *current) onOtherListElement686() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks440() (interface{}, error) { +func (p *parser) callonOtherListElement686() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks440() + return p.cur.onOtherListElement686() } -func (c *current) onDocumentBlocks429() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement693() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks429() (interface{}, error) { +func (p *parser) callonOtherListElement693() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks429() + return p.cur.onOtherListElement693() } -func (c *current) onDocumentBlocks448() (interface{}, error) { +func (c *current) onOtherListElement700() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlocks448() (interface{}, error) { +func (p *parser) callonOtherListElement700() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks448() + return p.cur.onOtherListElement700() } -func (c *current) onDocumentBlocks455() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement707() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks455() (interface{}, error) { +func (p *parser) callonOtherListElement707() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks455() + return p.cur.onOtherListElement707() } -func (c *current) onDocumentBlocks418(revnumber, revdate, revremark interface{}) (interface{}, error) { - return types.NewDocumentRevision(revnumber, revdate, revremark) +func (c *current) onOtherListElement714() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDocumentBlocks418() (interface{}, error) { +func (p *parser) callonOtherListElement714() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks418(stack["revnumber"], stack["revdate"], stack["revremark"]) + return p.cur.onOtherListElement714() } -func (c *current) onDocumentBlocks461() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement721() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks461() (interface{}, error) { +func (p *parser) callonOtherListElement721() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks461() + return p.cur.onOtherListElement721() } -func (c *current) onDocumentBlocks468() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement605(delimiter interface{}) (interface{}, error) { + return delimiter, nil + } -func (p *parser) callonDocumentBlocks468() (interface{}, error) { +func (p *parser) callonOtherListElement605() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks468() + return p.cur.onOtherListElement605(stack["delimiter"]) } -func (c *current) onDocumentBlocks458(revdate, revremark interface{}) (interface{}, error) { - return types.NewDocumentRevision(nil, revdate, revremark) +func (c *current) onOtherListElement724() (interface{}, error) { + return strings.TrimSpace(string(c.text)), nil } -func (p *parser) callonDocumentBlocks458() (interface{}, error) { +func (p *parser) callonOtherListElement724() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks458(stack["revdate"], stack["revremark"]) + return p.cur.onOtherListElement724() } -func (c *current) onDocumentBlocks407(revision interface{}) (interface{}, error) { - return revision, nil +func (c *current) onOtherListElement732() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlocks407() (interface{}, error) { +func (p *parser) callonOtherListElement732() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks407(stack["revision"]) + return p.cur.onOtherListElement732() } -func (c *current) onDocumentBlocks9(title, id, authors, revision interface{}) (interface{}, error) { - return types.NewDocumentHeader(title.([]interface{}), authors, revision) +func (c *current) onOtherListElement464(content interface{}) (interface{}, error) { + // do not retain the EOL chars + return types.NewRawLine(content.(string)) + } -func (p *parser) callonDocumentBlocks9() (interface{}, error) { +func (p *parser) callonOtherListElement464() (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.onOtherListElement464(stack["content"]) } -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 +func (c *current) onOtherListElement430(content interface{}) (interface{}, error) { + if content == nil { + return nil, nil } - return []interface{}{}, nil + return types.NewParagraph(content) + } -func (p *parser) callonDocumentBlocks1() (interface{}, error) { +func (p *parser) callonOtherListElement430() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlocks1(stack["header"], stack["blocks"]) + return p.cur.onOtherListElement430(stack["content"]) } -func (c *current) onDocumentBlock9(attributes interface{}) error { - c.globalStore.pushAttributes(attributes) - return nil +func (c *current) onOtherListElement736() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDocumentBlock9() error { +func (p *parser) callonOtherListElement736() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock9(stack["attributes"]) + return p.cur.onOtherListElement736() } -func (c *current) onDocumentBlock15() (bool, error) { - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Literal), nil +func (c *current) onOtherListElement740() (interface{}, error) { + return types.NewRawLine(string(c.text)) } -func (p *parser) callonDocumentBlock15() (bool, error) { +func (p *parser) callonOtherListElement740() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock15() + return p.cur.onOtherListElement740() } -func (c *current) onDocumentBlock24() (interface{}, error) { - +func (c *current) onOtherListElement748() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonDocumentBlock24() (interface{}, error) { +func (p *parser) callonOtherListElement748() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock24() + return p.cur.onOtherListElement748() } -func (c *current) onDocumentBlock33() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onOtherListElement734(content interface{}) (interface{}, error) { + return types.NewParagraph(content) } -func (p *parser) callonDocumentBlock33() (interface{}, error) { +func (p *parser) callonOtherListElement734() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock33() + return p.cur.onOtherListElement734(stack["content"]) } -func (c *current) onDocumentBlock20(elements interface{}) (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement397(term, separator, description interface{}) (interface{}, error) { + return types.NewLabeledListElement(len(separator.(string))-1, term, description) + } -func (p *parser) callonDocumentBlock20() (interface{}, error) { +func (p *parser) callonOtherListElement397() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock20(stack["elements"]) + return p.cur.onOtherListElement397(stack["term"], stack["separator"], stack["description"]) } -func (c *current) onDocumentBlock17(content interface{}) (interface{}, error) { +func (c *current) onOtherListElement376(element interface{}) (interface{}, error) { + return element, nil - return types.NewRawLine(content.(string)) } -func (p *parser) callonDocumentBlock17() (interface{}, error) { +func (p *parser) callonOtherListElement376() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock17(stack["content"]) + return p.cur.onOtherListElement376(stack["element"]) } -func (c *current) onDocumentBlock60() (interface{}, error) { +func (c *current) onOtherListElement766() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlock60() (interface{}, error) { +func (p *parser) callonOtherListElement766() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock60() + return p.cur.onOtherListElement766() } -func (c *current) onDocumentBlock69() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onOtherListElement769(separator interface{}) (bool, error) { -func (p *parser) callonDocumentBlock69() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onDocumentBlock69() -} + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil -func (c *current) onDocumentBlock52(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) } -func (p *parser) callonDocumentBlock52() (interface{}, error) { +func (p *parser) callonOtherListElement769() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock52(stack["content"]) + return p.cur.onOtherListElement769(stack["separator"]) } -func (c *current) onDocumentBlock90() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement763(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlock90() (interface{}, error) { +func (p *parser) callonOtherListElement763() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock90() + return p.cur.onOtherListElement763(stack["separator"]) } -func (c *current) onDocumentBlock102() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement776() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock102() (interface{}, error) { +func (p *parser) callonOtherListElement776() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock102() + return p.cur.onOtherListElement776() } -func (c *current) onDocumentBlock114() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement759() (interface{}, error) { + return types.NewRawLine(string(c.text)) + } -func (p *parser) callonDocumentBlock114() (interface{}, error) { +func (p *parser) callonOtherListElement759() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock114() + return p.cur.onOtherListElement759() } -func (c *current) onDocumentBlock126() (interface{}, error) { +func (c *current) onOtherListElement783() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlock126() (interface{}, error) { +func (p *parser) callonOtherListElement783() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock126() + return p.cur.onOtherListElement783() } -func (c *current) onDocumentBlock138() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement786(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) callonDocumentBlock138() (interface{}, error) { +func (p *parser) callonOtherListElement786() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock138() + return p.cur.onOtherListElement786(stack["separator"]) } -func (c *current) onDocumentBlock150() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement780(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlock150() (interface{}, error) { +func (p *parser) callonOtherListElement780() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock150() + return p.cur.onOtherListElement780(stack["separator"]) } -func (c *current) onDocumentBlock162() (interface{}, error) { +func (c *current) onOtherListElement794() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock162() (interface{}, error) { +func (p *parser) callonOtherListElement794() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock162() + return p.cur.onOtherListElement794() } -func (c *current) onDocumentBlock170() (interface{}, error) { - - return string(c.text), nil +func (c *current) onOtherListElement801() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock170() (interface{}, error) { +func (p *parser) callonOtherListElement801() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock170() + return p.cur.onOtherListElement801() } -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) onOtherListElement812() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDocumentBlock178() (bool, error) { +func (p *parser) callonOtherListElement812() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock178(stack["content"]) + return p.cur.onOtherListElement812() } -func (c *current) onDocumentBlock77(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) - +func (c *current) onOtherListElement819() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock77() (interface{}, error) { +func (p *parser) callonOtherListElement819() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock77(stack["content"]) + return p.cur.onOtherListElement819() } -func (c *current) onDocumentBlock13(firstLine, otherLines interface{}) (interface{}, error) { - - return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...), c.globalStore.getAttributes()) +func (c *current) onOtherListElement804() (interface{}, error) { + return types.NewBlankLine() } -func (p *parser) callonDocumentBlock13() (interface{}, error) { +func (p *parser) callonOtherListElement804() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock13(stack["firstLine"], stack["otherLines"]) + return p.cur.onOtherListElement804() } -func (c *current) onDocumentBlock187() (interface{}, error) { +func (c *current) onOtherListElement834() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock187() (interface{}, error) { +func (p *parser) callonOtherListElement834() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock187() + return p.cur.onOtherListElement834() } -func (c *current) onDocumentBlock179() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onOtherListElement841() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock179() (interface{}, error) { +func (p *parser) callonOtherListElement841() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock179() + return p.cur.onOtherListElement841() } -func (c *current) onDocumentBlock197() (interface{}, error) { - - // `=` is level 0, etc. - return (len(c.text) - 1), nil +func (c *current) onOtherListElement826() (interface{}, error) { + return types.NewBlankLine() } -func (p *parser) callonDocumentBlock197() (interface{}, error) { +func (p *parser) callonOtherListElement826() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock197() + return p.cur.onOtherListElement826() } -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) onOtherListElement849() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDocumentBlock200() (bool, error) { +func (p *parser) callonOtherListElement849() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock200(stack["level"]) + return p.cur.onOtherListElement849() } -func (c *current) onDocumentBlock204() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement854() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock204() (interface{}, error) { +func (p *parser) callonOtherListElement854() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock204() + return p.cur.onOtherListElement854() } -func (c *current) onDocumentBlock220() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ +func (c *current) onOtherListElement862() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock220() (interface{}, error) { +func (p *parser) callonOtherListElement862() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock220() + return p.cur.onOtherListElement862() } -func (c *current) onDocumentBlock227() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement869() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + } -func (p *parser) callonDocumentBlock227() (interface{}, error) { +func (p *parser) callonOtherListElement869() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock227() + return p.cur.onOtherListElement869() } -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) onOtherListElement872(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil + } -func (p *parser) callonDocumentBlock216() (interface{}, error) { +func (p *parser) callonOtherListElement872() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock216(stack["id"]) + return p.cur.onOtherListElement872(stack["depth"]) } -func (c *current) onDocumentBlock232() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onOtherListElement866(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) callonDocumentBlock232() (interface{}, error) { +func (p *parser) callonOtherListElement866() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock232() + return p.cur.onOtherListElement866(stack["depth"]) } -func (c *current) onDocumentBlock241() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onOtherListElement873() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) } -func (p *parser) callonDocumentBlock241() (interface{}, error) { +func (p *parser) callonOtherListElement873() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock241() + return p.cur.onOtherListElement873() } -func (c *current) onDocumentBlock254() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement878() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + } -func (p *parser) callonDocumentBlock254() (interface{}, error) { +func (p *parser) callonOtherListElement878() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock254() + return p.cur.onOtherListElement878() } -func (c *current) onDocumentBlock260() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement882() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + } -func (p *parser) callonDocumentBlock260() (interface{}, error) { +func (p *parser) callonOtherListElement882() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock260() + return p.cur.onOtherListElement882() } -func (c *current) onDocumentBlock250() (interface{}, error) { - return types.NewLineBreak() +func (c *current) onOtherListElement886() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + } -func (p *parser) callonDocumentBlock250() (interface{}, error) { +func (p *parser) callonOtherListElement886() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock250() + return p.cur.onOtherListElement886() } -func (c *current) onDocumentBlock271() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement891() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + } -func (p *parser) callonDocumentBlock271() (interface{}, error) { +func (p *parser) callonOtherListElement891() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock271() + return p.cur.onOtherListElement891() } -func (c *current) onDocumentBlock277() (interface{}, error) { +func (c *current) onOtherListElement896(prefix interface{}) (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock277() (interface{}, error) { +func (p *parser) callonOtherListElement896() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock277() + return p.cur.onOtherListElement896(stack["prefix"]) } -func (c *current) onDocumentBlock273(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onOtherListElement857(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonDocumentBlock273() (interface{}, error) { +func (p *parser) callonOtherListElement857() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock273(stack["ref"]) + return p.cur.onOtherListElement857(stack["prefix"]) } -func (c *current) onDocumentBlock281() (interface{}, error) { +func (c *current) onOtherListElement905() (interface{}, error) { + return string(c.text), nil - return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock281() (interface{}, error) { +func (p *parser) callonOtherListElement905() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock281() + return p.cur.onOtherListElement905() } -func (c *current) onDocumentBlock229(element interface{}) (interface{}, error) { - return element, nil -} +func (c *current) onOtherListElement912() (interface{}, error) { -func (p *parser) callonDocumentBlock229() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onDocumentBlock229(stack["element"]) -} + // `*` is 1, etc. + return (len(c.text)), nil -func (c *current) onDocumentBlock207(elements interface{}) (interface{}, error) { - // absorbs heading and trailing spaces - return types.NewInlineElements(elements.([]interface{})) } -func (p *parser) callonDocumentBlock207() (interface{}, error) { +func (p *parser) callonOtherListElement912() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock207(stack["elements"]) + return p.cur.onOtherListElement912() } -func (c *current) onDocumentBlock289() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil -} +func (c *current) onOtherListElement915(depth interface{}) (bool, error) { -func (p *parser) callonDocumentBlock289() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onDocumentBlock289() -} + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil -func (c *current) onDocumentBlock296() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonDocumentBlock296() (interface{}, error) { +func (p *parser) callonOtherListElement915() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock296() + return p.cur.onOtherListElement915(stack["depth"]) } -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) onOtherListElement909(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) callonDocumentBlock285() (interface{}, error) { +func (p *parser) callonOtherListElement909() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock285(stack["id"]) + return p.cur.onOtherListElement909(stack["depth"]) } -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) onOtherListElement917() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) + } -func (p *parser) callonDocumentBlock194() (interface{}, error) { +func (p *parser) callonOtherListElement917() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock194(stack["level"], stack["title"], stack["id"]) + return p.cur.onOtherListElement917() } -func (c *current) onDocumentBlock313() (interface{}, error) { +func (c *current) onOtherListElement919(prefix interface{}) (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock313() (interface{}, error) { +func (p *parser) callonOtherListElement919() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock313() + return p.cur.onOtherListElement919(stack["prefix"]) } -func (c *current) onDocumentBlock322() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement900(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonDocumentBlock322() (interface{}, error) { +func (p *parser) callonOtherListElement900() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock322() + return p.cur.onOtherListElement900(stack["prefix"]) } -func (c *current) onDocumentBlock305(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onOtherListElement927() (interface{}, error) { + return strconv.Atoi(string(c.text)) } -func (p *parser) callonDocumentBlock305() (interface{}, error) { +func (p *parser) callonOtherListElement927() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock305(stack["content"]) + return p.cur.onOtherListElement927() } -func (c *current) onDocumentBlock331() (interface{}, error) { - return types.NewThematicBreak() +func (c *current) onOtherListElement931(ref interface{}) (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlock331() (interface{}, error) { +func (p *parser) callonOtherListElement931() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock331() + return p.cur.onOtherListElement931(stack["ref"]) } -func (c *current) onDocumentBlock351() (bool, error) { - attrs := c.globalStore.getAttributes() - return types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Literal), nil +func (c *current) onOtherListElement923(ref interface{}) (interface{}, error) { + return ref, nil } -func (p *parser) callonDocumentBlock351() (bool, error) { +func (p *parser) callonOtherListElement923() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock351() + return p.cur.onOtherListElement923(stack["ref"]) } -func (c *current) onDocumentBlock365() (interface{}, error) { +func (c *current) onOtherListElement943() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlock365() (interface{}, error) { +func (p *parser) callonOtherListElement943() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock365() + return p.cur.onOtherListElement943() } -func (c *current) onDocumentBlock357() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onOtherListElement946(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) callonDocumentBlock357() (interface{}, error) { +func (p *parser) callonOtherListElement946() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock357() + return p.cur.onOtherListElement946(stack["separator"]) } -func (c *current) onDocumentBlock373() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onOtherListElement940(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlock373() (interface{}, error) { +func (p *parser) callonOtherListElement940() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock373() + return p.cur.onOtherListElement940(stack["separator"]) } -func (c *current) onDocumentBlock354(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onOtherListElement953() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock354() (interface{}, error) { +func (p *parser) callonOtherListElement953() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock354(stack["content"]) + return p.cur.onOtherListElement953() } -func (c *current) onDocumentBlock349(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithAttribute, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onOtherListElement936() (interface{}, error) { + return types.NewRawLine(string(c.text)) } -func (p *parser) callonDocumentBlock349() (interface{}, error) { +func (p *parser) callonOtherListElement936() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock349(stack["lines"]) + return p.cur.onOtherListElement936() } -func (c *current) onDocumentBlock394() (interface{}, error) { +func (c *current) onOtherListElement959() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlock394() (interface{}, error) { +func (p *parser) callonOtherListElement959() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock394() + return p.cur.onOtherListElement959() } -func (c *current) onDocumentBlock389() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onOtherListElement962(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) callonDocumentBlock389() (interface{}, error) { +func (p *parser) callonOtherListElement962() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock389() + return p.cur.onOtherListElement962(stack["separator"]) } -func (c *current) onDocumentBlock386(line interface{}) (interface{}, error) { - // do not include the trailing 'EOL' on the first line - return line, nil +func (c *current) onOtherListElement956(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlock386() (interface{}, error) { +func (p *parser) callonOtherListElement956() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock386(stack["line"]) + return p.cur.onOtherListElement956(stack["separator"]) } -func (c *current) onDocumentBlock416() (interface{}, error) { +func (c *current) onOtherListElement975() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock416() (interface{}, error) { +func (p *parser) callonOtherListElement975() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock416() + return p.cur.onOtherListElement975() } -func (c *current) onDocumentBlock408() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onOtherListElement982() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock408() (interface{}, error) { +func (p *parser) callonOtherListElement982() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock408() + return p.cur.onOtherListElement982() } -func (c *current) onDocumentBlock424() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onOtherListElement989() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlock424() (interface{}, error) { +func (p *parser) callonOtherListElement989() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock424() + return p.cur.onOtherListElement989() } -func (c *current) onDocumentBlock405(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onOtherListElement996() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock405() (interface{}, error) { +func (p *parser) callonOtherListElement996() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock405(stack["content"]) + return p.cur.onOtherListElement996() } -func (c *current) onDocumentBlock383(firstLine, otherLines interface{}) (interface{}, error) { +func (c *current) onOtherListElement1003() (interface{}, error) { + return string(c.text), nil - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil } -func (p *parser) callonDocumentBlock383() (interface{}, error) { +func (p *parser) callonOtherListElement1003() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock383(stack["firstLine"], stack["otherLines"]) + return p.cur.onOtherListElement1003() } -func (c *current) onDocumentBlock381(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithSpacesOnFirstLine, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onOtherListElement1010() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock381() (interface{}, error) { +func (p *parser) callonOtherListElement1010() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock381(stack["lines"]) + return p.cur.onOtherListElement1010() } -func (c *current) onDocumentBlock438() (interface{}, error) { +func (c *current) onOtherListElement1017() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock438() (interface{}, error) { +func (p *parser) callonOtherListElement1017() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock438() + return p.cur.onOtherListElement1017() } -func (c *current) onDocumentBlock450() (interface{}, error) { - return types.NewRawLine(string(c.text)) - +func (c *current) onOtherListElement1024() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock450() (interface{}, error) { +func (p *parser) callonOtherListElement1024() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock450() + return p.cur.onOtherListElement1024() } -func (c *current) onDocumentBlock447(line interface{}) (interface{}, error) { +func (c *current) onOtherListElement1031() (interface{}, error) { + return string(c.text), nil - return line, nil // do not include the trailing 'EOL' } -func (p *parser) callonDocumentBlock447() (interface{}, error) { +func (p *parser) callonOtherListElement1031() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock447(stack["line"]) + return p.cur.onOtherListElement1031() } -func (c *current) onDocumentBlock444(lines interface{}) (interface{}, error) { - return lines.([]interface{}), nil +func (c *current) onOtherListElement1038() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock444() (interface{}, error) { +func (p *parser) callonOtherListElement1038() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock444(stack["lines"]) + return p.cur.onOtherListElement1038() } -func (c *current) onDocumentBlock467() (interface{}, error) { +func (c *current) onOtherListElement1045() (interface{}, error) { return string(c.text), nil -} - -func (p *parser) callonDocumentBlock467() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onDocumentBlock467() -} -func (c *current) onDocumentBlock432(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithDelimiter, lines.([]interface{}), c.globalStore.getAttributes()) } -func (p *parser) callonDocumentBlock432() (interface{}, error) { +func (p *parser) callonOtherListElement1045() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock432(stack["lines"]) + return p.cur.onOtherListElement1045() } -func (c *current) onDocumentBlock480() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1052() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock480() (interface{}, error) { +func (p *parser) callonOtherListElement1052() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock480() + return p.cur.onOtherListElement1052() } -func (c *current) onDocumentBlock493() (interface{}, error) { +func (c *current) onOtherListElement1059() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock493() (interface{}, error) { +func (p *parser) callonOtherListElement1059() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock493() + return p.cur.onOtherListElement1059() } -func (c *current) onDocumentBlock498() (interface{}, error) { +func (c *current) onOtherListElement1066() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonDocumentBlock498() (interface{}, error) { +func (p *parser) callonOtherListElement1066() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock498() + return p.cur.onOtherListElement1066() } -func (c *current) onDocumentBlock505() (interface{}, error) { +func (c *current) onOtherListElement1073() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock505() (interface{}, error) { +func (p *parser) callonOtherListElement1073() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock505() + return p.cur.onOtherListElement1073() } -func (c *current) onDocumentBlock517() (interface{}, error) { - return string(c.text), nil - +func (c *current) onOtherListElement1080() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock517() (interface{}, error) { +func (p *parser) callonOtherListElement1080() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock517() + return p.cur.onOtherListElement1080() } -func (c *current) onDocumentBlock519() (interface{}, error) { - - return strconv.Atoi(string(c.text)) +func (c *current) onOtherListElement964(delimiter interface{}) (interface{}, error) { + return delimiter, nil } -func (p *parser) callonDocumentBlock519() (interface{}, error) { +func (p *parser) callonOtherListElement964() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock519() + return p.cur.onOtherListElement964(stack["delimiter"]) } -func (c *current) onDocumentBlock512(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onOtherListElement1083() (interface{}, error) { + return strings.TrimSpace(string(c.text)), nil } -func (p *parser) callonDocumentBlock512() (interface{}, error) { +func (p *parser) callonOtherListElement1083() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock512(stack["start"]) + return p.cur.onOtherListElement1083() } -func (c *current) onDocumentBlock501(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), false, start) +func (c *current) onOtherListElement1091() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock501() (interface{}, error) { +func (p *parser) callonOtherListElement1091() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock501(stack["name"], stack["start"]) + return p.cur.onOtherListElement1091() } -func (c *current) onDocumentBlock527() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement823(content interface{}) (interface{}, error) { + // do not retain the EOL chars + return types.NewRawLine(content.(string)) + } -func (p *parser) callonDocumentBlock527() (interface{}, error) { +func (p *parser) callonOtherListElement823() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock527() + return p.cur.onOtherListElement823(stack["content"]) } -func (c *current) onDocumentBlock539() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement789(content interface{}) (interface{}, error) { + if content == nil { + return nil, nil + } + return types.NewParagraph(content) } -func (p *parser) callonDocumentBlock539() (interface{}, error) { +func (p *parser) callonOtherListElement789() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock539() + return p.cur.onOtherListElement789(stack["content"]) } -func (c *current) onDocumentBlock541() (interface{}, error) { - - return strconv.Atoi(string(c.text)) +func (c *current) onOtherListElement1095() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDocumentBlock541() (interface{}, error) { +func (p *parser) callonOtherListElement1095() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock541() + return p.cur.onOtherListElement1095() } -func (c *current) onDocumentBlock534(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onOtherListElement1099() (interface{}, error) { + return types.NewRawLine(string(c.text)) } -func (p *parser) callonDocumentBlock534() (interface{}, error) { +func (p *parser) callonOtherListElement1099() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock534(stack["start"]) + return p.cur.onOtherListElement1099() } -func (c *current) onDocumentBlock523(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), true, nil) +func (c *current) onOtherListElement1107() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock523() (interface{}, error) { +func (p *parser) callonOtherListElement1107() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock523(stack["name"], stack["start"]) + return p.cur.onOtherListElement1107() } -func (c *current) onDocumentBlock549() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1093(content interface{}) (interface{}, error) { + return types.NewParagraph(content) + } -func (p *parser) callonDocumentBlock549() (interface{}, error) { +func (p *parser) callonOtherListElement1093() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock549() + return p.cur.onOtherListElement1093(stack["content"]) } -func (c *current) onDocumentBlock545(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onOtherListElement756(term, separator, description interface{}) (interface{}, error) { + return types.NewLabeledListElement(len(separator.(string))-1, term, description) + } -func (p *parser) callonDocumentBlock545() (interface{}, error) { +func (p *parser) callonOtherListElement756() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock545(stack["name"]) + return p.cur.onOtherListElement756(stack["term"], stack["separator"], stack["description"]) } -func (c *current) onDocumentBlock555() (interface{}, error) { - // standalone '{' - return types.NewStringElement(string(c.text)) +func (c *current) onOtherListElement750(attributes, element interface{}) (interface{}, error) { + return append(attributes.([]interface{}), element), nil } -func (p *parser) callonDocumentBlock555() (interface{}, error) { +func (p *parser) callonOtherListElement750() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock555() + return p.cur.onOtherListElement750(stack["attributes"], stack["element"]) } -func (c *current) onDocumentBlock488(elements interface{}) (interface{}, error) { - return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil +func (c *current) onOtherListElement1115() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlock488() (interface{}, error) { +func (p *parser) callonOtherListElement1115() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock488(stack["elements"]) + return p.cur.onOtherListElement1115() } -func (c *current) onDocumentBlock476(name, value interface{}) (interface{}, error) { - return types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) +func (c *current) onOtherListElement1123() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock476() (interface{}, error) { +func (p *parser) callonOtherListElement1123() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock476(stack["name"], stack["value"]) + return p.cur.onOtherListElement1123() } -func (c *current) onDocumentBlock566() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1109(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + } -func (p *parser) callonDocumentBlock566() (interface{}, error) { +func (p *parser) callonOtherListElement1109() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock566() + return p.cur.onOtherListElement1109(stack["content"]) } -func (c *current) onDocumentBlock575() (interface{}, error) { +func (c *current) onOtherListElement1138() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock575() (interface{}, error) { +func (p *parser) callonOtherListElement1138() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock575() + return p.cur.onOtherListElement1138() } -func (c *current) onDocumentBlock562(name interface{}) (interface{}, error) { - return types.NewAttributeReset(name.(string)) +func (c *current) onOtherListElement1145() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock562() (interface{}, error) { +func (p *parser) callonOtherListElement1145() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock562(stack["name"]) + return p.cur.onOtherListElement1145() } -func (c *current) onDocumentBlock586() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1130() (interface{}, error) { + return types.NewBlankLine() + } -func (p *parser) callonDocumentBlock586() (interface{}, error) { +func (p *parser) callonOtherListElement1130() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock586() + return p.cur.onOtherListElement1130() } -func (c *current) onDocumentBlock595() (interface{}, error) { +func (c *current) onOtherListElement1153() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock595() (interface{}, error) { +func (p *parser) callonOtherListElement1153() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock595() + return p.cur.onOtherListElement1153() } -func (c *current) onDocumentBlock582(name interface{}) (interface{}, error) { - return types.NewAttributeReset(name.(string)) +func (c *current) onOtherListElement1158() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock582() (interface{}, error) { +func (p *parser) callonOtherListElement1158() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock582(stack["name"]) + return p.cur.onOtherListElement1158() } -func (c *current) onDocumentBlock614() (interface{}, error) { - return types.Tip, nil +func (c *current) onOtherListElement1166() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlock614() (interface{}, error) { +func (p *parser) callonOtherListElement1166() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock614() + return p.cur.onOtherListElement1166() } -func (c *current) onDocumentBlock616() (interface{}, error) { - return types.Note, nil +func (c *current) onOtherListElement1173() (interface{}, error) { + + // `.` is 1, etc. + return (len(c.text)), nil + } -func (p *parser) callonDocumentBlock616() (interface{}, error) { +func (p *parser) callonOtherListElement1173() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock616() + return p.cur.onOtherListElement1173() } -func (c *current) onDocumentBlock618() (interface{}, error) { - return types.Important, nil +func (c *current) onOtherListElement1176(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil + } -func (p *parser) callonDocumentBlock618() (interface{}, error) { +func (p *parser) callonOtherListElement1176() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock618() + return p.cur.onOtherListElement1176(stack["depth"]) } -func (c *current) onDocumentBlock620() (interface{}, error) { - return types.Warning, nil +func (c *current) onOtherListElement1170(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) callonDocumentBlock620() (interface{}, error) { +func (p *parser) callonOtherListElement1170() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock620() + return p.cur.onOtherListElement1170(stack["depth"]) } -func (c *current) onDocumentBlock622() (interface{}, error) { - return types.Caution, nil +func (c *current) onOtherListElement1177() (interface{}, error) { + // numbering style: "1.", etc. + return types.NewOrderedListElementPrefix(types.Arabic) + } -func (p *parser) callonDocumentBlock622() (interface{}, error) { +func (p *parser) callonOtherListElement1177() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock622() + return p.cur.onOtherListElement1177() } -func (c *current) onDocumentBlock636() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1182() (interface{}, error) { + // numbering style: "a.", etc. + return types.NewOrderedListElementPrefix(types.LowerAlpha) + } -func (p *parser) callonDocumentBlock636() (interface{}, error) { +func (p *parser) callonOtherListElement1182() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock636() + return p.cur.onOtherListElement1182() } -func (c *current) onDocumentBlock645() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1186() (interface{}, error) { + // numbering style: "A.", etc. + return types.NewOrderedListElementPrefix(types.UpperAlpha) + } -func (p *parser) callonDocumentBlock645() (interface{}, error) { +func (p *parser) callonOtherListElement1186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock645() + return p.cur.onOtherListElement1186() } -func (c *current) onDocumentBlock628(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onOtherListElement1190() (interface{}, error) { + // numbering style: "i)", etc. + return types.NewOrderedListElementPrefix(types.LowerRoman) + } -func (p *parser) callonDocumentBlock628() (interface{}, error) { +func (p *parser) callonOtherListElement1190() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock628(stack["content"]) + return p.cur.onOtherListElement1190() } -func (c *current) onDocumentBlock666() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1195() (interface{}, error) { + // numbering style: "I)", etc. + return types.NewOrderedListElementPrefix(types.UpperRoman) + } -func (p *parser) callonDocumentBlock666() (interface{}, error) { +func (p *parser) callonOtherListElement1195() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock666() + return p.cur.onOtherListElement1195() } -func (c *current) onDocumentBlock678() (interface{}, error) { +func (c *current) onOtherListElement1200(prefix interface{}) (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock678() (interface{}, error) { +func (p *parser) callonOtherListElement1200() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock678() + return p.cur.onOtherListElement1200(stack["prefix"]) } -func (c *current) onDocumentBlock690() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1161(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonDocumentBlock690() (interface{}, error) { +func (p *parser) callonOtherListElement1161() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock690() + return p.cur.onOtherListElement1161(stack["prefix"]) } -func (c *current) onDocumentBlock702() (interface{}, error) { +func (c *current) onOtherListElement1209() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock702() (interface{}, error) { +func (p *parser) callonOtherListElement1209() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock702() + return p.cur.onOtherListElement1209() } -func (c *current) onDocumentBlock714() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1216() (interface{}, error) { + + // `*` is 1, etc. + return (len(c.text)), nil + } -func (p *parser) callonDocumentBlock714() (interface{}, error) { +func (p *parser) callonOtherListElement1216() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock714() + return p.cur.onOtherListElement1216() } -func (c *current) onDocumentBlock726() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1219(depth interface{}) (bool, error) { + + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + } -func (p *parser) callonDocumentBlock726() (interface{}, error) { +func (p *parser) callonOtherListElement1219() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock726() + return p.cur.onOtherListElement1219(stack["depth"]) } -func (c *current) onDocumentBlock738() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1213(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) callonDocumentBlock738() (interface{}, error) { +func (p *parser) callonOtherListElement1213() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock738() + return p.cur.onOtherListElement1213(stack["depth"]) } -func (c *current) onDocumentBlock746() (interface{}, error) { +func (c *current) onOtherListElement1221() (interface{}, error) { + return types.NewUnorderedListElementPrefix(types.Dash) - return string(c.text), nil } -func (p *parser) callonDocumentBlock746() (interface{}, error) { +func (p *parser) callonOtherListElement1221() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock746() + return p.cur.onOtherListElement1221() } -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) onOtherListElement1223(prefix interface{}) (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDocumentBlock754() (bool, error) { +func (p *parser) callonOtherListElement1223() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock754(stack["content"]) + return p.cur.onOtherListElement1223(stack["prefix"]) } -func (c *current) onDocumentBlock653(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) - +func (c *current) onOtherListElement1204(prefix interface{}) (interface{}, error) { + return prefix, nil } -func (p *parser) callonDocumentBlock653() (interface{}, error) { +func (p *parser) callonOtherListElement1204() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock653(stack["content"]) + return p.cur.onOtherListElement1204(stack["prefix"]) } -func (c *current) onDocumentBlock610(t, lines interface{}) (interface{}, error) { - - return types.NewAdmonitionParagraph(lines.([]interface{}), t.(string), c.globalStore.getAttributes()) - +func (c *current) onOtherListElement1231() (interface{}, error) { + return strconv.Atoi(string(c.text)) } -func (p *parser) callonDocumentBlock610() (interface{}, error) { +func (p *parser) callonOtherListElement1231() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock610(stack["t"], stack["lines"]) + return p.cur.onOtherListElement1231() } -func (c *current) onDocumentBlock771() (interface{}, error) { +func (c *current) onOtherListElement1235(ref interface{}) (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock771() (interface{}, error) { +func (p *parser) callonOtherListElement1235() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock771() + return p.cur.onOtherListElement1235(stack["ref"]) } -func (c *current) onDocumentBlock763() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onOtherListElement1227(ref interface{}) (interface{}, error) { + return ref, nil + } -func (p *parser) callonDocumentBlock763() (interface{}, error) { +func (p *parser) callonOtherListElement1227() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock763() + return p.cur.onOtherListElement1227(stack["ref"]) } -func (c *current) onDocumentBlock787() (interface{}, error) { +func (c *current) onOtherListElement1247() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonDocumentBlock787() (interface{}, error) { +func (p *parser) callonOtherListElement1247() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock787() + return p.cur.onOtherListElement1247() } -func (c *current) onDocumentBlock781(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onOtherListElement1250(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) callonDocumentBlock781() (interface{}, error) { +func (p *parser) callonOtherListElement1250() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock781(stack["content"]) + return p.cur.onOtherListElement1250(stack["separator"]) } -func (c *current) onDocumentBlock760(content interface{}) (interface{}, error) { +func (c *current) onOtherListElement1244(separator interface{}) (interface{}, error) { + return separator, nil - return content, nil } -func (p *parser) callonDocumentBlock760() (interface{}, error) { +func (p *parser) callonOtherListElement1244() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock760(stack["content"]) + return p.cur.onOtherListElement1244(stack["separator"]) } -func (c *current) onDocumentBlock755(content interface{}) (interface{}, error) { - return types.NewMarkdownQuoteBlock(content.([]interface{}), c.globalStore.getAttributes()) - +func (c *current) onOtherListElement1257() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock755() (interface{}, error) { +func (p *parser) callonOtherListElement1257() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock755(stack["content"]) + return p.cur.onOtherListElement1257() } -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) onOtherListElement1240() (interface{}, error) { + return types.NewRawLine(string(c.text)) } -func (p *parser) callonDocumentBlock797() (bool, error) { +func (p *parser) callonOtherListElement1240() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock797() + return p.cur.onOtherListElement1240() } -func (c *current) onDocumentBlock813() (interface{}, error) { +func (c *current) onOtherListElement1263() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDocumentBlock813() (interface{}, error) { +func (p *parser) callonOtherListElement1263() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock813() + return p.cur.onOtherListElement1263() } -func (c *current) onDocumentBlock825() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onOtherListElement1266(separator interface{}) (bool, error) { -func (p *parser) callonDocumentBlock825() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onDocumentBlock825() -} + // use a predicate to make sure that separator is `::`, `:::` or `::::` + return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil -func (c *current) onDocumentBlock837() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonDocumentBlock837() (interface{}, error) { +func (p *parser) callonOtherListElement1266() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock837() + return p.cur.onOtherListElement1266(stack["separator"]) } -func (c *current) onDocumentBlock849() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1260(separator interface{}) (interface{}, error) { + return separator, nil + } -func (p *parser) callonDocumentBlock849() (interface{}, error) { +func (p *parser) callonOtherListElement1260() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock849() + return p.cur.onOtherListElement1260(stack["separator"]) } -func (c *current) onDocumentBlock861() (interface{}, error) { +func (c *current) onOtherListElement1279() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock861() (interface{}, error) { +func (p *parser) callonOtherListElement1279() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock861() + return p.cur.onOtherListElement1279() } -func (c *current) onDocumentBlock873() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1286() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock873() (interface{}, error) { +func (p *parser) callonOtherListElement1286() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock873() + return p.cur.onOtherListElement1286() } -func (c *current) onDocumentBlock885() (interface{}, error) { +func (c *current) onOtherListElement1293() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock885() (interface{}, error) { +func (p *parser) callonOtherListElement1293() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock885() + return p.cur.onOtherListElement1293() } -func (c *current) onDocumentBlock893() (interface{}, error) { - - return string(c.text), nil +func (c *current) onOtherListElement1300() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock893() (interface{}, error) { +func (p *parser) callonOtherListElement1300() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock893() + return p.cur.onOtherListElement1300() } -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) onOtherListElement1307() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDocumentBlock901() (bool, error) { +func (p *parser) callonOtherListElement1307() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock901(stack["content"]) + return p.cur.onOtherListElement1307() } -func (c *current) onDocumentBlock800(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) - +func (c *current) onOtherListElement1314() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock800() (interface{}, error) { +func (p *parser) callonOtherListElement1314() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock800(stack["content"]) + return p.cur.onOtherListElement1314() } -func (c *current) onDocumentBlock795(content interface{}) (interface{}, error) { - - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onOtherListElement1321() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDocumentBlock795() (interface{}, error) { +func (p *parser) callonOtherListElement1321() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock795(stack["content"]) + return p.cur.onOtherListElement1321() } -func (c *current) onDocumentBlock914() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1328() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock914() (interface{}, error) { +func (p *parser) callonOtherListElement1328() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock914() + return p.cur.onOtherListElement1328() } -func (c *current) onDocumentBlock923() (interface{}, error) { +func (c *current) onOtherListElement1335() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock923() (interface{}, error) { +func (p *parser) callonOtherListElement1335() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock923() + return p.cur.onOtherListElement1335() } -func (c *current) onDocumentBlock906(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onOtherListElement1342() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock906() (interface{}, error) { +func (p *parser) callonOtherListElement1342() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock906(stack["content"]) + return p.cur.onOtherListElement1342() } -func (c *current) onDocumentBlock944() (interface{}, error) { +func (c *current) onOtherListElement1349() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock944() (interface{}, error) { +func (p *parser) callonOtherListElement1349() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock944() + return p.cur.onOtherListElement1349() } -func (c *current) onDocumentBlock956() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1356() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock956() (interface{}, error) { +func (p *parser) callonOtherListElement1356() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock956() + return p.cur.onOtherListElement1356() } -func (c *current) onDocumentBlock968() (interface{}, error) { +func (c *current) onOtherListElement1363() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock968() (interface{}, error) { +func (p *parser) callonOtherListElement1363() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock968() + return p.cur.onOtherListElement1363() } -func (c *current) onDocumentBlock980() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1370() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock980() (interface{}, error) { +func (p *parser) callonOtherListElement1370() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock980() + return p.cur.onOtherListElement1370() } -func (c *current) onDocumentBlock992() (interface{}, error) { +func (c *current) onOtherListElement1377() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDocumentBlock992() (interface{}, error) { +func (p *parser) callonOtherListElement1377() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock992() + return p.cur.onOtherListElement1377() } -func (c *current) onDocumentBlock1004() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1384() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock1004() (interface{}, error) { +func (p *parser) callonOtherListElement1384() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock1004() + return p.cur.onOtherListElement1384() } -func (c *current) onDocumentBlock1016() (interface{}, error) { - return string(c.text), nil +func (c *current) onOtherListElement1268(delimiter interface{}) (interface{}, error) { + return delimiter, nil + } -func (p *parser) callonDocumentBlock1016() (interface{}, error) { +func (p *parser) callonOtherListElement1268() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock1016() + return p.cur.onOtherListElement1268(stack["delimiter"]) } -func (c *current) onDocumentBlock1024() (interface{}, error) { +func (c *current) onOtherListElement1387() (interface{}, error) { + return strings.TrimSpace(string(c.text)), nil - return string(c.text), nil } -func (p *parser) callonDocumentBlock1024() (interface{}, error) { +func (p *parser) callonOtherListElement1387() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock1024() + return p.cur.onOtherListElement1387() } -func (c *current) onDocumentBlock1032(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) onOtherListElement1395() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDocumentBlock1032() (bool, error) { +func (p *parser) callonOtherListElement1395() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock1032(stack["content"]) + return p.cur.onOtherListElement1395() } -func (c *current) onDocumentBlock931(content interface{}) (interface{}, error) { +func (c *current) onOtherListElement1127(content interface{}) (interface{}, error) { + // do not retain the EOL chars return types.NewRawLine(content.(string)) } -func (p *parser) callonDocumentBlock931() (interface{}, error) { +func (p *parser) callonOtherListElement1127() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock931(stack["content"]) + return p.cur.onOtherListElement1127(stack["content"]) } -func (c *current) onDocumentBlock902(lines interface{}) (interface{}, error) { - - return types.NewParagraph(lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onOtherListElement1125(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonDocumentBlock902() (interface{}, error) { +func (p *parser) callonOtherListElement1125() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock902(stack["lines"]) + return p.cur.onOtherListElement1125(stack["element"]) } -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) onOtherListElement1(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonDocumentBlock1033() (interface{}, error) { +func (p *parser) callonOtherListElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock1033() + return p.cur.onOtherListElement1(stack["element"]) } -func (c *current) onDocumentBlock1(attributes, block interface{}) (interface{}, error) { - c.globalStore.discardAttributes() - return block, nil +func (c *current) onListElementContinuation9() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDocumentBlock1() (interface{}, error) { +func (p *parser) callonListElementContinuation9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentBlock1(stack["attributes"], stack["block"]) + return p.cur.onListElementContinuation9() } -func (c *current) onBlockAttributes16() (interface{}, error) { - // spaces, commas and dots are allowed in this syntax +func (c *current) onListElementContinuation14() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonBlockAttributes16() (interface{}, error) { +func (p *parser) callonListElementContinuation14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes16() + return p.cur.onListElementContinuation14() } -func (c *current) onBlockAttributes23() (interface{}, error) { +func (c *current) onListElementContinuation20() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonBlockAttributes23() (interface{}, error) { +func (p *parser) callonListElementContinuation20() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes23() + return p.cur.onListElementContinuation20() } -func (c *current) onBlockAttributes19(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuation25() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonBlockAttributes19() (interface{}, error) { +func (p *parser) callonListElementContinuation25() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes19(stack["ref"]) + return p.cur.onListElementContinuation25() } -func (c *current) onBlockAttributes31() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuation1(offset, element interface{}) (interface{}, error) { + return types.NewListElementContinuation(len(offset.([]interface{})), element) + } -func (p *parser) callonBlockAttributes31() (interface{}, error) { +func (p *parser) callonListElementContinuation1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes31() + return p.cur.onListElementContinuation1(stack["offset"], stack["element"]) } -func (c *current) onBlockAttributes27(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onListElementContinuationElement19() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonBlockAttributes27() (interface{}, error) { +func (p *parser) callonListElementContinuationElement19() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes27(stack["name"]) + return p.cur.onListElementContinuationElement19() } -func (c *current) onBlockAttributes37() (interface{}, error) { - +func (c *current) onListElementContinuationElement26() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonBlockAttributes37() (interface{}, error) { +func (p *parser) callonListElementContinuationElement26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes37() + return p.cur.onListElementContinuationElement26() } -func (c *current) onBlockAttributes12(elements interface{}) (interface{}, error) { - return types.Reduce(elements, strings.TrimSpace), nil +func (c *current) onListElementContinuationElement11() (interface{}, error) { + return types.NewBlankLine() } -func (p *parser) callonBlockAttributes12() (interface{}, error) { +func (p *parser) callonListElementContinuationElement11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes12(stack["elements"]) + return p.cur.onListElementContinuationElement11() } -func (c *current) onBlockAttributes8(id interface{}) (interface{}, error) { - return types.NewIDAttribute(id) +func (c *current) onListElementContinuationElement32() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonBlockAttributes8() (interface{}, error) { +func (p *parser) callonListElementContinuationElement32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes8(stack["id"]) + return p.cur.onListElementContinuationElement32() } -func (c *current) onBlockAttributes43() (interface{}, error) { +func (c *current) onListElementContinuationElement42() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonBlockAttributes43() (interface{}, error) { +func (p *parser) callonListElementContinuationElement42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes43() + return p.cur.onListElementContinuationElement42() } -func (c *current) onBlockAttributes5(anchor interface{}) (interface{}, error) { - return anchor, nil - +func (c *current) onListElementContinuationElement55() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonBlockAttributes5() (interface{}, error) { +func (p *parser) callonListElementContinuationElement55() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes5(stack["anchor"]) + return p.cur.onListElementContinuationElement55() } -func (c *current) onBlockAttributes62() (interface{}, error) { +func (c *current) onListElementContinuationElement59() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonBlockAttributes62() (interface{}, error) { +func (p *parser) callonListElementContinuationElement59() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes62() + return p.cur.onListElementContinuationElement59() } -func (c *current) onBlockAttributes69() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement64() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonBlockAttributes69() (interface{}, error) { +func (p *parser) callonListElementContinuationElement64() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes69() + return p.cur.onListElementContinuationElement64() } -func (c *current) onBlockAttributes65(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuationElement71() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonBlockAttributes65() (interface{}, error) { +func (p *parser) callonListElementContinuationElement71() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes65(stack["ref"]) + return p.cur.onListElementContinuationElement71() } -func (c *current) onBlockAttributes77() (interface{}, error) { +func (c *current) onListElementContinuationElement83() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonBlockAttributes77() (interface{}, error) { +func (p *parser) callonListElementContinuationElement83() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes77() + return p.cur.onListElementContinuationElement83() } -func (c *current) onBlockAttributes73(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onListElementContinuationElement85() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonBlockAttributes73() (interface{}, error) { +func (p *parser) callonListElementContinuationElement85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes73(stack["name"]) + return p.cur.onListElementContinuationElement85() } -func (c *current) onBlockAttributes83() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onListElementContinuationElement78(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonBlockAttributes83() (interface{}, error) { +func (p *parser) callonListElementContinuationElement78() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes83() + return p.cur.onListElementContinuationElement78(stack["start"]) } -func (c *current) onBlockAttributes55(elements interface{}) (interface{}, error) { - return types.Reduce(elements, strings.TrimSpace), nil - +func (c *current) onListElementContinuationElement67(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonBlockAttributes55() (interface{}, error) { +func (p *parser) callonListElementContinuationElement67() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes55(stack["elements"]) + return p.cur.onListElementContinuationElement67(stack["name"], stack["start"]) } -func (c *current) onBlockAttributes51(title interface{}) (interface{}, error) { - return types.NewTitleAttribute(title) +func (c *current) onListElementContinuationElement93() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonBlockAttributes51() (interface{}, error) { +func (p *parser) callonListElementContinuationElement93() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes51(stack["title"]) + return p.cur.onListElementContinuationElement93() } -func (c *current) onBlockAttributes88() (interface{}, error) { +func (c *current) onListElementContinuationElement105() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonBlockAttributes88() (interface{}, error) { +func (p *parser) callonListElementContinuationElement105() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes88() + return p.cur.onListElementContinuationElement105() } -func (c *current) onBlockAttributes48(title interface{}) (interface{}, error) { - return title, nil +func (c *current) onListElementContinuationElement107() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonBlockAttributes48() (interface{}, error) { +func (p *parser) callonListElementContinuationElement107() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes48(stack["title"]) + return p.cur.onListElementContinuationElement107() } -func (c *current) onBlockAttributes100() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement100(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonBlockAttributes100() (interface{}, error) { +func (p *parser) callonListElementContinuationElement100() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes100() + return p.cur.onListElementContinuationElement100(stack["start"]) } -func (c *current) onBlockAttributes93(attributes interface{}) (interface{}, error) { - return attributes, nil - +func (c *current) onListElementContinuationElement89(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonBlockAttributes93() (interface{}, error) { +func (p *parser) callonListElementContinuationElement89() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes93(stack["attributes"]) + return p.cur.onListElementContinuationElement89(stack["name"], stack["start"]) } -func (c *current) onBlockAttributes1(attributes interface{}) (interface{}, error) { - return types.NewAttributes(attributes.([]interface{})...) +func (c *current) onListElementContinuationElement115() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonBlockAttributes1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement115() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onBlockAttributes1(stack["attributes"]) + return p.cur.onListElementContinuationElement115() } -func (c *current) onInlineAttributes1(attributes interface{}) (interface{}, error) { - return types.NewAttributes(attributes.([]interface{})...) +func (c *current) onListElementContinuationElement111(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonInlineAttributes1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineAttributes1(stack["attributes"]) + return p.cur.onListElementContinuationElement111(stack["name"]) } -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) onListElementContinuationElement62(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonLongHandAttributes1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement62() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLongHandAttributes1(stack["firstPositionalAttributes"], stack["otherAttributes"]) + return p.cur.onListElementContinuationElement62(stack["element"]) } -func (c *current) onFirstPositionalAttributes18() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement121() (interface{}, error) { + // standalone '{' + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonFirstPositionalAttributes18() (interface{}, error) { +func (p *parser) callonListElementContinuationElement121() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFirstPositionalAttributes18() + return p.cur.onListElementContinuationElement121() } -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) onListElementContinuationElement47(element interface{}) (interface{}, error) { + + return element, nil } -func (p *parser) callonFirstPositionalAttributes20() (bool, error) { +func (p *parser) callonListElementContinuationElement47() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFirstPositionalAttributes20(stack["main"], stack["extras"]) + return p.cur.onListElementContinuationElement47(stack["element"]) } -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) onListElementContinuationElement40(elements interface{}) (interface{}, error) { + return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil } -func (p *parser) callonFirstPositionalAttributes1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement40() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFirstPositionalAttributes1(stack["main"], stack["extras"]) + return p.cur.onListElementContinuationElement40(stack["elements"]) } -func (c *current) onShortHandIDAttribute1(id interface{}) (interface{}, error) { - return types.NewIDAttribute(id) +func (c *current) onListElementContinuationElement128() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonShortHandIDAttribute1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement128() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandIDAttribute1(stack["id"]) + return p.cur.onListElementContinuationElement128() } -func (c *current) onShortHandAttribute1(value interface{}) (interface{}, error) { - return types.NewPositionalAttribute(value) +func (c *current) onListElementContinuationElement28(name, value interface{}) (interface{}, error) { + d := types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) + return d, nil + } -func (p *parser) callonShortHandAttribute1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement28() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttribute1(stack["value"]) + return p.cur.onListElementContinuationElement28(stack["name"], stack["value"]) } -func (c *current) onShortHandDotRoleAttribute1(role interface{}) (interface{}, error) { - return types.NewRoleAttribute(role) +func (c *current) onListElementContinuationElement134() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonShortHandDotRoleAttribute1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement134() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandDotRoleAttribute1(stack["role"]) + return p.cur.onListElementContinuationElement134() } -func (c *current) onShortHandOptionAttribute1(option interface{}) (interface{}, error) { - return types.NewOptionAttribute(option) +func (c *current) onListElementContinuationElement143() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonShortHandOptionAttribute1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement143() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandOptionAttribute1(stack["option"]) + return p.cur.onListElementContinuationElement143() } -func (c *current) onShortHandAttributeValue9() (interface{}, error) { +func (c *current) onListElementContinuationElement150() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonShortHandAttributeValue9() (interface{}, error) { +func (p *parser) callonListElementContinuationElement150() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue9() + return p.cur.onListElementContinuationElement150() } -func (c *current) onShortHandAttributeValue17() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement130(name interface{}) (interface{}, error) { + return types.NewAttributeReset(name.(string)) } -func (p *parser) callonShortHandAttributeValue17() (interface{}, error) { +func (p *parser) callonListElementContinuationElement130() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue17() + return p.cur.onListElementContinuationElement130(stack["name"]) } -func (c *current) onShortHandAttributeValue13(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuationElement156() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonShortHandAttributeValue13() (interface{}, error) { +func (p *parser) callonListElementContinuationElement156() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue13(stack["ref"]) + return p.cur.onListElementContinuationElement156() } -func (c *current) onShortHandAttributeValue25() (interface{}, error) { +func (c *current) onListElementContinuationElement165() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonShortHandAttributeValue25() (interface{}, error) { +func (p *parser) callonListElementContinuationElement165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue25() + return p.cur.onListElementContinuationElement165() } -func (c *current) onShortHandAttributeValue21(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onListElementContinuationElement172() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonShortHandAttributeValue21() (interface{}, error) { +func (p *parser) callonListElementContinuationElement172() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue21(stack["name"]) + return p.cur.onListElementContinuationElement172() } -func (c *current) onShortHandAttributeValue31() (interface{}, error) { - - return types.NewStringElement(string(c.text)) - +func (c *current) onListElementContinuationElement152(name interface{}) (interface{}, error) { + return types.NewAttributeReset(name.(string)) } -func (p *parser) callonShortHandAttributeValue31() (interface{}, error) { +func (p *parser) callonListElementContinuationElement152() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue31() + return p.cur.onListElementContinuationElement152(stack["name"]) } -func (c *current) onShortHandAttributeValue4(elements interface{}) (interface{}, error) { - return types.Reduce(elements, strings.TrimSpace), nil +func (c *current) onListElementContinuationElement175() (interface{}, error) { + // TODO: Space* before EOF + return types.NewThematicBreak() } -func (p *parser) callonShortHandAttributeValue4() (interface{}, error) { +func (p *parser) callonListElementContinuationElement175() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onShortHandAttributeValue4(stack["elements"]) + return p.cur.onListElementContinuationElement175() } -func (c *current) onPositionalAttribute13() (interface{}, error) { +func (c *current) onListElementContinuationElement195() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonPositionalAttribute13() (interface{}, error) { +func (p *parser) callonListElementContinuationElement195() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPositionalAttribute13() + return p.cur.onListElementContinuationElement195() } -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) onListElementContinuationElement202() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonPositionalAttribute2() (interface{}, error) { +func (p *parser) callonListElementContinuationElement202() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPositionalAttribute2(stack["value"]) + return p.cur.onListElementContinuationElement202() } -func (c *current) onPositionalAttribute24() (interface{}, error) { +func (c *current) onListElementContinuationElement216() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonPositionalAttribute24() (interface{}, error) { +func (p *parser) callonListElementContinuationElement216() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPositionalAttribute24() + return p.cur.onListElementContinuationElement216() } -func (c *current) onPositionalAttribute32() (interface{}, error) { +func (c *current) onListElementContinuationElement222() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonPositionalAttribute32() (interface{}, error) { +func (p *parser) callonListElementContinuationElement222() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPositionalAttribute32() + return p.cur.onListElementContinuationElement222() } -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) onListElementContinuationElement220(content interface{}) (interface{}, error) { + return types.NewRawContent(content.(string)) } -func (p *parser) callonPositionalAttribute36() (bool, error) { +func (p *parser) callonListElementContinuationElement220() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPositionalAttribute36(stack["value"]) + return p.cur.onListElementContinuationElement220(stack["content"]) } -func (c *current) onPositionalAttribute17(value interface{}) (interface{}, error) { - - return types.NewPositionalAttribute(nil) +func (c *current) onListElementContinuationElement210(content interface{}) (interface{}, error) { + return types.NewTableCell(content.(types.RawContent)) } -func (p *parser) callonPositionalAttribute17() (interface{}, error) { +func (p *parser) callonListElementContinuationElement210() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPositionalAttribute17(stack["value"]) + return p.cur.onListElementContinuationElement210(stack["content"]) } -func (c *current) onNamedAttribute9() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement230() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonNamedAttribute9() (interface{}, error) { +func (p *parser) callonListElementContinuationElement230() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttribute9() + return p.cur.onListElementContinuationElement230() } -func (c *current) onNamedAttribute16() (interface{}, error) { +func (c *current) onListElementContinuationElement241() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonNamedAttribute16() (interface{}, error) { +func (p *parser) callonListElementContinuationElement241() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttribute16() + return p.cur.onListElementContinuationElement241() } -func (c *current) onNamedAttribute4() (interface{}, error) { - return strings.TrimSpace(string(c.text)), nil +func (c *current) onListElementContinuationElement248() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonNamedAttribute4() (interface{}, error) { +func (p *parser) callonListElementContinuationElement248() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttribute4() + return p.cur.onListElementContinuationElement248() } -func (c *current) onNamedAttribute22() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement233() (interface{}, error) { + return types.NewBlankLine() + } -func (p *parser) callonNamedAttribute22() (interface{}, error) { +func (p *parser) callonListElementContinuationElement233() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttribute22() + return p.cur.onListElementContinuationElement233() } -func (c *current) onNamedAttribute32() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement206(cells interface{}) (interface{}, error) { + return types.NewTableRow(cells.([]interface{})) + } -func (p *parser) callonNamedAttribute32() (interface{}, error) { +func (p *parser) callonListElementContinuationElement206() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttribute32() + return p.cur.onListElementContinuationElement206(stack["cells"]) } -func (c *current) onNamedAttribute1(key, value interface{}) (interface{}, error) { - // TODO: include `,` or expect `]` - return types.NewNamedAttribute(key.(string), value) +func (c *current) onListElementContinuationElement262() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonNamedAttribute1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement262() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNamedAttribute1(stack["key"], stack["value"]) + return p.cur.onListElementContinuationElement262() } -func (c *current) onAttributeValue14() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement269() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonAttributeValue14() (interface{}, error) { +func (p *parser) callonListElementContinuationElement269() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeValue14() + return p.cur.onListElementContinuationElement269() } -func (c *current) onAttributeValue1(value interface{}) (interface{}, error) { - return value, nil +func (c *current) onListElementContinuationElement287() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonAttributeValue1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement287() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeValue1(stack["value"]) + return p.cur.onListElementContinuationElement287() } -func (c *current) onSingleQuotedAttributeValue8() (interface{}, error) { - // = and , signs are allowed within ' quotes +func (c *current) onListElementContinuationElement294() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonSingleQuotedAttributeValue8() (interface{}, error) { +func (p *parser) callonListElementContinuationElement294() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue8() + return p.cur.onListElementContinuationElement294() } -func (c *current) onSingleQuotedAttributeValue15() (interface{}, error) { +func (c *current) onListElementContinuationElement307() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSingleQuotedAttributeValue15() (interface{}, error) { +func (p *parser) callonListElementContinuationElement307() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue15() + return p.cur.onListElementContinuationElement307() } -func (c *current) onSingleQuotedAttributeValue11(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuationElement314() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSingleQuotedAttributeValue11() (interface{}, error) { +func (p *parser) callonListElementContinuationElement314() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue11(stack["ref"]) + return p.cur.onListElementContinuationElement314() } -func (c *current) onSingleQuotedAttributeValue23() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement299() (interface{}, error) { + return types.NewBlankLine() + } -func (p *parser) callonSingleQuotedAttributeValue23() (interface{}, error) { +func (p *parser) callonListElementContinuationElement299() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue23() + return p.cur.onListElementContinuationElement299() } -func (c *current) onSingleQuotedAttributeValue19(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onListElementContinuationElement320() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSingleQuotedAttributeValue19() (interface{}, error) { +func (p *parser) callonListElementContinuationElement320() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue19(stack["name"]) + return p.cur.onListElementContinuationElement320() } -func (c *current) onSingleQuotedAttributeValue29() (interface{}, error) { - - return types.NewStringElement(`'`) // escaped quote +func (c *current) onListElementContinuationElement326() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSingleQuotedAttributeValue29() (interface{}, error) { +func (p *parser) callonListElementContinuationElement326() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue29() + return p.cur.onListElementContinuationElement326() } -func (c *current) onSingleQuotedAttributeValue32() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onListElementContinuationElement324(content interface{}) (interface{}, error) { + return types.NewRawContent(content.(string)) } -func (p *parser) callonSingleQuotedAttributeValue32() (interface{}, error) { +func (p *parser) callonListElementContinuationElement324() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue32() + return p.cur.onListElementContinuationElement324(stack["content"]) } -func (c *current) onSingleQuotedAttributeValue1(elements interface{}) (interface{}, error) { - return types.Reduce(elements), nil +func (c *current) onListElementContinuationElement278(content interface{}) (interface{}, error) { + return types.NewTableCell(content.(types.RawContent)) } -func (p *parser) callonSingleQuotedAttributeValue1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement278() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedAttributeValue1(stack["elements"]) + return p.cur.onListElementContinuationElement278(stack["content"]) } -func (c *current) onDoubleQuotedAttributeValue8() (interface{}, error) { - // = and , signs are allowed within " quotes +func (c *current) onListElementContinuationElement334() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonDoubleQuotedAttributeValue8() (interface{}, error) { +func (p *parser) callonListElementContinuationElement334() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue8() + return p.cur.onListElementContinuationElement334() } -func (c *current) onDoubleQuotedAttributeValue15() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement275(cell interface{}) (interface{}, error) { + return cell, nil + } -func (p *parser) callonDoubleQuotedAttributeValue15() (interface{}, error) { +func (p *parser) callonListElementContinuationElement275() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue15() + return p.cur.onListElementContinuationElement275(stack["cell"]) } -func (c *current) onDoubleQuotedAttributeValue11(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuationElement346() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDoubleQuotedAttributeValue11() (interface{}, error) { +func (p *parser) callonListElementContinuationElement346() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue11(stack["ref"]) + return p.cur.onListElementContinuationElement346() } -func (c *current) onDoubleQuotedAttributeValue23() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement353() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDoubleQuotedAttributeValue23() (interface{}, error) { +func (p *parser) callonListElementContinuationElement353() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue23() + return p.cur.onListElementContinuationElement353() } -func (c *current) onDoubleQuotedAttributeValue19(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onListElementContinuationElement338() (interface{}, error) { + return types.NewBlankLine() + } -func (p *parser) callonDoubleQuotedAttributeValue19() (interface{}, error) { +func (p *parser) callonListElementContinuationElement338() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue19(stack["name"]) + return p.cur.onListElementContinuationElement338() } -func (c *current) onDoubleQuotedAttributeValue29() (interface{}, error) { - - return types.NewStringElement(`"`) // escaped quote +func (c *current) onListElementContinuationElement362() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDoubleQuotedAttributeValue29() (interface{}, error) { +func (p *parser) callonListElementContinuationElement362() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue29() + return p.cur.onListElementContinuationElement362() } -func (c *current) onDoubleQuotedAttributeValue32() (interface{}, error) { - +func (c *current) onListElementContinuationElement369() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonDoubleQuotedAttributeValue32() (interface{}, error) { +func (p *parser) callonListElementContinuationElement369() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue32() + return p.cur.onListElementContinuationElement369() } -func (c *current) onDoubleQuotedAttributeValue1(elements interface{}) (interface{}, error) { - return types.Reduce(elements), nil +func (c *current) onListElementContinuationElement253(cells interface{}) (interface{}, error) { + return types.NewTableRow(cells.([]interface{})) } -func (p *parser) callonDoubleQuotedAttributeValue1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement253() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedAttributeValue1(stack["elements"]) + return p.cur.onListElementContinuationElement253(stack["cells"]) } -func (c *current) onUnquotedAttributeValue6() (interface{}, error) { +func (c *current) onListElementContinuationElement382() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonUnquotedAttributeValue6() (interface{}, error) { +func (p *parser) callonListElementContinuationElement382() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue6() + return p.cur.onListElementContinuationElement382() } -func (c *current) onUnquotedAttributeValue12() (interface{}, error) { +func (c *current) onListElementContinuationElement389() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonUnquotedAttributeValue12() (interface{}, error) { +func (p *parser) callonListElementContinuationElement389() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue12() + return p.cur.onListElementContinuationElement389() } -func (c *current) onUnquotedAttributeValue19() (interface{}, error) { +func (c *current) onListElementContinuationElement404() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonUnquotedAttributeValue19() (interface{}, error) { +func (p *parser) callonListElementContinuationElement404() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue19() + return p.cur.onListElementContinuationElement404() } -func (c *current) onUnquotedAttributeValue15(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuationElement411() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonUnquotedAttributeValue15() (interface{}, error) { +func (p *parser) callonListElementContinuationElement411() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue15(stack["ref"]) + return p.cur.onListElementContinuationElement411() } -func (c *current) onUnquotedAttributeValue27() (interface{}, error) { +func (c *current) onListElementContinuationElement424() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonUnquotedAttributeValue27() (interface{}, error) { +func (p *parser) callonListElementContinuationElement424() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue27() + return p.cur.onListElementContinuationElement424() } -func (c *current) onUnquotedAttributeValue23(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onListElementContinuationElement431() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonUnquotedAttributeValue23() (interface{}, error) { +func (p *parser) callonListElementContinuationElement431() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue23(stack["name"]) + return p.cur.onListElementContinuationElement431() } -func (c *current) onUnquotedAttributeValue33() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onListElementContinuationElement416() (interface{}, error) { + return types.NewBlankLine() } -func (p *parser) callonUnquotedAttributeValue33() (interface{}, error) { +func (p *parser) callonListElementContinuationElement416() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue33() + return p.cur.onListElementContinuationElement416() } -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) onListElementContinuationElement437() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonUnquotedAttributeValue35() (bool, error) { +func (p *parser) callonListElementContinuationElement437() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue35(stack["elements"]) + return p.cur.onListElementContinuationElement437() } -func (c *current) onUnquotedAttributeValue1(elements interface{}) (interface{}, error) { - return types.Reduce(elements, strings.TrimSpace), nil +func (c *current) onListElementContinuationElement443() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonUnquotedAttributeValue1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement443() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnquotedAttributeValue1(stack["elements"]) + return p.cur.onListElementContinuationElement443() } -func (c *current) onUserMacroBlock4() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement441(content interface{}) (interface{}, error) { + return types.NewRawContent(content.(string)) + } -func (p *parser) callonUserMacroBlock4() (interface{}, error) { +func (p *parser) callonListElementContinuationElement441() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUserMacroBlock4() + return p.cur.onListElementContinuationElement441(stack["content"]) } -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) onListElementContinuationElement395(content interface{}) (interface{}, error) { + return types.NewTableCell(content.(types.RawContent)) } -func (p *parser) callonUserMacroBlock7() (bool, error) { +func (p *parser) callonListElementContinuationElement395() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUserMacroBlock7(stack["name"]) + return p.cur.onListElementContinuationElement395(stack["content"]) } -func (c *current) onUserMacroBlock10() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement451() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonUserMacroBlock10() (interface{}, error) { +func (p *parser) callonListElementContinuationElement451() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUserMacroBlock10() + return p.cur.onListElementContinuationElement451() } -func (c *current) onUserMacroBlock1(name, value, inlineAttributes interface{}) (interface{}, error) { - return types.NewUserMacroBlock(name.(string), value.(string), inlineAttributes, string(c.text)) +func (c *current) onListElementContinuationElement462() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonUserMacroBlock1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement462() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUserMacroBlock1(stack["name"], stack["value"], stack["inlineAttributes"]) + return p.cur.onListElementContinuationElement462() } -func (c *current) onInlineUserMacro4() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement469() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlineUserMacro4() (interface{}, error) { +func (p *parser) callonListElementContinuationElement469() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineUserMacro4() + return p.cur.onListElementContinuationElement469() } -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) onListElementContinuationElement454() (interface{}, error) { + return types.NewBlankLine() } -func (p *parser) callonInlineUserMacro7() (bool, error) { +func (p *parser) callonListElementContinuationElement454() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineUserMacro7(stack["name"]) + return p.cur.onListElementContinuationElement454() } -func (c *current) onInlineUserMacro10() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement373(cells interface{}) (interface{}, error) { + return types.NewTableRow(cells.([]interface{})) + } -func (p *parser) callonInlineUserMacro10() (interface{}, error) { +func (p *parser) callonListElementContinuationElement373() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineUserMacro10() + return p.cur.onListElementContinuationElement373(stack["cells"]) } -func (c *current) onInlineUserMacro1(name, value, inlineAttributes interface{}) (interface{}, error) { - return types.NewInlineUserMacro(name.(string), value.(string), inlineAttributes, string(c.text)) +func (c *current) onListElementContinuationElement477() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonInlineUserMacro1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement477() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineUserMacro1(stack["name"], stack["value"], stack["inlineAttributes"]) + return p.cur.onListElementContinuationElement477() } -func (c *current) onFileInclusion12() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" +func (c *current) onListElementContinuationElement484() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) } -func (p *parser) callonFileInclusion12() (interface{}, error) { +func (p *parser) callonListElementContinuationElement484() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion12() + return p.cur.onListElementContinuationElement484() } -func (c *current) onFileInclusion19() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement189(header, rows interface{}) (interface{}, error) { + return types.NewTable(header, rows.([]interface{})) + } -func (p *parser) callonFileInclusion19() (interface{}, error) { +func (p *parser) callonListElementContinuationElement189() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion19() + return p.cur.onListElementContinuationElement189(stack["header"], stack["rows"]) } -func (c *current) onFileInclusion15(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onListElementContinuationElement494() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonFileInclusion15() (interface{}, error) { +func (p *parser) callonListElementContinuationElement494() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion15(stack["ref"]) + return p.cur.onListElementContinuationElement494() } -func (c *current) onFileInclusion8(path interface{}) (interface{}, error) { - return types.NewLocation("", path.([]interface{})) +func (c *current) onListElementContinuationElement502() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonFileInclusion8() (interface{}, error) { +func (p *parser) callonListElementContinuationElement502() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion8(stack["path"]) + return p.cur.onListElementContinuationElement502() } -func (c *current) onFileInclusion4(path, inlineAttributes interface{}) (interface{}, error) { - - return types.NewFileInclusion(path.(types.Location), inlineAttributes.(types.Attributes), string(c.text)) +func (c *current) onListElementContinuationElement488(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) } -func (p *parser) callonFileInclusion4() (interface{}, error) { +func (p *parser) callonListElementContinuationElement488() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion4(stack["path"], stack["inlineAttributes"]) + return p.cur.onListElementContinuationElement488(stack["content"]) } -func (c *current) onFileInclusion28() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement508() (interface{}, error) { + return types.Tip, nil } -func (p *parser) callonFileInclusion28() (interface{}, error) { +func (p *parser) callonListElementContinuationElement508() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion28() + return p.cur.onListElementContinuationElement508() } -func (c *current) onFileInclusion1(incl interface{}) (interface{}, error) { - return incl.(types.FileInclusion), nil - +func (c *current) onListElementContinuationElement510() (interface{}, error) { + return types.Note, nil } -func (p *parser) callonFileInclusion1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement510() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileInclusion1(stack["incl"]) + return p.cur.onListElementContinuationElement510() } -func (c *current) onLineRanges17() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement512() (interface{}, error) { + return types.Important, nil } -func (p *parser) callonLineRanges17() (interface{}, error) { +func (p *parser) callonListElementContinuationElement512() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges17() + return p.cur.onListElementContinuationElement512() } -func (c *current) onLineRanges12() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement514() (interface{}, error) { + return types.Warning, nil } -func (p *parser) callonLineRanges12() (interface{}, error) { +func (p *parser) callonListElementContinuationElement514() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges12() + return p.cur.onListElementContinuationElement514() } -func (c *current) onLineRanges26() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement516() (interface{}, error) { + return types.Caution, nil } -func (p *parser) callonLineRanges26() (interface{}, error) { +func (p *parser) callonListElementContinuationElement516() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges26() + return p.cur.onListElementContinuationElement516() } -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) onListElementContinuationElement523() (interface{}, error) { + return string(c.text), nil -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) { +func (p *parser) callonListElementContinuationElement523() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges9(stack["start"], stack["end"]) + return p.cur.onListElementContinuationElement523() } -func (c *current) onLineRanges35() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement526(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + } -func (p *parser) callonLineRanges35() (interface{}, error) { +func (p *parser) callonListElementContinuationElement526() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges35() + return p.cur.onListElementContinuationElement526(stack["content"]) } -func (c *current) onLineRanges30() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement532() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonLineRanges30() (interface{}, error) { +func (p *parser) callonListElementContinuationElement532() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges30() + return p.cur.onListElementContinuationElement532() } -func (c *current) onLineRanges28(singleline interface{}) (interface{}, error) { - // eg: lines=12 - return types.NewLineRange(singleline.(int), singleline.(int)) +func (c *current) onListElementContinuationElement520(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + } -func (p *parser) callonLineRanges28() (interface{}, error) { +func (p *parser) callonListElementContinuationElement520() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges28(stack["singleline"]) + return p.cur.onListElementContinuationElement520(stack["content"]) } -func (c *current) onLineRanges52() (interface{}, error) { +func (c *current) onListElementContinuationElement544() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonLineRanges52() (interface{}, error) { +func (p *parser) callonListElementContinuationElement544() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges52() + return p.cur.onListElementContinuationElement544() } -func (c *current) onLineRanges47() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement549() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonLineRanges47() (interface{}, error) { +func (p *parser) callonListElementContinuationElement549() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges47() + return p.cur.onListElementContinuationElement549() } -func (c *current) onLineRanges61() (interface{}, error) { +func (c *current) onListElementContinuationElement559() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonLineRanges61() (interface{}, error) { +func (p *parser) callonListElementContinuationElement559() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges61() + return p.cur.onListElementContinuationElement559() } -func (c *current) onLineRanges56() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement567() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonLineRanges56() (interface{}, error) { +func (p *parser) callonListElementContinuationElement567() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges56() + return p.cur.onListElementContinuationElement567() } -func (c *current) onLineRanges44(start, end interface{}) (interface{}, error) { - // eg: lines=12..14 - return types.NewLineRange(start.(int), end.(int)) +func (c *current) onListElementContinuationElement553(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + } -func (p *parser) callonLineRanges44() (interface{}, error) { +func (p *parser) callonListElementContinuationElement553() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges44(stack["start"], stack["end"]) + return p.cur.onListElementContinuationElement553(stack["content"]) } -func (c *current) onLineRanges70() (interface{}, error) { +func (c *current) onListElementContinuationElement572() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonLineRanges70() (interface{}, error) { +func (p *parser) callonListElementContinuationElement572() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges70() + return p.cur.onListElementContinuationElement572() } -func (c *current) onLineRanges65() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement575(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + } -func (p *parser) callonLineRanges65() (interface{}, error) { +func (p *parser) callonListElementContinuationElement575() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges65() + return p.cur.onListElementContinuationElement575(stack["content"]) } -func (c *current) onLineRanges63(singleline interface{}) (interface{}, error) { - // eg: lines=12 - return types.NewLineRange(singleline.(int), singleline.(int)) +func (c *current) onListElementContinuationElement581() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonLineRanges63() (interface{}, error) { +func (p *parser) callonListElementContinuationElement581() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges63(stack["singleline"]) + return p.cur.onListElementContinuationElement581() } -func (c *current) onLineRanges39(other interface{}) (interface{}, error) { - return other, nil +func (c *current) onListElementContinuationElement569(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) } -func (p *parser) callonLineRanges39() (interface{}, error) { +func (p *parser) callonListElementContinuationElement569() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges39(stack["other"]) + return p.cur.onListElementContinuationElement569(stack["content"]) } -func (c *current) onLineRanges5(first, others interface{}) (interface{}, error) { - return append([]interface{}{first}, others.([]interface{})...), nil +func (c *current) onListElementContinuationElement536(line interface{}) (interface{}, error) { + return line, nil } -func (p *parser) callonLineRanges5() (interface{}, error) { +func (p *parser) callonListElementContinuationElement536() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges5(stack["first"], stack["others"]) + return p.cur.onListElementContinuationElement536(stack["line"]) } -func (c *current) onLineRanges80() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement504(kind, firstLine, otherLines interface{}) (interface{}, error) { + + return types.NewAdmonitionParagraph(kind.(string), append([]interface{}{firstLine}, otherLines.([]interface{})...)) + } -func (p *parser) callonLineRanges80() (interface{}, error) { +func (p *parser) callonListElementContinuationElement504() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges80() + return p.cur.onListElementContinuationElement504(stack["kind"], stack["firstLine"], stack["otherLines"]) } -func (c *current) onLineRanges75() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement591() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonLineRanges75() (interface{}, error) { +func (p *parser) callonListElementContinuationElement591() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges75() + return p.cur.onListElementContinuationElement591() } -func (c *current) onLineRanges89() (interface{}, error) { +func (c *current) onListElementContinuationElement589() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonLineRanges89() (interface{}, error) { +func (p *parser) callonListElementContinuationElement589() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges89() + return p.cur.onListElementContinuationElement589() } -func (c *current) onLineRanges84() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement596(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil + } -func (p *parser) callonLineRanges84() (interface{}, error) { +func (p *parser) callonListElementContinuationElement596() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges84() + return p.cur.onListElementContinuationElement596(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) onListElementContinuationElement602() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonLineRanges72() (interface{}, error) { +func (p *parser) callonListElementContinuationElement602() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges72(stack["start"], stack["end"]) + return p.cur.onListElementContinuationElement602() } -func (c *current) onLineRanges98() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement586(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + } -func (p *parser) callonLineRanges98() (interface{}, error) { +func (p *parser) callonListElementContinuationElement586() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges98() + return p.cur.onListElementContinuationElement586(stack["content"]) } -func (c *current) onLineRanges93() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onListElementContinuationElement613() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonLineRanges93() (interface{}, error) { +func (p *parser) callonListElementContinuationElement613() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges93() + return p.cur.onListElementContinuationElement613() } -func (c *current) onLineRanges91(singleline interface{}) (interface{}, error) { - // eg: lines=12 - return types.NewLineRange(singleline.(int), singleline.(int)) +func (c *current) onListElementContinuationElement621() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonLineRanges91() (interface{}, error) { +func (p *parser) callonListElementContinuationElement621() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges91(stack["singleline"]) + return p.cur.onListElementContinuationElement621() } -func (c *current) onLineRanges1(value interface{}) (interface{}, error) { - // must make sure that the whole content is parsed - return value, nil +func (c *current) onListElementContinuationElement607(content interface{}) (interface{}, error) { + return types.NewSingleLineComment(content.(string)) + } -func (p *parser) callonLineRanges1() (interface{}, error) { +func (p *parser) callonListElementContinuationElement607() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLineRanges1(stack["value"]) + return p.cur.onListElementContinuationElement607(stack["content"]) } -func (c *current) onTagRanges11() (interface{}, error) { +func (c *current) onListElementContinuationElement626() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonTagRanges11() (interface{}, error) { +func (p *parser) callonListElementContinuationElement626() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges11() + return p.cur.onListElementContinuationElement626() } -func (c *current) onTagRanges17() (interface{}, error) { - return string(c.text), nil +func (c *current) onListElementContinuationElement629(content interface{}) (bool, error) { + return len(strings.TrimSpace(string(c.text))) > 0, nil } -func (p *parser) callonTagRanges17() (interface{}, error) { +func (p *parser) callonListElementContinuationElement629() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges17() + return p.cur.onListElementContinuationElement629(stack["content"]) } -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) onListElementContinuationElement635() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonTagRanges20() (bool, error) { +func (p *parser) callonListElementContinuationElement635() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges20(stack["stars"]) + return p.cur.onListElementContinuationElement635() } -func (c *current) onTagRanges14(stars interface{}) (interface{}, error) { - return stars, nil +func (c *current) onListElementContinuationElement623(content interface{}) (interface{}, error) { + return types.NewRawLine(content.(string)) + } -func (p *parser) callonTagRanges14() (interface{}, error) { +func (p *parser) callonListElementContinuationElement623() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges14(stack["stars"]) + return p.cur.onListElementContinuationElement623(stack["content"]) } -func (c *current) onTagRanges8(tag interface{}) (interface{}, error) { - return types.NewTagRange(tag.(string), true) +func (c *current) onListElementContinuationElement583(firstLine, otherLines interface{}) (interface{}, error) { + + return types.NewLiteralParagraph(types.LiteralBlockWithSpacesOnFirstLine, append([]interface{}{firstLine}, otherLines.([]interface{})...)) + } -func (p *parser) callonTagRanges8() (interface{}, error) { +func (p *parser) callonListElementContinuationElement583() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges8(stack["tag"]) + return p.cur.onListElementContinuationElement583(stack["firstLine"], stack["otherLines"]) } -func (c *current) onTagRanges26() (interface{}, error) { +func (c *current) onListElementContinuationElement640() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonTagRanges26() (interface{}, error) { +func (p *parser) callonListElementContinuationElement640() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges26() + return p.cur.onListElementContinuationElement640() } -func (c *current) onTagRanges32() (interface{}, error) { - return string(c.text), nil - +func (c *current) onListElementContinuationElement648() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonTagRanges32() (interface{}, error) { +func (p *parser) callonListElementContinuationElement648() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges32() + return p.cur.onListElementContinuationElement648() } -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) onListElementContinuationElement637(content interface{}) (interface{}, error) { + // do not retain the EOL chars + return types.NewParagraph(types.RawLine(content.(string))) } -func (p *parser) callonTagRanges35() (bool, error) { +func (p *parser) callonListElementContinuationElement637() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges35(stack["stars"]) + return p.cur.onListElementContinuationElement637(stack["content"]) } -func (c *current) onTagRanges29(stars interface{}) (interface{}, error) { - return stars, 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) callonTagRanges29() (interface{}, error) { +func (p *parser) callonListElementContinuationElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges29(stack["stars"]) + return p.cur.onListElementContinuationElement1(stack["attributes"], stack["element"]) } -func (c *current) onTagRanges21(tag interface{}) (interface{}, error) { - return types.NewTagRange(tag.(string), false) +func (c *current) onCallout3() (bool, error) { + return c.isSubstitutionEnabled(Callouts) + } -func (p *parser) callonTagRanges21() (interface{}, error) { +func (p *parser) callonCallout3() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges21(stack["tag"]) + return p.cur.onCallout3() } -func (c *current) onTagRanges46() (interface{}, error) { - return string(c.text), nil +func (c *current) onCallout6() (interface{}, error) { + return strconv.Atoi(string(c.text)) } -func (p *parser) callonTagRanges46() (interface{}, error) { +func (p *parser) callonCallout6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges46() + return p.cur.onCallout6() } -func (c *current) onTagRanges52() (interface{}, error) { +func (c *current) onCallout13() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonTagRanges52() (interface{}, error) { +func (p *parser) callonCallout13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges52() + return p.cur.onCallout13() } -func (c *current) onTagRanges55(stars interface{}) (bool, error) { +func (c *current) onCallout21() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} - // use a predicate to make sure that only `*` and `**` are allowed - return len(stars.(string)) <= 2, nil +func (p *parser) callonCallout21() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onCallout21() +} + +func (c *current) onCallout1(ref interface{}) (interface{}, error) { + return types.NewCallout(ref.(int)) } -func (p *parser) callonTagRanges55() (bool, error) { +func (p *parser) callonCallout1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges55(stack["stars"]) + return p.cur.onCallout1(stack["ref"]) } -func (c *current) onTagRanges49(stars interface{}) (interface{}, error) { - return stars, nil +func (c *current) onQuotedText2(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -func (p *parser) callonTagRanges49() (interface{}, error) { +func (p *parser) callonQuotedText2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges49(stack["stars"]) + return p.cur.onQuotedText2(stack["attributes"], stack["text"]) } -func (c *current) onTagRanges43(tag interface{}) (interface{}, error) { - return types.NewTagRange(tag.(string), true) +func (c *current) onEscapedQuotedText1(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonTagRanges43() (interface{}, error) { +func (p *parser) callonEscapedQuotedText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges43(stack["tag"]) + return p.cur.onEscapedQuotedText1(stack["element"]) } -func (c *current) onTagRanges61() (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) callonTagRanges61() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges61() + return p.cur.onDoubleQuoteBoldText1(stack["elements"]) } -func (c *current) onTagRanges67() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement14() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonTagRanges67() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges67() + return p.cur.onDoubleQuoteBoldTextElement14() } -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) onDoubleQuoteBoldTextElement7() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonTagRanges70() (bool, error) { +func (p *parser) callonDoubleQuoteBoldTextElement7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges70(stack["stars"]) + return p.cur.onDoubleQuoteBoldTextElement7() } -func (c *current) onTagRanges64(stars interface{}) (interface{}, error) { - return stars, nil +func (c *current) onDoubleQuoteBoldTextElement17() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonTagRanges64() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges64(stack["stars"]) + return p.cur.onDoubleQuoteBoldTextElement17() } -func (c *current) onTagRanges56(tag interface{}) (interface{}, error) { - return types.NewTagRange(tag.(string), false) +func (c *current) onDoubleQuoteBoldTextElement24() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonTagRanges56() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges56(stack["tag"]) + return p.cur.onDoubleQuoteBoldTextElement24() } -func (c *current) onTagRanges38(other interface{}) (interface{}, error) { - return other, nil - +func (c *current) onDoubleQuoteBoldTextElement30() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonTagRanges38() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement30() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges38(stack["other"]) + return p.cur.onDoubleQuoteBoldTextElement30() } -func (c *current) onTagRanges4(first, others interface{}) (interface{}, error) { - return append([]interface{}{first}, others.([]interface{})...), nil +func (c *current) onDoubleQuoteBoldTextElement34() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonTagRanges4() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement34() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges4(stack["first"], stack["others"]) + return p.cur.onDoubleQuoteBoldTextElement34() } -func (c *current) onTagRanges1(value interface{}) (interface{}, error) { - // must make sure that the whole content is parsed - return value, nil +func (c *current) onDoubleQuoteBoldTextElement41() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonTagRanges1() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement41() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTagRanges1(stack["value"]) + return p.cur.onDoubleQuoteBoldTextElement41() } -func (c *current) onIncludedFileLine11() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement53() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonIncludedFileLine11() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement53() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine11() + return p.cur.onDoubleQuoteBoldTextElement53() } -func (c *current) onIncludedFileLine10() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement55() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonIncludedFileLine10() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement55() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine10() + return p.cur.onDoubleQuoteBoldTextElement55() } -func (c *current) onIncludedFileLine6(tag interface{}) (interface{}, error) { - return types.NewIncludedFileStartTag(tag.(string)) +func (c *current) onDoubleQuoteBoldTextElement48(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonIncludedFileLine6() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine6(stack["tag"]) + return p.cur.onDoubleQuoteBoldTextElement48(stack["start"]) } -func (c *current) onIncludedFileLine20() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement37(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonIncludedFileLine20() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement37() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine20() + return p.cur.onDoubleQuoteBoldTextElement37(stack["name"], stack["start"]) } -func (c *current) onIncludedFileLine19() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement63() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonIncludedFileLine19() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement63() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine19() + return p.cur.onDoubleQuoteBoldTextElement63() } -func (c *current) onIncludedFileLine15(tag interface{}) (interface{}, error) { - return types.NewIncludedFileEndTag(tag.(string)) +func (c *current) onDoubleQuoteBoldTextElement75() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonIncludedFileLine15() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement75() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine15(stack["tag"]) + return p.cur.onDoubleQuoteBoldTextElement75() } -func (c *current) onIncludedFileLine24() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement77() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonIncludedFileLine24() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement77() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine24() + return p.cur.onDoubleQuoteBoldTextElement77() } -func (c *current) onIncludedFileLine1(content interface{}) (interface{}, error) { - return types.NewIncludedFileLine(content.([]interface{})) +func (c *current) onDoubleQuoteBoldTextElement70(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonIncludedFileLine1() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement70() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIncludedFileLine1(stack["content"]) + return p.cur.onDoubleQuoteBoldTextElement70(stack["start"]) } -func (c *current) onListParagraph12() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement59(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonListParagraph12() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement59() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraph12() + return p.cur.onDoubleQuoteBoldTextElement59(stack["name"], stack["start"]) } -func (c *current) onListParagraph21() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement85() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonListParagraph21() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraph21() + return p.cur.onDoubleQuoteBoldTextElement85() } -func (c *current) onListParagraph4(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onDoubleQuoteBoldTextElement81(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonListParagraph4() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement81() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraph4(stack["content"]) + return p.cur.onDoubleQuoteBoldTextElement81(stack["name"]) } -func (c *current) onListParagraph2(comment interface{}) (interface{}, error) { - return comment, nil +func (c *current) onDoubleQuoteBoldTextElement32(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonListParagraph2() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraph2(stack["comment"]) + return p.cur.onDoubleQuoteBoldTextElement32(stack["element"]) } -func (c *current) onListParagraph29(lines interface{}) (interface{}, error) { - return types.NewParagraph(lines.([]interface{}), nil) +func (c *current) onDoubleQuoteBoldTextElement93() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonListParagraph29() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement93() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraph29(stack["lines"]) + return p.cur.onDoubleQuoteBoldTextElement93() } -func (c *current) onListParagraphLine15() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement102() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonListParagraphLine15() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement102() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine15() + return p.cur.onDoubleQuoteBoldTextElement102() } -func (c *current) onListParagraphLine7() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onDoubleQuoteBoldTextElement108() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonListParagraphLine7() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement108() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine7() + return p.cur.onDoubleQuoteBoldTextElement108() } -func (c *current) onListParagraphLine31() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement114() (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) callonListParagraphLine31() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement114() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine31() + return p.cur.onDoubleQuoteBoldTextElement114() } -func (c *current) onListParagraphLine40() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement121() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonListParagraphLine40() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement121() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine40() + return p.cur.onDoubleQuoteBoldTextElement121() } -func (c *current) onListParagraphLine23(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onDoubleQuoteBoldTextElement128() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonListParagraphLine23() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement128() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine23(stack["content"]) + return p.cur.onDoubleQuoteBoldTextElement128() } -func (c *current) onListParagraphLine54() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement140() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonListParagraphLine54() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement140() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine54() + return p.cur.onDoubleQuoteBoldTextElement140() } -func (c *current) onListParagraphLine61() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement142() (interface{}, error) { - // `.` is 1, etc. - return (len(c.text)), nil + return strconv.Atoi(string(c.text)) } -func (p *parser) callonListParagraphLine61() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement142() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine61() + return p.cur.onDoubleQuoteBoldTextElement142() } -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) onDoubleQuoteBoldTextElement135(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonListParagraphLine64() (bool, error) { +func (p *parser) callonDoubleQuoteBoldTextElement135() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine64(stack["depth"]) + return p.cur.onDoubleQuoteBoldTextElement135(stack["start"]) } -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) onDoubleQuoteBoldTextElement124(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonListParagraphLine58() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement124() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine58(stack["depth"]) + return p.cur.onDoubleQuoteBoldTextElement124(stack["name"], stack["start"]) } -func (c *current) onListParagraphLine65() (interface{}, error) { - // numbering style: "1." - return types.NewOrderedListItemPrefix(types.Arabic, 1) +func (c *current) onDoubleQuoteBoldTextElement150() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonListParagraphLine65() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement150() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine65() + return p.cur.onDoubleQuoteBoldTextElement150() } -func (c *current) onListParagraphLine70() (interface{}, error) { - // numbering style: "a." - return types.NewOrderedListItemPrefix(types.LowerAlpha, 1) +func (c *current) onDoubleQuoteBoldTextElement162() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonListParagraphLine70() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement162() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine70() + return p.cur.onDoubleQuoteBoldTextElement162() } -func (c *current) onListParagraphLine74() (interface{}, error) { - // numbering style: "A." - return types.NewOrderedListItemPrefix(types.UpperAlpha, 1) +func (c *current) onDoubleQuoteBoldTextElement164() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonListParagraphLine74() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement164() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine74() + return p.cur.onDoubleQuoteBoldTextElement164() } -func (c *current) onListParagraphLine78() (interface{}, error) { - // numbering style: "i)" - return types.NewOrderedListItemPrefix(types.LowerRoman, 1) +func (c *current) onDoubleQuoteBoldTextElement157(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonListParagraphLine78() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement157() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine78() + return p.cur.onDoubleQuoteBoldTextElement157(stack["start"]) } -func (c *current) onListParagraphLine83() (interface{}, error) { - // numbering style: "I)" - return types.NewOrderedListItemPrefix(types.UpperRoman, 1) - +func (c *current) onDoubleQuoteBoldTextElement146(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonListParagraphLine83() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement146() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine83() + return p.cur.onDoubleQuoteBoldTextElement146(stack["name"], stack["start"]) } -func (c *current) onListParagraphLine91() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement172() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonListParagraphLine91() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement172() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine91() + return p.cur.onDoubleQuoteBoldTextElement172() } -func (c *current) onListParagraphLine49(prefix interface{}) (interface{}, error) { - return prefix, nil +func (c *current) onDoubleQuoteBoldTextElement168(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonListParagraphLine49() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement168() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine49(stack["prefix"]) + return p.cur.onDoubleQuoteBoldTextElement168(stack["name"]) } -func (c *current) onListParagraphLine99() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement119(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonListParagraphLine99() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement119() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine99() + return p.cur.onDoubleQuoteBoldTextElement119(stack["element"]) } -func (c *current) onListParagraphLine106() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement178() (interface{}, error) { - // `*` is 1, etc. - return (len(c.text)), nil + return types.NewStringElement(string(c.text)) } -func (p *parser) callonListParagraphLine106() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine106() + return p.cur.onDoubleQuoteBoldTextElement178() } -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) onDoubleQuoteBoldTextElement98(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) } -func (p *parser) callonListParagraphLine109() (bool, error) { +func (p *parser) callonDoubleQuoteBoldTextElement98() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine109(stack["depth"]) + return p.cur.onDoubleQuoteBoldTextElement98(stack["id"], stack["label"]) } -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) onDoubleQuoteBoldTextElement185() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonListParagraphLine103() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement185() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine103(stack["depth"]) + return p.cur.onDoubleQuoteBoldTextElement185() } -func (c *current) onListParagraphLine111() (interface{}, error) { - return types.NewUnorderedListItemPrefix(types.Dash, 1) +func (c *current) onDoubleQuoteBoldTextElement181(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) } -func (p *parser) callonListParagraphLine111() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement181() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine111() + return p.cur.onDoubleQuoteBoldTextElement181(stack["id"]) } -func (c *current) onListParagraphLine116() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement96() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonListParagraphLine116() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement96() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine116() + return p.cur.onDoubleQuoteBoldTextElement96() } -func (c *current) onListParagraphLine94(prefix interface{}) (interface{}, error) { - return prefix, nil +func (c *current) onDoubleQuoteBoldTextElement189() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonListParagraphLine94() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement189() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine94(stack["prefix"]) + return p.cur.onDoubleQuoteBoldTextElement189() } -func (c *current) onListParagraphLine123() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onDoubleQuoteBoldTextElement91(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonListParagraphLine123() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement91() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine123() + return p.cur.onDoubleQuoteBoldTextElement91(stack["element"]) } -func (c *current) onListParagraphLine130() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement191() (interface{}, error) { + return types.NewStringElement("\u2019") + } -func (p *parser) callonListParagraphLine130() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement191() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine130() + return p.cur.onDoubleQuoteBoldTextElement191() } -func (c *current) onListParagraphLine119(ref interface{}) (interface{}, error) { - return ref, nil +func (c *current) onDoubleQuoteBoldTextElement193() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonListParagraphLine119() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement193() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine119(stack["ref"]) + return p.cur.onDoubleQuoteBoldTextElement193() } -func (c *current) onListParagraphLine138() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement195() (interface{}, error) { + return types.NewStringElement("\u2122") + } -func (p *parser) callonListParagraphLine138() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement195() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine138() + return p.cur.onDoubleQuoteBoldTextElement195() } -func (c *current) onListParagraphLine156() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement197() (interface{}, error) { + return types.NewStringElement("\u00ae") + } -func (p *parser) callonListParagraphLine156() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement197() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine156() + return p.cur.onDoubleQuoteBoldTextElement197() } -func (c *current) onListParagraphLine168() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement199() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonListParagraphLine168() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement199() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine168() + return p.cur.onDoubleQuoteBoldTextElement199() } -func (c *current) onListParagraphLine180() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement201() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonListParagraphLine180() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement201() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine180() + return p.cur.onDoubleQuoteBoldTextElement201() } -func (c *current) onListParagraphLine192() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement214() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonListParagraphLine192() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine192() + return p.cur.onDoubleQuoteBoldTextElement214() } -func (c *current) onListParagraphLine204() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement210(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonListParagraphLine204() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement210() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine204() + return p.cur.onDoubleQuoteBoldTextElement210(stack["ref"]) } -func (c *current) onListParagraphLine216() (interface{}, error) { +func (c *current) onDoubleQuoteBoldTextElement222() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonListParagraphLine216() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement222() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine216() + return p.cur.onDoubleQuoteBoldTextElement222() } -func (c *current) onListParagraphLine228() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteBoldTextElement219() (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) callonListParagraphLine228() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement219() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine228() + return p.cur.onDoubleQuoteBoldTextElement219() } -func (c *current) onListParagraphLine239() (interface{}, error) { - return types.NewStringElement(strings.TrimSpace(string(c.text))) +func (c *current) onDoubleQuoteBoldTextElement1(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonListParagraphLine239() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine239() + return p.cur.onDoubleQuoteBoldTextElement1(stack["element"]) } -func (c *current) onListParagraphLine237(content interface{}) (interface{}, error) { - return types.NewInlineElements(content) +func (c *current) onQuotedTextInDoubleQuoteBoldText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -func (p *parser) callonListParagraphLine237() (interface{}, error) { +func (p *parser) callonQuotedTextInDoubleQuoteBoldText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine237(stack["content"]) + return p.cur.onQuotedTextInDoubleQuoteBoldText1(stack["attributes"], stack["text"]) } -func (c *current) onListParagraphLine251() (interface{}, error) { - - return string(c.text), nil +func (c *current) onSingleQuoteBoldText1(elements interface{}) (interface{}, error) { + return types.NewQuotedText(types.SingleQuoteBold, elements.([]interface{})) } -func (p *parser) callonListParagraphLine251() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine251() + return p.cur.onSingleQuoteBoldText1(stack["elements"]) } -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) onSingleQuoteBoldTextElements9() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonListParagraphLine254() (bool, error) { +func (p *parser) callonSingleQuoteBoldTextElements9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine254(stack["content"], stack["separator"]) + return p.cur.onSingleQuoteBoldTextElements9() } -func (c *current) onListParagraphLine259() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElements14(elements interface{}) (bool, error) { + return validateSingleQuoteElements(elements.([]interface{})) // cannot end with spaces + } -func (p *parser) callonListParagraphLine259() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElements14() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine259() + return p.cur.onSingleQuoteBoldTextElements14(stack["elements"]) } -func (c *current) onListParagraphLine248(content, separator interface{}) (interface{}, error) { - return separator, nil +func (c *current) onSingleQuoteBoldTextElements1(elements interface{}) (interface{}, error) { + return elements, nil + } -func (p *parser) callonListParagraphLine248() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElements1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine248(stack["content"], stack["separator"]) + return p.cur.onSingleQuoteBoldTextElements1(stack["elements"]) } -func (c *current) onListParagraphLine273() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement9() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonListParagraphLine273() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine273() + return p.cur.onSingleQuoteBoldTextElement9() } -func (c *current) onListParagraphLine268(elements interface{}) (interface{}, error) { - - return types.NewInlineElements(elements.([]interface{})) +func (c *current) onSingleQuoteBoldTextElement2() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonListParagraphLine268() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine268(stack["elements"]) + return p.cur.onSingleQuoteBoldTextElement2() } -func (c *current) onListParagraphLine1(line interface{}) (interface{}, error) { - - return line, nil +func (c *current) onSingleQuoteBoldTextElement12() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonListParagraphLine1() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement12() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine1(stack["line"]) + return p.cur.onSingleQuoteBoldTextElement12() } -func (c *current) onContinuedListItemElement7() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement19() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonContinuedListItemElement7() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement19() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemElement7() + return p.cur.onSingleQuoteBoldTextElement19() } -func (c *current) onContinuedListItemElement1(element interface{}) (interface{}, error) { - return types.NewContinuedListItemElement(element) // offset is negative +func (c *current) onSingleQuoteBoldTextElement25() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonContinuedListItemElement1() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement25() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemElement1(stack["element"]) + return p.cur.onSingleQuoteBoldTextElement25() } -func (c *current) onContinuedListItemContent17() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement29() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonContinuedListItemContent17() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement29() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent17() + return p.cur.onSingleQuoteBoldTextElement29() } -func (c *current) onContinuedListItemContent26() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement36() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent26() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement36() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent26() + return p.cur.onSingleQuoteBoldTextElement36() } -func (c *current) onContinuedListItemContent9(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onSingleQuoteBoldTextElement48() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent9() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent9(stack["content"]) + return p.cur.onSingleQuoteBoldTextElement48() } -func (c *current) onContinuedListItemContent36() (interface{}, error) { - return types.NewThematicBreak() +func (c *current) onSingleQuoteBoldTextElement50() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonContinuedListItemContent36() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement50() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent36() + return p.cur.onSingleQuoteBoldTextElement50() } -func (c *current) onContinuedListItemContent61() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement43(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonContinuedListItemContent61() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement43() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent61() + return p.cur.onSingleQuoteBoldTextElement43(stack["start"]) } -func (c *current) onContinuedListItemContent53() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onSingleQuoteBoldTextElement32(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonContinuedListItemContent53() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent53() + return p.cur.onSingleQuoteBoldTextElement32(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemContent70() (bool, error) { - attrs := c.globalStore.getAttributes() - return types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Literal), nil +func (c *current) onSingleQuoteBoldTextElement58() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonContinuedListItemContent70() (bool, error) { +func (p *parser) callonSingleQuoteBoldTextElement58() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent70() + return p.cur.onSingleQuoteBoldTextElement58() } -func (c *current) onContinuedListItemContent84() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement70() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent84() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement70() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent84() + return p.cur.onSingleQuoteBoldTextElement70() } -func (c *current) onContinuedListItemContent76() (interface{}, error) { - return types.NewBlankLine() -} +func (c *current) onSingleQuoteBoldTextElement72() (interface{}, error) { -func (p *parser) callonContinuedListItemContent76() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onContinuedListItemContent76() -} + return strconv.Atoi(string(c.text)) -func (c *current) onContinuedListItemContent92() (interface{}, error) { - return types.NewRawLine(string(c.text)) } -func (p *parser) callonContinuedListItemContent92() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement72() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent92() + return p.cur.onSingleQuoteBoldTextElement72() } -func (c *current) onContinuedListItemContent73(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onSingleQuoteBoldTextElement65(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonContinuedListItemContent73() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement65() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent73(stack["content"]) + return p.cur.onSingleQuoteBoldTextElement65(stack["start"]) } -func (c *current) onContinuedListItemContent68(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithAttribute, lines.([]interface{}), c.globalStore.getAttributes()) - +func (c *current) onSingleQuoteBoldTextElement54(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonContinuedListItemContent68() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent68(stack["lines"]) + return p.cur.onSingleQuoteBoldTextElement54(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemContent113() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement80() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent113() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent113() + return p.cur.onSingleQuoteBoldTextElement80() } -func (c *current) onContinuedListItemContent108() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onSingleQuoteBoldTextElement76(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonContinuedListItemContent108() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement76() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent108() + return p.cur.onSingleQuoteBoldTextElement76(stack["name"]) } -func (c *current) onContinuedListItemContent105(line interface{}) (interface{}, error) { - // do not include the trailing 'EOL' on the first line - return line, nil +func (c *current) onSingleQuoteBoldTextElement27(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonContinuedListItemContent105() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent105(stack["line"]) + return p.cur.onSingleQuoteBoldTextElement27(stack["element"]) } -func (c *current) onContinuedListItemContent135() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement88() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonContinuedListItemContent135() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement88() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent135() + return p.cur.onSingleQuoteBoldTextElement88() } -func (c *current) onContinuedListItemContent127() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onSingleQuoteBoldTextElement97() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent127() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent127() + return p.cur.onSingleQuoteBoldTextElement97() } -func (c *current) onContinuedListItemContent143() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onSingleQuoteBoldTextElement103() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent143() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement103() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent143() + return p.cur.onSingleQuoteBoldTextElement103() } -func (c *current) onContinuedListItemContent124(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onSingleQuoteBoldTextElement109() (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) callonContinuedListItemContent124() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement109() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent124(stack["content"]) + return p.cur.onSingleQuoteBoldTextElement109() } -func (c *current) onContinuedListItemContent102(firstLine, otherLines interface{}) (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement116() (bool, error) { + return c.isSubstitutionEnabled(Attributes) - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil } -func (p *parser) callonContinuedListItemContent102() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement116() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent102(stack["firstLine"], stack["otherLines"]) + return p.cur.onSingleQuoteBoldTextElement116() } -func (c *current) onContinuedListItemContent100(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithSpacesOnFirstLine, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuoteBoldTextElement123() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent100() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement123() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent100(stack["lines"]) + return p.cur.onSingleQuoteBoldTextElement123() } -func (c *current) onContinuedListItemContent157() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement135() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent157() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement135() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent157() + return p.cur.onSingleQuoteBoldTextElement135() } -func (c *current) onContinuedListItemContent169() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onSingleQuoteBoldTextElement137() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonContinuedListItemContent169() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent169() + return p.cur.onSingleQuoteBoldTextElement137() } -func (c *current) onContinuedListItemContent166(line interface{}) (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement130(start interface{}) (interface{}, error) { + return start, nil - return line, nil // do not include the trailing 'EOL' } -func (p *parser) callonContinuedListItemContent166() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement130() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent166(stack["line"]) + return p.cur.onSingleQuoteBoldTextElement130(stack["start"]) } -func (c *current) onContinuedListItemContent163(lines interface{}) (interface{}, error) { - return lines.([]interface{}), nil +func (c *current) onSingleQuoteBoldTextElement119(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonContinuedListItemContent163() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement119() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent163(stack["lines"]) + return p.cur.onSingleQuoteBoldTextElement119(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemContent186() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement145() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent186() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement145() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent186() + return p.cur.onSingleQuoteBoldTextElement145() } -func (c *current) onContinuedListItemContent151(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithDelimiter, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuoteBoldTextElement157() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent151() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement157() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent151(stack["lines"]) + return p.cur.onSingleQuoteBoldTextElement157() } -func (c *current) onContinuedListItemContent199() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement159() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonContinuedListItemContent199() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement159() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent199() + return p.cur.onSingleQuoteBoldTextElement159() } -func (c *current) onContinuedListItemContent212() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement152(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonContinuedListItemContent212() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement152() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent212() + return p.cur.onSingleQuoteBoldTextElement152(stack["start"]) } -func (c *current) onContinuedListItemContent217() (interface{}, error) { - return types.NewStringElement(string(c.text)) - +func (c *current) onSingleQuoteBoldTextElement141(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonContinuedListItemContent217() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement141() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent217() + return p.cur.onSingleQuoteBoldTextElement141(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemContent224() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement167() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent224() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement167() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent224() + return p.cur.onSingleQuoteBoldTextElement167() } -func (c *current) onContinuedListItemContent236() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement163(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonContinuedListItemContent236() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement163() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent236() + return p.cur.onSingleQuoteBoldTextElement163(stack["name"]) } -func (c *current) onContinuedListItemContent238() (interface{}, error) { - - return strconv.Atoi(string(c.text)) +func (c *current) onSingleQuoteBoldTextElement114(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonContinuedListItemContent238() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement114() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent238() + return p.cur.onSingleQuoteBoldTextElement114(stack["element"]) } -func (c *current) onContinuedListItemContent231(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onSingleQuoteBoldTextElement173() (interface{}, error) { + + return types.NewStringElement(string(c.text)) } -func (p *parser) callonContinuedListItemContent231() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement173() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent231(stack["start"]) + return p.cur.onSingleQuoteBoldTextElement173() } -func (c *current) onContinuedListItemContent220(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), false, start) +func (c *current) onSingleQuoteBoldTextElement93(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonContinuedListItemContent220() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement93() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent220(stack["name"], stack["start"]) + return p.cur.onSingleQuoteBoldTextElement93(stack["id"], stack["label"]) } -func (c *current) onContinuedListItemContent246() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement180() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent246() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement180() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent246() + return p.cur.onSingleQuoteBoldTextElement180() } -func (c *current) onContinuedListItemContent258() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement176(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) } -func (p *parser) callonContinuedListItemContent258() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement176() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent258() + return p.cur.onSingleQuoteBoldTextElement176(stack["id"]) } -func (c *current) onContinuedListItemContent260() (interface{}, error) { - - return strconv.Atoi(string(c.text)) +func (c *current) onSingleQuoteBoldTextElement91() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonContinuedListItemContent260() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement91() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent260() + return p.cur.onSingleQuoteBoldTextElement91() } -func (c *current) onContinuedListItemContent253(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onSingleQuoteBoldTextElement184() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonContinuedListItemContent253() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement184() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent253(stack["start"]) + return p.cur.onSingleQuoteBoldTextElement184() } -func (c *current) onContinuedListItemContent242(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), true, nil) +func (c *current) onSingleQuoteBoldTextElement86(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonContinuedListItemContent242() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement86() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent242(stack["name"], stack["start"]) + return p.cur.onSingleQuoteBoldTextElement86(stack["element"]) } -func (c *current) onContinuedListItemContent268() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement186() (interface{}, error) { + return types.NewStringElement("\u2019") + } -func (p *parser) callonContinuedListItemContent268() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent268() + return p.cur.onSingleQuoteBoldTextElement186() } -func (c *current) onContinuedListItemContent264(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onSingleQuoteBoldTextElement188() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonContinuedListItemContent264() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement188() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent264(stack["name"]) + return p.cur.onSingleQuoteBoldTextElement188() } -func (c *current) onContinuedListItemContent274() (interface{}, error) { - // standalone '{' - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteBoldTextElement190() (interface{}, error) { + return types.NewStringElement("\u2122") } -func (p *parser) callonContinuedListItemContent274() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement190() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent274() + return p.cur.onSingleQuoteBoldTextElement190() } -func (c *current) onContinuedListItemContent207(elements interface{}) (interface{}, error) { - return types.Reduce(elements.([]interface{}), strings.TrimSpace), nil +func (c *current) onSingleQuoteBoldTextElement192() (interface{}, error) { + return types.NewStringElement("\u00ae") + } -func (p *parser) callonContinuedListItemContent207() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement192() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent207(stack["elements"]) + return p.cur.onSingleQuoteBoldTextElement192() } -func (c *current) onContinuedListItemContent195(name, value interface{}) (interface{}, error) { - return types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) +func (c *current) onSingleQuoteBoldTextElement194() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonContinuedListItemContent195() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement194() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent195(stack["name"], stack["value"]) + return p.cur.onSingleQuoteBoldTextElement194() } -func (c *current) onContinuedListItemContent285() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement196() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonContinuedListItemContent285() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement196() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent285() + return p.cur.onSingleQuoteBoldTextElement196() } -func (c *current) onContinuedListItemContent294() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement209() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonContinuedListItemContent294() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement209() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent294() + return p.cur.onSingleQuoteBoldTextElement209() } -func (c *current) onContinuedListItemContent281(name interface{}) (interface{}, error) { - return types.NewAttributeReset(name.(string)) +func (c *current) onSingleQuoteBoldTextElement205(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonContinuedListItemContent281() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement205() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent281(stack["name"]) + return p.cur.onSingleQuoteBoldTextElement205(stack["ref"]) } -func (c *current) onContinuedListItemContent305() (interface{}, error) { +func (c *current) onSingleQuoteBoldTextElement217() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent305() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement217() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent305() + return p.cur.onSingleQuoteBoldTextElement217() } -func (c *current) onContinuedListItemContent314() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteBoldTextElement214() (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) callonContinuedListItemContent314() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextElement214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent314() + return p.cur.onSingleQuoteBoldTextElement214() } -func (c *current) onContinuedListItemContent301(name interface{}) (interface{}, error) { - return types.NewAttributeReset(name.(string)) +func (c *current) onQuotedTextInSingleQuoteBoldText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -func (p *parser) callonContinuedListItemContent301() (interface{}, error) { +func (p *parser) callonQuotedTextInSingleQuoteBoldText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent301(stack["name"]) + return p.cur.onQuotedTextInSingleQuoteBoldText1(stack["attributes"], stack["text"]) } -func (c *current) onContinuedListItemContent333() (interface{}, error) { - return types.Tip, nil +func (c *current) onEscapedBoldText5() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent333() (interface{}, error) { +func (p *parser) callonEscapedBoldText5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent333() + return p.cur.onEscapedBoldText5() } -func (c *current) onContinuedListItemContent335() (interface{}, error) { - return types.Note, 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) callonContinuedListItemContent335() (interface{}, error) { +func (p *parser) callonEscapedBoldText2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent335() + return p.cur.onEscapedBoldText2(stack["backslashes"], stack["elements"]) } -func (c *current) onContinuedListItemContent337() (interface{}, error) { - return types.Important, nil +func (c *current) onEscapedBoldText17() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent337() (interface{}, error) { +func (p *parser) callonEscapedBoldText17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent337() + return p.cur.onEscapedBoldText17() } -func (c *current) onContinuedListItemContent339() (interface{}, error) { - return types.Warning, 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) callonContinuedListItemContent339() (interface{}, error) { +func (p *parser) callonEscapedBoldText14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent339() + return p.cur.onEscapedBoldText14(stack["backslashes"], stack["elements"]) } -func (c *current) onContinuedListItemContent341() (interface{}, error) { - return types.Caution, nil +func (c *current) onEscapedBoldText27() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent341() (interface{}, error) { +func (p *parser) callonEscapedBoldText27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent341() + return p.cur.onEscapedBoldText27() } -func (c *current) onContinuedListItemContent355() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onEscapedBoldText24(backslashes, elements interface{}) (interface{}, error) { + // simple punctuation must be evaluated last + return types.NewEscapedQuotedText(backslashes.(string), "*", elements.([]interface{})) } -func (p *parser) callonContinuedListItemContent355() (interface{}, error) { +func (p *parser) callonEscapedBoldText24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent355() + return p.cur.onEscapedBoldText24(stack["backslashes"], stack["elements"]) } -func (c *current) onContinuedListItemContent364() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteItalicText1(elements interface{}) (interface{}, error) { + // double punctuation must be evaluated first + return types.NewQuotedText(types.DoubleQuoteItalic, elements.([]interface{})) } -func (p *parser) callonContinuedListItemContent364() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent364() + return p.cur.onDoubleQuoteItalicText1(stack["elements"]) } -func (c *current) onContinuedListItemContent351(elements interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement14() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent351() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent351(stack["elements"]) + return p.cur.onDoubleQuoteItalicTextElement14() } -func (c *current) onContinuedListItemContent348(content interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement7() (interface{}, error) { + return types.NewStringElement(string(c.text)) - return types.NewRawLine(content.(string)) } -func (p *parser) callonContinuedListItemContent348() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent348(stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement7() } -func (c *current) onContinuedListItemContent390() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement17() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent390() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent390() + return p.cur.onDoubleQuoteItalicTextElement17() } -func (c *current) onContinuedListItemContent405() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement24() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonContinuedListItemContent405() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent405() + return p.cur.onDoubleQuoteItalicTextElement24() } -func (c *current) onContinuedListItemContent414() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement30() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonContinuedListItemContent414() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement30() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent414() + return p.cur.onDoubleQuoteItalicTextElement30() } -func (c *current) onContinuedListItemContent397(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onDoubleQuoteItalicTextElement34() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonContinuedListItemContent397() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement34() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent397(stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement34() } -func (c *current) onContinuedListItemContent435() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement41() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent435() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement41() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent435() + return p.cur.onDoubleQuoteItalicTextElement41() } -func (c *current) onContinuedListItemContent447() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement53() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent447() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement53() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent447() + return p.cur.onDoubleQuoteItalicTextElement53() } -func (c *current) onContinuedListItemContent459() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement55() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonContinuedListItemContent459() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement55() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent459() + return p.cur.onDoubleQuoteItalicTextElement55() } -func (c *current) onContinuedListItemContent471() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement48(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonContinuedListItemContent471() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent471() + return p.cur.onDoubleQuoteItalicTextElement48(stack["start"]) } -func (c *current) onContinuedListItemContent483() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement37(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonContinuedListItemContent483() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement37() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent483() + return p.cur.onDoubleQuoteItalicTextElement37(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemContent495() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement63() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent495() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement63() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent495() + return p.cur.onDoubleQuoteItalicTextElement63() } -func (c *current) onContinuedListItemContent507() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement75() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent507() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement75() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent507() + return p.cur.onDoubleQuoteItalicTextElement75() } -func (c *current) onContinuedListItemContent515() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement77() (interface{}, error) { + + return strconv.Atoi(string(c.text)) - return string(c.text), nil } -func (p *parser) callonContinuedListItemContent515() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement77() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent515() + return p.cur.onDoubleQuoteItalicTextElement77() } -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) onDoubleQuoteItalicTextElement70(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonContinuedListItemContent523() (bool, error) { +func (p *parser) callonDoubleQuoteItalicTextElement70() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent523(stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement70(stack["start"]) } -func (c *current) onContinuedListItemContent422(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) - +func (c *current) onDoubleQuoteItalicTextElement59(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonContinuedListItemContent422() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement59() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent422(stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement59(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemContent382(line interface{}) (interface{}, error) { - return line, nil +func (c *current) onDoubleQuoteItalicTextElement85() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent382() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent382(stack["line"]) + return p.cur.onDoubleQuoteItalicTextElement85() } -func (c *current) onContinuedListItemContent345(firstLine, otherLines interface{}) (interface{}, error) { - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil +func (c *current) onDoubleQuoteItalicTextElement81(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonContinuedListItemContent345() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement81() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent345(stack["firstLine"], stack["otherLines"]) + return p.cur.onDoubleQuoteItalicTextElement81(stack["name"]) } -func (c *current) onContinuedListItemContent329(t, lines interface{}) (interface{}, error) { - - return types.NewAdmonitionParagraph(lines.([]interface{}), t.(string), c.globalStore.getAttributes()) +func (c *current) onDoubleQuoteItalicTextElement32(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonContinuedListItemContent329() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent329(stack["t"], stack["lines"]) + return p.cur.onDoubleQuoteItalicTextElement32(stack["element"]) } -func (c *current) onContinuedListItemContent536() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteItalicTextElement93() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonContinuedListItemContent536() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement93() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent536() + return p.cur.onDoubleQuoteItalicTextElement93() } -func (c *current) onContinuedListItemContent545() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteItalicTextElement102() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonContinuedListItemContent545() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement102() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent545() + return p.cur.onDoubleQuoteItalicTextElement102() } -func (c *current) onContinuedListItemContent532(elements interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement108() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent532() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement108() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent532(stack["elements"]) + return p.cur.onDoubleQuoteItalicTextElement108() } -func (c *current) onContinuedListItemContent529(content interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement114() (interface{}, error) { + // `{`, `>` and `>` characters are not allowed as they are used for attribute substitutions and cross-references + return types.NewStringElement(string(c.text)) - return types.NewRawLine(content.(string)) } -func (p *parser) callonContinuedListItemContent529() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement114() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent529(stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement114() } -func (c *current) onContinuedListItemContent571() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement121() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonContinuedListItemContent571() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement121() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent571() + return p.cur.onDoubleQuoteItalicTextElement121() } -func (c *current) onContinuedListItemContent586() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement128() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent586() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement128() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent586() + return p.cur.onDoubleQuoteItalicTextElement128() } -func (c *current) onContinuedListItemContent595() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement140() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent595() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement140() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent595() + return p.cur.onDoubleQuoteItalicTextElement140() } -func (c *current) onContinuedListItemContent578(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) -} +func (c *current) onDoubleQuoteItalicTextElement142() (interface{}, error) { -func (p *parser) callonContinuedListItemContent578() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onContinuedListItemContent578(stack["content"]) -} + return strconv.Atoi(string(c.text)) -func (c *current) onContinuedListItemContent616() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonContinuedListItemContent616() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement142() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent616() + return p.cur.onDoubleQuoteItalicTextElement142() } -func (c *current) onContinuedListItemContent628() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement135(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonContinuedListItemContent628() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement135() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent628() + return p.cur.onDoubleQuoteItalicTextElement135(stack["start"]) } -func (c *current) onContinuedListItemContent640() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement124(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonContinuedListItemContent640() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement124() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent640() + return p.cur.onDoubleQuoteItalicTextElement124(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemContent652() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement150() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent652() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement150() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent652() + return p.cur.onDoubleQuoteItalicTextElement150() } -func (c *current) onContinuedListItemContent664() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement162() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonContinuedListItemContent664() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement162() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent664() + return p.cur.onDoubleQuoteItalicTextElement162() } -func (c *current) onContinuedListItemContent676() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onDoubleQuoteItalicTextElement164() (interface{}, error) { -func (p *parser) callonContinuedListItemContent676() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onContinuedListItemContent676() -} + return strconv.Atoi(string(c.text)) -func (c *current) onContinuedListItemContent688() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonContinuedListItemContent688() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement164() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent688() + return p.cur.onDoubleQuoteItalicTextElement164() } -func (c *current) onContinuedListItemContent696() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement157(start interface{}) (interface{}, error) { + return start, nil - return string(c.text), nil } -func (p *parser) callonContinuedListItemContent696() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement157() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent696() + return p.cur.onDoubleQuoteItalicTextElement157(stack["start"]) } -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) onDoubleQuoteItalicTextElement146(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonContinuedListItemContent704() (bool, error) { +func (p *parser) callonDoubleQuoteItalicTextElement146() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent704(stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement146(stack["name"], stack["start"]) } -func (c *current) onContinuedListItemContent603(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onDoubleQuoteItalicTextElement172() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonContinuedListItemContent603() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement172() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent603(stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement172() } -func (c *current) onContinuedListItemContent563(line interface{}) (interface{}, error) { - return line, nil +func (c *current) onDoubleQuoteItalicTextElement168(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonContinuedListItemContent563() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement168() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent563(stack["line"]) + return p.cur.onDoubleQuoteItalicTextElement168(stack["name"]) } -func (c *current) onContinuedListItemContent526(firstLine, otherLines interface{}) (interface{}, error) { - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil +func (c *current) onDoubleQuoteItalicTextElement119(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonContinuedListItemContent526() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement119() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent526(stack["firstLine"], stack["otherLines"]) + return p.cur.onDoubleQuoteItalicTextElement119(stack["element"]) } -func (c *current) onContinuedListItemContent524(lines interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement178() (interface{}, error) { + + return types.NewStringElement(string(c.text)) - return types.NewParagraph(lines.([]interface{}), c.globalStore.getAttributes()) } -func (p *parser) callonContinuedListItemContent524() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent524(stack["lines"]) + return p.cur.onDoubleQuoteItalicTextElement178() } -func (c *current) onContinuedListItemContent1(content interface{}) (interface{}, error) { - return content, nil +func (c *current) onDoubleQuoteItalicTextElement98(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonContinuedListItemContent1() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement98() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemContent1(stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement98(stack["id"], stack["label"]) } -func (c *current) onOrderedListItem9() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement185() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonOrderedListItem9() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement185() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem9() + return p.cur.onDoubleQuoteItalicTextElement185() } -func (c *current) onOrderedListItem16() (interface{}, error) { - - // `.` is 1, etc. - return (len(c.text)), nil +func (c *current) onDoubleQuoteItalicTextElement181(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) } -func (p *parser) callonOrderedListItem16() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement181() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem16() + return p.cur.onDoubleQuoteItalicTextElement181(stack["id"]) } -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) onDoubleQuoteItalicTextElement96() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonOrderedListItem19() (bool, error) { +func (p *parser) callonDoubleQuoteItalicTextElement96() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem19(stack["depth"]) + return p.cur.onDoubleQuoteItalicTextElement96() } -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) onDoubleQuoteItalicTextElement189() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonOrderedListItem13() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement189() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem13(stack["depth"]) + return p.cur.onDoubleQuoteItalicTextElement189() } -func (c *current) onOrderedListItem20() (interface{}, error) { - // numbering style: "1." - return types.NewOrderedListItemPrefix(types.Arabic, 1) +func (c *current) onDoubleQuoteItalicTextElement91(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonOrderedListItem20() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement91() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem20() + return p.cur.onDoubleQuoteItalicTextElement91(stack["element"]) } -func (c *current) onOrderedListItem25() (interface{}, error) { - // numbering style: "a." - return types.NewOrderedListItemPrefix(types.LowerAlpha, 1) +func (c *current) onDoubleQuoteItalicTextElement191() (interface{}, error) { + return types.NewStringElement("\u2019") } -func (p *parser) callonOrderedListItem25() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement191() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem25() + return p.cur.onDoubleQuoteItalicTextElement191() } -func (c *current) onOrderedListItem29() (interface{}, error) { - // numbering style: "A." - return types.NewOrderedListItemPrefix(types.UpperAlpha, 1) +func (c *current) onDoubleQuoteItalicTextElement193() (interface{}, error) { + return types.NewStringElement("\u00a9") } -func (p *parser) callonOrderedListItem29() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement193() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem29() + return p.cur.onDoubleQuoteItalicTextElement193() } -func (c *current) onOrderedListItem33() (interface{}, error) { - // numbering style: "i)" - return types.NewOrderedListItemPrefix(types.LowerRoman, 1) +func (c *current) onDoubleQuoteItalicTextElement195() (interface{}, error) { + return types.NewStringElement("\u2122") } -func (p *parser) callonOrderedListItem33() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement195() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem33() + return p.cur.onDoubleQuoteItalicTextElement195() } -func (c *current) onOrderedListItem38() (interface{}, error) { - // numbering style: "I)" - return types.NewOrderedListItemPrefix(types.UpperRoman, 1) +func (c *current) onDoubleQuoteItalicTextElement197() (interface{}, error) { + return types.NewStringElement("\u00ae") } -func (p *parser) callonOrderedListItem38() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement197() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem38() + return p.cur.onDoubleQuoteItalicTextElement197() } -func (c *current) onOrderedListItem46() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteItalicTextElement199() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonOrderedListItem46() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement199() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem46() + return p.cur.onDoubleQuoteItalicTextElement199() } -func (c *current) onOrderedListItem4(prefix interface{}) (interface{}, error) { - return prefix, nil +func (c *current) onDoubleQuoteItalicTextElement201() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonOrderedListItem4() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement201() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem4(stack["prefix"]) + return p.cur.onDoubleQuoteItalicTextElement201() } -func (c *current) onOrderedListItem1(prefix, content interface{}) (interface{}, error) { - return types.NewOrderedListItem(prefix.(types.OrderedListItemPrefix), content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onDoubleQuoteItalicTextElement214() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonOrderedListItem1() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItem1(stack["prefix"], stack["content"]) + return p.cur.onDoubleQuoteItalicTextElement214() } -func (c *current) onOrderedListItemContent1(elements interface{}) (interface{}, error) { - return types.NewListItemContent(elements.([]interface{})) +func (c *current) onDoubleQuoteItalicTextElement210(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonOrderedListItemContent1() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement210() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onOrderedListItemContent1(stack["elements"]) + return p.cur.onDoubleQuoteItalicTextElement210(stack["ref"]) } -func (c *current) onUnorderedListItem9() (interface{}, error) { +func (c *current) onDoubleQuoteItalicTextElement222() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonUnorderedListItem9() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement222() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem9() + return p.cur.onDoubleQuoteItalicTextElement222() } -func (c *current) onUnorderedListItem16() (interface{}, error) { - - // `*` is 1, etc. - return (len(c.text)), nil +func (c *current) onDoubleQuoteItalicTextElement219() (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) callonUnorderedListItem16() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextElement219() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem16() + return p.cur.onDoubleQuoteItalicTextElement219() } -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) onDoubleQuoteItalicTextElement1(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonUnorderedListItem19() (bool, error) { +func (p *parser) callonDoubleQuoteItalicTextElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem19(stack["depth"]) + return p.cur.onDoubleQuoteItalicTextElement1(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) onQuotedTextInDoubleQuoteItalicText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) } -func (p *parser) callonUnorderedListItem13() (interface{}, error) { +func (p *parser) callonQuotedTextInDoubleQuoteItalicText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem13(stack["depth"]) + return p.cur.onQuotedTextInDoubleQuoteItalicText1(stack["attributes"], stack["text"]) } -func (c *current) onUnorderedListItem21() (interface{}, error) { - return types.NewUnorderedListItemPrefix(types.Dash, 1) +func (c *current) onSingleQuoteItalicText1(elements interface{}) (interface{}, error) { + + return types.NewQuotedText(types.SingleQuoteItalic, elements.([]interface{})) } -func (p *parser) callonUnorderedListItem21() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem21() + return p.cur.onSingleQuoteItalicText1(stack["elements"]) } -func (c *current) onUnorderedListItem26() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElements9() (interface{}, error) { 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) callonSingleQuoteItalicTextElements9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem4(stack["prefix"]) + return p.cur.onSingleQuoteItalicTextElements9() } -func (c *current) onUnorderedListItem36() (interface{}, error) { - return types.Unchecked, nil +func (c *current) onSingleQuoteItalicTextElements14(elements interface{}) (bool, error) { + return validateSingleQuoteElements(elements.([]interface{})) // cannot end with spaces + } -func (p *parser) callonUnorderedListItem36() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElements14() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem36() + return p.cur.onSingleQuoteItalicTextElements14(stack["elements"]) } -func (c *current) onUnorderedListItem38() (interface{}, error) { - return types.Checked, nil +func (c *current) onSingleQuoteItalicTextElements1(elements interface{}) (interface{}, error) { + return elements, nil + } -func (p *parser) callonUnorderedListItem38() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElements1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem38() + return p.cur.onSingleQuoteItalicTextElements1(stack["elements"]) } -func (c *current) onUnorderedListItem40() (interface{}, error) { - return types.Checked, nil +func (c *current) onSingleQuoteItalicTextElement9() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonUnorderedListItem40() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem40() + return p.cur.onSingleQuoteItalicTextElement9() } -func (c *current) onUnorderedListItem45() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement2() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonUnorderedListItem45() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem45() + return p.cur.onSingleQuoteItalicTextElement2() } -func (c *current) onUnorderedListItem30(style interface{}) (interface{}, error) { - return style, nil +func (c *current) onSingleQuoteItalicTextElement12() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonUnorderedListItem30() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement12() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem30(stack["style"]) + return p.cur.onSingleQuoteItalicTextElement12() } -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) onSingleQuoteItalicTextElement19() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonUnorderedListItem1() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement19() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItem1(stack["prefix"], stack["checkstyle"], stack["content"]) + return p.cur.onSingleQuoteItalicTextElement19() } -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) onSingleQuoteItalicTextElement25() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonUnorderedListItemContent1() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement25() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onUnorderedListItemContent1(stack["elements"]) + return p.cur.onSingleQuoteItalicTextElement25() } -func (c *current) onLabeledListItem6() (interface{}, error) { - return types.NewStringElement(strings.TrimSpace(string(c.text))) +func (c *current) onSingleQuoteItalicTextElement29() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonLabeledListItem6() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement29() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem6() + return p.cur.onSingleQuoteItalicTextElement29() } -func (c *current) onLabeledListItem4(content interface{}) (interface{}, error) { - return types.NewInlineElements(content) +func (c *current) onSingleQuoteItalicTextElement36() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonLabeledListItem4() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement36() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem4(stack["content"]) + return p.cur.onSingleQuoteItalicTextElement36() } -func (c *current) onLabeledListItem19() (interface{}, error) { - +func (c *current) onSingleQuoteItalicTextElement48() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonLabeledListItem19() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem19() + return p.cur.onSingleQuoteItalicTextElement48() } -func (c *current) onLabeledListItem22(separator interface{}) (bool, error) { +func (c *current) onSingleQuoteItalicTextElement50() (interface{}, error) { - // use a predicate to make sure that only `::` to `::::` are allowed - return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil + return strconv.Atoi(string(c.text)) } -func (p *parser) callonLabeledListItem22() (bool, error) { +func (p *parser) callonSingleQuoteItalicTextElement50() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem22(stack["separator"]) + return p.cur.onSingleQuoteItalicTextElement50() } -func (c *current) onLabeledListItem27() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement43(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonLabeledListItem27() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement43() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem27() + return p.cur.onSingleQuoteItalicTextElement43(stack["start"]) } -func (c *current) onLabeledListItem16(separator interface{}) (interface{}, error) { - return separator, nil +func (c *current) onSingleQuoteItalicTextElement32(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonLabeledListItem16() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem16(stack["separator"]) + return p.cur.onSingleQuoteItalicTextElement32(stack["name"], stack["start"]) } -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) onSingleQuoteItalicTextElement58() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonLabeledListItem1() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement58() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItem1(stack["term"], stack["separator"], stack["description"]) + return p.cur.onSingleQuoteItalicTextElement58() } -func (c *current) onLabeledListItemTerm1(elements interface{}) (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement70() (interface{}, error) { + return string(c.text), nil - return types.NewInlineElements(elements.([]interface{})) } -func (p *parser) callonLabeledListItemTerm1() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement70() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTerm1(stack["elements"]) + return p.cur.onSingleQuoteItalicTextElement70() } -func (c *current) onLabeledListItemTermElement4() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement72() (interface{}, error) { - return types.NewStringElement(string(c.text)) + return strconv.Atoi(string(c.text)) } -func (p *parser) callonLabeledListItemTermElement4() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement72() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement4() + return p.cur.onSingleQuoteItalicTextElement72() } -func (c *current) onLabeledListItemTermElement13() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteItalicTextElement65(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonLabeledListItemTermElement13() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement65() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement13() + return p.cur.onSingleQuoteItalicTextElement65(stack["start"]) } -func (c *current) onLabeledListItemTermElement26() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement54(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonLabeledListItemTermElement26() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement26() + return p.cur.onSingleQuoteItalicTextElement54(stack["name"], stack["start"]) } -func (c *current) onLabeledListItemTermElement32() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement80() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement32() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement32() + return p.cur.onSingleQuoteItalicTextElement80() } -func (c *current) onLabeledListItemTermElement22() (interface{}, error) { - return types.NewLineBreak() +func (c *current) onSingleQuoteItalicTextElement76(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonLabeledListItemTermElement22() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement76() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement22() + return p.cur.onSingleQuoteItalicTextElement76(stack["name"]) } -func (c *current) onLabeledListItemTermElement43() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement27(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonLabeledListItemTermElement43() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement43() + return p.cur.onSingleQuoteItalicTextElement27(stack["element"]) } -func (c *current) onLabeledListItemTermElement54() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement88() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonLabeledListItemTermElement54() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement88() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement54() + return p.cur.onSingleQuoteItalicTextElement88() } -func (c *current) onLabeledListItemTermElement50() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement97() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement50() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement50() + return p.cur.onSingleQuoteItalicTextElement97() } -func (c *current) onLabeledListItemTermElement63() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement103() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement63() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement103() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement63() + return p.cur.onSingleQuoteItalicTextElement103() } -func (c *current) onLabeledListItemTermElement69() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement109() (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) callonLabeledListItemTermElement69() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement109() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement69() + return p.cur.onSingleQuoteItalicTextElement109() } -func (c *current) onLabeledListItemTermElement76() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement116() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonLabeledListItemTermElement76() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement116() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement76() + return p.cur.onSingleQuoteItalicTextElement116() } -func (c *current) onLabeledListItemTermElement72() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement123() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement72() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement123() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement72() + return p.cur.onSingleQuoteItalicTextElement123() } -func (c *current) onLabeledListItemTermElement58(content interface{}) (interface{}, error) { - return content, nil +func (c *current) onSingleQuoteItalicTextElement135() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement58() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement135() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement58(stack["content"]) + return p.cur.onSingleQuoteItalicTextElement135() } -func (c *current) onLabeledListItemTermElement85() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement137() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonLabeledListItemTermElement85() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement85() + return p.cur.onSingleQuoteItalicTextElement137() } -func (c *current) onLabeledListItemTermElement91() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement130(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonLabeledListItemTermElement91() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement130() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement91() + return p.cur.onSingleQuoteItalicTextElement130(stack["start"]) } -func (c *current) onLabeledListItemTermElement98() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement119(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonLabeledListItemTermElement98() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement119() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement98() + return p.cur.onSingleQuoteItalicTextElement119(stack["name"], stack["start"]) } -func (c *current) onLabeledListItemTermElement94() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement145() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement94() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement145() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement94() + return p.cur.onSingleQuoteItalicTextElement145() } -func (c *current) onLabeledListItemTermElement80(content interface{}) (interface{}, error) { - return content, nil +func (c *current) onSingleQuoteItalicTextElement157() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement80() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement157() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement80(stack["content"]) + return p.cur.onSingleQuoteItalicTextElement157() } -func (c *current) onLabeledListItemTermElement46(term1, term2, term3 interface{}) (interface{}, error) { - return types.NewConcealedIndexTerm(term1, term2, term3) +func (c *current) onSingleQuoteItalicTextElement159() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonLabeledListItemTermElement46() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement159() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement46(stack["term1"], stack["term2"], stack["term3"]) + return p.cur.onSingleQuoteItalicTextElement159() } -func (c *current) onLabeledListItemTermElement115() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement152(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonLabeledListItemTermElement115() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement152() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement115() + return p.cur.onSingleQuoteItalicTextElement152(stack["start"]) } -func (c *current) onLabeledListItemTermElement121() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement141(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonLabeledListItemTermElement121() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement141() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement121() + return p.cur.onSingleQuoteItalicTextElement141(stack["name"], stack["start"]) } -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) onSingleQuoteItalicTextElement167() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonLabeledListItemTermElement127() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement167() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement127() + return p.cur.onSingleQuoteItalicTextElement167() } -func (c *current) onLabeledListItemTermElement136() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteItalicTextElement163(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonLabeledListItemTermElement136() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement163() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement136() + return p.cur.onSingleQuoteItalicTextElement163(stack["name"]) } -func (c *current) onLabeledListItemTermElement132(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onSingleQuoteItalicTextElement114(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonLabeledListItemTermElement132() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement114() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement132(stack["name"]) + return p.cur.onSingleQuoteItalicTextElement114(stack["element"]) } -func (c *current) onLabeledListItemTermElement142() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement173() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonLabeledListItemTermElement142() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement173() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement142() + return p.cur.onSingleQuoteItalicTextElement173() } -func (c *current) onLabeledListItemTermElement111(id, label interface{}) (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement93(id, label interface{}) (interface{}, error) { return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonLabeledListItemTermElement111() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement93() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement111(stack["id"], stack["label"]) + return p.cur.onSingleQuoteItalicTextElement93(stack["id"], stack["label"]) } -func (c *current) onLabeledListItemTermElement149() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement180() (interface{}, error) { // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement149() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement180() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement149() + return p.cur.onSingleQuoteItalicTextElement180() } -func (c *current) onLabeledListItemTermElement145(id interface{}) (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement176(id interface{}) (interface{}, error) { return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonLabeledListItemTermElement145() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement176() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement145(stack["id"]) + return p.cur.onSingleQuoteItalicTextElement176(stack["id"]) } -func (c *current) onLabeledListItemTermElement109() (interface{}, error) { - // if we have a InternalCrossReference we just return a StringElement. +func (c *current) onSingleQuoteItalicTextElement91() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonLabeledListItemTermElement109() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement91() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement109() + return p.cur.onSingleQuoteItalicTextElement91() } -func (c *current) onLabeledListItemTermElement153() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement184() (interface{}, error) { return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonLabeledListItemTermElement153() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement184() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSingleQuoteItalicTextElement184() +} + +func (c *current) onSingleQuoteItalicTextElement86(element interface{}) (interface{}, error) { + return element, nil + +} + +func (p *parser) callonSingleQuoteItalicTextElement86() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement153() + return p.cur.onSingleQuoteItalicTextElement86(stack["element"]) } -func (c *current) onLabeledListItemTermElement155() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement186() (interface{}, error) { return types.NewStringElement("\u2019") + } -func (p *parser) callonLabeledListItemTermElement155() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement155() + return p.cur.onSingleQuoteItalicTextElement186() } -func (c *current) onLabeledListItemTermElement157() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement188() (interface{}, error) { return types.NewStringElement("\u00a9") + } -func (p *parser) callonLabeledListItemTermElement157() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement188() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement157() + return p.cur.onSingleQuoteItalicTextElement188() } -func (c *current) onLabeledListItemTermElement159() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement190() (interface{}, error) { return types.NewStringElement("\u2122") + } -func (p *parser) callonLabeledListItemTermElement159() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement190() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement159() + return p.cur.onSingleQuoteItalicTextElement190() } -func (c *current) onLabeledListItemTermElement161() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement192() (interface{}, error) { return types.NewStringElement("\u00ae") + } -func (p *parser) callonLabeledListItemTermElement161() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement192() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement161() + return p.cur.onSingleQuoteItalicTextElement192() } -func (c *current) onLabeledListItemTermElement163() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement194() (interface{}, error) { return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonLabeledListItemTermElement163() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement194() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement163() + return p.cur.onSingleQuoteItalicTextElement194() } -func (c *current) onLabeledListItemTermElement165() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement196() (interface{}, error) { return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonLabeledListItemTermElement165() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement196() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement165() + return p.cur.onSingleQuoteItalicTextElement196() } -func (c *current) onLabeledListItemTermElement175() (interface{}, error) { +func (c *current) onSingleQuoteItalicTextElement209() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonLabeledListItemTermElement175() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement209() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement175() + return p.cur.onSingleQuoteItalicTextElement209() } -func (c *current) onLabeledListItemTermElement187() (interface{}, error) { - return string(c.text), nil - +func (c *current) onSingleQuoteItalicTextElement205(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonLabeledListItemTermElement187() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement205() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement187() + return p.cur.onSingleQuoteItalicTextElement205(stack["ref"]) } -func (c *current) onLabeledListItemTermElement189() (interface{}, error) { - - return strconv.Atoi(string(c.text)) +func (c *current) onSingleQuoteItalicTextElement217() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonLabeledListItemTermElement189() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement217() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement189() + return p.cur.onSingleQuoteItalicTextElement217() } -func (c *current) onLabeledListItemTermElement182(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onSingleQuoteItalicTextElement214() (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) callonLabeledListItemTermElement182() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextElement214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement182(stack["start"]) + return p.cur.onSingleQuoteItalicTextElement214() } -func (c *current) onLabeledListItemTermElement171(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) callonLabeledListItemTermElement171() (interface{}, error) { +func (p *parser) callonQuotedTextInSingleQuoteItalicText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement171(stack["name"], stack["start"]) + return p.cur.onQuotedTextInSingleQuoteItalicText1(stack["attributes"], stack["text"]) } -func (c *current) onLabeledListItemTermElement197() (interface{}, error) { +func (c *current) onEscapedItalicText5() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement197() (interface{}, error) { +func (p *parser) callonEscapedItalicText5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement197() + return p.cur.onEscapedItalicText5() } -func (c *current) onLabeledListItemTermElement209() (interface{}, error) { - return string(c.text), nil +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) callonLabeledListItemTermElement209() (interface{}, error) { +func (p *parser) callonEscapedItalicText2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement209() + return p.cur.onEscapedItalicText2(stack["backslashes"], stack["elements"]) } -func (c *current) onLabeledListItemTermElement211() (interface{}, error) { - - return strconv.Atoi(string(c.text)) +func (c *current) onEscapedItalicText17() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonLabeledListItemTermElement211() (interface{}, error) { +func (p *parser) callonEscapedItalicText17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement211() + return p.cur.onEscapedItalicText17() } -func (c *current) onLabeledListItemTermElement204(start interface{}) (interface{}, error) { - return start, 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) callonLabeledListItemTermElement204() (interface{}, error) { +func (p *parser) callonEscapedItalicText14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement204(stack["start"]) + return p.cur.onEscapedItalicText14(stack["backslashes"], stack["elements"]) } -func (c *current) onLabeledListItemTermElement193(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), true, nil) +func (c *current) onEscapedItalicText27() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonLabeledListItemTermElement193() (interface{}, error) { +func (p *parser) callonEscapedItalicText27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement193(stack["name"], stack["start"]) + return p.cur.onEscapedItalicText27() } -func (c *current) onLabeledListItemTermElement219() (interface{}, error) { - return string(c.text), nil +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) callonLabeledListItemTermElement219() (interface{}, error) { +func (p *parser) callonEscapedItalicText24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement219() + return p.cur.onEscapedItalicText24(stack["backslashes"], stack["elements"]) } -func (c *current) onLabeledListItemTermElement215(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onDoubleQuoteMonospaceText1(elements interface{}) (interface{}, error) { + + return types.NewQuotedText(types.DoubleQuoteMonospace, elements.([]interface{})) + } -func (p *parser) callonLabeledListItemTermElement215() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement215(stack["name"]) + return p.cur.onDoubleQuoteMonospaceText1(stack["elements"]) } -func (c *current) onLabeledListItemTermElement225() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement14() (interface{}, error) { + return string(c.text), nil - return types.NewStringElement(string(c.text)) } -func (p *parser) callonLabeledListItemTermElement225() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement225() + return p.cur.onDoubleQuoteMonospaceTextElement14() } -func (c *current) onLabeledListItemTermElement1(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onDoubleQuoteMonospaceTextElement7() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonLabeledListItemTermElement1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemTermElement1(stack["element"]) + return p.cur.onDoubleQuoteMonospaceTextElement7() } -func (c *current) onLabeledListItemDescription1(elements interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement17() (interface{}, error) { + return string(c.text), nil - return types.NewListItemContent(elements.([]interface{})) } -func (p *parser) callonLabeledListItemDescription1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLabeledListItemDescription1(stack["elements"]) + return p.cur.onDoubleQuoteMonospaceTextElement17() } -func (c *current) onInlineElement4() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement24() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonInlineElement4() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement4() + return p.cur.onDoubleQuoteMonospaceTextElement24() } -func (c *current) onInlineElement13() (interface{}, error) { - +func (c *current) onDoubleQuoteMonospaceTextElement30() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonInlineElement13() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement30() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement13() + return p.cur.onDoubleQuoteMonospaceTextElement30() } -func (c *current) onInlineElement22() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMonospaceTextElement34() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonInlineElement22() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement34() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement22() + return p.cur.onDoubleQuoteMonospaceTextElement34() } -func (c *current) onInlineElement35() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement41() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineElement35() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement41() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement35() + return p.cur.onDoubleQuoteMonospaceTextElement41() } -func (c *current) onInlineElement41() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement53() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineElement41() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement53() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement41() + return p.cur.onDoubleQuoteMonospaceTextElement53() } -func (c *current) onInlineElement31() (interface{}, error) { - return types.NewLineBreak() -} +func (c *current) onDoubleQuoteMonospaceTextElement55() (interface{}, error) { -func (p *parser) callonInlineElement31() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onInlineElement31() -} + return strconv.Atoi(string(c.text)) -func (c *current) onInlineElement52() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonInlineElement52() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement55() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement52() + return p.cur.onDoubleQuoteMonospaceTextElement55() } -func (c *current) onInlineElement76() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement48(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonInlineElement76() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement76() + return p.cur.onDoubleQuoteMonospaceTextElement48(stack["start"]) } -func (c *current) onInlineElement82() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement37(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonInlineElement82() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement37() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement82() + return p.cur.onDoubleQuoteMonospaceTextElement37(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) onDoubleQuoteMonospaceTextElement63() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonInlineElement88() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement63() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement88() + return p.cur.onDoubleQuoteMonospaceTextElement63() } -func (c *current) onInlineElement97() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement75() (interface{}, error) { return string(c.text), nil -} - -func (p *parser) callonInlineElement97() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onInlineElement97() -} -func (c *current) onInlineElement93(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonInlineElement93() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement75() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement93(stack["name"]) + return p.cur.onDoubleQuoteMonospaceTextElement75() } -func (c *current) onInlineElement103() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement77() (interface{}, error) { - return types.NewStringElement(string(c.text)) + return strconv.Atoi(string(c.text)) } -func (p *parser) callonInlineElement103() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement77() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement103() -} - -func (c *current) onInlineElement72(id, label interface{}) (interface{}, error) { - return types.NewInternalCrossReference(id, label) + return p.cur.onDoubleQuoteMonospaceTextElement77() } -func (p *parser) callonInlineElement72() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onInlineElement72(stack["id"], stack["label"]) -} +func (c *current) onDoubleQuoteMonospaceTextElement70(start interface{}) (interface{}, error) { + return start, nil -func (c *current) onInlineElement110() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil } -func (p *parser) callonInlineElement110() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement70() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement110() + return p.cur.onDoubleQuoteMonospaceTextElement70(stack["start"]) } -func (c *current) onInlineElement106(id interface{}) (interface{}, error) { - return types.NewInternalCrossReference(id, nil) +func (c *current) onDoubleQuoteMonospaceTextElement59(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonInlineElement106() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement59() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement106(stack["id"]) + return p.cur.onDoubleQuoteMonospaceTextElement59(stack["name"], stack["start"]) } -func (c *current) onInlineElement70() (interface{}, error) { - // if we have a InternalCrossReference we just return a StringElement. - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMonospaceTextElement85() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonInlineElement70() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement70() + return p.cur.onDoubleQuoteMonospaceTextElement85() } -func (c *current) onInlineElement114() (interface{}, error) { - return types.NewSpecialCharacter(string(c.text)) +func (c *current) onDoubleQuoteMonospaceTextElement81(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonInlineElement114() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement81() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement114() + return p.cur.onDoubleQuoteMonospaceTextElement81(stack["name"]) } -func (c *current) onInlineElement116() (interface{}, error) { - return types.NewStringElement("\u2019") +func (c *current) onDoubleQuoteMonospaceTextElement32(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonInlineElement116() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement116() + return p.cur.onDoubleQuoteMonospaceTextElement32(stack["element"]) } -func (c *current) onInlineElement118() (interface{}, error) { - return types.NewStringElement("\u00a9") +func (c *current) onDoubleQuoteMonospaceTextElement93() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonInlineElement118() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement93() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement118() + return p.cur.onDoubleQuoteMonospaceTextElement93() } -func (c *current) onInlineElement120() (interface{}, error) { - return types.NewStringElement("\u2122") +func (c *current) onDoubleQuoteMonospaceTextElement102() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonInlineElement120() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement102() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement120() + return p.cur.onDoubleQuoteMonospaceTextElement102() } -func (c *current) onInlineElement122() (interface{}, error) { - return types.NewStringElement("\u00ae") +func (c *current) onDoubleQuoteMonospaceTextElement108() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonInlineElement122() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement108() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement122() + return p.cur.onDoubleQuoteMonospaceTextElement108() } -func (c *current) onInlineElement124() (interface{}, error) { - return types.NewStringElement("\u2026\u200b") +func (c *current) onDoubleQuoteMonospaceTextElement114() (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) callonInlineElement124() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement114() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement124() + return p.cur.onDoubleQuoteMonospaceTextElement114() } -func (c *current) onInlineElement126() (interface{}, error) { - return types.NewStringElement(string(c.text[:1]) + "\u2019") +func (c *current) onDoubleQuoteMonospaceTextElement121() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonInlineElement126() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement121() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement126() + return p.cur.onDoubleQuoteMonospaceTextElement121() } -func (c *current) onInlineElement137() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement128() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineElement137() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement128() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement137() + return p.cur.onDoubleQuoteMonospaceTextElement128() } -func (c *current) onInlineElement149() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement140() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonInlineElement149() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement140() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement149() + return p.cur.onDoubleQuoteMonospaceTextElement140() } -func (c *current) onInlineElement151() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement142() (interface{}, error) { return strconv.Atoi(string(c.text)) } -func (p *parser) callonInlineElement151() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement142() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement151() + return p.cur.onDoubleQuoteMonospaceTextElement142() } -func (c *current) onInlineElement144(start interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement135(start interface{}) (interface{}, error) { return start, nil } -func (p *parser) callonInlineElement144() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement135() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement144(stack["start"]) + return p.cur.onDoubleQuoteMonospaceTextElement135(stack["start"]) } -func (c *current) onInlineElement133(name, start interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement124(name, start interface{}) (interface{}, error) { return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonInlineElement133() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement124() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement133(stack["name"], stack["start"]) + return p.cur.onDoubleQuoteMonospaceTextElement124(stack["name"], stack["start"]) } -func (c *current) onInlineElement159() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement150() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineElement159() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement150() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement159() + return p.cur.onDoubleQuoteMonospaceTextElement150() } -func (c *current) onInlineElement171() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement162() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonInlineElement171() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement162() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement171() + return p.cur.onDoubleQuoteMonospaceTextElement162() } -func (c *current) onInlineElement173() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement164() (interface{}, error) { return strconv.Atoi(string(c.text)) } -func (p *parser) callonInlineElement173() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement164() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement173() + return p.cur.onDoubleQuoteMonospaceTextElement164() } -func (c *current) onInlineElement166(start interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement157(start interface{}) (interface{}, error) { return start, nil } -func (p *parser) callonInlineElement166() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement157() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement166(stack["start"]) + return p.cur.onDoubleQuoteMonospaceTextElement157(stack["start"]) } -func (c *current) onInlineElement155(name, start interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement146(name, start interface{}) (interface{}, error) { return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonInlineElement155() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement146() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement155(stack["name"], stack["start"]) + return p.cur.onDoubleQuoteMonospaceTextElement146(stack["name"], stack["start"]) } -func (c *current) onInlineElement181() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement172() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineElement181() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement172() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement181() + return p.cur.onDoubleQuoteMonospaceTextElement172() } -func (c *current) onInlineElement177(name interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement168(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonInlineElement177() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement168() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement177(stack["name"]) + return p.cur.onDoubleQuoteMonospaceTextElement168(stack["name"]) } -func (c *current) onInlineElement191() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement119(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonInlineElement191() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement119() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement191() + return p.cur.onDoubleQuoteMonospaceTextElement119(stack["element"]) } -func (c *current) onInlineElement198() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement178() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonInlineElement198() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement198() + return p.cur.onDoubleQuoteMonospaceTextElement178() } -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) onDoubleQuoteMonospaceTextElement98(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonInlineElement187() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement98() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement187(stack["id"]) + return p.cur.onDoubleQuoteMonospaceTextElement98(stack["id"], stack["label"]) } -func (c *current) onInlineElement208() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement185() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonInlineElement208() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement185() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement208() + return p.cur.onDoubleQuoteMonospaceTextElement185() } -func (c *current) onInlineElement204() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement181(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonInlineElement204() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement181() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement204() + return p.cur.onDoubleQuoteMonospaceTextElement181(stack["id"]) } -func (c *current) onInlineElement217() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement96() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonInlineElement217() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement96() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement217() + return p.cur.onDoubleQuoteMonospaceTextElement96() } -func (c *current) onInlineElement223() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement189() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonInlineElement223() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement189() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement223() + return p.cur.onDoubleQuoteMonospaceTextElement189() } -func (c *current) onInlineElement230() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement91(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonInlineElement230() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement91() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement230() + return p.cur.onDoubleQuoteMonospaceTextElement91(stack["element"]) } -func (c *current) onInlineElement226() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement191() (interface{}, error) { + return types.NewStringElement("\u2019") + } -func (p *parser) callonInlineElement226() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement191() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement226() + return p.cur.onDoubleQuoteMonospaceTextElement191() } -func (c *current) onInlineElement212(content interface{}) (interface{}, error) { - return content, nil +func (c *current) onDoubleQuoteMonospaceTextElement193() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonInlineElement212() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement193() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement212(stack["content"]) + return p.cur.onDoubleQuoteMonospaceTextElement193() } -func (c *current) onInlineElement239() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement195() (interface{}, error) { + return types.NewStringElement("\u2122") + } -func (p *parser) callonInlineElement239() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement195() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement239() + return p.cur.onDoubleQuoteMonospaceTextElement195() } -func (c *current) onInlineElement245() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement197() (interface{}, error) { + return types.NewStringElement("\u00ae") + } -func (p *parser) callonInlineElement245() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement197() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement245() + return p.cur.onDoubleQuoteMonospaceTextElement197() } -func (c *current) onInlineElement252() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement199() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonInlineElement252() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement199() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement252() + return p.cur.onDoubleQuoteMonospaceTextElement199() } -func (c *current) onInlineElement248() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMonospaceTextElement201() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonInlineElement248() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement201() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement248() + return p.cur.onDoubleQuoteMonospaceTextElement201() } -func (c *current) onInlineElement234(content interface{}) (interface{}, error) { - return content, nil +func (c *current) onDoubleQuoteMonospaceTextElement215() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonInlineElement234() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement215() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement234(stack["content"]) + return p.cur.onDoubleQuoteMonospaceTextElement215() } -func (c *current) onInlineElement200(term1, term2, term3 interface{}) (interface{}, error) { - return types.NewConcealedIndexTerm(term1, term2, term3) - +func (c *current) onDoubleQuoteMonospaceTextElement211(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonInlineElement200() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement211() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement200(stack["term1"], stack["term2"], stack["term3"]) + return p.cur.onDoubleQuoteMonospaceTextElement211(stack["ref"]) } -func (c *current) onInlineElement260() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement223() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineElement260() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement223() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement260() + return p.cur.onDoubleQuoteMonospaceTextElement223() } -func (c *current) onInlineElement256(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onDoubleQuoteMonospaceTextElement220() (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) callonInlineElement256() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement220() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement256(stack["ref"]) + return p.cur.onDoubleQuoteMonospaceTextElement220() } -func (c *current) onInlineElement264() (interface{}, error) { +func (c *current) onDoubleQuoteMonospaceTextElement1(element interface{}) (interface{}, error) { + return element, nil - return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlineElement264() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement264() + return p.cur.onDoubleQuoteMonospaceTextElement1(stack["element"]) } -func (c *current) onInlineElement1(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onQuotedTextInDoubleQuoteMonospaceText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -func (p *parser) callonInlineElement1() (interface{}, error) { +func (p *parser) callonQuotedTextInDoubleQuoteMonospaceText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElement1(stack["element"]) + return p.cur.onQuotedTextInDoubleQuoteMonospaceText1(stack["attributes"], stack["text"]) } -func (c *current) onQuotedText2(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onSingleQuoteMonospaceText1(elements interface{}) (interface{}, error) { + + return types.NewQuotedText(types.SingleQuoteMonospace, elements.([]interface{})) } -func (p *parser) callonQuotedText2() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedText2(stack["attributes"], stack["text"]) + return p.cur.onSingleQuoteMonospaceText1(stack["elements"]) } -func (c *current) onDoubleQuoteBoldText1(elements interface{}) (interface{}, error) { - return types.NewQuotedText(types.DoubleQuoteBold, elements.([]interface{})) +func (c *current) onSingleQuoteMonospaceTextElements9() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDoubleQuoteBoldText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElements9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldText1(stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElements9() } -func (c *current) onDoubleQuoteBoldTextElement7() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElements14(elements interface{}) (bool, error) { + return validateSingleQuoteElements(elements.([]interface{})) // cannot end with spaces - return types.NewStringElement(string(c.text)) +} +func (p *parser) callonSingleQuoteMonospaceTextElements14() (bool, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSingleQuoteMonospaceTextElements14(stack["elements"]) } -func (p *parser) callonDoubleQuoteBoldTextElement7() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElements1(elements interface{}) (interface{}, error) { + return elements, nil + +} + +func (p *parser) callonSingleQuoteMonospaceTextElements1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement7() + return p.cur.onSingleQuoteMonospaceTextElements1(stack["elements"]) } -func (c *current) onDoubleQuoteBoldTextElement16() (interface{}, error) { - // allow ` +func (c *current) onSingleQuoteMonospaceTextElement2() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonDoubleQuoteBoldTextElement16() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement16() + return p.cur.onSingleQuoteMonospaceTextElement2() } -func (c *current) onDoubleQuoteBoldTextElement26() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement11() (interface{}, error) { + // allow ` + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonDoubleQuoteBoldTextElement26() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement26() + return p.cur.onSingleQuoteMonospaceTextElement11() } -func (c *current) onDoubleQuoteBoldTextElement42() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement20() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDoubleQuoteBoldTextElement42() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement20() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement42() + return p.cur.onSingleQuoteMonospaceTextElement20() } -func (c *current) onDoubleQuoteBoldTextElement38(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMonospaceTextElement27() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDoubleQuoteBoldTextElement38() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement38(stack["ref"]) + return p.cur.onSingleQuoteMonospaceTextElement27() } -func (c *current) onDoubleQuoteBoldTextElement50() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement33() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDoubleQuoteBoldTextElement50() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement33() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement50() + return p.cur.onSingleQuoteMonospaceTextElement33() } -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 (c *current) onSingleQuoteMonospaceTextElement37() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonDoubleQuoteBoldTextElement47() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement37() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement47() + return p.cur.onSingleQuoteMonospaceTextElement37() } -func (c *current) onDoubleQuoteBoldTextElement1(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onSingleQuoteMonospaceTextElement44() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDoubleQuoteBoldTextElement1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement44() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement1(stack["element"]) + return p.cur.onSingleQuoteMonospaceTextElement44() } -func (c *current) onQuotedTextInDoubleQuoteBoldText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onSingleQuoteMonospaceTextElement56() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuotedTextInDoubleQuoteBoldText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInDoubleQuoteBoldText1(stack["attributes"], stack["text"]) + return p.cur.onSingleQuoteMonospaceTextElement56() } -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) onSingleQuoteMonospaceTextElement58() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonSingleQuoteBoldText2() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement58() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldText2(stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement58() } -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) onSingleQuoteMonospaceTextElement51(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonSingleQuoteBoldText13() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement51() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldText13(stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement51(stack["start"]) } -func (c *current) onSingleQuoteBoldTextElements5() (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) callonSingleQuoteBoldTextElements5() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement40() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElements5() + return p.cur.onSingleQuoteMonospaceTextElement40(stack["name"], stack["start"]) } -func (c *current) onSingleQuoteBoldTextElement2() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMonospaceTextElement66() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSingleQuoteBoldTextElement2() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement66() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement2() + return p.cur.onSingleQuoteMonospaceTextElement66() } -func (c *current) onSingleQuoteBoldTextElement11() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMonospaceTextElement78() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSingleQuoteBoldTextElement11() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement78() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement11() + return p.cur.onSingleQuoteMonospaceTextElement78() } -func (c *current) onSingleQuoteBoldTextElement33() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement80() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonSingleQuoteBoldTextElement33() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement33() + return p.cur.onSingleQuoteMonospaceTextElement80() } -func (c *current) onSingleQuoteBoldTextElement45() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement73(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonSingleQuoteBoldTextElement45() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement73() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement45() + return p.cur.onSingleQuoteMonospaceTextElement73(stack["start"]) } -func (c *current) onSingleQuoteBoldTextElement41(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMonospaceTextElement62(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonSingleQuoteBoldTextElement41() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement62() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement41(stack["ref"]) + return p.cur.onSingleQuoteMonospaceTextElement62(stack["name"], stack["start"]) } -func (c *current) onSingleQuoteBoldTextElement53() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement88() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSingleQuoteBoldTextElement53() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement88() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement53() + return p.cur.onSingleQuoteMonospaceTextElement88() } -func (c *current) onSingleQuoteBoldTextElement50() (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 (c *current) onSingleQuoteMonospaceTextElement84(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSingleQuoteBoldTextElement50() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement84() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement50() + return p.cur.onSingleQuoteMonospaceTextElement84(stack["name"]) } -func (c *current) onQuotedTextInSingleQuoteBoldText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onSingleQuoteMonospaceTextElement35(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonQuotedTextInSingleQuoteBoldText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInSingleQuoteBoldText1(stack["attributes"], stack["text"]) + return p.cur.onSingleQuoteMonospaceTextElement35(stack["element"]) } -func (c *current) onEscapedBoldText5() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement96() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonEscapedBoldText5() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement96() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedBoldText5() + return p.cur.onSingleQuoteMonospaceTextElement96() } -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) onSingleQuoteMonospaceTextElement105() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonEscapedBoldText2() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement105() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedBoldText2(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement105() } -func (c *current) onEscapedBoldText17() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement111() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonEscapedBoldText17() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedBoldText17() + return p.cur.onSingleQuoteMonospaceTextElement111() } -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) onSingleQuoteMonospaceTextElement117() (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) callonEscapedBoldText14() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement117() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedBoldText14(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement117() } -func (c *current) onEscapedBoldText27() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement124() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonEscapedBoldText27() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement124() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedBoldText27() + return p.cur.onSingleQuoteMonospaceTextElement124() } -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) onSingleQuoteMonospaceTextElement131() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonEscapedBoldText24() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement131() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedBoldText24(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement131() } -func (c *current) onDoubleQuoteItalicText1(elements interface{}) (interface{}, error) { - // double punctuation must be evaluated first - return types.NewQuotedText(types.DoubleQuoteItalic, elements.([]interface{})) +func (c *current) onSingleQuoteMonospaceTextElement143() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDoubleQuoteItalicText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement143() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicText1(stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement143() } -func (c *current) onDoubleQuoteItalicTextElement7() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement145() (interface{}, error) { - return types.NewStringElement(string(c.text)) + return strconv.Atoi(string(c.text)) } -func (p *parser) callonDoubleQuoteItalicTextElement7() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement145() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement7() + return p.cur.onSingleQuoteMonospaceTextElement145() } -func (c *current) onDoubleQuoteItalicTextElement16() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMonospaceTextElement138(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonDoubleQuoteItalicTextElement16() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement138() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement16() + return p.cur.onSingleQuoteMonospaceTextElement138(stack["start"]) } -func (c *current) onDoubleQuoteItalicTextElement26() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement127(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonDoubleQuoteItalicTextElement26() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement127() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement26() + return p.cur.onSingleQuoteMonospaceTextElement127(stack["name"], stack["start"]) } -func (c *current) onDoubleQuoteItalicTextElement42() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement153() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDoubleQuoteItalicTextElement42() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement153() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement42() + return p.cur.onSingleQuoteMonospaceTextElement153() } -func (c *current) onDoubleQuoteItalicTextElement38(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMonospaceTextElement165() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDoubleQuoteItalicTextElement38() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement38(stack["ref"]) + return p.cur.onSingleQuoteMonospaceTextElement165() } -func (c *current) onDoubleQuoteItalicTextElement50() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement167() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonDoubleQuoteItalicTextElement50() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement167() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement50() + return p.cur.onSingleQuoteMonospaceTextElement167() } -func (c *current) onDoubleQuoteItalicTextElement47() (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 (c *current) onSingleQuoteMonospaceTextElement160(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonDoubleQuoteItalicTextElement47() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement160() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement47() + return p.cur.onSingleQuoteMonospaceTextElement160(stack["start"]) } -func (c *current) onDoubleQuoteItalicTextElement1(element interface{}) (interface{}, error) { - return element, nil - +func (c *current) onSingleQuoteMonospaceTextElement149(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonDoubleQuoteItalicTextElement1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement149() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement1(stack["element"]) + return p.cur.onSingleQuoteMonospaceTextElement149(stack["name"], stack["start"]) } -func (c *current) onQuotedTextInDoubleQuoteItalicText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onSingleQuoteMonospaceTextElement175() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuotedTextInDoubleQuoteItalicText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement175() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInDoubleQuoteItalicText1(stack["attributes"], stack["text"]) + return p.cur.onSingleQuoteMonospaceTextElement175() } -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) onSingleQuoteMonospaceTextElement171(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSingleQuoteItalicText2() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement171() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicText2(stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement171(stack["name"]) } -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) onSingleQuoteMonospaceTextElement122(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonSingleQuoteItalicText10() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement122() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicText10(stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement122(stack["element"]) } -func (c *current) onSingleQuoteItalicTextElements5() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement181() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSingleQuoteItalicTextElements5() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement181() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElements5() + return p.cur.onSingleQuoteMonospaceTextElement181() } -func (c *current) onSingleQuoteItalicTextElement2() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMonospaceTextElement101(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) } -func (p *parser) callonSingleQuoteItalicTextElement2() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement101() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement2() + return p.cur.onSingleQuoteMonospaceTextElement101(stack["id"], stack["label"]) } -func (c *current) onSingleQuoteItalicTextElement11() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMonospaceTextElement188() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonSingleQuoteItalicTextElement11() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement188() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement11() + return p.cur.onSingleQuoteMonospaceTextElement188() } -func (c *current) onSingleQuoteItalicTextElement33() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement184(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonSingleQuoteItalicTextElement33() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement184() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement33() + return p.cur.onSingleQuoteMonospaceTextElement184(stack["id"]) } -func (c *current) onSingleQuoteItalicTextElement45() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement99() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSingleQuoteItalicTextElement45() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement45() + return p.cur.onSingleQuoteMonospaceTextElement99() } -func (c *current) onSingleQuoteItalicTextElement41(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMonospaceTextElement192() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonSingleQuoteItalicTextElement41() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement192() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement41(stack["ref"]) + return p.cur.onSingleQuoteMonospaceTextElement192() } -func (c *current) onSingleQuoteItalicTextElement53() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement94(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonSingleQuoteItalicTextElement53() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement94() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement53() + return p.cur.onSingleQuoteMonospaceTextElement94(stack["element"]) } -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) onSingleQuoteMonospaceTextElement194() (interface{}, error) { + return types.NewStringElement("\u2019") + } -func (p *parser) callonSingleQuoteItalicTextElement50() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement194() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement50() + return p.cur.onSingleQuoteMonospaceTextElement194() } -func (c *current) onQuotedTextInSingleQuoteItalicText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onSingleQuoteMonospaceTextElement196() (interface{}, error) { + return types.NewStringElement("\u00a9") } -func (p *parser) callonQuotedTextInSingleQuoteItalicText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement196() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInSingleQuoteItalicText1(stack["attributes"], stack["text"]) + return p.cur.onSingleQuoteMonospaceTextElement196() } -func (c *current) onEscapedItalicText5() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement198() (interface{}, error) { + return types.NewStringElement("\u2122") + } -func (p *parser) callonEscapedItalicText5() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement198() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedItalicText5() + return p.cur.onSingleQuoteMonospaceTextElement198() } -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) onSingleQuoteMonospaceTextElement200() (interface{}, error) { + return types.NewStringElement("\u00ae") } -func (p *parser) callonEscapedItalicText2() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement200() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedItalicText2(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement200() } -func (c *current) onEscapedItalicText17() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMonospaceTextElement202() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonEscapedItalicText17() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement202() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedItalicText17() + return p.cur.onSingleQuoteMonospaceTextElement202() } -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) onSingleQuoteMonospaceTextElement204() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") } -func (p *parser) callonEscapedItalicText14() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement204() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedItalicText14(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement204() } -func (c *current) onEscapedItalicText27() (interface{}, error) { +func (c *current) onSingleQuoteMonospaceTextElement218() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonEscapedItalicText27() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement218() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedItalicText27() + return p.cur.onSingleQuoteMonospaceTextElement218() } -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) onSingleQuoteMonospaceTextElement214(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonEscapedItalicText24() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedItalicText24(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement214(stack["ref"]) } -func (c *current) onDoubleQuoteMonospaceText1(elements interface{}) (interface{}, error) { - // double punctuation must be evaluated first - return types.NewQuotedText(types.DoubleQuoteMonospace, elements.([]interface{})) +func (c *current) onSingleQuoteMonospaceTextElement227() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDoubleQuoteMonospaceText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement227() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceText1(stack["elements"]) + return p.cur.onSingleQuoteMonospaceTextElement227() } -func (c *current) onDoubleQuoteMonospaceTextElement7() (interface{}, error) { - +func (c *current) onSingleQuoteMonospaceTextElement222() (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) callonDoubleQuoteMonospaceTextElement7() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextElement222() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement7() + return p.cur.onSingleQuoteMonospaceTextElement222() } -func (c *current) onDoubleQuoteMonospaceTextElement16() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onQuotedTextInSingleQuoteMonospaceText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) } -func (p *parser) callonDoubleQuoteMonospaceTextElement16() (interface{}, error) { +func (p *parser) callonQuotedTextInSingleQuoteMonospaceText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement16() + return p.cur.onQuotedTextInSingleQuoteMonospaceText1(stack["attributes"], stack["text"]) } -func (c *current) onDoubleQuoteMonospaceTextElement26() (interface{}, error) { +func (c *current) onEscapedMonospaceText5() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDoubleQuoteMonospaceTextElement26() (interface{}, error) { +func (p *parser) callonEscapedMonospaceText5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement26() + return p.cur.onEscapedMonospaceText5() } -func (c *current) onDoubleQuoteMonospaceTextElement43() (interface{}, error) { - return string(c.text), nil +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) callonDoubleQuoteMonospaceTextElement43() (interface{}, error) { +func (p *parser) callonEscapedMonospaceText2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement43() + return p.cur.onEscapedMonospaceText2(stack["backslashes"], stack["elements"]) } -func (c *current) onDoubleQuoteMonospaceTextElement39(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onEscapedMonospaceText17() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDoubleQuoteMonospaceTextElement39() (interface{}, error) { +func (p *parser) callonEscapedMonospaceText17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement39(stack["ref"]) + return p.cur.onEscapedMonospaceText17() } -func (c *current) onDoubleQuoteMonospaceTextElement51() (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) callonDoubleQuoteMonospaceTextElement51() (interface{}, error) { +func (p *parser) callonEscapedMonospaceText14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement51() + return p.cur.onEscapedMonospaceText14(stack["backslashes"], stack["elements"]) } -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) onEscapedMonospaceText27() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDoubleQuoteMonospaceTextElement48() (interface{}, error) { +func (p *parser) callonEscapedMonospaceText27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement48() + return p.cur.onEscapedMonospaceText27() } -func (c *current) onDoubleQuoteMonospaceTextElement1(element interface{}) (interface{}, error) { - return element, 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) callonDoubleQuoteMonospaceTextElement1() (interface{}, error) { +func (p *parser) callonEscapedMonospaceText24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement1(stack["element"]) + return p.cur.onEscapedMonospaceText24(stack["backslashes"], stack["elements"]) } -func (c *current) onQuotedTextInDoubleQuoteMonospaceText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onDoubleQuoteMarkedText1(elements interface{}) (interface{}, error) { + + return types.NewQuotedText(types.DoubleQuoteMarked, elements.([]interface{})) } -func (p *parser) callonQuotedTextInDoubleQuoteMonospaceText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInDoubleQuoteMonospaceText1(stack["attributes"], stack["text"]) + return p.cur.onDoubleQuoteMarkedText1(stack["elements"]) } -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) onDoubleQuoteMarkedTextElement14() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSingleQuoteMonospaceText2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceText2(stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement14() } -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) onDoubleQuoteMarkedTextElement7() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSingleQuoteMonospaceText10() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceText10(stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement7() } -func (c *current) onSingleQuoteMonospaceTextElements5() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement17() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSingleQuoteMonospaceTextElements5() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElements5() + return p.cur.onDoubleQuoteMarkedTextElement17() } -func (c *current) onSingleQuoteMonospaceTextElement2() (interface{}, error) { - +func (c *current) onDoubleQuoteMarkedTextElement24() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonSingleQuoteMonospaceTextElement2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement2() + return p.cur.onDoubleQuoteMarkedTextElement24() } -func (c *current) onSingleQuoteMonospaceTextElement11() (interface{}, error) { - // allow ` +func (c *current) onDoubleQuoteMarkedTextElement30() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) +} +func (p *parser) callonDoubleQuoteMarkedTextElement30() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDoubleQuoteMarkedTextElement30() } -func (p *parser) callonSingleQuoteMonospaceTextElement11() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement34() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + +} + +func (p *parser) callonDoubleQuoteMarkedTextElement34() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement11() + return p.cur.onDoubleQuoteMarkedTextElement34() } -func (c *current) onSingleQuoteMonospaceTextElement33() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement41() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSingleQuoteMonospaceTextElement33() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement41() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement33() + return p.cur.onDoubleQuoteMarkedTextElement41() } -func (c *current) onSingleQuoteMonospaceTextElement46() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement53() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSingleQuoteMonospaceTextElement46() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement53() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement46() + return p.cur.onDoubleQuoteMarkedTextElement53() } -func (c *current) onSingleQuoteMonospaceTextElement42(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onDoubleQuoteMarkedTextElement55() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonSingleQuoteMonospaceTextElement42() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement55() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement42(stack["ref"]) + return p.cur.onDoubleQuoteMarkedTextElement55() } -func (c *current) onSingleQuoteMonospaceTextElement55() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement48(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonSingleQuoteMonospaceTextElement55() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement55() + return p.cur.onDoubleQuoteMarkedTextElement48(stack["start"]) } -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) onDoubleQuoteMarkedTextElement37(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSingleQuoteMonospaceTextElement50() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement37() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement50() + return p.cur.onDoubleQuoteMarkedTextElement37(stack["name"], stack["start"]) } -func (c *current) onQuotedTextInSingleQuoteMonospaceText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onDoubleQuoteMarkedTextElement63() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuotedTextInSingleQuoteMonospaceText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement63() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInSingleQuoteMonospaceText1(stack["attributes"], stack["text"]) + return p.cur.onDoubleQuoteMarkedTextElement63() } -func (c *current) onEscapedMonospaceText5() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement75() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonEscapedMonospaceText5() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement75() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMonospaceText5() + return p.cur.onDoubleQuoteMarkedTextElement75() } -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) onDoubleQuoteMarkedTextElement77() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonEscapedMonospaceText2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement77() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMonospaceText2(stack["backslashes"], stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement77() } -func (c *current) onEscapedMonospaceText17() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement70(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonEscapedMonospaceText17() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement70() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMonospaceText17() + return p.cur.onDoubleQuoteMarkedTextElement70(stack["start"]) } -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) onDoubleQuoteMarkedTextElement59(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonEscapedMonospaceText14() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement59() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMonospaceText14(stack["backslashes"], stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement59(stack["name"], stack["start"]) } -func (c *current) onEscapedMonospaceText27() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement85() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonEscapedMonospaceText27() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMonospaceText27() + return p.cur.onDoubleQuoteMarkedTextElement85() } -func (c *current) onEscapedMonospaceText24(backslashes, elements interface{}) (interface{}, error) { - // simple punctuation must be evaluated last - return types.NewEscapedQuotedText(backslashes.(string), "`", elements.([]interface{})) +func (c *current) onDoubleQuoteMarkedTextElement81(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonEscapedMonospaceText24() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement81() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMonospaceText24(stack["backslashes"], stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement81(stack["name"]) } -func (c *current) onSingleQuotedString1(elements interface{}) (interface{}, error) { - return types.NewQuotedString(types.SingleQuote, elements.([]interface{})) +func (c *current) onDoubleQuoteMarkedTextElement32(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonSingleQuotedString1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedString1(stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement32(stack["element"]) } -func (c *current) onSingleQuotedStringElements1(elements interface{}) (interface{}, error) { - return types.NewInlineElements(elements) +func (c *current) onDoubleQuoteMarkedTextElement93() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonSingleQuotedStringElements1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement93() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElements1(stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement93() } -func (c *current) onSingleQuotedStringElement9() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement102() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonSingleQuotedStringElement9() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement102() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement9() + return p.cur.onDoubleQuoteMarkedTextElement102() } -func (c *current) onSingleQuotedStringElement15() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement108() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSingleQuotedStringElement15() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement108() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement15() + return p.cur.onDoubleQuoteMarkedTextElement108() } -func (c *current) onSingleQuotedStringElement5() (interface{}, error) { - return types.NewLineBreak() +func (c *current) onDoubleQuoteMarkedTextElement114() (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) callonSingleQuotedStringElement5() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement114() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement5() + return p.cur.onDoubleQuoteMarkedTextElement114() } -func (c *current) onSingleQuotedStringElement29() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement121() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonSingleQuotedStringElement29() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement121() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement29() + return p.cur.onDoubleQuoteMarkedTextElement121() } -func (c *current) onSingleQuotedStringElement39() (interface{}, error) { - return types.NewStringElement("\u2019") +func (c *current) onDoubleQuoteMarkedTextElement128() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSingleQuotedStringElement39() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement128() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement39() + return p.cur.onDoubleQuoteMarkedTextElement128() } -func (c *current) onSingleQuotedStringElement41() (interface{}, error) { - return types.NewStringElement("\u00a9") +func (c *current) onDoubleQuoteMarkedTextElement140() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSingleQuotedStringElement41() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement140() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement41() + return p.cur.onDoubleQuoteMarkedTextElement140() } -func (c *current) onSingleQuotedStringElement43() (interface{}, error) { - return types.NewStringElement("\u2122") +func (c *current) onDoubleQuoteMarkedTextElement142() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonSingleQuotedStringElement43() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement142() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement43() + return p.cur.onDoubleQuoteMarkedTextElement142() } -func (c *current) onSingleQuotedStringElement45() (interface{}, error) { - return types.NewStringElement("\u00ae") +func (c *current) onDoubleQuoteMarkedTextElement135(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonSingleQuotedStringElement45() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement135() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement45() + return p.cur.onDoubleQuoteMarkedTextElement135(stack["start"]) } -func (c *current) onSingleQuotedStringElement47() (interface{}, error) { - return types.NewStringElement("\u2026\u200b") +func (c *current) onDoubleQuoteMarkedTextElement124(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSingleQuotedStringElement47() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement124() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement47() + return p.cur.onDoubleQuoteMarkedTextElement124(stack["name"], stack["start"]) } -func (c *current) onSingleQuotedStringElement49() (interface{}, error) { - return types.NewStringElement(string(c.text[:1]) + "\u2019") +func (c *current) onDoubleQuoteMarkedTextElement150() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSingleQuotedStringElement49() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement150() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement49() + return p.cur.onDoubleQuoteMarkedTextElement150() } -func (c *current) onSingleQuotedStringElement33(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onDoubleQuoteMarkedTextElement162() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSingleQuotedStringElement33() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement162() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement33(stack["element"]) + return p.cur.onDoubleQuoteMarkedTextElement162() } -func (c *current) onSingleQuotedStringElement58() (interface{}, error) { - // ' - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedTextElement164() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonSingleQuotedStringElement58() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement164() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement58() + return p.cur.onDoubleQuoteMarkedTextElement164() } -func (c *current) onSingleQuotedStringElement1(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onDoubleQuoteMarkedTextElement157(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonSingleQuotedStringElement1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement157() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuotedStringElement1(stack["element"]) + return p.cur.onDoubleQuoteMarkedTextElement157(stack["start"]) } -func (c *current) onQuotedTextInSingleQuotedString10(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onDoubleQuoteMarkedTextElement146(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonQuotedTextInSingleQuotedString10() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement146() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInSingleQuotedString10(stack["element"]) + return p.cur.onDoubleQuoteMarkedTextElement146(stack["name"], stack["start"]) } -func (c *current) onQuotedTextInSingleQuotedString1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onDoubleQuoteMarkedTextElement172() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuotedTextInSingleQuotedString1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement172() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInSingleQuotedString1(stack["attributes"], stack["text"]) + return p.cur.onDoubleQuoteMarkedTextElement172() } -func (c *current) onDoubleQuotedString1(elements interface{}) (interface{}, error) { - return types.NewQuotedString(types.DoubleQuote, elements.([]interface{})) +func (c *current) onDoubleQuoteMarkedTextElement168(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonDoubleQuotedString1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement168() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedString1(stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement168(stack["name"]) } -func (c *current) onDoubleQuotedStringElements1(elements interface{}) (interface{}, error) { - return types.NewInlineElements(elements) +func (c *current) onDoubleQuoteMarkedTextElement119(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonDoubleQuotedStringElements1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement119() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElements1(stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement119(stack["element"]) } -func (c *current) onDoubleQuotedStringElement9() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement178() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonDoubleQuotedStringElement9() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElement9() + return p.cur.onDoubleQuoteMarkedTextElement178() } -func (c *current) onDoubleQuotedStringElement15() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement98(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonDoubleQuotedStringElement15() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement98() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElement15() + return p.cur.onDoubleQuoteMarkedTextElement98(stack["id"], stack["label"]) } -func (c *current) onDoubleQuotedStringElement5() (interface{}, error) { - return types.NewLineBreak() +func (c *current) onDoubleQuoteMarkedTextElement185() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonDoubleQuotedStringElement5() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement185() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElement5() + return p.cur.onDoubleQuoteMarkedTextElement185() } -func (c *current) onDoubleQuotedStringElement29() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement181(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonDoubleQuotedStringElement29() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement181() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElement29() + return p.cur.onDoubleQuoteMarkedTextElement181(stack["id"]) } -func (c *current) onDoubleQuotedStringElement35() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement96() (interface{}, error) { return types.NewStringElement(string(c.text)) + } -func (p *parser) callonDoubleQuotedStringElement35() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement96() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElement35() + return p.cur.onDoubleQuoteMarkedTextElement96() } -func (c *current) onDoubleQuotedStringElement1(element interface{}) (interface{}, error) { - return element, nil +func (c *current) onDoubleQuoteMarkedTextElement189() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonDoubleQuotedStringElement1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement189() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuotedStringElement1(stack["element"]) + return p.cur.onDoubleQuoteMarkedTextElement189() } -func (c *current) onQuotedTextInDoubleQuotedString10(element interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement91(element interface{}) (interface{}, error) { return element, nil + } -func (p *parser) callonQuotedTextInDoubleQuotedString10() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement91() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInDoubleQuotedString10(stack["element"]) + return p.cur.onDoubleQuoteMarkedTextElement91(stack["element"]) } -func (c *current) onQuotedTextInDoubleQuotedString1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onDoubleQuoteMarkedTextElement191() (interface{}, error) { + return types.NewStringElement("\u2019") } -func (p *parser) callonQuotedTextInDoubleQuotedString1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement191() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextInDoubleQuotedString1(stack["attributes"], stack["text"]) + return p.cur.onDoubleQuoteMarkedTextElement191() } -func (c *current) onDoubleQuoteMarkedText1(elements interface{}) (interface{}, error) { - // double punctuation must be evaluated first - return types.NewQuotedText(types.DoubleQuoteMarked, elements.([]interface{})) +func (c *current) onDoubleQuoteMarkedTextElement193() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonDoubleQuoteMarkedText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement193() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedText1(stack["elements"]) + return p.cur.onDoubleQuoteMarkedTextElement193() } -func (c *current) onDoubleQuoteMarkedTextElements9() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuoteMarkedTextElement195() (interface{}, error) { + return types.NewStringElement("\u2122") + } -func (p *parser) callonDoubleQuoteMarkedTextElements9() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement195() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElements9() + return p.cur.onDoubleQuoteMarkedTextElement195() } -func (c *current) onDoubleQuoteMarkedTextElement2() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement197() (interface{}, error) { + return types.NewStringElement("\u00ae") - return types.NewStringElement(string(c.text)) +} + +func (p *parser) callonDoubleQuoteMarkedTextElement197() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onDoubleQuoteMarkedTextElement197() +} + +func (c *current) onDoubleQuoteMarkedTextElement199() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") } -func (p *parser) callonDoubleQuoteMarkedTextElement2() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement199() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElement2() + return p.cur.onDoubleQuoteMarkedTextElement199() } -func (c *current) onDoubleQuoteMarkedTextElement11() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onDoubleQuoteMarkedTextElement201() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") } -func (p *parser) callonDoubleQuoteMarkedTextElement11() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement201() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElement11() + return p.cur.onDoubleQuoteMarkedTextElement201() } -func (c *current) onDoubleQuoteMarkedTextElement34() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement214() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonDoubleQuoteMarkedTextElement34() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElement34() + return p.cur.onDoubleQuoteMarkedTextElement214() } -func (c *current) onDoubleQuoteMarkedTextElement30(ref interface{}) (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement210(ref interface{}) (interface{}, error) { return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonDoubleQuoteMarkedTextElement30() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement210() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElement30(stack["ref"]) + return p.cur.onDoubleQuoteMarkedTextElement210(stack["ref"]) } -func (c *current) onDoubleQuoteMarkedTextElement42() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement222() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDoubleQuoteMarkedTextElement42() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement222() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElement42() + return p.cur.onDoubleQuoteMarkedTextElement222() } -func (c *current) onDoubleQuoteMarkedTextElement39() (interface{}, error) { +func (c *current) onDoubleQuoteMarkedTextElement219() (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) callonDoubleQuoteMarkedTextElement39() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement219() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMarkedTextElement39() + return p.cur.onDoubleQuoteMarkedTextElement219() } -func (c *current) onNonDoubleQuoteMarkedText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) +func (c *current) onDoubleQuoteMarkedTextElement1(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonNonDoubleQuoteMarkedText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMarkedTextElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNonDoubleQuoteMarkedText1(stack["attributes"], stack["text"]) + return p.cur.onDoubleQuoteMarkedTextElement1(stack["element"]) } -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) onQuotedTextInDoubleMarkedBoldText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -func (p *parser) callonSingleQuoteMarkedText2() (interface{}, error) { +func (p *parser) callonQuotedTextInDoubleMarkedBoldText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedText2(stack["elements"]) + return p.cur.onQuotedTextInDoubleMarkedBoldText1(stack["attributes"], stack["text"]) } -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) onSingleQuoteMarkedText1(elements interface{}) (interface{}, error) { -func (p *parser) callonSingleQuoteMarkedText10() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSingleQuoteMarkedText10(stack["elements"]) -} + return types.NewQuotedText(types.SingleQuoteMarked, elements.([]interface{})) -func (c *current) onSingleQuoteMarkedTextElements5() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonSingleQuoteMarkedTextElements5() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElements5() + return p.cur.onSingleQuoteMarkedText1(stack["elements"]) } -func (c *current) onSingleQuoteMarkedTextElement2() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElements9() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSingleQuoteMarkedTextElement2() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElements9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement2() + return p.cur.onSingleQuoteMarkedTextElements9() } -func (c *current) onSingleQuoteMarkedTextElement11() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElements14(elements interface{}) (bool, error) { + return validateSingleQuoteElements(elements.([]interface{})) // cannot end with spaces } -func (p *parser) callonSingleQuoteMarkedTextElement11() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElements14() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement11() + return p.cur.onSingleQuoteMarkedTextElements14(stack["elements"]) } -func (c *current) onSingleQuoteMarkedTextElement33() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElements1(elements interface{}) (interface{}, error) { + return elements, nil + } -func (p *parser) callonSingleQuoteMarkedTextElement33() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElements1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement33() + return p.cur.onSingleQuoteMarkedTextElements1(stack["elements"]) } -func (c *current) onSingleQuoteMarkedTextElement45() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement9() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSingleQuoteMarkedTextElement45() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement45() + return p.cur.onSingleQuoteMarkedTextElement9() } -func (c *current) onSingleQuoteMarkedTextElement41(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMarkedTextElement2() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSingleQuoteMarkedTextElement41() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement41(stack["ref"]) + return p.cur.onSingleQuoteMarkedTextElement2() } -func (c *current) onSingleQuoteMarkedTextElement53() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement12() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSingleQuoteMarkedTextElement53() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement12() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement53() + return p.cur.onSingleQuoteMarkedTextElement12() } -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) onSingleQuoteMarkedTextElement19() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) } -func (p *parser) callonSingleQuoteMarkedTextElement50() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement19() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMarkedTextElement50() + return p.cur.onSingleQuoteMarkedTextElement19() } -func (c *current) onNonSingleQuoteMarkedText1(attributes, text interface{}) (interface{}, error) { - return text.(types.QuotedText).WithAttributes(attributes) - +func (c *current) onSingleQuoteMarkedTextElement25() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonNonSingleQuoteMarkedText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement25() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNonSingleQuoteMarkedText1(stack["attributes"], stack["text"]) + return p.cur.onSingleQuoteMarkedTextElement25() } -func (c *current) onEscapedMarkedText5() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement29() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonEscapedMarkedText5() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement29() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMarkedText5() + return p.cur.onSingleQuoteMarkedTextElement29() } -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) onSingleQuoteMarkedTextElement36() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonEscapedMarkedText2() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement36() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMarkedText2(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMarkedTextElement36() } -func (c *current) onEscapedMarkedText17() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement48() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonEscapedMarkedText17() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMarkedText17() + return p.cur.onSingleQuoteMarkedTextElement48() } -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) onSingleQuoteMarkedTextElement50() (interface{}, error) { -func (p *parser) callonEscapedMarkedText14() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onEscapedMarkedText14(stack["backslashes"], stack["elements"]) -} + return strconv.Atoi(string(c.text)) -func (c *current) onEscapedMarkedText27() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonEscapedMarkedText27() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement50() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMarkedText27() + return p.cur.onSingleQuoteMarkedTextElement50() } -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) onSingleQuoteMarkedTextElement43(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonEscapedMarkedText24() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement43() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedMarkedText24(stack["backslashes"], stack["elements"]) + return p.cur.onSingleQuoteMarkedTextElement43(stack["start"]) } -func (c *current) onSubscriptText1(element interface{}) (interface{}, error) { - // wraps a single word - return types.NewQuotedText(types.SingleQuoteSubscript, element) +func (c *current) onSingleQuoteMarkedTextElement32(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSubscriptText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement32() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSubscriptText1(stack["element"]) + return p.cur.onSingleQuoteMarkedTextElement32(stack["name"], stack["start"]) } -func (c *current) onSubscriptTextElement3() (interface{}, error) { - // anything except spaces, EOL or '~' - return c.text, nil +func (c *current) onSingleQuoteMarkedTextElement58() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSubscriptTextElement3() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement58() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSubscriptTextElement3() + return p.cur.onSingleQuoteMarkedTextElement58() } -func (c *current) onEscapedSubscriptText4() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement70() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonEscapedSubscriptText4() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement70() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedSubscriptText4() + return p.cur.onSingleQuoteMarkedTextElement70() } -func (c *current) onEscapedSubscriptText1(backslashes, element interface{}) (interface{}, error) { - // simple punctuation must be evaluated last - return types.NewEscapedQuotedText(backslashes.(string), "~", element) +func (c *current) onSingleQuoteMarkedTextElement72() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonEscapedSubscriptText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement72() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedSubscriptText1(stack["backslashes"], stack["element"]) + return p.cur.onSingleQuoteMarkedTextElement72() } -func (c *current) onSuperscriptText1(element interface{}) (interface{}, error) { - // wraps a single word - return types.NewQuotedText(types.SingleQuoteSuperscript, element) +func (c *current) onSingleQuoteMarkedTextElement65(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonSuperscriptText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement65() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSuperscriptText1(stack["element"]) + return p.cur.onSingleQuoteMarkedTextElement65(stack["start"]) } -func (c *current) onSuperscriptTextElement3() (interface{}, error) { - // anything except spaces, EOL or '^' - return c.text, nil +func (c *current) onSingleQuoteMarkedTextElement54(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonSuperscriptTextElement3() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSuperscriptTextElement3() + return p.cur.onSingleQuoteMarkedTextElement54(stack["name"], stack["start"]) } -func (c *current) onEscapedSuperscriptText4() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement80() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonEscapedSuperscriptText4() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedSuperscriptText4() + return p.cur.onSingleQuoteMarkedTextElement80() } -func (c *current) onEscapedSuperscriptText1(backslashes, element interface{}) (interface{}, error) { - // simple punctuation must be evaluated last - return types.NewEscapedQuotedText(backslashes.(string), "^", element) +func (c *current) onSingleQuoteMarkedTextElement76(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonEscapedSuperscriptText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement76() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onEscapedSuperscriptText1(stack["backslashes"], stack["element"]) + return p.cur.onSingleQuoteMarkedTextElement76(stack["name"]) } -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) onSingleQuoteMarkedTextElement27(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonInlinePassthrough7() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough7() + return p.cur.onSingleQuoteMarkedTextElement27(stack["element"]) } -func (c *current) onInlinePassthrough19() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement88() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonInlinePassthrough19() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement88() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough19() + return p.cur.onSingleQuoteMarkedTextElement88() } -func (c *current) onInlinePassthrough13() (interface{}, error) { - // a single character - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElement97() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonInlinePassthrough13() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough13() + return p.cur.onSingleQuoteMarkedTextElement97() } -func (c *current) onInlinePassthrough2(content interface{}) (interface{}, error) { - return types.NewInlinePassthrough(types.TriplePlusPassthrough, []interface{}{content}) +func (c *current) onSingleQuoteMarkedTextElement103() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonInlinePassthrough2() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement103() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough2(stack["content"]) + return p.cur.onSingleQuoteMarkedTextElement103() } -func (c *current) onInlinePassthrough43() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement109() (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) callonInlinePassthrough43() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement109() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough43() + return p.cur.onSingleQuoteMarkedTextElement109() } -func (c *current) onInlinePassthrough57() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement116() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonInlinePassthrough57() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement116() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough57() + return p.cur.onSingleQuoteMarkedTextElement116() } -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) onSingleQuoteMarkedTextElement123() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonInlinePassthrough36() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement123() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough36() + return p.cur.onSingleQuoteMarkedTextElement123() } -func (c *current) onInlinePassthrough72() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement135() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlinePassthrough72() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement135() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough72() + return p.cur.onSingleQuoteMarkedTextElement135() } -func (c *current) onInlinePassthrough67() (interface{}, error) { - // a single character - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElement137() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonInlinePassthrough67() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough67() + return p.cur.onSingleQuoteMarkedTextElement137() } -func (c *current) onInlinePassthrough31(content interface{}) (interface{}, error) { - return types.NewInlinePassthrough(types.SinglePlusPassthrough, []interface{}{content}) +func (c *current) onSingleQuoteMarkedTextElement130(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonInlinePassthrough31() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement130() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthrough31(stack["content"]) + return p.cur.onSingleQuoteMarkedTextElement130(stack["start"]) } -func (c *current) onPassthroughMacro7() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElement119(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonPassthroughMacro7() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement119() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPassthroughMacro7() + return p.cur.onSingleQuoteMarkedTextElement119(stack["name"], stack["start"]) } -func (c *current) onPassthroughMacro2(content interface{}) (interface{}, error) { - return types.NewInlinePassthrough(types.PassthroughMacro, []interface{}{content}) +func (c *current) onSingleQuoteMarkedTextElement145() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonPassthroughMacro2() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement145() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPassthroughMacro2(stack["content"]) + return p.cur.onSingleQuoteMarkedTextElement145() } -func (c *current) onPassthroughMacro17() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElement157() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonPassthroughMacro17() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement157() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPassthroughMacro17() + return p.cur.onSingleQuoteMarkedTextElement157() } -func (c *current) onPassthroughMacro10(content interface{}) (interface{}, error) { - return types.NewInlinePassthrough(types.PassthroughMacro, content.([]interface{})) +func (c *current) onSingleQuoteMarkedTextElement159() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonPassthroughMacro10() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement159() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPassthroughMacro10(stack["content"]) + return p.cur.onSingleQuoteMarkedTextElement159() } -func (c *current) onCrossReference6() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement152(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonCrossReference6() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement152() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference6() + return p.cur.onSingleQuoteMarkedTextElement152(stack["start"]) } -func (c *current) onCrossReference12() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement141(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonCrossReference12() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement141() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference12() + return p.cur.onSingleQuoteMarkedTextElement141(stack["name"], stack["start"]) } -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) onSingleQuoteMarkedTextElement167() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonCrossReference18() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement167() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference18() + return p.cur.onSingleQuoteMarkedTextElement167() } -func (c *current) onCrossReference27() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement163(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonCrossReference27() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement163() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference27() + return p.cur.onSingleQuoteMarkedTextElement163(stack["name"]) } -func (c *current) onCrossReference23(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onSingleQuoteMarkedTextElement114(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonCrossReference23() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement114() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference23(stack["name"]) + return p.cur.onSingleQuoteMarkedTextElement114(stack["element"]) } -func (c *current) onCrossReference33() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement173() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonCrossReference33() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement173() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference33() + return p.cur.onSingleQuoteMarkedTextElement173() } -func (c *current) onCrossReference2(id, label interface{}) (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement93(id, label interface{}) (interface{}, error) { return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonCrossReference2() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement93() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference2(stack["id"], stack["label"]) + return p.cur.onSingleQuoteMarkedTextElement93(stack["id"], stack["label"]) } -func (c *current) onCrossReference40() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement180() (interface{}, error) { // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonCrossReference40() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement180() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference40() + return p.cur.onSingleQuoteMarkedTextElement180() } -func (c *current) onCrossReference36(id interface{}) (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement176(id interface{}) (interface{}, error) { return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonCrossReference36() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement176() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCrossReference36(stack["id"]) + return p.cur.onSingleQuoteMarkedTextElement176(stack["id"]) } -func (c *current) onExternalCrossReference9() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" +func (c *current) onSingleQuoteMarkedTextElement91() (interface{}, error) { return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExternalCrossReference9() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement91() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalCrossReference9() + return p.cur.onSingleQuoteMarkedTextElement91() } -func (c *current) onExternalCrossReference16() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement184() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonExternalCrossReference16() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement184() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalCrossReference16() + return p.cur.onSingleQuoteMarkedTextElement184() } -func (c *current) onExternalCrossReference12(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMarkedTextElement86(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonExternalCrossReference12() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement86() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalCrossReference12(stack["ref"]) + return p.cur.onSingleQuoteMarkedTextElement86(stack["element"]) } -func (c *current) onExternalCrossReference5(path interface{}) (interface{}, error) { - return types.NewLocation("", path.([]interface{})) +func (c *current) onSingleQuoteMarkedTextElement186() (interface{}, error) { + return types.NewStringElement("\u2019") + } -func (p *parser) callonExternalCrossReference5() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalCrossReference5(stack["path"]) + return p.cur.onSingleQuoteMarkedTextElement186() } -func (c *current) onExternalCrossReference1(url, inlineAttributes interface{}) (interface{}, error) { - return types.NewExternalCrossReference(url.(types.Location), inlineAttributes.(types.Attributes)) +func (c *current) onSingleQuoteMarkedTextElement188() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonExternalCrossReference1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement188() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalCrossReference1(stack["url"], stack["inlineAttributes"]) + return p.cur.onSingleQuoteMarkedTextElement188() } -func (c *current) onRelativeLink18() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElement190() (interface{}, error) { + return types.NewStringElement("\u2122") + } -func (p *parser) callonRelativeLink18() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement190() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRelativeLink18() + return p.cur.onSingleQuoteMarkedTextElement190() } -func (c *current) onRelativeLink25() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuoteMarkedTextElement192() (interface{}, error) { + return types.NewStringElement("\u00ae") + } -func (p *parser) callonRelativeLink25() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement192() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRelativeLink25() + return p.cur.onSingleQuoteMarkedTextElement192() } -func (c *current) onRelativeLink21(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onSingleQuoteMarkedTextElement194() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonRelativeLink21() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement194() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRelativeLink21(stack["ref"]) + return p.cur.onSingleQuoteMarkedTextElement194() } -func (c *current) onRelativeLink5(scheme, path interface{}) (interface{}, error) { - return types.NewLocation(scheme, path.([]interface{})) +func (c *current) onSingleQuoteMarkedTextElement196() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonRelativeLink5() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement196() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRelativeLink5(stack["scheme"], stack["path"]) + return p.cur.onSingleQuoteMarkedTextElement196() } -func (c *current) onRelativeLink1(url, inlineAttributes interface{}) (interface{}, error) { - return types.NewInlineLink(url.(types.Location), inlineAttributes.(types.Attributes)) +func (c *current) onSingleQuoteMarkedTextElement209() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonRelativeLink1() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement209() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onRelativeLink1(stack["url"], stack["inlineAttributes"]) + return p.cur.onSingleQuoteMarkedTextElement209() } -func (c *current) onExternalLink16() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuoteMarkedTextElement205(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonExternalLink16() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement205() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalLink16() + return p.cur.onSingleQuoteMarkedTextElement205(stack["ref"]) } -func (c *current) onExternalLink23() (interface{}, error) { +func (c *current) onSingleQuoteMarkedTextElement217() (interface{}, error) { return string(c.text), nil -} - -func (p *parser) callonExternalLink23() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onExternalLink23() -} -func (c *current) onExternalLink19(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonExternalLink19() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement217() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalLink19(stack["ref"]) + return p.cur.onSingleQuoteMarkedTextElement217() } -func (c *current) onExternalLink4(scheme, path interface{}) (interface{}, error) { - return types.NewLocation(scheme, path.([]interface{})) +func (c *current) onSingleQuoteMarkedTextElement214() (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) callonExternalLink4() (interface{}, error) { +func (p *parser) callonSingleQuoteMarkedTextElement214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalLink4(stack["scheme"], stack["path"]) + return p.cur.onSingleQuoteMarkedTextElement214() } -func (c *current) onExternalLink1(url, inlineAttributes interface{}) (interface{}, error) { - return types.NewInlineLink(url.(types.Location), inlineAttributes) +func (c *current) onQuotedTextInSingleQuoteMarkedText1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -func (p *parser) callonExternalLink1() (interface{}, error) { +func (p *parser) callonQuotedTextInSingleQuoteMarkedText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExternalLink1(stack["url"], stack["inlineAttributes"]) + return p.cur.onQuotedTextInSingleQuoteMarkedText1(stack["attributes"], stack["text"]) } -func (c *current) onImageBlock3() (bool, error) { - // AttrPositional1 must not be set - return types.HasNotAttribute(c.globalStore.getAttributes(), types.AttrPositional1), nil +func (c *current) onEscapedMarkedText5() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonImageBlock3() (bool, error) { +func (p *parser) callonEscapedMarkedText5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock3() + return p.cur.onEscapedMarkedText5() } -func (c *current) onImageBlock19() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" - return types.NewStringElement(string(c.text)) +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) callonImageBlock19() (interface{}, error) { +func (p *parser) callonEscapedMarkedText2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock19() + return p.cur.onEscapedMarkedText2(stack["backslashes"], stack["elements"]) } -func (c *current) onImageBlock26() (interface{}, error) { +func (c *current) onEscapedMarkedText17() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonImageBlock26() (interface{}, error) { +func (p *parser) callonEscapedMarkedText17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock26() + return p.cur.onEscapedMarkedText17() } -func (c *current) onImageBlock22(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(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) callonImageBlock22() (interface{}, error) { +func (p *parser) callonEscapedMarkedText14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock22(stack["ref"]) + return p.cur.onEscapedMarkedText14(stack["backslashes"], stack["elements"]) } -func (c *current) onImageBlock6(scheme, path interface{}) (interface{}, error) { - return types.NewLocation(scheme, path.([]interface{})) +func (c *current) onEscapedMarkedText27() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonImageBlock6() (interface{}, error) { +func (p *parser) callonEscapedMarkedText27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock6(stack["scheme"], stack["path"]) + return p.cur.onEscapedMarkedText27() } -func (c *current) onImageBlock35() (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) callonImageBlock35() (interface{}, error) { +func (p *parser) callonEscapedMarkedText24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock35() + return p.cur.onEscapedMarkedText24(stack["backslashes"], stack["elements"]) } -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) onSubscriptText1(element interface{}) (interface{}, error) { + // wraps a single word + return types.NewQuotedText(types.SingleQuoteSubscript, element) + } -func (p *parser) callonImageBlock1() (interface{}, error) { +func (p *parser) callonSubscriptText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onImageBlock1(stack["path"], stack["inlineAttributes"]) + return p.cur.onSubscriptText1(stack["element"]) } -func (c *current) onInlineImage20() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" - return types.NewStringElement(string(c.text)) +func (c *current) onSubscriptTextElement3() (interface{}, error) { + // anything except spaces, EOL or '~' + return c.text, nil + } -func (p *parser) callonInlineImage20() (interface{}, error) { +func (p *parser) callonSubscriptTextElement3() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineImage20() + return p.cur.onSubscriptTextElement3() } -func (c *current) onInlineImage27() (interface{}, error) { +func (c *current) onEscapedSubscriptText4() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineImage27() (interface{}, error) { +func (p *parser) callonEscapedSubscriptText4() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineImage27() + return p.cur.onEscapedSubscriptText4() } -func (c *current) onInlineImage23(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onEscapedSubscriptText1(backslashes, element interface{}) (interface{}, error) { + // simple punctuation must be evaluated last + return types.NewEscapedQuotedText(backslashes.(string), "~", element) + } -func (p *parser) callonInlineImage23() (interface{}, error) { +func (p *parser) callonEscapedSubscriptText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineImage23(stack["ref"]) + return p.cur.onEscapedSubscriptText1(stack["backslashes"], stack["element"]) } -func (c *current) onInlineImage7(scheme, path interface{}) (interface{}, error) { - return types.NewLocation(scheme, path.([]interface{})) +func (c *current) onSuperscriptText1(element interface{}) (interface{}, error) { + // wraps a single word + return types.NewQuotedText(types.SingleQuoteSuperscript, element) + } -func (p *parser) callonInlineImage7() (interface{}, error) { +func (p *parser) callonSuperscriptText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineImage7(stack["scheme"], stack["path"]) + return p.cur.onSuperscriptText1(stack["element"]) } -func (c *current) onInlineImage1(path, inlineAttributes interface{}) (interface{}, error) { - return types.NewInlineImage(path.(types.Location), inlineAttributes.(types.Attributes), c.globalStore["imagesdir"]) +func (c *current) onSuperscriptTextElement3() (interface{}, error) { + // anything except spaces, EOL or '^' + return c.text, nil + } -func (p *parser) callonInlineImage1() (interface{}, error) { +func (p *parser) callonSuperscriptTextElement3() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineImage1(stack["path"], stack["inlineAttributes"]) + return p.cur.onSuperscriptTextElement3() } -func (c *current) onInlineIcon5() (interface{}, error) { +func (c *current) onEscapedSuperscriptText4() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineIcon5() (interface{}, error) { +func (p *parser) callonEscapedSuperscriptText4() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineIcon5() + return p.cur.onEscapedSuperscriptText4() } -func (c *current) onInlineIcon1(icon, attributes interface{}) (interface{}, error) { - return types.NewIcon(icon.(string), attributes) +func (c *current) onEscapedSuperscriptText1(backslashes, element interface{}) (interface{}, error) { + // simple punctuation must be evaluated last + return types.NewEscapedQuotedText(backslashes.(string), "^", element) + } -func (p *parser) callonInlineIcon1() (interface{}, error) { +func (p *parser) callonEscapedSuperscriptText1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineIcon1(stack["icon"], stack["attributes"]) + return p.cur.onEscapedSuperscriptText1(stack["backslashes"], stack["element"]) } -func (c *current) onInlineFootnote2(content interface{}) (interface{}, error) { - return types.NewFootnote("", content.([]interface{})) +func (c *current) onSingleQuotedString1(elements interface{}) (interface{}, error) { + return types.NewQuotedString(types.SingleQuote, elements.([]interface{})) + } -func (p *parser) callonInlineFootnote2() (interface{}, error) { +func (p *parser) callonSingleQuotedString1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineFootnote2(stack["content"]) + return p.cur.onSingleQuotedString1(stack["elements"]) } -func (c *current) onInlineFootnote12() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElements1(elements interface{}) (interface{}, error) { + return types.Merge(elements), nil + } -func (p *parser) callonInlineFootnote12() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElements1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineFootnote12() + return p.cur.onSingleQuotedStringElements1(stack["elements"]) } -func (c *current) onInlineFootnote8(ref, content interface{}) (interface{}, error) { - return types.NewFootnote(ref.(string), content) +func (c *current) onSingleQuotedStringElement14() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonInlineFootnote8() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineFootnote8(stack["ref"], stack["content"]) + return p.cur.onSingleQuotedStringElement14() } -func (c *current) onFootnoteContent1(elements interface{}) (interface{}, error) { - // footnote content may span multiple lines - return types.NewInlineElements(elements.([]interface{})) +func (c *current) onSingleQuotedStringElement7() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonFootnoteContent1() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFootnoteContent1(stack["elements"]) + return p.cur.onSingleQuotedStringElement7() } -func (c *current) onCallout5() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onSingleQuotedStringElement21() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonCallout5() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement21() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCallout5() + return p.cur.onSingleQuotedStringElement21() } -func (c *current) onCallout12() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement27() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonCallout12() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement27() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCallout12() + return p.cur.onSingleQuotedStringElement27() } -func (c *current) onCallout1(ref interface{}) (interface{}, error) { - return types.NewCallout(ref.(int)) +func (c *current) onSingleQuotedStringElement31() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonCallout1() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement31() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCallout1(stack["ref"]) + return p.cur.onSingleQuotedStringElement31() } -func (c *current) onCalloutListItem8() (interface{}, error) { - return strconv.Atoi(string(c.text)) +func (c *current) onSingleQuotedStringElement38() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonCalloutListItem8() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement38() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutListItem8() + return p.cur.onSingleQuotedStringElement38() } -func (c *current) onCalloutListItem15() (interface{}, error) { +func (c *current) onSingleQuotedStringElement50() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonCalloutListItem15() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement50() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutListItem15() + return p.cur.onSingleQuotedStringElement50() } -func (c *current) onCalloutListItem4(ref interface{}) (interface{}, error) { - return ref, nil -} +func (c *current) onSingleQuotedStringElement52() (interface{}, error) { -func (p *parser) callonCalloutListItem4() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onCalloutListItem4(stack["ref"]) -} + return strconv.Atoi(string(c.text)) -func (c *current) onCalloutListItem1(ref, description interface{}) (interface{}, error) { - return types.NewCalloutListItem(ref.(int), description.([]interface{})) } -func (p *parser) callonCalloutListItem1() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement52() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onCalloutListItem1(stack["ref"], stack["description"]) + return p.cur.onSingleQuotedStringElement52() } -func (c *current) onDelimitedBlock13() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement45(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonDelimitedBlock13() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement45() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock13() + return p.cur.onSingleQuotedStringElement45(stack["start"]) } -func (c *current) onDelimitedBlock31() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement34(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonDelimitedBlock31() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement34() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock31() + return p.cur.onSingleQuotedStringElement34(stack["name"], stack["start"]) } -func (c *current) onDelimitedBlock47() (interface{}, error) { - +func (c *current) onSingleQuotedStringElement60() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonDelimitedBlock47() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement60() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock47() + return p.cur.onSingleQuotedStringElement60() } -func (c *current) onDelimitedBlock41(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onSingleQuotedStringElement72() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDelimitedBlock41() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement72() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock41(stack["content"]) + return p.cur.onSingleQuotedStringElement72() } -func (c *current) onDelimitedBlock22(line interface{}) (interface{}, error) { +func (c *current) onSingleQuotedStringElement74() (interface{}, error) { + + return strconv.Atoi(string(c.text)) - return line, nil } -func (p *parser) callonDelimitedBlock22() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement74() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock22(stack["line"]) + return p.cur.onSingleQuotedStringElement74() } -func (c *current) onDelimitedBlock61() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement67(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonDelimitedBlock61() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement67() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock61() + return p.cur.onSingleQuotedStringElement67(stack["start"]) } -func (c *current) onDelimitedBlock7(content interface{}) (interface{}, error) { - return types.NewFencedBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuotedStringElement56(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonDelimitedBlock7() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock7(stack["content"]) + return p.cur.onSingleQuotedStringElement56(stack["name"], stack["start"]) } -func (c *current) onDelimitedBlock76() (interface{}, error) { +func (c *current) onSingleQuotedStringElement82() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDelimitedBlock76() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement82() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock76() + return p.cur.onSingleQuotedStringElement82() } -func (c *current) onDelimitedBlock94() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement78(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonDelimitedBlock94() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement78() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock94() + return p.cur.onSingleQuotedStringElement78(stack["name"]) } -func (c *current) onDelimitedBlock110() (interface{}, error) { - - return string(c.text), nil +func (c *current) onSingleQuotedStringElement29(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonDelimitedBlock110() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement29() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock110() + return p.cur.onSingleQuotedStringElement29(stack["element"]) } -func (c *current) onDelimitedBlock104(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onSingleQuotedStringElement90() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonDelimitedBlock104() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement90() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock104(stack["content"]) + return p.cur.onSingleQuotedStringElement90() } -func (c *current) onDelimitedBlock85(line interface{}) (interface{}, error) { +func (c *current) onSingleQuotedStringElement99() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil - return line, nil } -func (p *parser) callonDelimitedBlock85() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock85(stack["line"]) + return p.cur.onSingleQuotedStringElement99() } -func (c *current) onDelimitedBlock124() (interface{}, error) { +func (c *current) onSingleQuotedStringElement105() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDelimitedBlock124() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement105() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock124() + return p.cur.onSingleQuotedStringElement105() } -func (c *current) onDelimitedBlock70(content interface{}) (interface{}, error) { - return types.NewListingBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuotedStringElement111() (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) callonDelimitedBlock70() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock70(stack["content"]) + return p.cur.onSingleQuotedStringElement111() } -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) onSingleQuotedStringElement118() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonDelimitedBlock136() (bool, error) { +func (p *parser) callonSingleQuotedStringElement118() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock136() + return p.cur.onSingleQuotedStringElement118() } -func (c *current) onDelimitedBlock141() (interface{}, error) { +func (c *current) onSingleQuotedStringElement125() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDelimitedBlock141() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement125() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock141() + return p.cur.onSingleQuotedStringElement125() } -func (c *current) onDelimitedBlock159() (interface{}, error) { +func (c *current) onSingleQuotedStringElement137() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDelimitedBlock159() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock159() + return p.cur.onSingleQuotedStringElement137() } -func (c *current) onDelimitedBlock175() (interface{}, error) { +func (c *current) onSingleQuotedStringElement139() (interface{}, error) { - return string(c.text), nil + return strconv.Atoi(string(c.text)) } -func (p *parser) callonDelimitedBlock175() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement139() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock175() + return p.cur.onSingleQuotedStringElement139() } -func (c *current) onDelimitedBlock169(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onSingleQuotedStringElement132(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonDelimitedBlock169() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement132() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock169(stack["content"]) + return p.cur.onSingleQuotedStringElement132(stack["start"]) } -func (c *current) onDelimitedBlock150(line interface{}) (interface{}, error) { - - return line, nil +func (c *current) onSingleQuotedStringElement121(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonDelimitedBlock150() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement121() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock150(stack["line"]) + return p.cur.onSingleQuotedStringElement121(stack["name"], stack["start"]) } -func (c *current) onDelimitedBlock189() (interface{}, error) { +func (c *current) onSingleQuotedStringElement147() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDelimitedBlock189() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement147() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock189() + return p.cur.onSingleQuotedStringElement147() } -func (c *current) onDelimitedBlock134(content interface{}) (interface{}, error) { - return types.NewVerseBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuotedStringElement159() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonDelimitedBlock134() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement159() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock134(stack["content"]) + return p.cur.onSingleQuotedStringElement159() } -func (c *current) onDelimitedBlock206() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement161() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonDelimitedBlock206() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement161() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock206() + return p.cur.onSingleQuotedStringElement161() } -func (c *current) onDelimitedBlock224() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement154(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonDelimitedBlock224() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement154() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock224() + return p.cur.onSingleQuotedStringElement154(stack["start"]) +} + +func (c *current) onSingleQuotedStringElement143(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (c *current) onDelimitedBlock240() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement143() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onSingleQuotedStringElement143(stack["name"], stack["start"]) +} +func (c *current) onSingleQuotedStringElement169() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonDelimitedBlock240() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement169() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock240() + return p.cur.onSingleQuotedStringElement169() } -func (c *current) onDelimitedBlock234(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onSingleQuotedStringElement165(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonDelimitedBlock234() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock234(stack["content"]) + return p.cur.onSingleQuotedStringElement165(stack["name"]) } -func (c *current) onDelimitedBlock215(line interface{}) (interface{}, error) { +func (c *current) onSingleQuotedStringElement116(element interface{}) (interface{}, error) { + return element, nil - return line, nil } -func (p *parser) callonDelimitedBlock215() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock215(stack["line"]) + return p.cur.onSingleQuotedStringElement116(stack["element"]) } -func (c *current) onDelimitedBlock254() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement175() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonDelimitedBlock254() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement175() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock254() + return p.cur.onSingleQuotedStringElement175() } -func (c *current) onDelimitedBlock200(content interface{}) (interface{}, error) { - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuotedStringElement95(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonDelimitedBlock200() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement95() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock200(stack["content"]) + return p.cur.onSingleQuotedStringElement95(stack["id"], stack["label"]) } -func (c *current) onDelimitedBlock269() (interface{}, error) { +func (c *current) onSingleQuotedStringElement182() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonDelimitedBlock269() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement182() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock269() + return p.cur.onSingleQuotedStringElement182() } -func (c *current) onDelimitedBlock287() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement178(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonDelimitedBlock287() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock287() + return p.cur.onSingleQuotedStringElement178(stack["id"]) } -func (c *current) onDelimitedBlock303() (interface{}, error) { - - return string(c.text), nil +func (c *current) onSingleQuotedStringElement93() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDelimitedBlock303() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement93() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock303() + return p.cur.onSingleQuotedStringElement93() } -func (c *current) onDelimitedBlock297(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onSingleQuotedStringElement186() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonDelimitedBlock297() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock297(stack["content"]) + return p.cur.onSingleQuotedStringElement186() } -func (c *current) onDelimitedBlock278(line interface{}) (interface{}, error) { +func (c *current) onSingleQuotedStringElement88(element interface{}) (interface{}, error) { + return element, nil - return line, nil } -func (p *parser) callonDelimitedBlock278() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement88() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock278(stack["line"]) + return p.cur.onSingleQuotedStringElement88(stack["element"]) } -func (c *current) onDelimitedBlock317() (interface{}, error) { +func (c *current) onSingleQuotedStringElement194() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonDelimitedBlock317() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement194() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock317() + return p.cur.onSingleQuotedStringElement194() } -func (c *current) onDelimitedBlock263(content interface{}) (interface{}, error) { - return types.NewCommentBlock(content.([]interface{}), nil) +func (c *current) onSingleQuotedStringElement200() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonDelimitedBlock263() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement200() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock263(stack["content"]) + return p.cur.onSingleQuotedStringElement200() } -func (c *current) onDelimitedBlock1(block interface{}) (interface{}, error) { - return block, nil +func (c *current) onSingleQuotedStringElement208() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDelimitedBlock1() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement208() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDelimitedBlock1(stack["block"]) + return p.cur.onSingleQuotedStringElement208() } -func (c *current) onExampleBlock7() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement190() (interface{}, error) { + return types.NewLineBreak() + } -func (p *parser) callonExampleBlock7() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement190() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlock7() + return p.cur.onSingleQuotedStringElement190() } -func (c *current) onExampleBlock22() (interface{}, error) { +func (c *current) onSingleQuotedStringElement215() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlock22() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement215() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlock22() + return p.cur.onSingleQuotedStringElement215() } -func (c *current) onExampleBlock1(blocks interface{}) (interface{}, error) { - return types.NewExampleBlock(blocks.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSingleQuotedStringElement219() (interface{}, error) { + return types.NewStringElement("\u2019") } -func (p *parser) callonExampleBlock1() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement219() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlock1(stack["blocks"]) + return p.cur.onSingleQuotedStringElement219() } -func (c *current) onExampleBlockRawContent13() (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement221() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonExampleBlockRawContent13() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement221() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent13() + return p.cur.onSingleQuotedStringElement221() } -func (c *current) onExampleBlockRawContent25(attributes interface{}) error { - c.globalStore.pushAttributes(attributes) - return nil +func (c *current) onSingleQuotedStringElement223() (interface{}, error) { + return types.NewStringElement("\u2122") } -func (p *parser) callonExampleBlockRawContent25() error { +func (p *parser) callonSingleQuotedStringElement223() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent25(stack["attributes"]) + return p.cur.onSingleQuotedStringElement223() } -func (c *current) onExampleBlockRawContent31() (bool, error) { - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Literal), nil +func (c *current) onSingleQuotedStringElement225() (interface{}, error) { + return types.NewStringElement("\u00ae") } -func (p *parser) callonExampleBlockRawContent31() (bool, error) { +func (p *parser) callonSingleQuotedStringElement225() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent31() + return p.cur.onSingleQuotedStringElement225() } -func (c *current) onExampleBlockRawContent40() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuotedStringElement227() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") } -func (p *parser) callonExampleBlockRawContent40() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement227() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent40() + return p.cur.onSingleQuotedStringElement227() } -func (c *current) onExampleBlockRawContent49() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onSingleQuotedStringElement229() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") } -func (p *parser) callonExampleBlockRawContent49() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement229() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent49() + return p.cur.onSingleQuotedStringElement229() } -func (c *current) onExampleBlockRawContent36(elements interface{}) (interface{}, error) { - return string(c.text), nil +func (c *current) onSingleQuotedStringElement238() (interface{}, error) { + // ' + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent36() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement238() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent36(stack["elements"]) + return p.cur.onSingleQuotedStringElement238() } -func (c *current) onExampleBlockRawContent33(content interface{}) (interface{}, error) { +func (c *current) onSingleQuotedStringElement1(element interface{}) (interface{}, error) { + return element, nil - return types.NewRawLine(content.(string)) } -func (p *parser) callonExampleBlockRawContent33() (interface{}, error) { +func (p *parser) callonSingleQuotedStringElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent33(stack["content"]) + return p.cur.onSingleQuotedStringElement1(stack["element"]) } -func (c *current) onExampleBlockRawContent76() (interface{}, error) { - return string(c.text), nil +func (c *current) onQuotedTextInSingleQuotedString10(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonExampleBlockRawContent76() (interface{}, error) { +func (p *parser) callonQuotedTextInSingleQuotedString10() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent76() + return p.cur.onQuotedTextInSingleQuotedString10(stack["element"]) } -func (c *current) onExampleBlockRawContent85() (interface{}, error) { - return string(c.text), nil +func (c *current) onQuotedTextInSingleQuotedString1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -func (p *parser) callonExampleBlockRawContent85() (interface{}, error) { +func (p *parser) callonQuotedTextInSingleQuotedString1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent85() + return p.cur.onQuotedTextInSingleQuotedString1(stack["attributes"], stack["text"]) } -func (c *current) onExampleBlockRawContent68(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onDoubleQuotedString1(elements interface{}) (interface{}, error) { + return types.NewQuotedString(types.DoubleQuote, elements.([]interface{})) + } -func (p *parser) callonExampleBlockRawContent68() (interface{}, error) { +func (p *parser) callonDoubleQuotedString1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent68(stack["content"]) + return p.cur.onDoubleQuotedString1(stack["elements"]) } -func (c *current) onExampleBlockRawContent106() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElements1(elements interface{}) (interface{}, error) { + return types.Merge(elements), nil + } -func (p *parser) callonExampleBlockRawContent106() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElements1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent106() + return p.cur.onDoubleQuotedStringElements1(stack["elements"]) } -func (c *current) onExampleBlockRawContent118() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement14() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent118() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement14() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent118() + return p.cur.onDoubleQuotedStringElement14() } -func (c *current) onExampleBlockRawContent130() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement7() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent130() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent130() + return p.cur.onDoubleQuotedStringElement7() } -func (c *current) onExampleBlockRawContent142() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement22() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent142() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent142() + return p.cur.onDoubleQuotedStringElement22() } -func (c *current) onExampleBlockRawContent154() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement28() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent154() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement28() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent154() + return p.cur.onDoubleQuotedStringElement28() } -func (c *current) onExampleBlockRawContent166() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement36() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonExampleBlockRawContent166() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement36() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent166() + return p.cur.onDoubleQuotedStringElement36() } -func (c *current) onExampleBlockRawContent178() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement18() (interface{}, error) { + return types.NewLineBreak() + } -func (p *parser) callonExampleBlockRawContent178() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement18() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent178() + return p.cur.onDoubleQuotedStringElement18() } -func (c *current) onExampleBlockRawContent186() (interface{}, error) { - +func (c *current) onDoubleQuotedStringElement43() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent186() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement43() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent186() + return p.cur.onDoubleQuotedStringElement43() } -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) onDoubleQuotedStringElement51() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonExampleBlockRawContent194() (bool, error) { +func (p *parser) callonDoubleQuotedStringElement51() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent194(stack["content"]) + return p.cur.onDoubleQuotedStringElement51() } -func (c *current) onExampleBlockRawContent93(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) - +func (c *current) onDoubleQuotedStringElement57() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonExampleBlockRawContent93() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement57() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent93(stack["content"]) + return p.cur.onDoubleQuotedStringElement57() } -func (c *current) onExampleBlockRawContent29(firstLine, otherLines interface{}) (interface{}, error) { - - return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...), c.globalStore.getAttributes()) +func (c *current) onDoubleQuotedStringElement61() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonExampleBlockRawContent29() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement61() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent29(stack["firstLine"], stack["otherLines"]) + return p.cur.onDoubleQuotedStringElement61() } -func (c *current) onExampleBlockRawContent203() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement68() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent203() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement68() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent203() + return p.cur.onDoubleQuotedStringElement68() } -func (c *current) onExampleBlockRawContent195() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onDoubleQuotedStringElement80() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent195() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent195() + return p.cur.onDoubleQuotedStringElement80() } -func (c *current) onExampleBlockRawContent211() (interface{}, error) { - return types.NewThematicBreak() -} +func (c *current) onDoubleQuotedStringElement82() (interface{}, error) { -func (p *parser) callonExampleBlockRawContent211() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onExampleBlockRawContent211() -} + return strconv.Atoi(string(c.text)) -func (c *current) onExampleBlockRawContent234() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent234() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement82() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent234() + return p.cur.onDoubleQuotedStringElement82() } -func (c *current) onExampleBlockRawContent252() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement75(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent252() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement75() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent252() + return p.cur.onDoubleQuotedStringElement75(stack["start"]) } -func (c *current) onExampleBlockRawContent268() (interface{}, error) { - - return string(c.text), nil - +func (c *current) onDoubleQuotedStringElement64(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonExampleBlockRawContent268() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement64() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent268() + return p.cur.onDoubleQuotedStringElement64(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent262(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onDoubleQuotedStringElement90() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent262() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement90() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent262(stack["content"]) + return p.cur.onDoubleQuotedStringElement90() } -func (c *current) onExampleBlockRawContent243(line interface{}) (interface{}, error) { +func (c *current) onDoubleQuotedStringElement102() (interface{}, error) { + return string(c.text), nil - return line, nil } -func (p *parser) callonExampleBlockRawContent243() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement102() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent243(stack["line"]) + return p.cur.onDoubleQuotedStringElement102() } -func (c *current) onExampleBlockRawContent282() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement104() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent282() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement104() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent282() + return p.cur.onDoubleQuotedStringElement104() } -func (c *current) onExampleBlockRawContent228(content interface{}) (interface{}, error) { - return types.NewFencedBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onDoubleQuotedStringElement97(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent228() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement97() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent228(stack["content"]) + return p.cur.onDoubleQuotedStringElement97(stack["start"]) } -func (c *current) onExampleBlockRawContent297() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement86(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonExampleBlockRawContent297() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement86() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent297() + return p.cur.onDoubleQuotedStringElement86(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent315() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement112() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent315() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement112() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent315() + return p.cur.onDoubleQuotedStringElement112() } -func (c *current) onExampleBlockRawContent331() (interface{}, error) { - - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement108(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonExampleBlockRawContent331() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement108() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent331() + return p.cur.onDoubleQuotedStringElement108(stack["name"]) } -func (c *current) onExampleBlockRawContent325(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onDoubleQuotedStringElement59(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonExampleBlockRawContent325() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement59() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent325(stack["content"]) + return p.cur.onDoubleQuotedStringElement59(stack["element"]) } -func (c *current) onExampleBlockRawContent306(line interface{}) (interface{}, error) { +func (c *current) onDoubleQuotedStringElement120() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) - return line, nil } -func (p *parser) callonExampleBlockRawContent306() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement120() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent306(stack["line"]) + return p.cur.onDoubleQuotedStringElement120() } -func (c *current) onExampleBlockRawContent345() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement129() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent345() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement129() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent345() + return p.cur.onDoubleQuotedStringElement129() } -func (c *current) onExampleBlockRawContent291(content interface{}) (interface{}, error) { - return types.NewListingBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onDoubleQuotedStringElement135() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent291() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement135() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent291(stack["content"]) + return p.cur.onDoubleQuotedStringElement135() } -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) onDoubleQuotedStringElement141() (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) callonExampleBlockRawContent356() (bool, error) { +func (p *parser) callonDoubleQuotedStringElement141() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent356() + return p.cur.onDoubleQuotedStringElement141() } -func (c *current) onExampleBlockRawContent361() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement148() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonExampleBlockRawContent361() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement148() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent361() + return p.cur.onDoubleQuotedStringElement148() } -func (c *current) onExampleBlockRawContent379() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement155() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent379() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement155() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent379() + return p.cur.onDoubleQuotedStringElement155() } -func (c *current) onExampleBlockRawContent395() (interface{}, error) { - +func (c *current) onDoubleQuotedStringElement167() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent395() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement167() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent395() + return p.cur.onDoubleQuotedStringElement167() } -func (c *current) onExampleBlockRawContent389(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onDoubleQuotedStringElement169() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonExampleBlockRawContent389() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement169() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent389(stack["content"]) + return p.cur.onDoubleQuotedStringElement169() } -func (c *current) onExampleBlockRawContent370(line interface{}) (interface{}, error) { +func (c *current) onDoubleQuotedStringElement162(start interface{}) (interface{}, error) { + return start, nil - return line, nil } -func (p *parser) callonExampleBlockRawContent370() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement162() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent370(stack["line"]) + return p.cur.onDoubleQuotedStringElement162(stack["start"]) } -func (c *current) onExampleBlockRawContent409() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement151(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonExampleBlockRawContent409() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement151() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent409() + return p.cur.onDoubleQuotedStringElement151(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent354(content interface{}) (interface{}, error) { - return types.NewVerseBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onDoubleQuotedStringElement177() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent354() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement177() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent354(stack["content"]) + return p.cur.onDoubleQuotedStringElement177() } -func (c *current) onExampleBlockRawContent428() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement189() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent428() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement189() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent428() + return p.cur.onDoubleQuotedStringElement189() } -func (c *current) onExampleBlockRawContent437() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onDoubleQuotedStringElement191() (interface{}, error) { -func (p *parser) callonExampleBlockRawContent437() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onExampleBlockRawContent437() -} + return strconv.Atoi(string(c.text)) -func (c *current) onExampleBlockRawContent420(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) } -func (p *parser) callonExampleBlockRawContent420() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement191() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent420(stack["content"]) + return p.cur.onDoubleQuotedStringElement191() } -func (c *current) onExampleBlockRawContent451() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement184(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent451() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement184() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent451() + return p.cur.onDoubleQuotedStringElement184(stack["start"]) } -func (c *current) onExampleBlockRawContent469() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement173(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonExampleBlockRawContent469() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement173() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent469() + return p.cur.onDoubleQuotedStringElement173(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent485() (interface{}, error) { - +func (c *current) onDoubleQuotedStringElement199() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent485() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement199() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent485() + return p.cur.onDoubleQuotedStringElement199() } -func (c *current) onExampleBlockRawContent479(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onDoubleQuotedStringElement195(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonExampleBlockRawContent479() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement195() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent479(stack["content"]) + return p.cur.onDoubleQuotedStringElement195(stack["name"]) } -func (c *current) onExampleBlockRawContent460(line interface{}) (interface{}, error) { +func (c *current) onDoubleQuotedStringElement146(element interface{}) (interface{}, error) { + return element, nil - return line, nil } -func (p *parser) callonExampleBlockRawContent460() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement146() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent460(stack["line"]) + return p.cur.onDoubleQuotedStringElement146(stack["element"]) } -func (c *current) onExampleBlockRawContent499() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement205() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent499() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement205() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent499() + return p.cur.onDoubleQuotedStringElement205() } -func (c *current) onExampleBlockRawContent445(content interface{}) (interface{}, error) { - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onDoubleQuotedStringElement125(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonExampleBlockRawContent445() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement125() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent445(stack["content"]) + return p.cur.onDoubleQuotedStringElement125(stack["id"], stack["label"]) } -func (c *current) onExampleBlockRawContent515() (interface{}, error) { +func (c *current) onDoubleQuotedStringElement212() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent515() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement212() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent515() + return p.cur.onDoubleQuotedStringElement212() } -func (c *current) onExampleBlockRawContent533() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement208(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonExampleBlockRawContent533() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement208() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent533() + return p.cur.onDoubleQuotedStringElement208(stack["id"]) } -func (c *current) onExampleBlockRawContent549() (interface{}, error) { - - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement123() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonExampleBlockRawContent549() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement123() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent549() + return p.cur.onDoubleQuotedStringElement123() } -func (c *current) onExampleBlockRawContent543(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onDoubleQuotedStringElement216() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonExampleBlockRawContent543() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement216() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent543(stack["content"]) + return p.cur.onDoubleQuotedStringElement216() } -func (c *current) onExampleBlockRawContent524(line interface{}) (interface{}, error) { +func (c *current) onDoubleQuotedStringElement118(element interface{}) (interface{}, error) { + return element, nil - return line, nil } -func (p *parser) callonExampleBlockRawContent524() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement118() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent524(stack["line"]) + return p.cur.onDoubleQuotedStringElement118(stack["element"]) } -func (c *current) onExampleBlockRawContent563() (interface{}, error) { - return string(c.text), nil +func (c *current) onDoubleQuotedStringElement221() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent563() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement221() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent563() + return p.cur.onDoubleQuotedStringElement221() } -func (c *current) onExampleBlockRawContent509(content interface{}) (interface{}, error) { - return types.NewCommentBlock(content.([]interface{}), nil) +func (c *current) onDoubleQuotedStringElement1(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonExampleBlockRawContent509() (interface{}, error) { +func (p *parser) callonDoubleQuotedStringElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent509(stack["content"]) + return p.cur.onDoubleQuotedStringElement1(stack["element"]) } -func (c *current) onExampleBlockRawContent574() (bool, error) { - attrs := c.globalStore.getAttributes() - return types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Literal), nil - +func (c *current) onQuotedTextInDoubleQuotedString10(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonExampleBlockRawContent574() (bool, error) { +func (p *parser) callonQuotedTextInDoubleQuotedString10() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent574() + return p.cur.onQuotedTextInDoubleQuotedString10(stack["element"]) } -func (c *current) onExampleBlockRawContent588() (interface{}, error) { - return string(c.text), nil +func (c *current) onQuotedTextInDoubleQuotedString1(attributes, text interface{}) (interface{}, error) { + return text.(*types.QuotedText).WithAttributes(attributes) + } -func (p *parser) callonExampleBlockRawContent588() (interface{}, error) { +func (p *parser) callonQuotedTextInDoubleQuotedString1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent588() + return p.cur.onQuotedTextInDoubleQuotedString1(stack["attributes"], stack["text"]) } -func (c *current) onExampleBlockRawContent580() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onAttributesGroup6() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent580() (interface{}, error) { +func (p *parser) callonAttributesGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent580() + return p.cur.onAttributesGroup6() } -func (c *current) onExampleBlockRawContent596() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onAttributesGroup10() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent596() (interface{}, error) { +func (p *parser) callonAttributesGroup10() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent596() + return p.cur.onAttributesGroup10() } -func (c *current) onExampleBlockRawContent577(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onAttributesGroup14() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonExampleBlockRawContent577() (interface{}, error) { +func (p *parser) callonAttributesGroup14() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent577(stack["content"]) + return p.cur.onAttributesGroup14() } -func (c *current) onExampleBlockRawContent572(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithAttribute, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onAttributesGroup23() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent572() (interface{}, error) { +func (p *parser) callonAttributesGroup23() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent572(stack["lines"]) + return p.cur.onAttributesGroup23() } -func (c *current) onExampleBlockRawContent617() (interface{}, error) { +func (c *current) onAttributesGroup29() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent617() (interface{}, error) { +func (p *parser) callonAttributesGroup29() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent617() + return p.cur.onAttributesGroup29() } -func (c *current) onExampleBlockRawContent612() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onAttributesGroup35() (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) callonExampleBlockRawContent612() (interface{}, error) { +func (p *parser) callonAttributesGroup35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent612() + return p.cur.onAttributesGroup35() } -func (c *current) onExampleBlockRawContent609(line interface{}) (interface{}, error) { - // do not include the trailing 'EOL' on the first line - return line, nil +func (c *current) onAttributesGroup42() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonExampleBlockRawContent609() (interface{}, error) { +func (p *parser) callonAttributesGroup42() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent609(stack["line"]) + return p.cur.onAttributesGroup42() } -func (c *current) onExampleBlockRawContent639() (interface{}, error) { +func (c *current) onAttributesGroup49() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent639() (interface{}, error) { +func (p *parser) callonAttributesGroup49() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent639() + return p.cur.onAttributesGroup49() } -func (c *current) onExampleBlockRawContent631() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onAttributesGroup61() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent631() (interface{}, error) { +func (p *parser) callonAttributesGroup61() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent631() + return p.cur.onAttributesGroup61() } -func (c *current) onExampleBlockRawContent647() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onAttributesGroup63() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent647() (interface{}, error) { +func (p *parser) callonAttributesGroup63() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent647() + return p.cur.onAttributesGroup63() } -func (c *current) onExampleBlockRawContent628(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onAttributesGroup56(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent628() (interface{}, error) { +func (p *parser) callonAttributesGroup56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent628(stack["content"]) + return p.cur.onAttributesGroup56(stack["start"]) } -func (c *current) onExampleBlockRawContent606(firstLine, otherLines interface{}) (interface{}, error) { - - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil +func (c *current) onAttributesGroup45(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonExampleBlockRawContent606() (interface{}, error) { +func (p *parser) callonAttributesGroup45() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent606(stack["firstLine"], stack["otherLines"]) + return p.cur.onAttributesGroup45(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent604(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithSpacesOnFirstLine, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onAttributesGroup71() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent604() (interface{}, error) { +func (p *parser) callonAttributesGroup71() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent604(stack["lines"]) + return p.cur.onAttributesGroup71() } -func (c *current) onExampleBlockRawContent661() (interface{}, error) { +func (c *current) onAttributesGroup83() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent661() (interface{}, error) { +func (p *parser) callonAttributesGroup83() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent661() + return p.cur.onAttributesGroup83() } -func (c *current) onExampleBlockRawContent673() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onAttributesGroup85() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonExampleBlockRawContent673() (interface{}, error) { +func (p *parser) callonAttributesGroup85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent673() + return p.cur.onAttributesGroup85() } -func (c *current) onExampleBlockRawContent670(line interface{}) (interface{}, error) { +func (c *current) onAttributesGroup78(start interface{}) (interface{}, error) { + return start, nil - return line, nil // do not include the trailing 'EOL' } -func (p *parser) callonExampleBlockRawContent670() (interface{}, error) { +func (p *parser) callonAttributesGroup78() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent670(stack["line"]) + return p.cur.onAttributesGroup78(stack["start"]) } -func (c *current) onExampleBlockRawContent667(lines interface{}) (interface{}, error) { - return lines.([]interface{}), nil +func (c *current) onAttributesGroup67(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonExampleBlockRawContent667() (interface{}, error) { +func (p *parser) callonAttributesGroup67() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent667(stack["lines"]) + return p.cur.onAttributesGroup67(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent690() (interface{}, error) { +func (c *current) onAttributesGroup93() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent690() (interface{}, error) { +func (p *parser) callonAttributesGroup93() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent690() + return p.cur.onAttributesGroup93() } -func (c *current) onExampleBlockRawContent655(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithDelimiter, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onAttributesGroup89(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonExampleBlockRawContent655() (interface{}, error) { +func (p *parser) callonAttributesGroup89() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent655(stack["lines"]) + return p.cur.onAttributesGroup89(stack["name"]) } -func (c *current) onExampleBlockRawContent703() (interface{}, error) { - return types.Tip, nil +func (c *current) onAttributesGroup40(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonExampleBlockRawContent703() (interface{}, error) { +func (p *parser) callonAttributesGroup40() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent703() + return p.cur.onAttributesGroup40(stack["element"]) } -func (c *current) onExampleBlockRawContent705() (interface{}, error) { - return types.Note, nil +func (c *current) onAttributesGroup99() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent705() (interface{}, error) { +func (p *parser) callonAttributesGroup99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent705() + return p.cur.onAttributesGroup99() } -func (c *current) onExampleBlockRawContent707() (interface{}, error) { - return types.Important, nil +func (c *current) onAttributesGroup19(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonExampleBlockRawContent707() (interface{}, error) { +func (p *parser) callonAttributesGroup19() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent707() + return p.cur.onAttributesGroup19(stack["id"], stack["label"]) } -func (c *current) onExampleBlockRawContent709() (interface{}, error) { - return types.Warning, nil +func (c *current) onAttributesGroup106() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent709() (interface{}, error) { +func (p *parser) callonAttributesGroup106() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent709() + return p.cur.onAttributesGroup106() } -func (c *current) onExampleBlockRawContent711() (interface{}, error) { - return types.Caution, nil +func (c *current) onAttributesGroup102(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonExampleBlockRawContent711() (interface{}, error) { +func (p *parser) callonAttributesGroup102() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent711() + return p.cur.onAttributesGroup102(stack["id"]) } -func (c *current) onExampleBlockRawContent725() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup17() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent725() (interface{}, error) { +func (p *parser) callonAttributesGroup17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent725() + return p.cur.onAttributesGroup17() } -func (c *current) onExampleBlockRawContent734() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup110() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent734() (interface{}, error) { +func (p *parser) callonAttributesGroup110() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent734() + return p.cur.onAttributesGroup110() } -func (c *current) onExampleBlockRawContent717(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onAttributesGroup12(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonExampleBlockRawContent717() (interface{}, error) { +func (p *parser) callonAttributesGroup12() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent717(stack["content"]) + return p.cur.onAttributesGroup12(stack["element"]) } -func (c *current) onExampleBlockRawContent755() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup116() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonExampleBlockRawContent755() (interface{}, error) { +func (p *parser) callonAttributesGroup116() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent755() + return p.cur.onAttributesGroup116() } -func (c *current) onExampleBlockRawContent767() (interface{}, error) { +func (c *current) onAttributesGroup123() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent767() (interface{}, error) { +func (p *parser) callonAttributesGroup123() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent767() + return p.cur.onAttributesGroup123() } -func (c *current) onExampleBlockRawContent779() (interface{}, error) { +func (c *current) onAttributesGroup135() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent779() (interface{}, error) { +func (p *parser) callonAttributesGroup135() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent779() + return p.cur.onAttributesGroup135() } -func (c *current) onExampleBlockRawContent791() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup137() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent791() (interface{}, error) { +func (p *parser) callonAttributesGroup137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent791() + return p.cur.onAttributesGroup137() } -func (c *current) onExampleBlockRawContent803() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup130(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent803() (interface{}, error) { +func (p *parser) callonAttributesGroup130() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent803() + return p.cur.onAttributesGroup130(stack["start"]) } -func (c *current) onExampleBlockRawContent815() (interface{}, error) { - return string(c.text), nil +func (c *current) onAttributesGroup119(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonExampleBlockRawContent815() (interface{}, error) { +func (p *parser) callonAttributesGroup119() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent815() + return p.cur.onAttributesGroup119(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent827() (interface{}, error) { +func (c *current) onAttributesGroup145() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent827() (interface{}, error) { +func (p *parser) callonAttributesGroup145() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent827() + return p.cur.onAttributesGroup145() } -func (c *current) onExampleBlockRawContent835() (interface{}, error) { - +func (c *current) onAttributesGroup157() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent835() (interface{}, error) { +func (p *parser) callonAttributesGroup157() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent835() + return p.cur.onAttributesGroup157() } -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) onAttributesGroup159() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonExampleBlockRawContent843() (bool, error) { +func (p *parser) callonAttributesGroup159() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent843(stack["content"]) + return p.cur.onAttributesGroup159() } -func (c *current) onExampleBlockRawContent742(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onAttributesGroup152(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonExampleBlockRawContent742() (interface{}, error) { +func (p *parser) callonAttributesGroup152() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent742(stack["content"]) + return p.cur.onAttributesGroup152(stack["start"]) } -func (c *current) onExampleBlockRawContent699(t, lines interface{}) (interface{}, error) { - - return types.NewAdmonitionParagraph(lines.([]interface{}), t.(string), c.globalStore.getAttributes()) - +func (c *current) onAttributesGroup141(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonExampleBlockRawContent699() (interface{}, error) { +func (p *parser) callonAttributesGroup141() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent699(stack["t"], stack["lines"]) + return p.cur.onAttributesGroup141(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent860() (interface{}, error) { +func (c *current) onAttributesGroup167() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent860() (interface{}, error) { +func (p *parser) callonAttributesGroup167() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent860() + return p.cur.onAttributesGroup167() } -func (c *current) onExampleBlockRawContent852() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onAttributesGroup163(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonExampleBlockRawContent852() (interface{}, error) { +func (p *parser) callonAttributesGroup163() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent852() + return p.cur.onAttributesGroup163(stack["name"]) } -func (c *current) onExampleBlockRawContent876() (interface{}, error) { - - return string(c.text), nil +func (c *current) onAttributesGroup114(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonExampleBlockRawContent876() (interface{}, error) { +func (p *parser) callonAttributesGroup114() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent876() + return p.cur.onAttributesGroup114(stack["element"]) } -func (c *current) onExampleBlockRawContent870(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) - +func (c *current) onAttributesGroup177() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent870() (interface{}, error) { +func (p *parser) callonAttributesGroup177() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent870(stack["content"]) + return p.cur.onAttributesGroup177() } -func (c *current) onExampleBlockRawContent849(content interface{}) (interface{}, error) { - - return content, nil +func (c *current) onAttributesGroup173(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonExampleBlockRawContent849() (interface{}, error) { +func (p *parser) callonAttributesGroup173() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent849(stack["content"]) + return p.cur.onAttributesGroup173(stack["ref"]) } -func (c *current) onExampleBlockRawContent844(content interface{}) (interface{}, error) { - return types.NewMarkdownQuoteBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onAttributesGroup181() (interface{}, error) { + + return types.NewStringElement(string(c.text)) } -func (p *parser) callonExampleBlockRawContent844() (interface{}, error) { +func (p *parser) callonAttributesGroup181() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent844(stack["content"]) + return p.cur.onAttributesGroup181() } -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) onAttributesGroup1(elements interface{}) (interface{}, error) { + + return types.Merge(elements), nil } -func (p *parser) callonExampleBlockRawContent886() (bool, error) { +func (p *parser) callonAttributesGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent886() + return p.cur.onAttributesGroup1(stack["elements"]) } -func (c *current) onExampleBlockRawContent902() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup9() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent902() (interface{}, error) { +func (p *parser) callonElementAttributesGroup9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent902() + return p.cur.onElementAttributesGroup9() } -func (c *current) onExampleBlockRawContent914() (interface{}, error) { +func (c *current) onElementAttributesGroup15() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent914() (interface{}, error) { +func (p *parser) callonElementAttributesGroup15() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent914() + return p.cur.onElementAttributesGroup15() } -func (c *current) onExampleBlockRawContent926() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup22() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonExampleBlockRawContent926() (interface{}, error) { +func (p *parser) callonElementAttributesGroup22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent926() + return p.cur.onElementAttributesGroup22() } -func (c *current) onExampleBlockRawContent938() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup6(content interface{}) (interface{}, error) { + return content, nil + } -func (p *parser) callonExampleBlockRawContent938() (interface{}, error) { +func (p *parser) callonElementAttributesGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent938() + return p.cur.onElementAttributesGroup6(stack["content"]) } -func (c *current) onExampleBlockRawContent950() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup24() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent950() (interface{}, error) { +func (p *parser) callonElementAttributesGroup24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent950() + return p.cur.onElementAttributesGroup24() } -func (c *current) onExampleBlockRawContent962() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup33() (interface{}, error) { + // allow ` + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent962() (interface{}, error) { +func (p *parser) callonElementAttributesGroup33() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent962() + return p.cur.onElementAttributesGroup33() } -func (c *current) onExampleBlockRawContent974() (interface{}, error) { +func (c *current) onElementAttributesGroup48() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent974() (interface{}, error) { +func (p *parser) callonElementAttributesGroup48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent974() + return p.cur.onElementAttributesGroup48() } -func (c *current) onExampleBlockRawContent982() (interface{}, error) { - - return string(c.text), nil +func (c *current) onElementAttributesGroup54() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonExampleBlockRawContent982() (interface{}, error) { +func (p *parser) callonElementAttributesGroup54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent982() + return p.cur.onElementAttributesGroup54() } -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) onElementAttributesGroup42() (interface{}, error) { + return types.NewString(string(c.text)) } -func (p *parser) callonExampleBlockRawContent990() (bool, error) { +func (p *parser) callonElementAttributesGroup42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent990(stack["content"]) + return p.cur.onElementAttributesGroup42() } -func (c *current) onExampleBlockRawContent889(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onElementAttributesGroup58() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonExampleBlockRawContent889() (interface{}, error) { +func (p *parser) callonElementAttributesGroup58() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent889(stack["content"]) + return p.cur.onElementAttributesGroup58() } -func (c *current) onExampleBlockRawContent884(content interface{}) (interface{}, error) { - - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onElementAttributesGroup65() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent884() (interface{}, error) { +func (p *parser) callonElementAttributesGroup65() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent884(stack["content"]) + return p.cur.onElementAttributesGroup65() } -func (c *current) onExampleBlockRawContent1003() (interface{}, error) { +func (c *current) onElementAttributesGroup77() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent1003() (interface{}, error) { +func (p *parser) callonElementAttributesGroup77() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1003() + return p.cur.onElementAttributesGroup77() } -func (c *current) onExampleBlockRawContent1012() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup79() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent1012() (interface{}, error) { +func (p *parser) callonElementAttributesGroup79() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1012() + return p.cur.onElementAttributesGroup79() } -func (c *current) onExampleBlockRawContent995(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onElementAttributesGroup72(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent995() (interface{}, error) { +func (p *parser) callonElementAttributesGroup72() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent995(stack["content"]) + return p.cur.onElementAttributesGroup72(stack["start"]) } -func (c *current) onExampleBlockRawContent1033() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup61(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonExampleBlockRawContent1033() (interface{}, error) { +func (p *parser) callonElementAttributesGroup61() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1033() + return p.cur.onElementAttributesGroup61(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent1045() (interface{}, error) { +func (c *current) onElementAttributesGroup87() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent1045() (interface{}, error) { +func (p *parser) callonElementAttributesGroup87() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1045() + return p.cur.onElementAttributesGroup87() } -func (c *current) onExampleBlockRawContent1057() (interface{}, error) { +func (c *current) onElementAttributesGroup99() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent1057() (interface{}, error) { +func (p *parser) callonElementAttributesGroup99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1057() + return p.cur.onElementAttributesGroup99() } -func (c *current) onExampleBlockRawContent1069() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup101() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonExampleBlockRawContent1069() (interface{}, error) { +func (p *parser) callonElementAttributesGroup101() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1069() + return p.cur.onElementAttributesGroup101() } -func (c *current) onExampleBlockRawContent1081() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup94(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonExampleBlockRawContent1081() (interface{}, error) { +func (p *parser) callonElementAttributesGroup94() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1081() + return p.cur.onElementAttributesGroup94(stack["start"]) } -func (c *current) onExampleBlockRawContent1093() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup83(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonExampleBlockRawContent1093() (interface{}, error) { +func (p *parser) callonElementAttributesGroup83() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1093() + return p.cur.onElementAttributesGroup83(stack["name"], stack["start"]) } -func (c *current) onExampleBlockRawContent1105() (interface{}, error) { +func (c *current) onElementAttributesGroup109() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent1105() (interface{}, error) { +func (p *parser) callonElementAttributesGroup109() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1105() + return p.cur.onElementAttributesGroup109() } -func (c *current) onExampleBlockRawContent1113() (interface{}, error) { +func (c *current) onElementAttributesGroup105(name interface{}) (interface{}, error) { - return string(c.text), nil + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonExampleBlockRawContent1113() (interface{}, error) { +func (p *parser) callonElementAttributesGroup105() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1113() + return p.cur.onElementAttributesGroup105(stack["name"]) } -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) onElementAttributesGroup56(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonExampleBlockRawContent1121() (bool, error) { +func (p *parser) callonElementAttributesGroup56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1121(stack["content"]) + return p.cur.onElementAttributesGroup56(stack["element"]) } -func (c *current) onExampleBlockRawContent1020(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onElementAttributesGroup118() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonExampleBlockRawContent1020() (interface{}, error) { +func (p *parser) callonElementAttributesGroup118() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1020(stack["content"]) + return p.cur.onElementAttributesGroup118() } -func (c *current) onExampleBlockRawContent991(lines interface{}) (interface{}, error) { - - return types.NewParagraph(lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onElementAttributesGroup127() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent991() (interface{}, error) { +func (p *parser) callonElementAttributesGroup127() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent991(stack["lines"]) + return p.cur.onElementAttributesGroup127() } -func (c *current) onExampleBlockRawContent1128() (interface{}, error) { +func (c *current) onElementAttributesGroup133() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonExampleBlockRawContent1128() (interface{}, error) { +func (p *parser) callonElementAttributesGroup133() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1128() + return p.cur.onElementAttributesGroup133() } -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) onElementAttributesGroup139() (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) callonExampleBlockRawContent1122() (interface{}, error) { +func (p *parser) callonElementAttributesGroup139() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1122() + return p.cur.onElementAttributesGroup139() } -func (c *current) onExampleBlockRawContent4(attributes, element interface{}) (interface{}, error) { - c.globalStore.discardAttributes() - return element, nil +func (c *current) onElementAttributesGroup146() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonExampleBlockRawContent4() (interface{}, error) { +func (p *parser) callonElementAttributesGroup146() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent4(stack["attributes"], stack["element"]) + return p.cur.onElementAttributesGroup146() } -func (c *current) onExampleBlockRawContent1(elements interface{}) (interface{}, error) { - return elements, nil +func (c *current) onElementAttributesGroup153() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonExampleBlockRawContent1() (interface{}, error) { +func (p *parser) callonElementAttributesGroup153() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onExampleBlockRawContent1(stack["elements"]) + return p.cur.onElementAttributesGroup153() } -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) onElementAttributesGroup165() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlock3() (bool, error) { +func (p *parser) callonElementAttributesGroup165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlock3() + return p.cur.onElementAttributesGroup165() } -func (c *current) onQuoteBlock8() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup167() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonQuoteBlock8() (interface{}, error) { +func (p *parser) callonElementAttributesGroup167() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlock8() + return p.cur.onElementAttributesGroup167() } -func (c *current) onQuoteBlock23() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup160(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonQuoteBlock23() (interface{}, error) { +func (p *parser) callonElementAttributesGroup160() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlock23() + return p.cur.onElementAttributesGroup160(stack["start"]) } -func (c *current) onQuoteBlock1(content interface{}) (interface{}, error) { - return types.NewQuoteBlock(content.([]interface{}), c.globalStore.getAttributes()) - +func (c *current) onElementAttributesGroup149(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonQuoteBlock1() (interface{}, error) { +func (p *parser) callonElementAttributesGroup149() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlock1(stack["content"]) + return p.cur.onElementAttributesGroup149(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent13() (interface{}, error) { +func (c *current) onElementAttributesGroup175() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent13() (interface{}, error) { +func (p *parser) callonElementAttributesGroup175() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent13() + return p.cur.onElementAttributesGroup175() } -func (c *current) onQuoteBlockRawContent25(attributes interface{}) error { - c.globalStore.pushAttributes(attributes) - return nil +func (c *current) onElementAttributesGroup187() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent25() error { +func (p *parser) callonElementAttributesGroup187() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent25(stack["attributes"]) + return p.cur.onElementAttributesGroup187() } -func (c *current) onQuoteBlockRawContent31() (bool, error) { - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Literal), nil +func (c *current) onElementAttributesGroup189() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent31() (bool, error) { +func (p *parser) callonElementAttributesGroup189() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent31() + return p.cur.onElementAttributesGroup189() } -func (c *current) onQuoteBlockRawContent40() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onElementAttributesGroup182(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonQuoteBlockRawContent40() (interface{}, error) { +func (p *parser) callonElementAttributesGroup182() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent40() + return p.cur.onElementAttributesGroup182(stack["start"]) } -func (c *current) onQuoteBlockRawContent49() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) - +func (c *current) onElementAttributesGroup171(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonQuoteBlockRawContent49() (interface{}, error) { +func (p *parser) callonElementAttributesGroup171() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent49() + return p.cur.onElementAttributesGroup171(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent36(elements interface{}) (interface{}, error) { +func (c *current) onElementAttributesGroup197() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent36() (interface{}, error) { +func (p *parser) callonElementAttributesGroup197() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent36(stack["elements"]) + return p.cur.onElementAttributesGroup197() } -func (c *current) onQuoteBlockRawContent33(content interface{}) (interface{}, error) { +func (c *current) onElementAttributesGroup193(name interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonQuoteBlockRawContent33() (interface{}, error) { +func (p *parser) callonElementAttributesGroup193() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent33(stack["content"]) + return p.cur.onElementAttributesGroup193(stack["name"]) } -func (c *current) onQuoteBlockRawContent76() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup144(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent76() (interface{}, error) { +func (p *parser) callonElementAttributesGroup144() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent76() + return p.cur.onElementAttributesGroup144(stack["element"]) } -func (c *current) onQuoteBlockRawContent85() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup203() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent85() (interface{}, error) { +func (p *parser) callonElementAttributesGroup203() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent85() + return p.cur.onElementAttributesGroup203() } -func (c *current) onQuoteBlockRawContent68(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onElementAttributesGroup123(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonQuoteBlockRawContent68() (interface{}, error) { +func (p *parser) callonElementAttributesGroup123() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent68(stack["content"]) + return p.cur.onElementAttributesGroup123(stack["id"], stack["label"]) } -func (c *current) onQuoteBlockRawContent106() (interface{}, error) { +func (c *current) onElementAttributesGroup210() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent106() (interface{}, error) { +func (p *parser) callonElementAttributesGroup210() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent106() + return p.cur.onElementAttributesGroup210() } -func (c *current) onQuoteBlockRawContent118() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup206(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonQuoteBlockRawContent118() (interface{}, error) { +func (p *parser) callonElementAttributesGroup206() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent118() + return p.cur.onElementAttributesGroup206(stack["id"]) } -func (c *current) onQuoteBlockRawContent130() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup121() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent130() (interface{}, error) { +func (p *parser) callonElementAttributesGroup121() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent130() + return p.cur.onElementAttributesGroup121() } -func (c *current) onQuoteBlockRawContent142() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup214() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent142() (interface{}, error) { +func (p *parser) callonElementAttributesGroup214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent142() + return p.cur.onElementAttributesGroup214() } -func (c *current) onQuoteBlockRawContent154() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup116(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent154() (interface{}, error) { +func (p *parser) callonElementAttributesGroup116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent154() + return p.cur.onElementAttributesGroup116(stack["element"]) } -func (c *current) onQuoteBlockRawContent166() (interface{}, error) { +func (c *current) onElementAttributesGroup220() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent166() (interface{}, error) { +func (p *parser) callonElementAttributesGroup220() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent166() + return p.cur.onElementAttributesGroup220() } -func (c *current) onQuoteBlockRawContent178() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementAttributesGroup216(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonQuoteBlockRawContent178() (interface{}, error) { +func (p *parser) callonElementAttributesGroup216() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent178() + return p.cur.onElementAttributesGroup216(stack["ref"]) } -func (c *current) onQuoteBlockRawContent186() (interface{}, error) { +func (c *current) onElementAttributesGroup224() (interface{}, error) { + + return types.NewStringElement(string(c.text)) - return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent186() (interface{}, error) { +func (p *parser) callonElementAttributesGroup224() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent186() + return p.cur.onElementAttributesGroup224() } -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) onElementAttributesGroup1(elements interface{}) (interface{}, error) { + + return types.Merge(elements), nil } -func (p *parser) callonQuoteBlockRawContent194() (bool, error) { +func (p *parser) callonElementAttributesGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent194(stack["content"]) + return p.cur.onElementAttributesGroup1(stack["elements"]) } -func (c *current) onQuoteBlockRawContent93(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onHeaderGroup1(elements interface{}) (interface{}, error) { + + return types.Merge(elements), nil } -func (p *parser) callonQuoteBlockRawContent93() (interface{}, error) { +func (p *parser) callonHeaderGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent93(stack["content"]) + return p.cur.onHeaderGroup1(stack["elements"]) } -func (c *current) onQuoteBlockRawContent29(firstLine, otherLines interface{}) (interface{}, error) { - - return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...), c.globalStore.getAttributes()) +func (c *current) onHeaderGroupElement11() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent29() (interface{}, error) { +func (p *parser) callonHeaderGroupElement11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent29(stack["firstLine"], stack["otherLines"]) + return p.cur.onHeaderGroupElement11() } -func (c *current) onQuoteBlockRawContent203() (interface{}, error) { +func (c *current) onHeaderGroupElement17() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent203() (interface{}, error) { +func (p *parser) callonHeaderGroupElement17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent203() + return p.cur.onHeaderGroupElement17() } -func (c *current) onQuoteBlockRawContent195() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onHeaderGroupElement24() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent195() (interface{}, error) { +func (p *parser) callonHeaderGroupElement24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent195() + return p.cur.onHeaderGroupElement24() } -func (c *current) onQuoteBlockRawContent211() (interface{}, error) { - return types.NewThematicBreak() +func (c *current) onHeaderGroupElement8(content interface{}) (interface{}, error) { + return content, nil + } -func (p *parser) callonQuoteBlockRawContent211() (interface{}, error) { +func (p *parser) callonHeaderGroupElement8() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent211() + return p.cur.onHeaderGroupElement8(stack["content"]) } -func (c *current) onQuoteBlockRawContent234() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement26() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent234() (interface{}, error) { +func (p *parser) callonHeaderGroupElement26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent234() + return p.cur.onHeaderGroupElement26() } -func (c *current) onQuoteBlockRawContent252() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement35() (interface{}, error) { + // allow ` + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent252() (interface{}, error) { +func (p *parser) callonHeaderGroupElement35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent252() + return p.cur.onHeaderGroupElement35() } -func (c *current) onQuoteBlockRawContent268() (interface{}, error) { - +func (c *current) onHeaderGroupElement50() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent268() (interface{}, error) { +func (p *parser) callonHeaderGroupElement50() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent268() + return p.cur.onHeaderGroupElement50() } -func (c *current) onQuoteBlockRawContent262(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) - +func (c *current) onHeaderGroupElement56() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent262() (interface{}, error) { +func (p *parser) callonHeaderGroupElement56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent262(stack["content"]) + return p.cur.onHeaderGroupElement56() } -func (c *current) onQuoteBlockRawContent243(line interface{}) (interface{}, error) { - - return line, nil +func (c *current) onHeaderGroupElement44() (interface{}, error) { + return types.NewString(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent243() (interface{}, error) { +func (p *parser) callonHeaderGroupElement44() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent243(stack["line"]) + return p.cur.onHeaderGroupElement44() } -func (c *current) onQuoteBlockRawContent282() (interface{}, error) { +func (c *current) onHeaderGroupElement59() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent282() (interface{}, error) { +func (p *parser) callonHeaderGroupElement59() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent282() + return p.cur.onHeaderGroupElement59() } -func (c *current) onQuoteBlockRawContent228(content interface{}) (interface{}, error) { - return types.NewFencedBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onHeaderGroupElement64() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonQuoteBlockRawContent228() (interface{}, error) { +func (p *parser) callonHeaderGroupElement64() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent228(stack["content"]) + return p.cur.onHeaderGroupElement64() } -func (c *current) onQuoteBlockRawContent297() (interface{}, error) { +func (c *current) onHeaderGroupElement73() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent297() (interface{}, error) { +func (p *parser) callonHeaderGroupElement73() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent297() + return p.cur.onHeaderGroupElement73() } -func (c *current) onQuoteBlockRawContent315() (interface{}, error) { +func (c *current) onHeaderGroupElement79() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent315() (interface{}, error) { +func (p *parser) callonHeaderGroupElement79() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent315() + return p.cur.onHeaderGroupElement79() } -func (c *current) onQuoteBlockRawContent331() (interface{}, error) { - - return string(c.text), nil +func (c *current) onHeaderGroupElement85() (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) callonQuoteBlockRawContent331() (interface{}, error) { +func (p *parser) callonHeaderGroupElement85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent331() + return p.cur.onHeaderGroupElement85() } -func (c *current) onQuoteBlockRawContent325(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onHeaderGroupElement92() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonQuoteBlockRawContent325() (interface{}, error) { +func (p *parser) callonHeaderGroupElement92() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent325(stack["content"]) + return p.cur.onHeaderGroupElement92() } -func (c *current) onQuoteBlockRawContent306(line interface{}) (interface{}, error) { +func (c *current) onHeaderGroupElement99() (interface{}, error) { + return string(c.text), nil - return line, nil } -func (p *parser) callonQuoteBlockRawContent306() (interface{}, error) { +func (p *parser) callonHeaderGroupElement99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent306(stack["line"]) + return p.cur.onHeaderGroupElement99() } -func (c *current) onQuoteBlockRawContent345() (interface{}, error) { +func (c *current) onHeaderGroupElement111() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent345() (interface{}, error) { +func (p *parser) callonHeaderGroupElement111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent345() + return p.cur.onHeaderGroupElement111() } -func (c *current) onQuoteBlockRawContent291(content interface{}) (interface{}, error) { - return types.NewListingBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onHeaderGroupElement113() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent291() (interface{}, error) { +func (p *parser) callonHeaderGroupElement113() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent291(stack["content"]) + return p.cur.onHeaderGroupElement113() } -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) onHeaderGroupElement106(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonQuoteBlockRawContent356() (bool, error) { +func (p *parser) callonHeaderGroupElement106() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent356() + return p.cur.onHeaderGroupElement106(stack["start"]) } -func (c *current) onQuoteBlockRawContent361() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement95(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonQuoteBlockRawContent361() (interface{}, error) { +func (p *parser) callonHeaderGroupElement95() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent361() + return p.cur.onHeaderGroupElement95(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent379() (interface{}, error) { +func (c *current) onHeaderGroupElement121() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent379() (interface{}, error) { +func (p *parser) callonHeaderGroupElement121() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent379() + return p.cur.onHeaderGroupElement121() } -func (c *current) onQuoteBlockRawContent395() (interface{}, error) { - +func (c *current) onHeaderGroupElement133() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent395() (interface{}, error) { +func (p *parser) callonHeaderGroupElement133() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent395() + return p.cur.onHeaderGroupElement133() } -func (c *current) onQuoteBlockRawContent389(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onHeaderGroupElement135() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent389() (interface{}, error) { +func (p *parser) callonHeaderGroupElement135() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent389(stack["content"]) + return p.cur.onHeaderGroupElement135() } -func (c *current) onQuoteBlockRawContent370(line interface{}) (interface{}, error) { +func (c *current) onHeaderGroupElement128(start interface{}) (interface{}, error) { + return start, nil - return line, nil } -func (p *parser) callonQuoteBlockRawContent370() (interface{}, error) { +func (p *parser) callonHeaderGroupElement128() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent370(stack["line"]) + return p.cur.onHeaderGroupElement128(stack["start"]) } -func (c *current) onQuoteBlockRawContent409() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement117(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonQuoteBlockRawContent409() (interface{}, error) { +func (p *parser) callonHeaderGroupElement117() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent409() + return p.cur.onHeaderGroupElement117(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent354(content interface{}) (interface{}, error) { - return types.NewVerseBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onHeaderGroupElement143() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent354() (interface{}, error) { +func (p *parser) callonHeaderGroupElement143() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent354(stack["content"]) + return p.cur.onHeaderGroupElement143() } -func (c *current) onQuoteBlockRawContent428() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement139(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonQuoteBlockRawContent428() (interface{}, error) { +func (p *parser) callonHeaderGroupElement139() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent428() + return p.cur.onHeaderGroupElement139(stack["name"]) } -func (c *current) onQuoteBlockRawContent437() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement90(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent437() (interface{}, error) { +func (p *parser) callonHeaderGroupElement90() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent437() + return p.cur.onHeaderGroupElement90(stack["element"]) } -func (c *current) onQuoteBlockRawContent420(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onHeaderGroupElement149() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent420() (interface{}, error) { +func (p *parser) callonHeaderGroupElement149() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent420(stack["content"]) + return p.cur.onHeaderGroupElement149() } -func (c *current) onQuoteBlockRawContent451() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement69(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonQuoteBlockRawContent451() (interface{}, error) { +func (p *parser) callonHeaderGroupElement69() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent451() + return p.cur.onHeaderGroupElement69(stack["id"], stack["label"]) } -func (c *current) onQuoteBlockRawContent469() (interface{}, error) { +func (c *current) onHeaderGroupElement156() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent469() (interface{}, error) { +func (p *parser) callonHeaderGroupElement156() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent469() + return p.cur.onHeaderGroupElement156() } -func (c *current) onQuoteBlockRawContent485() (interface{}, error) { - - return string(c.text), nil +func (c *current) onHeaderGroupElement152(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) } -func (p *parser) callonQuoteBlockRawContent485() (interface{}, error) { +func (p *parser) callonHeaderGroupElement152() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent485() + return p.cur.onHeaderGroupElement152(stack["id"]) } -func (c *current) onQuoteBlockRawContent479(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onHeaderGroupElement67() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent479() (interface{}, error) { +func (p *parser) callonHeaderGroupElement67() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent479(stack["content"]) + return p.cur.onHeaderGroupElement67() } -func (c *current) onQuoteBlockRawContent460(line interface{}) (interface{}, error) { +func (c *current) onHeaderGroupElement160() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) - return line, nil } -func (p *parser) callonQuoteBlockRawContent460() (interface{}, error) { +func (p *parser) callonHeaderGroupElement160() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent460(stack["line"]) + return p.cur.onHeaderGroupElement160() } -func (c *current) onQuoteBlockRawContent499() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement62(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent499() (interface{}, error) { +func (p *parser) callonHeaderGroupElement62() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent499() + return p.cur.onHeaderGroupElement62(stack["element"]) } -func (c *current) onQuoteBlockRawContent445(content interface{}) (interface{}, error) { - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onHeaderGroupElement167() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonQuoteBlockRawContent445() (interface{}, error) { +func (p *parser) callonHeaderGroupElement167() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent445(stack["content"]) + return p.cur.onHeaderGroupElement167() } -func (c *current) onQuoteBlockRawContent515() (interface{}, error) { +func (c *current) onHeaderGroupElement174() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent515() (interface{}, error) { +func (p *parser) callonHeaderGroupElement174() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent515() + return p.cur.onHeaderGroupElement174() } -func (c *current) onQuoteBlockRawContent533() (interface{}, error) { +func (c *current) onHeaderGroupElement186() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent533() (interface{}, error) { +func (p *parser) callonHeaderGroupElement186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent533() + return p.cur.onHeaderGroupElement186() } -func (c *current) onQuoteBlockRawContent549() (interface{}, error) { +func (c *current) onHeaderGroupElement188() (interface{}, error) { - return string(c.text), nil + return strconv.Atoi(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent549() (interface{}, error) { +func (p *parser) callonHeaderGroupElement188() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent549() + return p.cur.onHeaderGroupElement188() } -func (c *current) onQuoteBlockRawContent543(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onHeaderGroupElement181(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonQuoteBlockRawContent543() (interface{}, error) { +func (p *parser) callonHeaderGroupElement181() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent543(stack["content"]) + return p.cur.onHeaderGroupElement181(stack["start"]) } -func (c *current) onQuoteBlockRawContent524(line interface{}) (interface{}, error) { - - return line, nil +func (c *current) onHeaderGroupElement170(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonQuoteBlockRawContent524() (interface{}, error) { +func (p *parser) callonHeaderGroupElement170() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent524(stack["line"]) + return p.cur.onHeaderGroupElement170(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent563() (interface{}, error) { +func (c *current) onHeaderGroupElement196() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent563() (interface{}, error) { +func (p *parser) callonHeaderGroupElement196() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent563() + return p.cur.onHeaderGroupElement196() } -func (c *current) onQuoteBlockRawContent509(content interface{}) (interface{}, error) { - return types.NewCommentBlock(content.([]interface{}), nil) +func (c *current) onHeaderGroupElement208() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent509() (interface{}, error) { +func (p *parser) callonHeaderGroupElement208() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent509(stack["content"]) + return p.cur.onHeaderGroupElement208() } -func (c *current) onQuoteBlockRawContent574() (bool, error) { - attrs := c.globalStore.getAttributes() - return types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Literal), nil +func (c *current) onHeaderGroupElement210() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent574() (bool, error) { +func (p *parser) callonHeaderGroupElement210() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent574() + return p.cur.onHeaderGroupElement210() } -func (c *current) onQuoteBlockRawContent588() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement203(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonQuoteBlockRawContent588() (interface{}, error) { +func (p *parser) callonHeaderGroupElement203() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent588() + return p.cur.onHeaderGroupElement203(stack["start"]) } -func (c *current) onQuoteBlockRawContent580() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onHeaderGroupElement192(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonQuoteBlockRawContent580() (interface{}, error) { +func (p *parser) callonHeaderGroupElement192() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent580() + return p.cur.onHeaderGroupElement192(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent596() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onHeaderGroupElement218() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent596() (interface{}, error) { +func (p *parser) callonHeaderGroupElement218() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent596() + return p.cur.onHeaderGroupElement218() } -func (c *current) onQuoteBlockRawContent577(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onHeaderGroupElement214(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonQuoteBlockRawContent577() (interface{}, error) { +func (p *parser) callonHeaderGroupElement214() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent577(stack["content"]) + return p.cur.onHeaderGroupElement214(stack["name"]) } -func (c *current) onQuoteBlockRawContent572(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithAttribute, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onHeaderGroupElement165(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonQuoteBlockRawContent572() (interface{}, error) { +func (p *parser) callonHeaderGroupElement165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent572(stack["lines"]) + return p.cur.onHeaderGroupElement165(stack["element"]) } -func (c *current) onQuoteBlockRawContent617() (interface{}, error) { +func (c *current) onHeaderGroupElement228() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent617() (interface{}, error) { +func (p *parser) callonHeaderGroupElement228() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent617() + return p.cur.onHeaderGroupElement228() } -func (c *current) onQuoteBlockRawContent612() (interface{}, error) { - return types.NewRawLine(string(c.text)) - +func (c *current) onHeaderGroupElement224(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonQuoteBlockRawContent612() (interface{}, error) { +func (p *parser) callonHeaderGroupElement224() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent612() + return p.cur.onHeaderGroupElement224(stack["ref"]) } -func (c *current) onQuoteBlockRawContent609(line interface{}) (interface{}, error) { - // do not include the trailing 'EOL' on the first line - return line, nil +func (c *current) onHeaderGroupElement234() (bool, error) { + return c.isSubstitutionEnabled(Replacements) + } -func (p *parser) callonQuoteBlockRawContent609() (interface{}, error) { +func (p *parser) callonHeaderGroupElement234() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent609(stack["line"]) + return p.cur.onHeaderGroupElement234() } -func (c *current) onQuoteBlockRawContent639() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement237() (interface{}, error) { + return types.NewStringElement("\u2019") + } -func (p *parser) callonQuoteBlockRawContent639() (interface{}, error) { +func (p *parser) callonHeaderGroupElement237() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent639() + return p.cur.onHeaderGroupElement237() } -func (c *current) onQuoteBlockRawContent631() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onHeaderGroupElement239() (interface{}, error) { + return types.NewStringElement("\u00a9") + } -func (p *parser) callonQuoteBlockRawContent631() (interface{}, error) { +func (p *parser) callonHeaderGroupElement239() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent631() + return p.cur.onHeaderGroupElement239() } -func (c *current) onQuoteBlockRawContent647() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onHeaderGroupElement241() (interface{}, error) { + return types.NewStringElement("\u2122") + } -func (p *parser) callonQuoteBlockRawContent647() (interface{}, error) { +func (p *parser) callonHeaderGroupElement241() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent647() + return p.cur.onHeaderGroupElement241() } -func (c *current) onQuoteBlockRawContent628(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onHeaderGroupElement243() (interface{}, error) { + return types.NewStringElement("\u00ae") + } -func (p *parser) callonQuoteBlockRawContent628() (interface{}, error) { +func (p *parser) callonHeaderGroupElement243() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent628(stack["content"]) + return p.cur.onHeaderGroupElement243() } -func (c *current) onQuoteBlockRawContent606(firstLine, otherLines interface{}) (interface{}, error) { +func (c *current) onHeaderGroupElement245() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil } -func (p *parser) callonQuoteBlockRawContent606() (interface{}, error) { +func (p *parser) callonHeaderGroupElement245() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent606(stack["firstLine"], stack["otherLines"]) + return p.cur.onHeaderGroupElement245() } -func (c *current) onQuoteBlockRawContent604(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithSpacesOnFirstLine, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onHeaderGroupElement247() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonQuoteBlockRawContent604() (interface{}, error) { +func (p *parser) callonHeaderGroupElement247() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent604(stack["lines"]) + return p.cur.onHeaderGroupElement247() } -func (c *current) onQuoteBlockRawContent661() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement232(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent661() (interface{}, error) { +func (p *parser) callonHeaderGroupElement232() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent661() + return p.cur.onHeaderGroupElement232(stack["element"]) } -func (c *current) onQuoteBlockRawContent673() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onHeaderGroupElement261() (interface{}, error) { + // spaces, commas and dots are allowed in this syntax + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent673() (interface{}, error) { +func (p *parser) callonHeaderGroupElement261() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent673() + return p.cur.onHeaderGroupElement261() } -func (c *current) onQuoteBlockRawContent670(line interface{}) (interface{}, error) { - - return line, nil // do not include the trailing 'EOL' +func (c *current) onHeaderGroupElement268() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent670() (interface{}, error) { +func (p *parser) callonHeaderGroupElement268() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent670(stack["line"]) + return p.cur.onHeaderGroupElement268() } -func (c *current) onQuoteBlockRawContent667(lines interface{}) (interface{}, error) { - return lines.([]interface{}), nil +func (c *current) onHeaderGroupElement264(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonQuoteBlockRawContent667() (interface{}, error) { +func (p *parser) callonHeaderGroupElement264() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent667(stack["lines"]) + return p.cur.onHeaderGroupElement264(stack["ref"]) } -func (c *current) onQuoteBlockRawContent690() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement274() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonQuoteBlockRawContent690() (interface{}, error) { +func (p *parser) callonHeaderGroupElement274() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent690() + return p.cur.onHeaderGroupElement274() } -func (c *current) onQuoteBlockRawContent655(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithDelimiter, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onHeaderGroupElement281() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent655() (interface{}, error) { +func (p *parser) callonHeaderGroupElement281() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent655(stack["lines"]) + return p.cur.onHeaderGroupElement281() } -func (c *current) onQuoteBlockRawContent703() (interface{}, error) { - return types.Tip, nil +func (c *current) onHeaderGroupElement293() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent703() (interface{}, error) { +func (p *parser) callonHeaderGroupElement293() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent703() + return p.cur.onHeaderGroupElement293() } -func (c *current) onQuoteBlockRawContent705() (interface{}, error) { - return types.Note, nil +func (c *current) onHeaderGroupElement295() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent705() (interface{}, error) { +func (p *parser) callonHeaderGroupElement295() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent705() + return p.cur.onHeaderGroupElement295() } -func (c *current) onQuoteBlockRawContent707() (interface{}, error) { - return types.Important, nil +func (c *current) onHeaderGroupElement288(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonQuoteBlockRawContent707() (interface{}, error) { +func (p *parser) callonHeaderGroupElement288() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent707() + return p.cur.onHeaderGroupElement288(stack["start"]) } -func (c *current) onQuoteBlockRawContent709() (interface{}, error) { - return types.Warning, nil +func (c *current) onHeaderGroupElement277(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonQuoteBlockRawContent709() (interface{}, error) { +func (p *parser) callonHeaderGroupElement277() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent709() + return p.cur.onHeaderGroupElement277(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent711() (interface{}, error) { - return types.Caution, nil +func (c *current) onHeaderGroupElement303() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent711() (interface{}, error) { +func (p *parser) callonHeaderGroupElement303() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent711() + return p.cur.onHeaderGroupElement303() } -func (c *current) onQuoteBlockRawContent725() (interface{}, error) { +func (c *current) onHeaderGroupElement315() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent725() (interface{}, error) { +func (p *parser) callonHeaderGroupElement315() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent725() + return p.cur.onHeaderGroupElement315() } -func (c *current) onQuoteBlockRawContent734() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement317() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent734() (interface{}, error) { +func (p *parser) callonHeaderGroupElement317() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent734() + return p.cur.onHeaderGroupElement317() } -func (c *current) onQuoteBlockRawContent717(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onHeaderGroupElement310(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonQuoteBlockRawContent717() (interface{}, error) { +func (p *parser) callonHeaderGroupElement310() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent717(stack["content"]) + return p.cur.onHeaderGroupElement310(stack["start"]) } -func (c *current) onQuoteBlockRawContent755() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement299(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonQuoteBlockRawContent755() (interface{}, error) { +func (p *parser) callonHeaderGroupElement299() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent755() + return p.cur.onHeaderGroupElement299(stack["name"], stack["start"]) } -func (c *current) onQuoteBlockRawContent767() (interface{}, error) { +func (c *current) onHeaderGroupElement325() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent767() (interface{}, error) { +func (p *parser) callonHeaderGroupElement325() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent767() + return p.cur.onHeaderGroupElement325() } -func (c *current) onQuoteBlockRawContent779() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement321(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonQuoteBlockRawContent779() (interface{}, error) { +func (p *parser) callonHeaderGroupElement321() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent779() + return p.cur.onHeaderGroupElement321(stack["name"]) } -func (c *current) onQuoteBlockRawContent791() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement272(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuoteBlockRawContent791() (interface{}, error) { +func (p *parser) callonHeaderGroupElement272() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent791() + return p.cur.onHeaderGroupElement272(stack["element"]) } -func (c *current) onQuoteBlockRawContent803() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement331() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent803() (interface{}, error) { +func (p *parser) callonHeaderGroupElement331() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent803() + return p.cur.onHeaderGroupElement331() } -func (c *current) onQuoteBlockRawContent815() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement257(elements interface{}) (interface{}, error) { + return types.Reduce(elements, strings.TrimSpace), nil + } -func (p *parser) callonQuoteBlockRawContent815() (interface{}, error) { +func (p *parser) callonHeaderGroupElement257() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent815() + return p.cur.onHeaderGroupElement257(stack["elements"]) } -func (c *current) onQuoteBlockRawContent827() (interface{}, error) { - return string(c.text), nil +func (c *current) onHeaderGroupElement253(id interface{}) (interface{}, error) { + return types.NewIDAttribute(id) + } -func (p *parser) callonQuoteBlockRawContent827() (interface{}, error) { +func (p *parser) callonHeaderGroupElement253() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent827() + return p.cur.onHeaderGroupElement253(stack["id"]) } -func (c *current) onQuoteBlockRawContent835() (interface{}, error) { +func (c *current) onHeaderGroupElement335() (interface{}, error) { + + return types.NewStringElement(string(c.text)) - return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent835() (interface{}, error) { +func (p *parser) callonHeaderGroupElement335() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent835() + return p.cur.onHeaderGroupElement335() } -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) onHeaderGroupElement1(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonQuoteBlockRawContent843() (bool, error) { +func (p *parser) callonHeaderGroupElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent843(stack["content"]) + return p.cur.onHeaderGroupElement1(stack["element"]) } -func (c *current) onQuoteBlockRawContent742(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onMacrosGroup9() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent742() (interface{}, error) { +func (p *parser) callonMacrosGroup9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent742(stack["content"]) + return p.cur.onMacrosGroup9() } -func (c *current) onQuoteBlockRawContent699(t, lines interface{}) (interface{}, error) { - - return types.NewAdmonitionParagraph(lines.([]interface{}), t.(string), c.globalStore.getAttributes()) +func (c *current) onMacrosGroup15() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent699() (interface{}, error) { +func (p *parser) callonMacrosGroup15() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent699(stack["t"], stack["lines"]) + return p.cur.onMacrosGroup15() } -func (c *current) onQuoteBlockRawContent860() (interface{}, error) { - return string(c.text), nil +func (c *current) onMacrosGroup22() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent860() (interface{}, error) { +func (p *parser) callonMacrosGroup22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent860() + return p.cur.onMacrosGroup22() } -func (c *current) onQuoteBlockRawContent852() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onMacrosGroup6(content interface{}) (interface{}, error) { + return content, nil + } -func (p *parser) callonQuoteBlockRawContent852() (interface{}, error) { +func (p *parser) callonMacrosGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent852() + return p.cur.onMacrosGroup6(stack["content"]) } -func (c *current) onQuoteBlockRawContent876() (interface{}, error) { - - return string(c.text), nil +func (c *current) onMacrosGroup24() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent876() (interface{}, error) { +func (p *parser) callonMacrosGroup24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent876() + return p.cur.onMacrosGroup24() } -func (c *current) onQuoteBlockRawContent870(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onMacrosGroup33() (interface{}, error) { + // allow ` + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent870() (interface{}, error) { +func (p *parser) callonMacrosGroup33() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent870(stack["content"]) + return p.cur.onMacrosGroup33() } -func (c *current) onQuoteBlockRawContent849(content interface{}) (interface{}, error) { +func (c *current) onMacrosGroup48() (interface{}, error) { + return string(c.text), nil - return content, nil } -func (p *parser) callonQuoteBlockRawContent849() (interface{}, error) { +func (p *parser) callonMacrosGroup48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent849(stack["content"]) + return p.cur.onMacrosGroup48() } -func (c *current) onQuoteBlockRawContent844(content interface{}) (interface{}, error) { - return types.NewMarkdownQuoteBlock(content.([]interface{}), c.globalStore.getAttributes()) - +func (c *current) onMacrosGroup54() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent844() (interface{}, error) { +func (p *parser) callonMacrosGroup54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent844(stack["content"]) + return p.cur.onMacrosGroup54() } -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) onMacrosGroup42() (interface{}, error) { + return types.NewString(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent886() (bool, error) { +func (p *parser) callonMacrosGroup42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent886() + return p.cur.onMacrosGroup42() } -func (c *current) onQuoteBlockRawContent902() (interface{}, error) { +func (c *current) onMacrosGroup61() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent902() (interface{}, error) { +func (p *parser) callonMacrosGroup61() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent902() + return p.cur.onMacrosGroup61() } -func (c *current) onQuoteBlockRawContent914() (interface{}, error) { - return string(c.text), nil +func (c *current) onMacrosGroup57(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonQuoteBlockRawContent914() (interface{}, error) { +func (p *parser) callonMacrosGroup57() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent914() + return p.cur.onMacrosGroup57(stack["ref"]) } -func (c *current) onQuoteBlockRawContent926() (interface{}, error) { - return string(c.text), nil +func (c *current) onMacrosGroup65() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent926() (interface{}, error) { +func (p *parser) callonMacrosGroup65() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent926() + return p.cur.onMacrosGroup65() } -func (c *current) onQuoteBlockRawContent938() (interface{}, error) { - return string(c.text), nil +func (c *current) onMacrosGroup1(elements interface{}) (interface{}, error) { + + return types.Merge(elements), nil + } -func (p *parser) callonQuoteBlockRawContent938() (interface{}, error) { +func (p *parser) callonMacrosGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent938() + return p.cur.onMacrosGroup1(stack["elements"]) } -func (c *current) onQuoteBlockRawContent950() (interface{}, error) { - return string(c.text), nil +func (c *current) onNoneGroup16() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent950() (interface{}, error) { +func (p *parser) callonNoneGroup16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent950() + return p.cur.onNoneGroup16() } -func (c *current) onQuoteBlockRawContent962() (interface{}, error) { +func (c *current) onNoneGroup22() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent962() (interface{}, error) { +func (p *parser) callonNoneGroup22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent962() + return p.cur.onNoneGroup22() } -func (c *current) onQuoteBlockRawContent974() (interface{}, error) { - return string(c.text), nil +func (c *current) onNoneGroup29() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent974() (interface{}, error) { +func (p *parser) callonNoneGroup29() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent974() + return p.cur.onNoneGroup29() } -func (c *current) onQuoteBlockRawContent982() (interface{}, error) { +func (c *current) onNoneGroup13(content interface{}) (interface{}, error) { + return content, nil - return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent982() (interface{}, error) { +func (p *parser) callonNoneGroup13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent982() + return p.cur.onNoneGroup13(stack["content"]) } -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) onNoneGroup31() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent990() (bool, error) { +func (p *parser) callonNoneGroup31() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent990(stack["content"]) + return p.cur.onNoneGroup31() } -func (c *current) onQuoteBlockRawContent889(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onNoneGroup40() (interface{}, error) { + // allow ` + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent889() (interface{}, error) { +func (p *parser) callonNoneGroup40() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent889(stack["content"]) + return p.cur.onNoneGroup40() } -func (c *current) onQuoteBlockRawContent884(content interface{}) (interface{}, error) { +func (c *current) onNoneGroup55() (interface{}, error) { + return string(c.text), nil + +} - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (p *parser) callonNoneGroup55() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onNoneGroup55() +} +func (c *current) onNoneGroup61() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent884() (interface{}, error) { +func (p *parser) callonNoneGroup61() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent884(stack["content"]) + return p.cur.onNoneGroup61() } -func (c *current) onQuoteBlockRawContent1003() (interface{}, error) { - return string(c.text), nil +func (c *current) onNoneGroup49() (interface{}, error) { + return types.NewString(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent1003() (interface{}, error) { +func (p *parser) callonNoneGroup49() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1003() + return p.cur.onNoneGroup49() } -func (c *current) onQuoteBlockRawContent1012() (interface{}, error) { +func (c *current) onNoneGroup67() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent1012() (interface{}, error) { +func (p *parser) callonNoneGroup67() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1012() + return p.cur.onNoneGroup67() } -func (c *current) onQuoteBlockRawContent995(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onNoneGroup63(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonQuoteBlockRawContent995() (interface{}, error) { +func (p *parser) callonNoneGroup63() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent995(stack["content"]) + return p.cur.onNoneGroup63(stack["ref"]) } -func (c *current) onQuoteBlockRawContent1033() (interface{}, error) { - return string(c.text), nil +func (c *current) onNoneGroup71() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent1033() (interface{}, error) { +func (p *parser) callonNoneGroup71() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1033() + return p.cur.onNoneGroup71() } -func (c *current) onQuoteBlockRawContent1045() (interface{}, error) { - return string(c.text), nil +func (c *current) onNoneGroup5(element interface{}) (interface{}, error) { + + return element, nil + } -func (p *parser) callonQuoteBlockRawContent1045() (interface{}, error) { +func (p *parser) callonNoneGroup5() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1045() + return p.cur.onNoneGroup5(stack["element"]) } -func (c *current) onQuoteBlockRawContent1057() (interface{}, error) { - return string(c.text), nil +func (c *current) onNoneGroup1(elements interface{}) (interface{}, error) { + + return types.Merge(elements), nil + } -func (p *parser) callonQuoteBlockRawContent1057() (interface{}, error) { +func (p *parser) callonNoneGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1057() + return p.cur.onNoneGroup1(stack["elements"]) } -func (c *current) onQuoteBlockRawContent1069() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroup1(elements interface{}) (interface{}, error) { + + return types.Merge(elements), nil + } -func (p *parser) callonQuoteBlockRawContent1069() (interface{}, error) { +func (p *parser) callonNormalGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1069() + return p.cur.onNormalGroup1(stack["elements"]) } -func (c *current) onQuoteBlockRawContent1081() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement11() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuoteBlockRawContent1081() (interface{}, error) { +func (p *parser) callonNormalGroupElement11() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1081() + return p.cur.onNormalGroupElement11() } -func (c *current) onQuoteBlockRawContent1093() (interface{}, error) { +func (c *current) onNormalGroupElement17() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonQuoteBlockRawContent1093() (interface{}, error) { +func (p *parser) callonNormalGroupElement17() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1093() + return p.cur.onNormalGroupElement17() } -func (c *current) onQuoteBlockRawContent1105() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement24() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent1105() (interface{}, error) { +func (p *parser) callonNormalGroupElement24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1105() + return p.cur.onNormalGroupElement24() } -func (c *current) onQuoteBlockRawContent1113() (interface{}, error) { +func (c *current) onNormalGroupElement8(content interface{}) (interface{}, error) { + return content, nil - return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent1113() (interface{}, error) { +func (p *parser) callonNormalGroupElement8() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1113() + return p.cur.onNormalGroupElement8(stack["content"]) } -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) onNormalGroupElement26() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent1121() (bool, error) { +func (p *parser) callonNormalGroupElement26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1121(stack["content"]) + return p.cur.onNormalGroupElement26() } -func (c *current) onQuoteBlockRawContent1020(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onNormalGroupElement35() (interface{}, error) { + // allow ` + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent1020() (interface{}, error) { +func (p *parser) callonNormalGroupElement35() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1020(stack["content"]) + return p.cur.onNormalGroupElement35() } -func (c *current) onQuoteBlockRawContent991(lines interface{}) (interface{}, error) { - - return types.NewParagraph(lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onNormalGroupElement50() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent991() (interface{}, error) { +func (p *parser) callonNormalGroupElement50() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent991(stack["lines"]) + return p.cur.onNormalGroupElement50() } -func (c *current) onQuoteBlockRawContent1129() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement56() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent1129() (interface{}, error) { +func (p *parser) callonNormalGroupElement56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1129() + return p.cur.onNormalGroupElement56() } -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) onNormalGroupElement44() (interface{}, error) { + return types.NewString(string(c.text)) } -func (p *parser) callonQuoteBlockRawContent1122() (interface{}, error) { +func (p *parser) callonNormalGroupElement44() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1122() + return p.cur.onNormalGroupElement44() } -func (c *current) onQuoteBlockRawContent4(attributes, element interface{}) (interface{}, error) { - c.globalStore.discardAttributes() - return element, nil +func (c *current) onNormalGroupElement62() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent4() (interface{}, error) { +func (p *parser) callonNormalGroupElement62() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent4(stack["attributes"], stack["element"]) + return p.cur.onNormalGroupElement62() } -func (c *current) onQuoteBlockRawContent1(elements interface{}) (interface{}, error) { - return elements, nil +func (c *current) onNormalGroupElement68() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonQuoteBlockRawContent1() (interface{}, error) { +func (p *parser) callonNormalGroupElement68() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuoteBlockRawContent1(stack["elements"]) + return p.cur.onNormalGroupElement68() } -func (c *current) onSidebarBlock7() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement76() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlock7() (interface{}, error) { +func (p *parser) callonNormalGroupElement76() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlock7() + return p.cur.onNormalGroupElement76() } -func (c *current) onSidebarBlock22() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement58() (interface{}, error) { + return types.NewLineBreak() + } -func (p *parser) callonSidebarBlock22() (interface{}, error) { +func (p *parser) callonNormalGroupElement58() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlock22() + return p.cur.onNormalGroupElement58() } -func (c *current) onSidebarBlock1(content interface{}) (interface{}, error) { - return types.NewSidebarBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onNormalGroupElement79() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSidebarBlock1() (interface{}, error) { +func (p *parser) callonNormalGroupElement79() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlock1(stack["content"]) + return p.cur.onNormalGroupElement79() } -func (c *current) onSidebarBlockRawContent13() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement83() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent13() (interface{}, error) { +func (p *parser) callonNormalGroupElement83() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent13() + return p.cur.onNormalGroupElement83() } -func (c *current) onSidebarBlockRawContent25(attributes interface{}) error { - c.globalStore.pushAttributes(attributes) - return nil +func (c *current) onNormalGroupElement90() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonSidebarBlockRawContent25() error { +func (p *parser) callonNormalGroupElement90() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent25(stack["attributes"]) + return p.cur.onNormalGroupElement90() } -func (c *current) onSidebarBlockRawContent31() (bool, error) { - return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Literal), nil +func (c *current) onNormalGroupElement99() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent31() (bool, error) { +func (p *parser) callonNormalGroupElement99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent31() + return p.cur.onNormalGroupElement99() } -func (c *current) onSidebarBlockRawContent40() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onNormalGroupElement105() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent40() (interface{}, error) { +func (p *parser) callonNormalGroupElement105() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent40() + return p.cur.onNormalGroupElement105() } -func (c *current) onSidebarBlockRawContent49() (interface{}, error) { - // allow ` +func (c *current) onNormalGroupElement111() (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) callonSidebarBlockRawContent49() (interface{}, error) { +func (p *parser) callonNormalGroupElement111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent49() + return p.cur.onNormalGroupElement111() } -func (c *current) onSidebarBlockRawContent36(elements interface{}) (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement118() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonSidebarBlockRawContent36() (interface{}, error) { +func (p *parser) callonNormalGroupElement118() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent36(stack["elements"]) + return p.cur.onNormalGroupElement118() } -func (c *current) onSidebarBlockRawContent33(content interface{}) (interface{}, error) { +func (c *current) onNormalGroupElement125() (interface{}, error) { + return string(c.text), nil - return types.NewRawLine(content.(string)) } -func (p *parser) callonSidebarBlockRawContent33() (interface{}, error) { +func (p *parser) callonNormalGroupElement125() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent33(stack["content"]) + return p.cur.onNormalGroupElement125() } -func (c *current) onSidebarBlockRawContent76() (interface{}, error) { +func (c *current) onNormalGroupElement137() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent76() (interface{}, error) { +func (p *parser) callonNormalGroupElement137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent76() + return p.cur.onNormalGroupElement137() } -func (c *current) onSidebarBlockRawContent85() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement139() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent85() (interface{}, error) { +func (p *parser) callonNormalGroupElement139() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent85() + return p.cur.onNormalGroupElement139() } -func (c *current) onSidebarBlockRawContent68(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onNormalGroupElement132(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonSidebarBlockRawContent68() (interface{}, error) { +func (p *parser) callonNormalGroupElement132() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent68(stack["content"]) + return p.cur.onNormalGroupElement132(stack["start"]) } -func (c *current) onSidebarBlockRawContent106() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement121(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSidebarBlockRawContent106() (interface{}, error) { +func (p *parser) callonNormalGroupElement121() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent106() + return p.cur.onNormalGroupElement121(stack["name"], stack["start"]) } -func (c *current) onSidebarBlockRawContent118() (interface{}, error) { +func (c *current) onNormalGroupElement147() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent118() (interface{}, error) { +func (p *parser) callonNormalGroupElement147() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent118() + return p.cur.onNormalGroupElement147() } -func (c *current) onSidebarBlockRawContent130() (interface{}, error) { +func (c *current) onNormalGroupElement159() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent130() (interface{}, error) { +func (p *parser) callonNormalGroupElement159() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent130() + return p.cur.onNormalGroupElement159() } -func (c *current) onSidebarBlockRawContent142() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement161() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent142() (interface{}, error) { +func (p *parser) callonNormalGroupElement161() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent142() + return p.cur.onNormalGroupElement161() } -func (c *current) onSidebarBlockRawContent154() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement154(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonSidebarBlockRawContent154() (interface{}, error) { +func (p *parser) callonNormalGroupElement154() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent154() + return p.cur.onNormalGroupElement154(stack["start"]) } -func (c *current) onSidebarBlockRawContent166() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement143(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonSidebarBlockRawContent166() (interface{}, error) { +func (p *parser) callonNormalGroupElement143() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent166() + return p.cur.onNormalGroupElement143(stack["name"], stack["start"]) } -func (c *current) onSidebarBlockRawContent178() (interface{}, error) { +func (c *current) onNormalGroupElement169() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent178() (interface{}, error) { +func (p *parser) callonNormalGroupElement169() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent178() + return p.cur.onNormalGroupElement169() } -func (c *current) onSidebarBlockRawContent186() (interface{}, error) { +func (c *current) onNormalGroupElement165(name interface{}) (interface{}, error) { - return string(c.text), nil + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSidebarBlockRawContent186() (interface{}, error) { +func (p *parser) callonNormalGroupElement165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent186() + return p.cur.onNormalGroupElement165(stack["name"]) } -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) onNormalGroupElement116(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonSidebarBlockRawContent194() (bool, error) { +func (p *parser) callonNormalGroupElement116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent194(stack["content"]) + return p.cur.onNormalGroupElement116(stack["element"]) } -func (c *current) onSidebarBlockRawContent93(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onNormalGroupElement175() (interface{}, error) { + + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent93() (interface{}, error) { +func (p *parser) callonNormalGroupElement175() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent93(stack["content"]) + return p.cur.onNormalGroupElement175() } -func (c *current) onSidebarBlockRawContent29(firstLine, otherLines interface{}) (interface{}, error) { - - return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...), c.globalStore.getAttributes()) +func (c *current) onNormalGroupElement95(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) } -func (p *parser) callonSidebarBlockRawContent29() (interface{}, error) { +func (p *parser) callonNormalGroupElement95() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent29(stack["firstLine"], stack["otherLines"]) + return p.cur.onNormalGroupElement95(stack["id"], stack["label"]) } -func (c *current) onSidebarBlockRawContent203() (interface{}, error) { +func (c *current) onNormalGroupElement182() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent203() (interface{}, error) { +func (p *parser) callonNormalGroupElement182() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent203() + return p.cur.onNormalGroupElement182() } -func (c *current) onSidebarBlockRawContent195() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onNormalGroupElement178(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonSidebarBlockRawContent195() (interface{}, error) { +func (p *parser) callonNormalGroupElement178() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent195() + return p.cur.onNormalGroupElement178(stack["id"]) } -func (c *current) onSidebarBlockRawContent211() (interface{}, error) { - return types.NewThematicBreak() +func (c *current) onNormalGroupElement93() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent211() (interface{}, error) { +func (p *parser) callonNormalGroupElement93() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent211() + return p.cur.onNormalGroupElement93() } -func (c *current) onSidebarBlockRawContent234() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement186() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent234() (interface{}, error) { +func (p *parser) callonNormalGroupElement186() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent234() + return p.cur.onNormalGroupElement186() } -func (c *current) onSidebarBlockRawContent252() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement88(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonSidebarBlockRawContent252() (interface{}, error) { +func (p *parser) callonNormalGroupElement88() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent252() + return p.cur.onNormalGroupElement88(stack["element"]) } -func (c *current) onSidebarBlockRawContent268() (interface{}, error) { - - return string(c.text), nil +func (c *current) onNormalGroupElement190() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonSidebarBlockRawContent268() (interface{}, error) { +func (p *parser) callonNormalGroupElement190() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent268() + return p.cur.onNormalGroupElement190() } -func (c *current) onSidebarBlockRawContent262(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onNormalGroupElement197() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent262() (interface{}, error) { +func (p *parser) callonNormalGroupElement197() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent262(stack["content"]) + return p.cur.onNormalGroupElement197() } -func (c *current) onSidebarBlockRawContent243(line interface{}) (interface{}, error) { +func (c *current) onNormalGroupElement209() (interface{}, error) { + return string(c.text), nil - return line, nil } -func (p *parser) callonSidebarBlockRawContent243() (interface{}, error) { +func (p *parser) callonNormalGroupElement209() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent243(stack["line"]) + return p.cur.onNormalGroupElement209() } -func (c *current) onSidebarBlockRawContent282() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement211() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent282() (interface{}, error) { +func (p *parser) callonNormalGroupElement211() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent282() + return p.cur.onNormalGroupElement211() } -func (c *current) onSidebarBlockRawContent228(content interface{}) (interface{}, error) { - return types.NewFencedBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onNormalGroupElement204(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonSidebarBlockRawContent228() (interface{}, error) { +func (p *parser) callonNormalGroupElement204() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent228(stack["content"]) + return p.cur.onNormalGroupElement204(stack["start"]) } -func (c *current) onSidebarBlockRawContent297() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement193(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSidebarBlockRawContent297() (interface{}, error) { +func (p *parser) callonNormalGroupElement193() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent297() + return p.cur.onNormalGroupElement193(stack["name"], stack["start"]) } -func (c *current) onSidebarBlockRawContent315() (interface{}, error) { +func (c *current) onNormalGroupElement219() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent315() (interface{}, error) { +func (p *parser) callonNormalGroupElement219() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent315() + return p.cur.onNormalGroupElement219() } -func (c *current) onSidebarBlockRawContent331() (interface{}, error) { - +func (c *current) onNormalGroupElement231() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent331() (interface{}, error) { +func (p *parser) callonNormalGroupElement231() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent331() + return p.cur.onNormalGroupElement231() } -func (c *current) onSidebarBlockRawContent325(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onNormalGroupElement233() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent325() (interface{}, error) { +func (p *parser) callonNormalGroupElement233() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent325(stack["content"]) + return p.cur.onNormalGroupElement233() } -func (c *current) onSidebarBlockRawContent306(line interface{}) (interface{}, error) { +func (c *current) onNormalGroupElement226(start interface{}) (interface{}, error) { + return start, nil - return line, nil } -func (p *parser) callonSidebarBlockRawContent306() (interface{}, error) { +func (p *parser) callonNormalGroupElement226() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent306(stack["line"]) + return p.cur.onNormalGroupElement226(stack["start"]) } -func (c *current) onSidebarBlockRawContent345() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement215(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonSidebarBlockRawContent345() (interface{}, error) { +func (p *parser) callonNormalGroupElement215() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent345() + return p.cur.onNormalGroupElement215(stack["name"], stack["start"]) } -func (c *current) onSidebarBlockRawContent291(content interface{}) (interface{}, error) { - return types.NewListingBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onNormalGroupElement241() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent291() (interface{}, error) { +func (p *parser) callonNormalGroupElement241() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent291(stack["content"]) + return p.cur.onNormalGroupElement241() } -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) onNormalGroupElement237(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSidebarBlockRawContent356() (bool, error) { +func (p *parser) callonNormalGroupElement237() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent356() + return p.cur.onNormalGroupElement237(stack["name"]) } -func (c *current) onSidebarBlockRawContent361() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement188(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonSidebarBlockRawContent361() (interface{}, error) { +func (p *parser) callonNormalGroupElement188() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent361() + return p.cur.onNormalGroupElement188(stack["element"]) } -func (c *current) onSidebarBlockRawContent379() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement249() (bool, error) { + return c.isSubstitutionEnabled(Replacements) + } -func (p *parser) callonSidebarBlockRawContent379() (interface{}, error) { +func (p *parser) callonNormalGroupElement249() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent379() + return p.cur.onNormalGroupElement249() } -func (c *current) onSidebarBlockRawContent395() (interface{}, error) { - - return string(c.text), nil +func (c *current) onNormalGroupElement252() (interface{}, error) { + return types.NewStringElement("\u2019") } -func (p *parser) callonSidebarBlockRawContent395() (interface{}, error) { +func (p *parser) callonNormalGroupElement252() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent395() + return p.cur.onNormalGroupElement252() } -func (c *current) onSidebarBlockRawContent389(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onNormalGroupElement254() (interface{}, error) { + return types.NewStringElement("\u00a9") } -func (p *parser) callonSidebarBlockRawContent389() (interface{}, error) { +func (p *parser) callonNormalGroupElement254() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent389(stack["content"]) + return p.cur.onNormalGroupElement254() } -func (c *current) onSidebarBlockRawContent370(line interface{}) (interface{}, error) { +func (c *current) onNormalGroupElement256() (interface{}, error) { + return types.NewStringElement("\u2122") - return line, nil } -func (p *parser) callonSidebarBlockRawContent370() (interface{}, error) { +func (p *parser) callonNormalGroupElement256() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent370(stack["line"]) + return p.cur.onNormalGroupElement256() } -func (c *current) onSidebarBlockRawContent409() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement258() (interface{}, error) { + return types.NewStringElement("\u00ae") + } -func (p *parser) callonSidebarBlockRawContent409() (interface{}, error) { +func (p *parser) callonNormalGroupElement258() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent409() + return p.cur.onNormalGroupElement258() } -func (c *current) onSidebarBlockRawContent354(content interface{}) (interface{}, error) { - return types.NewVerseBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onNormalGroupElement260() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") } -func (p *parser) callonSidebarBlockRawContent354() (interface{}, error) { +func (p *parser) callonNormalGroupElement260() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent354(stack["content"]) + return p.cur.onNormalGroupElement260() } -func (c *current) onSidebarBlockRawContent428() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement262() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") + } -func (p *parser) callonSidebarBlockRawContent428() (interface{}, error) { +func (p *parser) callonNormalGroupElement262() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent428() + return p.cur.onNormalGroupElement262() } -func (c *current) onSidebarBlockRawContent437() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement247(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonSidebarBlockRawContent437() (interface{}, error) { +func (p *parser) callonNormalGroupElement247() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent437() + return p.cur.onNormalGroupElement247(stack["element"]) } -func (c *current) onSidebarBlockRawContent420(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onNormalGroupElement270() (bool, error) { + return c.isSubstitutionEnabled(PostReplacements) + } -func (p *parser) callonSidebarBlockRawContent420() (interface{}, error) { +func (p *parser) callonNormalGroupElement270() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent420(stack["content"]) + return p.cur.onNormalGroupElement270() } -func (c *current) onSidebarBlockRawContent451() (interface{}, error) { +func (c *current) onNormalGroupElement276() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent451() (interface{}, error) { +func (p *parser) callonNormalGroupElement276() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent451() + return p.cur.onNormalGroupElement276() } -func (c *current) onSidebarBlockRawContent469() (interface{}, error) { +func (c *current) onNormalGroupElement282() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent469() (interface{}, error) { +func (p *parser) callonNormalGroupElement282() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent469() + return p.cur.onNormalGroupElement282() } -func (c *current) onSidebarBlockRawContent485() (interface{}, error) { - - return string(c.text), nil - +func (c *current) onNormalGroupElement290() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent485() (interface{}, error) { +func (p *parser) callonNormalGroupElement290() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent485() + return p.cur.onNormalGroupElement290() } -func (c *current) onSidebarBlockRawContent479(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onNormalGroupElement272() (interface{}, error) { + return types.NewLineBreak() } -func (p *parser) callonSidebarBlockRawContent479() (interface{}, error) { +func (p *parser) callonNormalGroupElement272() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent479(stack["content"]) + return p.cur.onNormalGroupElement272() } -func (c *current) onSidebarBlockRawContent460(line interface{}) (interface{}, error) { +func (c *current) onNormalGroupElement268(element interface{}) (interface{}, error) { + return element, nil - return line, nil } -func (p *parser) callonSidebarBlockRawContent460() (interface{}, error) { +func (p *parser) callonNormalGroupElement268() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent460(stack["line"]) + return p.cur.onNormalGroupElement268(stack["element"]) } -func (c *current) onSidebarBlockRawContent499() (interface{}, error) { +func (c *current) onNormalGroupElement296() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent499() (interface{}, error) { +func (p *parser) callonNormalGroupElement296() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent499() + return p.cur.onNormalGroupElement296() } -func (c *current) onSidebarBlockRawContent445(content interface{}) (interface{}, error) { - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onNormalGroupElement292(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonSidebarBlockRawContent445() (interface{}, error) { +func (p *parser) callonNormalGroupElement292() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent445(stack["content"]) + return p.cur.onNormalGroupElement292(stack["ref"]) } -func (c *current) onSidebarBlockRawContent515() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement300() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent515() (interface{}, error) { +func (p *parser) callonNormalGroupElement300() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent515() + return p.cur.onNormalGroupElement300() } -func (c *current) onSidebarBlockRawContent533() (interface{}, error) { - return string(c.text), nil +func (c *current) onNormalGroupElement1(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonSidebarBlockRawContent533() (interface{}, error) { +func (p *parser) callonNormalGroupElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent533() + return p.cur.onNormalGroupElement1(stack["element"]) } -func (c *current) onSidebarBlockRawContent549() (interface{}, error) { - - return string(c.text), nil +func (c *current) onPostReplacementsGroup9() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent549() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent549() + return p.cur.onPostReplacementsGroup9() } -func (c *current) onSidebarBlockRawContent543(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onPostReplacementsGroup15() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent543() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup15() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent543(stack["content"]) + return p.cur.onPostReplacementsGroup15() } -func (c *current) onSidebarBlockRawContent524(line interface{}) (interface{}, error) { - - return line, nil +func (c *current) onPostReplacementsGroup22() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent524() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent524(stack["line"]) + return p.cur.onPostReplacementsGroup22() } -func (c *current) onSidebarBlockRawContent563() (interface{}, error) { - return string(c.text), nil +func (c *current) onPostReplacementsGroup6(content interface{}) (interface{}, error) { + return content, nil + } -func (p *parser) callonSidebarBlockRawContent563() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent563() + return p.cur.onPostReplacementsGroup6(stack["content"]) } -func (c *current) onSidebarBlockRawContent509(content interface{}) (interface{}, error) { - return types.NewCommentBlock(content.([]interface{}), nil) +func (c *current) onPostReplacementsGroup24() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent509() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent509(stack["content"]) + return p.cur.onPostReplacementsGroup24() } -func (c *current) onSidebarBlockRawContent574() (bool, error) { - attrs := c.globalStore.getAttributes() - return types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Literal), nil +func (c *current) onPostReplacementsGroup33() (interface{}, error) { + // allow ` + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent574() (bool, error) { +func (p *parser) callonPostReplacementsGroup33() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent574() + return p.cur.onPostReplacementsGroup33() } -func (c *current) onSidebarBlockRawContent588() (interface{}, error) { +func (c *current) onPostReplacementsGroup48() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent588() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent588() + return p.cur.onPostReplacementsGroup48() } -func (c *current) onSidebarBlockRawContent580() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onPostReplacementsGroup54() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent580() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent580() + return p.cur.onPostReplacementsGroup54() } -func (c *current) onSidebarBlockRawContent596() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onPostReplacementsGroup42() (interface{}, error) { + return types.NewString(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent596() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent596() + return p.cur.onPostReplacementsGroup42() } -func (c *current) onSidebarBlockRawContent577(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onPostReplacementsGroup60() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent577() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup60() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent577(stack["content"]) + return p.cur.onPostReplacementsGroup60() } -func (c *current) onSidebarBlockRawContent572(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithAttribute, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onPostReplacementsGroup66() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent572() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup66() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent572(stack["lines"]) + return p.cur.onPostReplacementsGroup66() } -func (c *current) onSidebarBlockRawContent617() (interface{}, error) { - return string(c.text), nil +func (c *current) onPostReplacementsGroup74() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent617() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup74() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent617() + return p.cur.onPostReplacementsGroup74() } -func (c *current) onSidebarBlockRawContent612() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onPostReplacementsGroup56() (interface{}, error) { + return types.NewLineBreak() } -func (p *parser) callonSidebarBlockRawContent612() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent612() + return p.cur.onPostReplacementsGroup56() } -func (c *current) onSidebarBlockRawContent609(line interface{}) (interface{}, error) { - // do not include the trailing 'EOL' on the first line - return line, nil +func (c *current) onPostReplacementsGroup77() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent609() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup77() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent609(stack["line"]) + return p.cur.onPostReplacementsGroup77() } -func (c *current) onSidebarBlockRawContent639() (interface{}, error) { - return string(c.text), nil +func (c *current) onPostReplacementsGroup81() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent639() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup81() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent639() + return p.cur.onPostReplacementsGroup81() } -func (c *current) onSidebarBlockRawContent631() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onPostReplacementsGroup87() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent631() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup87() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent631() + return p.cur.onPostReplacementsGroup87() } -func (c *current) onSidebarBlockRawContent647() (interface{}, error) { - return types.NewRawLine(string(c.text)) +func (c *current) onPostReplacementsGroup83(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonSidebarBlockRawContent647() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup83() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent647() + return p.cur.onPostReplacementsGroup83(stack["ref"]) } -func (c *current) onSidebarBlockRawContent628(content interface{}) (interface{}, error) { - return content, nil // do not include the trailing 'EOL' +func (c *current) onPostReplacementsGroup91() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent628() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup91() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent628(stack["content"]) + return p.cur.onPostReplacementsGroup91() } -func (c *current) onSidebarBlockRawContent606(firstLine, otherLines interface{}) (interface{}, error) { +func (c *current) onPostReplacementsGroup1(elements interface{}) (interface{}, error) { + return types.Merge(elements), nil - return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil } -func (p *parser) callonSidebarBlockRawContent606() (interface{}, error) { +func (p *parser) callonPostReplacementsGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent606(stack["firstLine"], stack["otherLines"]) + return p.cur.onPostReplacementsGroup1(stack["elements"]) } -func (c *current) onSidebarBlockRawContent604(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithSpacesOnFirstLine, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onQuotesGroup9() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent604() (interface{}, error) { +func (p *parser) callonQuotesGroup9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent604(stack["lines"]) + return p.cur.onQuotesGroup9() } -func (c *current) onSidebarBlockRawContent661() (interface{}, error) { +func (c *current) onQuotesGroup15() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent661() (interface{}, error) { +func (p *parser) callonQuotesGroup15() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent661() + return p.cur.onQuotesGroup15() } -func (c *current) onSidebarBlockRawContent673() (interface{}, error) { - return types.NewRawLine(string(c.text)) - +func (c *current) onQuotesGroup22() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent673() (interface{}, error) { +func (p *parser) callonQuotesGroup22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent673() + return p.cur.onQuotesGroup22() } -func (c *current) onSidebarBlockRawContent670(line interface{}) (interface{}, error) { +func (c *current) onQuotesGroup6(content interface{}) (interface{}, error) { + return content, nil - return line, nil // do not include the trailing 'EOL' } -func (p *parser) callonSidebarBlockRawContent670() (interface{}, error) { +func (p *parser) callonQuotesGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent670(stack["line"]) + return p.cur.onQuotesGroup6(stack["content"]) } -func (c *current) onSidebarBlockRawContent667(lines interface{}) (interface{}, error) { - return lines.([]interface{}), nil +func (c *current) onQuotesGroup24() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent667() (interface{}, error) { +func (p *parser) callonQuotesGroup24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent667(stack["lines"]) + return p.cur.onQuotesGroup24() } -func (c *current) onSidebarBlockRawContent690() (interface{}, error) { - return string(c.text), nil +func (c *current) onQuotesGroup33() (interface{}, error) { + // allow ` + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent690() (interface{}, error) { +func (p *parser) callonQuotesGroup33() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent690() + return p.cur.onQuotesGroup33() } -func (c *current) onSidebarBlockRawContent655(lines interface{}) (interface{}, error) { - return types.NewLiteralBlock(types.LiteralBlockWithDelimiter, lines.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onQuotesGroup48() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent655() (interface{}, error) { +func (p *parser) callonQuotesGroup48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent655(stack["lines"]) + return p.cur.onQuotesGroup48() } -func (c *current) onSidebarBlockRawContent703() (interface{}, error) { - return types.Tip, nil +func (c *current) onQuotesGroup54() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent703() (interface{}, error) { +func (p *parser) callonQuotesGroup54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent703() + return p.cur.onQuotesGroup54() } -func (c *current) onSidebarBlockRawContent705() (interface{}, error) { - return types.Note, nil +func (c *current) onQuotesGroup42() (interface{}, error) { + return types.NewString(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent705() (interface{}, error) { +func (p *parser) callonQuotesGroup42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent705() + return p.cur.onQuotesGroup42() } -func (c *current) onSidebarBlockRawContent707() (interface{}, error) { - return types.Important, nil +func (c *current) onQuotesGroup61() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent707() (interface{}, error) { +func (p *parser) callonQuotesGroup61() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent707() + return p.cur.onQuotesGroup61() } -func (c *current) onSidebarBlockRawContent709() (interface{}, error) { - return types.Warning, nil +func (c *current) onQuotesGroup57(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonSidebarBlockRawContent709() (interface{}, error) { +func (p *parser) callonQuotesGroup57() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent709() + return p.cur.onQuotesGroup57(stack["ref"]) } -func (c *current) onSidebarBlockRawContent711() (interface{}, error) { - return types.Caution, nil +func (c *current) onQuotesGroup65() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent711() (interface{}, error) { +func (p *parser) callonQuotesGroup65() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent711() + return p.cur.onQuotesGroup65() } -func (c *current) onSidebarBlockRawContent725() (interface{}, error) { - return string(c.text), nil +func (c *current) onQuotesGroup1(elements interface{}) (interface{}, error) { + + return types.Merge(elements), nil + } -func (p *parser) callonSidebarBlockRawContent725() (interface{}, error) { +func (p *parser) callonQuotesGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent725() + return p.cur.onQuotesGroup1(stack["elements"]) } -func (c *current) onSidebarBlockRawContent734() (interface{}, error) { - return string(c.text), nil +func (c *current) onReplacementsGroup9() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent734() (interface{}, error) { +func (p *parser) callonReplacementsGroup9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent734() + return p.cur.onReplacementsGroup9() } -func (c *current) onSidebarBlockRawContent717(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onReplacementsGroup15() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent717() (interface{}, error) { +func (p *parser) callonReplacementsGroup15() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent717(stack["content"]) + return p.cur.onReplacementsGroup15() } -func (c *current) onSidebarBlockRawContent755() (interface{}, error) { - return string(c.text), nil +func (c *current) onReplacementsGroup22() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent755() (interface{}, error) { +func (p *parser) callonReplacementsGroup22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent755() + return p.cur.onReplacementsGroup22() } -func (c *current) onSidebarBlockRawContent767() (interface{}, error) { - return string(c.text), nil +func (c *current) onReplacementsGroup6(content interface{}) (interface{}, error) { + return content, nil + } -func (p *parser) callonSidebarBlockRawContent767() (interface{}, error) { +func (p *parser) callonReplacementsGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent767() + return p.cur.onReplacementsGroup6(stack["content"]) } -func (c *current) onSidebarBlockRawContent779() (interface{}, error) { - return string(c.text), nil +func (c *current) onReplacementsGroup24() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent779() (interface{}, error) { +func (p *parser) callonReplacementsGroup24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent779() + return p.cur.onReplacementsGroup24() } -func (c *current) onSidebarBlockRawContent791() (interface{}, error) { - return string(c.text), nil +func (c *current) onReplacementsGroup33() (interface{}, error) { + // allow ` + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent791() (interface{}, error) { +func (p *parser) callonReplacementsGroup33() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent791() + return p.cur.onReplacementsGroup33() } -func (c *current) onSidebarBlockRawContent803() (interface{}, error) { +func (c *current) onReplacementsGroup48() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent803() (interface{}, error) { +func (p *parser) callonReplacementsGroup48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent803() + return p.cur.onReplacementsGroup48() } -func (c *current) onSidebarBlockRawContent815() (interface{}, error) { - return string(c.text), nil +func (c *current) onReplacementsGroup54() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent815() (interface{}, error) { +func (p *parser) callonReplacementsGroup54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent815() + return p.cur.onReplacementsGroup54() } -func (c *current) onSidebarBlockRawContent827() (interface{}, error) { - return string(c.text), nil +func (c *current) onReplacementsGroup42() (interface{}, error) { + return types.NewString(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent827() (interface{}, error) { +func (p *parser) callonReplacementsGroup42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent827() + return p.cur.onReplacementsGroup42() } -func (c *current) onSidebarBlockRawContent835() (interface{}, error) { +func (c *current) onReplacementsGroup58() (bool, error) { + return c.isSubstitutionEnabled(Replacements) - return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent835() (interface{}, error) { +func (p *parser) callonReplacementsGroup58() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent835() + return p.cur.onReplacementsGroup58() } -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) onReplacementsGroup61() (interface{}, error) { + return types.NewStringElement("\u2019") } -func (p *parser) callonSidebarBlockRawContent843() (bool, error) { +func (p *parser) callonReplacementsGroup61() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent843(stack["content"]) + return p.cur.onReplacementsGroup61() } -func (c *current) onSidebarBlockRawContent742(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onReplacementsGroup63() (interface{}, error) { + return types.NewStringElement("\u00a9") } -func (p *parser) callonSidebarBlockRawContent742() (interface{}, error) { +func (p *parser) callonReplacementsGroup63() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent742(stack["content"]) + return p.cur.onReplacementsGroup63() } -func (c *current) onSidebarBlockRawContent699(t, lines interface{}) (interface{}, error) { - - return types.NewAdmonitionParagraph(lines.([]interface{}), t.(string), c.globalStore.getAttributes()) +func (c *current) onReplacementsGroup65() (interface{}, error) { + return types.NewStringElement("\u2122") } -func (p *parser) callonSidebarBlockRawContent699() (interface{}, error) { +func (p *parser) callonReplacementsGroup65() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent699(stack["t"], stack["lines"]) + return p.cur.onReplacementsGroup65() } -func (c *current) onSidebarBlockRawContent860() (interface{}, error) { - return string(c.text), nil +func (c *current) onReplacementsGroup67() (interface{}, error) { + return types.NewStringElement("\u00ae") + } -func (p *parser) callonSidebarBlockRawContent860() (interface{}, error) { +func (p *parser) callonReplacementsGroup67() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent860() + return p.cur.onReplacementsGroup67() } -func (c *current) onSidebarBlockRawContent852() (interface{}, error) { - return types.NewBlankLine() +func (c *current) onReplacementsGroup69() (interface{}, error) { + return types.NewStringElement("\u2026\u200b") + } -func (p *parser) callonSidebarBlockRawContent852() (interface{}, error) { +func (p *parser) callonReplacementsGroup69() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent852() + return p.cur.onReplacementsGroup69() } -func (c *current) onSidebarBlockRawContent876() (interface{}, error) { - - return string(c.text), nil +func (c *current) onReplacementsGroup71() (interface{}, error) { + return types.NewStringElement(string(c.text[:1]) + "\u2019") } -func (p *parser) callonSidebarBlockRawContent876() (interface{}, error) { +func (p *parser) callonReplacementsGroup71() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent876() + return p.cur.onReplacementsGroup71() } -func (c *current) onSidebarBlockRawContent870(content interface{}) (interface{}, error) { - // line MAY have content - return types.NewRawLine(content.(string)) +func (c *current) onReplacementsGroup56(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonSidebarBlockRawContent870() (interface{}, error) { +func (p *parser) callonReplacementsGroup56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent870(stack["content"]) + return p.cur.onReplacementsGroup56(stack["element"]) } -func (c *current) onSidebarBlockRawContent849(content interface{}) (interface{}, error) { - - return content, nil +func (c *current) onReplacementsGroup81() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSidebarBlockRawContent849() (interface{}, error) { +func (p *parser) callonReplacementsGroup81() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent849(stack["content"]) + return p.cur.onReplacementsGroup81() } -func (c *current) onSidebarBlockRawContent844(content interface{}) (interface{}, error) { - return types.NewMarkdownQuoteBlock(content.([]interface{}), c.globalStore.getAttributes()) - +func (c *current) onReplacementsGroup77(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonSidebarBlockRawContent844() (interface{}, error) { +func (p *parser) callonReplacementsGroup77() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent844(stack["content"]) + return p.cur.onReplacementsGroup77(stack["ref"]) } -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) onReplacementsGroup85() (interface{}, error) { + + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent886() (bool, error) { +func (p *parser) callonReplacementsGroup85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent886() + return p.cur.onReplacementsGroup85() } -func (c *current) onSidebarBlockRawContent902() (interface{}, error) { - return string(c.text), nil +func (c *current) onReplacementsGroup1(elements interface{}) (interface{}, error) { + + return types.Merge(elements), nil + } -func (p *parser) callonSidebarBlockRawContent902() (interface{}, error) { +func (p *parser) callonReplacementsGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent902() + return p.cur.onReplacementsGroup1(stack["elements"]) } -func (c *current) onSidebarBlockRawContent914() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup9() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent914() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent914() + return p.cur.onSpecialCharactersGroup9() } -func (c *current) onSidebarBlockRawContent926() (interface{}, error) { +func (c *current) onSpecialCharactersGroup15() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent926() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup15() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent926() + return p.cur.onSpecialCharactersGroup15() } -func (c *current) onSidebarBlockRawContent938() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup22() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent938() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent938() + return p.cur.onSpecialCharactersGroup22() } -func (c *current) onSidebarBlockRawContent950() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup6(content interface{}) (interface{}, error) { + return content, nil + } -func (p *parser) callonSidebarBlockRawContent950() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent950() + return p.cur.onSpecialCharactersGroup6(stack["content"]) } -func (c *current) onSidebarBlockRawContent962() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup24() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent962() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent962() + return p.cur.onSpecialCharactersGroup24() } -func (c *current) onSidebarBlockRawContent974() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup33() (interface{}, error) { + // allow ` + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent974() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup33() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent974() + return p.cur.onSpecialCharactersGroup33() } -func (c *current) onSidebarBlockRawContent982() (interface{}, error) { - +func (c *current) onSpecialCharactersGroup48() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent982() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent982() + return p.cur.onSpecialCharactersGroup48() } -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) onSpecialCharactersGroup54() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent990() (bool, error) { +func (p *parser) callonSpecialCharactersGroup54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent990(stack["content"]) + return p.cur.onSpecialCharactersGroup54() } -func (c *current) onSidebarBlockRawContent889(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) - +func (c *current) onSpecialCharactersGroup42() (interface{}, error) { + return types.NewString(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent889() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent889(stack["content"]) + return p.cur.onSpecialCharactersGroup42() } -func (c *current) onSidebarBlockRawContent884(content interface{}) (interface{}, error) { - - return types.NewPassthroughBlock(content.([]interface{}), c.globalStore.getAttributes()) +func (c *current) onSpecialCharactersGroup58() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) } -func (p *parser) callonSidebarBlockRawContent884() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup58() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent884(stack["content"]) + return p.cur.onSpecialCharactersGroup58() } -func (c *current) onSidebarBlockRawContent1003() (interface{}, error) { +func (c *current) onSpecialCharactersGroup67() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent1003() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup67() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1003() + return p.cur.onSpecialCharactersGroup67() } -func (c *current) onSidebarBlockRawContent1012() (interface{}, error) { +func (c *current) onSpecialCharactersGroup73() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent1012() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup73() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1012() + return p.cur.onSpecialCharactersGroup73() } -func (c *current) onSidebarBlockRawContent995(content interface{}) (interface{}, error) { - return types.NewSingleLineComment(content.(string)) +func (c *current) onSpecialCharactersGroup79() (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) callonSidebarBlockRawContent995() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup79() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent995(stack["content"]) + return p.cur.onSpecialCharactersGroup79() } -func (c *current) onSidebarBlockRawContent1033() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup86() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonSidebarBlockRawContent1033() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup86() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1033() + return p.cur.onSpecialCharactersGroup86() } -func (c *current) onSidebarBlockRawContent1045() (interface{}, error) { +func (c *current) onSpecialCharactersGroup93() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent1045() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup93() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1045() + return p.cur.onSpecialCharactersGroup93() } -func (c *current) onSidebarBlockRawContent1057() (interface{}, error) { +func (c *current) onSpecialCharactersGroup105() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent1057() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup105() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1057() + return p.cur.onSpecialCharactersGroup105() } -func (c *current) onSidebarBlockRawContent1069() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup107() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonSidebarBlockRawContent1069() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup107() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1069() + return p.cur.onSpecialCharactersGroup107() } -func (c *current) onSidebarBlockRawContent1081() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup100(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonSidebarBlockRawContent1081() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup100() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1081() + return p.cur.onSpecialCharactersGroup100(stack["start"]) } -func (c *current) onSidebarBlockRawContent1093() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup89(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSidebarBlockRawContent1093() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup89() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1093() + return p.cur.onSpecialCharactersGroup89(stack["name"], stack["start"]) } -func (c *current) onSidebarBlockRawContent1105() (interface{}, error) { +func (c *current) onSpecialCharactersGroup115() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent1105() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup115() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1105() + return p.cur.onSpecialCharactersGroup115() } -func (c *current) onSidebarBlockRawContent1113() (interface{}, error) { - +func (c *current) onSpecialCharactersGroup127() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent1113() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup127() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1113() + return p.cur.onSpecialCharactersGroup127() } -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) onSpecialCharactersGroup129() (interface{}, error) { + + return strconv.Atoi(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent1121() (bool, error) { +func (p *parser) callonSpecialCharactersGroup129() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1121(stack["content"]) + return p.cur.onSpecialCharactersGroup129() } -func (c *current) onSidebarBlockRawContent1020(content interface{}) (interface{}, error) { - return types.NewRawLine(content.(string)) +func (c *current) onSpecialCharactersGroup122(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonSidebarBlockRawContent1020() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup122() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1020(stack["content"]) + return p.cur.onSpecialCharactersGroup122(stack["start"]) } -func (c *current) onSidebarBlockRawContent991(lines interface{}) (interface{}, error) { - - return types.NewParagraph(lines.([]interface{}), c.globalStore.getAttributes()) - +func (c *current) onSpecialCharactersGroup111(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonSidebarBlockRawContent991() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup111() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent991(stack["lines"]) + return p.cur.onSpecialCharactersGroup111(stack["name"], stack["start"]) } -func (c *current) onSidebarBlockRawContent1129() (interface{}, error) { +func (c *current) onSpecialCharactersGroup137() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSidebarBlockRawContent1129() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1129() + return p.cur.onSpecialCharactersGroup137() } -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) onSpecialCharactersGroup133(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSidebarBlockRawContent1122() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup133() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1122() + return p.cur.onSpecialCharactersGroup133(stack["name"]) } -func (c *current) onSidebarBlockRawContent4(attributes, element interface{}) (interface{}, error) { - c.globalStore.discardAttributes() +func (c *current) onSpecialCharactersGroup84(element interface{}) (interface{}, error) { return element, nil } -func (p *parser) callonSidebarBlockRawContent4() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup84() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent4(stack["attributes"], stack["element"]) + return p.cur.onSpecialCharactersGroup84(stack["element"]) } -func (c *current) onSidebarBlockRawContent1(elements interface{}) (interface{}, error) { - return elements, nil +func (c *current) onSpecialCharactersGroup143() (interface{}, error) { + + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSidebarBlockRawContent1() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup143() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSidebarBlockRawContent1(stack["elements"]) + return p.cur.onSpecialCharactersGroup143() } -func (c *current) onInlineMacros13() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onSpecialCharactersGroup63(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonInlineMacros13() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup63() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros13() + return p.cur.onSpecialCharactersGroup63(stack["id"], stack["label"]) } -func (c *current) onInlineMacros20() (interface{}, error) { +func (c *current) onSpecialCharactersGroup150() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonInlineMacros20() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup150() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros20() + return p.cur.onSpecialCharactersGroup150() } -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) onSpecialCharactersGroup146(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonInlineMacros9() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup146() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros9(stack["id"]) + return p.cur.onSpecialCharactersGroup146(stack["id"]) } -func (c *current) onInlineMacros30() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup61() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonInlineMacros30() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup61() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros30() + return p.cur.onSpecialCharactersGroup61() } -func (c *current) onInlineMacros26() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup154() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) + } -func (p *parser) callonInlineMacros26() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup154() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros26() + return p.cur.onSpecialCharactersGroup154() } -func (c *current) onInlineMacros39() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup56(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonInlineMacros39() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros39() + return p.cur.onSpecialCharactersGroup56(stack["element"]) } -func (c *current) onInlineMacros45() (interface{}, error) { +func (c *current) onSpecialCharactersGroup160() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonInlineMacros45() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup160() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros45() + return p.cur.onSpecialCharactersGroup160() } -func (c *current) onInlineMacros52() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup156(ref interface{}) (interface{}, error) { + return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonInlineMacros52() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup156() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros52() + return p.cur.onSpecialCharactersGroup156(stack["ref"]) } -func (c *current) onInlineMacros48() (interface{}, error) { - return string(c.text), nil -} +func (c *current) onSpecialCharactersGroup164() (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) callonSpecialCharactersGroup164() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros34(stack["content"]) + return p.cur.onSpecialCharactersGroup164() } -func (c *current) onInlineMacros61() (interface{}, error) { - return string(c.text), nil +func (c *current) onSpecialCharactersGroup1(elements interface{}) (interface{}, error) { + + return types.Merge(elements), nil + } -func (p *parser) callonInlineMacros61() (interface{}, error) { +func (p *parser) callonSpecialCharactersGroup1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros61() + return p.cur.onSpecialCharactersGroup1(stack["elements"]) } -func (c *current) onInlineMacros67() (interface{}, error) { - return string(c.text), nil +func (c *current) onVerbatimGroup9() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonInlineMacros67() (interface{}, error) { +func (p *parser) callonVerbatimGroup9() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros67() + return p.cur.onVerbatimGroup9() } -func (c *current) onInlineMacros74() (interface{}, error) { +func (c *current) onVerbatimGroup15() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonInlineMacros74() (interface{}, error) { +func (p *parser) callonVerbatimGroup15() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros74() + return p.cur.onVerbatimGroup15() } -func (c *current) onInlineMacros70() (interface{}, error) { - return string(c.text), nil +func (c *current) onVerbatimGroup22() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlineMacros70() (interface{}, error) { +func (p *parser) callonVerbatimGroup22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros70() + return p.cur.onVerbatimGroup22() } -func (c *current) onInlineMacros56(content interface{}) (interface{}, error) { +func (c *current) onVerbatimGroup6(content interface{}) (interface{}, error) { return content, nil + } -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(stack["content"]) } -func (c *current) onInlineMacros22(term1, term2, term3 interface{}) (interface{}, error) { - return types.NewConcealedIndexTerm(term1, term2, term3) +func (c *current) onVerbatimGroup24() (interface{}, error) { + return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlineMacros22() (interface{}, error) { +func (p *parser) callonVerbatimGroup24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacros22(stack["term1"], stack["term2"], stack["term3"]) + return p.cur.onVerbatimGroup24() } -func (c *current) onInlinePassthroughSubs5() (interface{}, error) { +func (c *current) onVerbatimGroup33() (interface{}, error) { + // allow ` return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlinePassthroughSubs5() (interface{}, error) { +func (p *parser) callonVerbatimGroup33() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthroughSubs5() + return p.cur.onVerbatimGroup33() } -func (c *current) onInlinePassthroughSubs14() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup48() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonInlinePassthroughSubs14() (interface{}, error) { +func (p *parser) callonVerbatimGroup48() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthroughSubs14() + return p.cur.onVerbatimGroup48() } -func (c *current) onInlinePassthroughSubs23() (interface{}, error) { - // allow ` +func (c *current) onVerbatimGroup54() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonInlinePassthroughSubs23() (interface{}, error) { +func (p *parser) callonVerbatimGroup54() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthroughSubs23() + return p.cur.onVerbatimGroup54() } -func (c *current) onInlinePassthroughSubs36() (interface{}, error) { - return string(c.text), nil +func (c *current) onVerbatimGroup42() (interface{}, error) { + return types.NewString(string(c.text)) } -func (p *parser) callonInlinePassthroughSubs36() (interface{}, error) { +func (p *parser) callonVerbatimGroup42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthroughSubs36() + return p.cur.onVerbatimGroup42() } -func (c *current) onInlinePassthroughSubs32(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onVerbatimGroup59() (bool, error) { + return c.isSubstitutionEnabled(SpecialCharacters) + } -func (p *parser) callonInlinePassthroughSubs32() (interface{}, error) { +func (p *parser) callonVerbatimGroup59() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthroughSubs32(stack["ref"]) + return p.cur.onVerbatimGroup59() } -func (c *current) onInlinePassthroughSubs43() (interface{}, error) { +func (c *current) onVerbatimGroup68() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonInlinePassthroughSubs43() (interface{}, error) { +func (p *parser) callonVerbatimGroup68() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthroughSubs43() + return p.cur.onVerbatimGroup68() } -func (c *current) onInlinePassthroughSubs45() (interface{}, error) { +func (c *current) onVerbatimGroup74() (interface{}, error) { + return string(c.text), nil - return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlinePassthroughSubs45() (interface{}, error) { +func (p *parser) callonVerbatimGroup74() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlinePassthroughSubs45() + return p.cur.onVerbatimGroup74() } -func (c *current) onSpecialCharacterSubs4() (interface{}, error) { +func (c *current) onVerbatimGroup80() (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) callonSpecialCharacterSubs4() (interface{}, error) { +func (p *parser) callonVerbatimGroup80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs4() + return p.cur.onVerbatimGroup80() } -func (c *current) onSpecialCharacterSubs13() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup87() (bool, error) { + return c.isSubstitutionEnabled(Attributes) } -func (p *parser) callonSpecialCharacterSubs13() (interface{}, error) { +func (p *parser) callonVerbatimGroup87() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs13() + return p.cur.onVerbatimGroup87() } -func (c *current) onSpecialCharacterSubs22() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup94() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSpecialCharacterSubs22() (interface{}, error) { +func (p *parser) callonVerbatimGroup94() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs22() + return p.cur.onVerbatimGroup94() } -func (c *current) onSpecialCharacterSubs37() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ +func (c *current) onVerbatimGroup106() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonSpecialCharacterSubs37() (interface{}, error) { +func (p *parser) callonVerbatimGroup106() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs37() + return p.cur.onVerbatimGroup106() } -func (c *current) onSpecialCharacterSubs43() (interface{}, error) { - return string(c.text), nil +func (c *current) onVerbatimGroup108() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonSpecialCharacterSubs43() (interface{}, error) { +func (p *parser) callonVerbatimGroup108() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs43() + return p.cur.onVerbatimGroup108() } -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) onVerbatimGroup101(start interface{}) (interface{}, error) { + return start, nil } -func (p *parser) callonSpecialCharacterSubs49() (interface{}, error) { +func (p *parser) callonVerbatimGroup101() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs49() + return p.cur.onVerbatimGroup101(stack["start"]) } -func (c *current) onSpecialCharacterSubs58() (interface{}, error) { - return string(c.text), nil +func (c *current) onVerbatimGroup90(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonSpecialCharacterSubs58() (interface{}, error) { +func (p *parser) callonVerbatimGroup90() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs58() + return p.cur.onVerbatimGroup90(stack["name"], stack["start"]) } -func (c *current) onSpecialCharacterSubs54(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onVerbatimGroup116() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonSpecialCharacterSubs54() (interface{}, error) { +func (p *parser) callonVerbatimGroup116() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs54(stack["name"]) + return p.cur.onVerbatimGroup116() } -func (c *current) onSpecialCharacterSubs64() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup128() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSpecialCharacterSubs64() (interface{}, error) { +func (p *parser) callonVerbatimGroup128() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs64() + return p.cur.onVerbatimGroup128() } -func (c *current) onSpecialCharacterSubs33(id, label interface{}) (interface{}, error) { - return types.NewInternalCrossReference(id, label) +func (c *current) onVerbatimGroup130() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonSpecialCharacterSubs33() (interface{}, error) { +func (p *parser) callonVerbatimGroup130() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs33(stack["id"], stack["label"]) + return p.cur.onVerbatimGroup130() } -func (c *current) onSpecialCharacterSubs71() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onVerbatimGroup123(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonSpecialCharacterSubs71() (interface{}, error) { +func (p *parser) callonVerbatimGroup123() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs71() + return p.cur.onVerbatimGroup123(stack["start"]) } -func (c *current) onSpecialCharacterSubs67(id interface{}) (interface{}, error) { - return types.NewInternalCrossReference(id, nil) +func (c *current) onVerbatimGroup112(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonSpecialCharacterSubs67() (interface{}, error) { +func (p *parser) callonVerbatimGroup112() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs67(stack["id"]) + return p.cur.onVerbatimGroup112(stack["name"], stack["start"]) } -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) onVerbatimGroup138() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonSpecialCharacterSubs31() (interface{}, error) { +func (p *parser) callonVerbatimGroup138() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs31() + return p.cur.onVerbatimGroup138() } -func (c *current) onSpecialCharacterSubs75() (interface{}, error) { - return types.NewSpecialCharacter(string(c.text)) +func (c *current) onVerbatimGroup134(name interface{}) (interface{}, error) { + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonSpecialCharacterSubs75() (interface{}, error) { +func (p *parser) callonVerbatimGroup134() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs75() + return p.cur.onVerbatimGroup134(stack["name"]) } -func (c *current) onSpecialCharacterSubs81() (interface{}, error) { - return string(c.text), nil +func (c *current) onVerbatimGroup85(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonSpecialCharacterSubs81() (interface{}, error) { +func (p *parser) callonVerbatimGroup85() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs81() + return p.cur.onVerbatimGroup85(stack["element"]) } -func (c *current) onSpecialCharacterSubs77(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onVerbatimGroup144() (interface{}, error) { + + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonSpecialCharacterSubs77() (interface{}, error) { +func (p *parser) callonVerbatimGroup144() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs77(stack["ref"]) + return p.cur.onVerbatimGroup144() } -func (c *current) onSpecialCharacterSubs88() (interface{}, error) { - return string(c.text), nil +func (c *current) onVerbatimGroup64(id, label interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, label) + } -func (p *parser) callonSpecialCharacterSubs88() (interface{}, error) { +func (p *parser) callonVerbatimGroup64() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs88() + return p.cur.onVerbatimGroup64(stack["id"], stack["label"]) } -func (c *current) onSpecialCharacterSubs90() (interface{}, error) { +func (c *current) onVerbatimGroup151() (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) callonVerbatimGroup151() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSpecialCharacterSubs90() + return p.cur.onVerbatimGroup151() } -func (c *current) onQuotedTextSubs4() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup147(id interface{}) (interface{}, error) { + return types.NewInternalCrossReference(id, nil) } -func (p *parser) callonQuotedTextSubs4() (interface{}, error) { +func (p *parser) callonVerbatimGroup147() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs4() + return p.cur.onVerbatimGroup147(stack["id"]) } -func (c *current) onQuotedTextSubs13() (interface{}, error) { - +func (c *current) onVerbatimGroup62() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonQuotedTextSubs13() (interface{}, error) { +func (p *parser) callonVerbatimGroup62() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs13() + return p.cur.onVerbatimGroup62() } -func (c *current) onQuotedTextSubs22() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup155() (interface{}, error) { + return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonQuotedTextSubs22() (interface{}, error) { +func (p *parser) callonVerbatimGroup155() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs22() + return p.cur.onVerbatimGroup155() } -func (c *current) onQuotedTextSubs34() (interface{}, error) { - return string(c.text), nil +func (c *current) onVerbatimGroup57(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonQuotedTextSubs34() (interface{}, error) { +func (p *parser) callonVerbatimGroup57() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs34() + return p.cur.onVerbatimGroup57(stack["element"]) } -func (c *current) onQuotedTextSubs42() (interface{}, error) { +func (c *current) onVerbatimGroup161() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonQuotedTextSubs42() (interface{}, error) { +func (p *parser) callonVerbatimGroup161() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs42() + return p.cur.onVerbatimGroup161() } -func (c *current) onQuotedTextSubs38(ref interface{}) (interface{}, error) { +func (c *current) onVerbatimGroup157(ref interface{}) (interface{}, error) { return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonQuotedTextSubs38() (interface{}, error) { +func (p *parser) callonVerbatimGroup157() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs38(stack["ref"]) + return p.cur.onVerbatimGroup157(stack["ref"]) } -func (c *current) onQuotedTextSubs46() (interface{}, error) { +func (c *current) onVerbatimGroup165() (interface{}, error) { return types.NewStringElement(string(c.text)) + } -func (p *parser) callonQuotedTextSubs46() (interface{}, error) { +func (p *parser) callonVerbatimGroup165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onQuotedTextSubs46() + return p.cur.onVerbatimGroup165() } -func (c *current) onAttributeSubs4() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onVerbatimGroup1(elements interface{}) (interface{}, error) { + + return types.Merge(elements), nil } -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) onInlineMacro24() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonAttributeSubs34() (interface{}, error) { +func (p *parser) callonInlineMacro24() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs34() + return p.cur.onInlineMacro24() } -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) onInlineMacro34() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonAttributeSubs52() (interface{}, error) { +func (p *parser) callonInlineMacro34() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs52() + return p.cur.onInlineMacro34() } -func (c *current) onAttributeSubs54() (interface{}, error) { - - return strconv.Atoi(string(c.text)) - +func (c *current) onInlineMacro30() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonAttributeSubs54() (interface{}, error) { +func (p *parser) callonInlineMacro30() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs54() + return p.cur.onInlineMacro30() } -func (c *current) onAttributeSubs47(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onInlineMacro43() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonAttributeSubs47() (interface{}, error) { +func (p *parser) callonInlineMacro43() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs47(stack["start"]) + return p.cur.onInlineMacro43() } -func (c *current) onAttributeSubs36(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), false, start) +func (c *current) onInlineMacro49() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonAttributeSubs36() (interface{}, error) { +func (p *parser) callonInlineMacro49() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs36(stack["name"], stack["start"]) + return p.cur.onInlineMacro49() } -func (c *current) onAttributeSubs62() (interface{}, error) { +func (c *current) onInlineMacro56() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonAttributeSubs62() (interface{}, error) { +func (p *parser) callonInlineMacro56() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs62() + return p.cur.onInlineMacro56() } -func (c *current) onAttributeSubs74() (interface{}, error) { +func (c *current) onInlineMacro52() (interface{}, error) { return string(c.text), nil - } -func (p *parser) callonAttributeSubs74() (interface{}, error) { +func (p *parser) callonInlineMacro52() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs74() + return p.cur.onInlineMacro52() } -func (c *current) onAttributeSubs76() (interface{}, error) { - - return strconv.Atoi(string(c.text)) - +func (c *current) onInlineMacro38(content interface{}) (interface{}, error) { + return content, nil } -func (p *parser) callonAttributeSubs76() (interface{}, error) { +func (p *parser) callonInlineMacro38() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs76() + return p.cur.onInlineMacro38(stack["content"]) } -func (c *current) onAttributeSubs69(start interface{}) (interface{}, error) { - return start, nil +func (c *current) onInlineMacro65() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonAttributeSubs69() (interface{}, error) { +func (p *parser) callonInlineMacro65() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs69(stack["start"]) + return p.cur.onInlineMacro65() } -func (c *current) onAttributeSubs58(name, start interface{}) (interface{}, error) { - return types.NewCounterSubstitution(name.(string), true, nil) +func (c *current) onInlineMacro71() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonAttributeSubs58() (interface{}, error) { +func (p *parser) callonInlineMacro71() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs58(stack["name"], stack["start"]) + return p.cur.onInlineMacro71() } -func (c *current) onAttributeSubs84() (interface{}, error) { +func (c *current) onInlineMacro78() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonAttributeSubs84() (interface{}, error) { +func (p *parser) callonInlineMacro78() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs84() + return p.cur.onInlineMacro78() } -func (c *current) onAttributeSubs80(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onInlineMacro74() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonAttributeSubs80() (interface{}, error) { +func (p *parser) callonInlineMacro74() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs80(stack["name"]) + return p.cur.onInlineMacro74() } -func (c *current) onAttributeSubs94() (interface{}, error) { - return string(c.text), nil +func (c *current) onInlineMacro60(content interface{}) (interface{}, error) { + return content, nil } -func (p *parser) callonAttributeSubs94() (interface{}, error) { +func (p *parser) callonInlineMacro60() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs94() + return p.cur.onInlineMacro60(stack["content"]) } -func (c *current) onAttributeSubs90(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onInlineMacro26(term1, term2, term3 interface{}) (interface{}, error) { + return types.NewConcealedIndexTerm(term1, term2, term3) + } -func (p *parser) callonAttributeSubs90() (interface{}, error) { +func (p *parser) callonInlineMacro26() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAttributeSubs90(stack["ref"]) + return p.cur.onInlineMacro26(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) onInlinePassthrough23() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonInlineMacroSubs22() (interface{}, error) { +func (p *parser) callonInlinePassthrough23() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacroSubs22() + return p.cur.onInlinePassthrough23() } -func (c *current) onInlineMacroSubs34() (interface{}, error) { - return string(c.text), nil +func (c *current) onInlinePassthrough29() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlineMacroSubs34() (interface{}, error) { +func (p *parser) callonInlinePassthrough29() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacroSubs34() + return p.cur.onInlinePassthrough29() } -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) onInlinePassthrough49() (interface{}, error) { + return string(c.text), nil - return types.NewStringElement(string(c.text)) } -func (p *parser) callonInlineMacroSubs45() (interface{}, error) { +func (p *parser) callonInlinePassthrough49() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineMacroSubs45() + return p.cur.onInlinePassthrough49() } -func (c *current) onMarkdownQuoteMacroSubs1(lines interface{}) (interface{}, error) { - return types.NewParagraph(lines.([]interface{}), nil) +func (c *current) onInlinePassthrough55() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonMarkdownQuoteMacroSubs1() (interface{}, error) { +func (p *parser) callonInlinePassthrough55() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteMacroSubs1(stack["lines"]) + return p.cur.onInlinePassthrough55() } -func (c *current) onMarkdownQuoteLine6() (interface{}, error) { - return types.NewStringElement(string(c.text)) +func (c *current) onInlinePassthrough62() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonMarkdownQuoteLine6() (interface{}, error) { +func (p *parser) callonInlinePassthrough62() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine6() + return p.cur.onInlinePassthrough62() } -func (c *current) onMarkdownQuoteLine15() (interface{}, error) { - +func (c *current) onInlinePassthrough72() (interface{}, error) { + // TODO: just use "\n" return types.NewStringElement(string(c.text)) - } -func (p *parser) callonMarkdownQuoteLine15() (interface{}, error) { +func (p *parser) callonInlinePassthrough72() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine15() + return p.cur.onInlinePassthrough72() } -func (c *current) onMarkdownQuoteLine24() (interface{}, error) { - // allow ` +func (c *current) onInlinePassthrough42() (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) callonInlinePassthrough42() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine24() + return p.cur.onInlinePassthrough42() } -func (c *current) onMarkdownQuoteLine36() (interface{}, error) { +func (c *current) onInlinePassthrough80() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonMarkdownQuoteLine36() (interface{}, error) { +func (p *parser) callonInlinePassthrough80() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine36() + return p.cur.onInlinePassthrough80() } -func (c *current) onMarkdownQuoteLine43() (interface{}, error) { - return string(c.text), nil +func (c *current) onInlinePassthrough86() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonMarkdownQuoteLine43() (interface{}, error) { +func (p *parser) callonInlinePassthrough86() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine43() + return p.cur.onInlinePassthrough86() } -func (c *current) onMarkdownQuoteLine39(ref interface{}) (interface{}, error) { - return types.NewElementPlaceHolder(ref.(string)) +func (c *current) onInlinePassthrough75() (interface{}, error) { + // a single character + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonMarkdownQuoteLine39() (interface{}, error) { +func (p *parser) callonInlinePassthrough75() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine39(stack["ref"]) + return p.cur.onInlinePassthrough75() } -func (c *current) onMarkdownQuoteLine47() (interface{}, error) { +func (c *current) onInlinePassthrough37(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) callonInlinePassthrough37() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onMarkdownQuoteLine47() + return p.cur.onInlinePassthrough37(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) { - return string(c.text), nil +func (c *current) onUserMacroBlock20() (interface{}, error) { + // TODO: just use "\n" + return types.NewStringElement(string(c.text)) } -func (p *parser) callonPostReplacementSubs49() (interface{}, error) { +func (p *parser) callonUserMacroBlock20() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPostReplacementSubs49() + return p.cur.onUserMacroBlock20() } -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, 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, 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) onFileLocation88() (interface{}, error) { + return string(c.text), nil + } -func (p *parser) callonTableLine25() (interface{}, error) { +func (p *parser) callonFileLocation88() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableLine25() + return p.cur.onFileLocation88() } -func (c *current) onTableLine1(cells interface{}) (interface{}, error) { - return types.NewTableLine(cells.([]interface{})) +func (c *current) onFileLocation94() (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) callonFileLocation94() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableLine1(stack["cells"]) + return p.cur.onFileLocation94() } -func (c *current) onTableCell7() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation101() (bool, error) { + return c.isSubstitutionEnabled(Attributes) + } -func (p *parser) callonTableCell7() (interface{}, error) { +func (p *parser) callonFileLocation101() (bool, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableCell7() + return p.cur.onFileLocation101() } -func (c *current) onTableCell18() (interface{}, error) { +func (c *current) onFileLocation108() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonTableCell18() (interface{}, error) { +func (p *parser) callonFileLocation108() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableCell18() + return p.cur.onFileLocation108() } -func (c *current) onTableCell29() (interface{}, error) { +func (c *current) onFileLocation120() (interface{}, error) { return string(c.text), nil + } -func (p *parser) callonTableCell29() (interface{}, error) { +func (p *parser) callonFileLocation120() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableCell29() + return p.cur.onFileLocation120() } -func (c *current) onTableCell35() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation122() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonTableCell35() (interface{}, error) { +func (p *parser) callonFileLocation122() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableCell35() + return p.cur.onFileLocation122() } -func (c *current) onTableCell1(elements interface{}) (interface{}, error) { - return types.NewInlineElements(elements) +func (c *current) onFileLocation115(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonTableCell1() (interface{}, error) { +func (p *parser) callonFileLocation115() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTableCell1(stack["elements"]) + return p.cur.onFileLocation115(stack["start"]) } -func (c *current) onIndexTerm1(term interface{}) (interface{}, error) { - return types.NewIndexTerm(term.([]interface{})) +func (c *current) onFileLocation104(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), false, start) } -func (p *parser) callonIndexTerm1() (interface{}, error) { +func (p *parser) callonFileLocation104() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTerm1(stack["term"]) + return p.cur.onFileLocation104(stack["name"], stack["start"]) } -func (c *current) onIndexTermContent5() (interface{}, error) { - - return types.NewStringElement(string(c.text)) +func (c *current) onFileLocation130() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonIndexTermContent5() (interface{}, error) { +func (p *parser) callonFileLocation130() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent5() + return p.cur.onFileLocation130() } -func (c *current) onIndexTermContent14() (interface{}, error) { - // allow ` - return types.NewStringElement(string(c.text)) +func (c *current) onFileLocation142() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonIndexTermContent14() (interface{}, error) { +func (p *parser) callonFileLocation142() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent14() + return p.cur.onFileLocation142() } -func (c *current) onIndexTermContent26() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation144() (interface{}, error) { + + return strconv.Atoi(string(c.text)) + } -func (p *parser) callonIndexTermContent26() (interface{}, error) { +func (p *parser) callonFileLocation144() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent26() + return p.cur.onFileLocation144() } -func (c *current) onIndexTermContent34() (interface{}, error) { - // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ - return string(c.text), nil +func (c *current) onFileLocation137(start interface{}) (interface{}, error) { + return start, nil + } -func (p *parser) callonIndexTermContent34() (interface{}, error) { +func (p *parser) callonFileLocation137() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent34() + return p.cur.onFileLocation137(stack["start"]) } -func (c *current) onIndexTermContent40() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation126(name, start interface{}) (interface{}, error) { + return types.NewCounterSubstitution(name.(string), true, nil) } -func (p *parser) callonIndexTermContent40() (interface{}, error) { +func (p *parser) callonFileLocation126() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent40() + return p.cur.onFileLocation126(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) onFileLocation152() (interface{}, error) { + return string(c.text), nil } -func (p *parser) callonIndexTermContent46() (interface{}, error) { +func (p *parser) callonFileLocation152() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent46() + return p.cur.onFileLocation152() } -func (c *current) onIndexTermContent55() (interface{}, error) { - return string(c.text), nil +func (c *current) onFileLocation148(name interface{}) (interface{}, error) { + + return types.NewAttributeSubstitution(name.(string)) } -func (p *parser) callonIndexTermContent55() (interface{}, error) { +func (p *parser) callonFileLocation148() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent55() + return p.cur.onFileLocation148(stack["name"]) } -func (c *current) onIndexTermContent51(name interface{}) (interface{}, error) { - return types.NewAttributeSubstitution(name.(string)) +func (c *current) onFileLocation99(element interface{}) (interface{}, error) { + return element, nil + } -func (p *parser) callonIndexTermContent51() (interface{}, error) { +func (p *parser) callonFileLocation99() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent51(stack["name"]) + return p.cur.onFileLocation99(stack["element"]) } -func (c *current) onIndexTermContent61() (interface{}, error) { +func (c *current) onFileLocation158() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonIndexTermContent61() (interface{}, error) { +func (p *parser) callonFileLocation158() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent61() + return p.cur.onFileLocation158() } -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) onFileLocation165() (interface{}, error) { // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil + } -func (p *parser) callonIndexTermContent68() (interface{}, error) { +func (p *parser) callonFileLocation165() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent68() + return p.cur.onFileLocation165() } -func (c *current) onIndexTermContent64(id interface{}) (interface{}, error) { +func (c *current) onFileLocation161(id interface{}) (interface{}, error) { return types.NewInternalCrossReference(id, nil) + } -func (p *parser) callonIndexTermContent64() (interface{}, error) { +func (p *parser) callonFileLocation161() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent64(stack["id"]) + return p.cur.onFileLocation161(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) onFileLocation169() (interface{}, error) { return types.NewSpecialCharacter(string(c.text)) } -func (p *parser) callonIndexTermContent72() (interface{}, error) { +func (p *parser) callonFileLocation169() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent72() + return p.cur.onFileLocation169() } -func (c *current) onIndexTermContent78() (interface{}, error) { - return string(c.text), nil -} - -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) onFileLocation171() (interface{}, error) { + return types.NewStringElement(string(c.text)) -func (p *parser) callonIndexTermContent82() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onIndexTermContent82() } -func (c *current) onIndexTermContent1(elements interface{}) (interface{}, error) { - return types.NewInlineElements(elements.([]interface{})) -} - -func (p *parser) callonIndexTermContent1() (interface{}, error) { +func (p *parser) callonFileLocation171() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent1(stack["elements"]) + return p.cur.onFileLocation171() } -func (c *current) onFileLocation5() (interface{}, error) { - // not supported for now: EOL, space, "[", "]" - return types.NewStringElement(string(c.text)) +func (c *current) onFileLocation5(elements interface{}) (interface{}, error) { + return types.Merge(elements.([]interface{})...), nil + } 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) onFileLocation177() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonFileLocation12() (interface{}, error) { +func (p *parser) callonFileLocation177() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileLocation12() + return p.cur.onFileLocation177() } -func (c *current) onFileLocation8(ref interface{}) (interface{}, error) { +func (c *current) onFileLocation173(ref interface{}) (interface{}, error) { return types.NewElementPlaceHolder(ref.(string)) } -func (p *parser) callonFileLocation8() (interface{}, error) { +func (p *parser) callonFileLocation173() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileLocation8(stack["ref"]) + return p.cur.onFileLocation173(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.old.peg b/pkg/parser/parser.old.peg new file mode 100644 index 00000000..82133504 --- /dev/null +++ b/pkg/parser/parser.old.peg @@ -0,0 +1,2263 @@ +{ +package parser + +import ( + "io" + "strconv" + "strings" + "unicode" + "github.com/bytesparadise/libasciidoc/pkg/types" + + log "github.com/sirupsen/logrus" + "github.com/davecgh/go-spew/spew" +) + +} + +// ---------------------------------------------------------------- +// 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]* { // line MAY have content + return string(c.text), nil + }) EOL { + 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 <- + !EOF + attributes:(BlockAttributes)? + #{ + c.globalStore.pushAttributes(attributes) + return nil + } + block:( + LabeledListItem // must appear before simple paragraph + / SimpleRawParagraph + / BlankLine // must be before LiteralBlock + / Section + / DelimitedBlock + / ImageBlock + / SingleLineComment + / Table + / ThematicBreak + / OrderedListElement + / 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 + } + ) { + c.globalStore.discardAttributes() + return block, 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) +} + +// "<" marks the beginning of the author email, and ";" is the authors separator +DocumentAuthorName <- [^<;\r\n]+ { + return string(c.text), nil +} + +DocumentAuthorEmail <- "<" 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 +} + +DocumentRevisionDate <- [^:\r\n]+ { + return string(c.text), nil +} + +DocumentRevisionRemark <- [^\r\r\n]+ { + return string(c.text), nil +} + +// ------------------------------------------ +// Attributes +// ------------------------------------------ +AttributeDeclaration <- ":" name:(AttributeName) ":" + value:(AttributeDeclarationValue)? EOL { + return types.NewAttributeDeclaration(name.(string), types.Reduce(value, strings.TrimSpace)) +} + +// 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 +} + +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 +} + +AttributeReset <- ":!" name:(AttributeName) ":" Space* EOL { + return types.NewAttributeReset(name.(string)) +} / ":" 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 <- + attributes:( + // shorthand syntax for anchors. Eg: `[[an_id]]` + (anchor:(ShortHandAnchor) Space* Newline { + return anchor, nil + }) + // shorthand syntax for titles. Eg: `.a title` + / (title:(ShortHandTitle) Space* Newline { + return title, nil + }) + // default syntax + / (attributes:(LongHandAttributes) Space* Newline { + return attributes, nil + }) + )+ { + return types.NewAttributes(attributes.([]interface{})...) + } + +InlineAttributes <- + "[" + attributes:(PositionalAttribute/NamedAttribute)* + "]" { + return types.NewAttributes(attributes.([]interface{})...) + } + +// shorthand syntax for anchors. Eg: `[[An ID]]` +ShortHandAnchor <- + "[[" + id:( + elements:( + ([^=\r\n\uFFFD{\]]+ { // spaces, commas and dots are allowed in this syntax + return types.NewStringElement(string(c.text)) + }) / + ElementPlaceHolder / + AttrSub / + ("{" { + return types.NewStringElement(string(c.text)) + }))+ { + return types.Reduce(elements, strings.TrimSpace), nil + } + ) + "]]" { + return types.NewIDAttribute(id) + } + +// shorthand syntax for titles. Eg: `.a title` +ShortHandTitle <- `.` title:( + ![. ] // may not start with a dot or a space, to avoid confusion with list items or literal block delimiters + elements:( + ([^\r\n\uFFFD{]+ { + return types.NewStringElement(string(c.text)) + }) / + ElementPlaceHolder / + AttrSub / + ("{" { + return types.NewStringElement(string(c.text)) + }))+ { + return types.Reduce(elements, strings.TrimSpace), nil + } + ) { + return types.NewTitleAttribute(title) + } + +// LongHandAttributes. Eg: `[positional1,positional2,...,named1,named2,...] +// 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 + firstPositionalAttributes:(FirstPositionalAttributes)? + otherAttributes:(PositionalAttribute / NamedAttribute)* + "]" { + attributes:=[]interface{}{} + if firstPositionalAttributes != nil { + attributes=append(attributes, firstPositionalAttributes.([]interface{})...) + } + attributes=append(attributes, otherAttributes.([]interface{})...) + return types.NewAttributes(attributes...) + } + +// First positional attributes may be an ID or a style, with extra roles and options. +// Or sometimes, it's just 1 or more roles or options... +FirstPositionalAttributes <- + main:( + ShortHandAttribute + )? + extras:( + ShortHandIDAttribute + / ShortHandOptionAttribute + / ShortHandDotRoleAttribute + )* ("," Space*)? + &{ + // make sure there was a match + return main != nil || len(extras.([]interface{})) > 0, nil + } + { + attrs:=[]interface{}{} + if main != nil { + attrs = append(attrs, main) + } + attrs = append(attrs, extras.([]interface{})...) + return attrs, nil + } + +// an `id` must be prefixed with a `#` +ShortHandIDAttribute <- "#" id:(ShortHandAttributeValue) { + return types.NewIDAttribute(id) +} + +ShortHandAttribute <- value:(ShortHandAttributeValue) { + return types.NewPositionalAttribute(value) +} + +// a `role` must be prefixed with a `.` +ShortHandDotRoleAttribute <- "." role:(ShortHandAttributeValue) { + return types.NewRoleAttribute(role) +} + +// an `option` must be prefixed with a `%` +ShortHandOptionAttribute <- "%" option:(ShortHandAttributeValue) { + return types.NewOptionAttribute(option) +} + +// Shorthand Attribute Value. +ShortHandAttributeValue <- + SingleQuotedAttributeValue + / DoubleQuotedAttributeValue + / 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)) + }))+ &[^=] { + 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*) + return types.NewPositionalAttribute(value) + }) + / + // empty/edge-case values. Eg: `[ ]`, `[, a, b]`, `[a, ,b]`, etc. + (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 + // rule that matched) + v := types.Merge(value) + return len(v) > 0, nil + } + { + return types.NewPositionalAttribute(nil) + }) + +NamedAttribute <- key:(NamedAttributeKey) "=" Space* value:(AttributeValue) ("," 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 +} + +AttributeValue <- + value:( + SingleQuotedAttributeValue + / DoubleQuotedAttributeValue + / UnquotedAttributeValue + ) + &(!(Space* "=")) { + return value, nil + } + +SingleQuotedAttributeValue <- + "'" + elements:( + QuotedText + / ([^'\r\n\uFFFD\\{]+ { // = and , signs are allowed within ' quotes + return types.NewStringElement(string(c.text)) + }) + / ElementPlaceHolder + / AttrSub + / (`\'` { + return types.NewStringElement(`'`) // escaped quote + } + / `{` / `\` { + return types.NewStringElement(string(c.text)) + }) + )+ + "'" { + return types.Reduce(elements), nil + } + +DoubleQuotedAttributeValue <- + "\"" + elements:( + QuotedText + / ([^\r\n\uFFFD"\\{]+ { // = and , signs are allowed within " quotes + return types.NewStringElement(string(c.text)) + }) + / ElementPlaceHolder + / AttrSub + / (`\"` { + return types.NewStringElement(`"`) // escaped quote + } + / `{` / `\` { + 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 + elements:( + QuotedText + / ([^,=\r\n\uFFFD{\]]+ { + return types.NewStringElement(string(c.text)) + }) + / ElementPlaceHolder + / AttrSub + / ("{" { + return types.NewStringElement(string(c.text)) + }) + )+ + &{ + // empty string is not a valid value + return types.Reduce(elements, strings.TrimSpace) != "", nil + } + { + 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()) +} + +TitleElements <- elements:(!Newline !InlineElementID TitleElement)+ { // absorbs heading and trailing spaces + return types.NewInlineElements(elements.([]interface{})) +} + +TitleElement <- element:(Word + / LineBreak // must be before spaces + / Space+ + / ElementPlaceHolder + / AnyChar) { + return element, nil +} + +// ------------------------------------------ +// Table of Contents +// ------------------------------------------ +TableOfContentsPlaceHolder <- "toc::[]" EOL + +// ------------------------------------------ +// 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) { + return types.NewUserMacroBlock(name.(string), value.(string), inlineAttributes, string(c.text)) + } + +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, string(c.text)) + } + +UserMacroName <- ([\pL0-9_-]+) { + return string(c.text), nil +} + +UserMacroValue <- [^:[ \r\n]* { + return string(c.text), nil +} + +// ------------------------------------------ +// File inclusions +// ------------------------------------------ +FileInclusion <- + incl:( + "include::" + path:(FileLocation) + inlineAttributes:(InlineAttributes) { + return types.NewFileInclusion(path.(types.Location), inlineAttributes.(types.Attributes), string(c.text)) + } + ) + Space* EOL { + 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 +} + +MultipleLineRanges <- first:(MultiLineRange / SingleLineRange) + others:( + ("," / ";") // at this point, we already got rid of the surrounding quotes, so we can accept both `,` and `;` + other:(MultiLineRange / SingleLineRange) { + return other, nil + })+ { + return append([]interface{}{first}, others.([]interface{})...), nil + } + +MultiLineRange <- start:(Number) ".." end:(Number) { // eg: lines=12..14 + return types.NewLineRange(start.(int), end.(int)) +} + +SingleLineRange <- singleline:(Number) { // eg: lines=12 + 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 +} + +MultipleTagRanges <- first:(TagRange) + others:( + ("," / ";") // at this point, we already got rid of the surrounding quotes, so we can accept both `,` and `;` + other:(TagRange) { + return other, nil + })* { + return append([]interface{}{first}, others.([]interface{})...), nil + } + +TagRange <- tag:(Alphanums / TagWildcard) { + return types.NewTagRange(tag.(string), true) +} / "!" tag:(Alphanums / TagWildcard) { + return types.NewTagRange(tag.(string), false) +} + +TagWildcard <- stars:(("*")+ { + return string(c.text), nil + }) + &{ + // use a predicate to make sure that only `*` and `**` are allowed + return len(stars.(string)) <= 2, 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{})) +} + +IncludedFileStartTag <- "tag::" tag:(Alphanums {return string(c.text), nil}) "[]" { + return types.NewIncludedFileStartTag(tag.(string)) +} + +IncludedFileEndTag <- "end::" tag:(Alphanums {return string(c.text), nil}) "[]" { + return types.NewIncludedFileEndTag(tag.(string)) +} + +// ------------------------------------------ +// Lists +// ------------------------------------------ +ListParagraph <- comment:(SingleLineComment) { + return comment, nil + } / lines:(ListParagraphLine)+ { + return types.NewParagraph(lines.([]interface{}), nil) + } + +ListParagraphLine <- !EOF + !BlankLine + !SingleLineComment + !OrderedListElementPrefix + !UnorderedListItemPrefix + !CalloutListItemPrefix + !ListItemContinuation + !BlockAttributes + !BlockDelimiter + !LabeledListItemPrefix + line:(Space* elements:(InlineElement)+ { + return types.NewInlineElements(elements.([]interface{})) + }) EOL { + return line, 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 +} + +ContinuedListItemContent <- !EOF + content:(DelimitedBlock + / SingleLineComment + / Table + / ImageBlock + / ThematicBreak + / OrderedListElement + / UnorderedListItem + / LabeledListItem + / BlankLine // must be before LiteralBlock + / LiteralBlock + / AttributeDeclaration + / AttributeReset + / TableOfContentsPlaceHolder + / UserMacroBlock + / ContinuedRawParagraph) { + return content, nil +} + +// ------------------------------------------ +// Ordered List Items +// ------------------------------------------ +OrderedListElement <- prefix:(OrderedListElementPrefix) content:(OrderedListElementContent) { + return types.NewOrderedListElement(prefix.(types.OrderedListElementPrefix), content.([]interface{}), c.globalStore.getAttributes()) +} + +OrderedListElementPrefix <- + Space* prefix:( + // implicit numbering: "." to "....." + depth:((".")+ { + // `.` is 1, etc. + return (len(c.text)), nil + }) + &{ + // use a predicate to make sure that only `.` to `.....` are allowed + return depth.(int) <= 5, nil + } + { + switch depth.(int){ + case 1: + return types.NewOrderedListElementPrefix(types.Arabic, 1) + case 2: + return types.NewOrderedListElementPrefix(types.LowerAlpha, 2) + case 3: + return types.NewOrderedListElementPrefix(types.LowerRoman, 3) + case 4: + return types.NewOrderedListElementPrefix(types.UpperAlpha, 4) + default: + return types.NewOrderedListElementPrefix(types.UpperRoman, 5) + } + } + // explicit numbering + / ([0-9])+ "." { // numbering style: "1." + return types.NewOrderedListElementPrefix(types.Arabic, 1) + } / ([a-z]) "." { // numbering style: "a." + return types.NewOrderedListElementPrefix(types.LowerAlpha, 1) + } / ([A-Z]) "." { // numbering style: "A." + return types.NewOrderedListElementPrefix(types.UpperAlpha, 1) + } / ([ivxdlcm])+ ")" { // numbering style: "i)" + return types.NewOrderedListElementPrefix(types.LowerRoman, 1) + } / ([IVXDLCM])+ ")" { // numbering style: "I)" + return types.NewOrderedListElementPrefix(types.UpperRoman, 1) + }) Space+ { + return prefix, nil +} + +OrderedListElementContent <- 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()) + } + +UnorderedListItemPrefix <- + Space* prefix:(( + // implicit numbering: "*" to "*****" + depth:(("*")+ { + // `*` is 1, etc. + return (len(c.text)), nil + }) + &{ + // use a predicate to make sure that only `*` to `*****` are allowed + return depth.(int) <= 5, nil + } + { + 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) + } + }) / depth:(("-") { + return types.NewUnorderedListItemPrefix(types.Dash, 1) + })) Space+ { + 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 + } { + return types.NewRawLine(content.(string)) + } + +RawParagraphLineContent <- [^\r\n]+ { + return string(c.text), nil +} + +// a paragraph whose first line begins with a word followed by spaces +SimpleRawParagraph <- + !{ + return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Literal), nil + } + firstLine: FirstParagraphRawLine + otherLines:(SingleLineComment / RawParagraphLine)* { + return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...), c.globalStore.getAttributes()) + } + +FirstParagraphRawLine <- + content:(elements:Word [^\r\n]* { return string(c.text), nil}) EOL { + return types.NewRawLine(content.(string)) +} + + + +// ------------------------------------------ +// Continued Paragraphs +// ------------------------------------------ + +// 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()) +} + +ContinuedRawParagraphLines <- firstLine:(FirstParagraphRawLine) otherLines:(!ListItemContinuation line:(SingleLineComment / RawParagraphLine) { return line, nil })* { + return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil +} + +// ------------------------------------------ +// Inline Elements +// ------------------------------------------ + +InlineElements <- !BlankLine + elements:(comment:(SingleLineComment) { + return types.NewInlineElements([]interface{}{comment}) + } / elements:(InlineElement)+ EOL { + return types.NewInlineElements(elements.([]interface{})) + }) { + return elements, nil + } + +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 +} + +// ---------------------------------------------------------------------------- +// Explicit line breaks +// ---------------------------------------------------------------------------- +LineBreak <- Space "+" Space* &EOL { + return types.NewLineBreak() +} + +// ---------------------------------------------------------------------------- +// Quoted Texts (bold, italic and monospace) including substitution prevention +// ---------------------------------------------------------------------------- +QuotedText <- + ( + attributes:(LongHandAttributes)? + text:(UnconstrainedQuotedText / ConstrainedQuotedText) { + return text.(types.QuotedText).WithAttributes(attributes) + } + ) + / EscapedQuotedText + +ConstrainedQuotedTextMarker <- "*" !"*" / "_" !"_" / "#" !"#" / "`" !"`" + +UnconstrainedQuotedTextPrefix <- "**" / "__" / "``" / "##" / "^" / "~" + +ConstrainedQuotedText <- + SingleQuoteBoldText + / SingleQuoteItalicText + / SingleQuoteMarkedText + / SingleQuoteMonospaceText + / SubscriptText + / SuperscriptText + +UnconstrainedQuotedText <- + DoubleQuoteBoldText + / DoubleQuoteItalicText + / DoubleQuoteMarkedText + / DoubleQuoteMonospaceText + +EscapedQuotedText <- + EscapedBoldText + / EscapedItalicText + / EscapedMarkedText + / EscapedMonospaceText + / EscapedSubscriptText + / EscapedSuperscriptText + +SubscriptOrSuperscriptPrefix <- "^" / "~" { // rule used within `words` to detect superscript or subscript portions, eg in math formulae. + return string(c.text), nil +} + +OneOrMoreBackslashes <- `\`+ { + return string(c.text), nil +} + +TwoOrMoreBackslashes <- `\\` `\`* { + return string(c.text), nil +} + +// ----------------- +// Bold text +// ----------------- + +BoldText <- DoubleQuoteBoldText / SingleQuoteBoldText // double punctuation must be evaluated first + +DoubleQuoteBoldText <- "**" elements:(DoubleQuoteBoldTextElements) "**" { + return types.NewQuotedText(types.DoubleQuoteBold, elements.([]interface{})) +} + +DoubleQuoteBoldTextElements <- DoubleQuoteBoldTextElement* + +DoubleQuoteBoldTextElement <- !("**") element:(Word + / Space // may start and end with spaces + / Newline !Newline + / QuotedString + / QuotedTextInDoubleQuoteBoldText + / ElementPlaceHolder + / DoubleQuoteBoldTextFallbackCharacter) { + return element, nil + } + +QuotedTextInDoubleQuoteBoldText <- + attributes:(LongHandAttributes)? + text:(SingleQuoteBoldText + / ItalicText + / MarkedText + / MonospaceText + / SubscriptText + / SuperscriptText) { + 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) + return types.NewStringElement(string(c.text)) + } + +SingleQuoteBoldText <- + ("*" !"*") elements:(SingleQuoteBoldTextElements) "*" &(!Alphanum) { // single punctuation cannot be followed by a character (needs '**' to emphazise a portion of a word) + 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+ + +SingleQuoteBoldTextElement <- + Word + / Newline !Newline + / QuotedString + / Space+ ('*' !'*')? + / QuotedTextInSingleQuoteBoldText + / ElementPlaceHolder + / SingleQuoteBoldTextFallbackCharacter + +QuotedTextInSingleQuoteBoldText <- + attributes:(LongHandAttributes)? + text:(DoubleQuoteBoldText + / ItalicText + / MarkedText + / MonospaceText + / SubscriptText + / SuperscriptText) { + return text.(types.QuotedText).WithAttributes(attributes) + } +SingleQuoteBoldTextFallbackCharacter <- + [^\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) + return types.NewStringElement(string(c.text)) + } + +EscapedBoldText <- + backslashes:(TwoOrMoreBackslashes) "**" elements:(DoubleQuoteBoldTextElements) "**" { // double punctuation must be evaluated first + return types.NewEscapedQuotedText(backslashes.(string), "**", elements.([]interface{})) + } / backslashes:(OneOrMoreBackslashes) "**" elements:(SingleQuoteBoldTextElements) "*" { // unbalanced `**` vs `*` punctuation + result := append([]interface{}{"*"}, elements.([]interface{})) + 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 +// ----------------- + +ItalicText <- DoubleQuoteItalicText / SingleQuoteItalicText + +DoubleQuoteItalicText <- "__" elements:(DoubleQuoteItalicTextElements) "__" { // double punctuation must be evaluated first + return types.NewQuotedText(types.DoubleQuoteItalic, elements.([]interface{})) +} + +DoubleQuoteItalicTextElements <- DoubleQuoteItalicTextElement* + +DoubleQuoteItalicTextElement <- + !("__") element:(Word + / Space // may start and end with spaces + / Newline !Newline + / QuotedString + / QuotedTextInDoubleQuoteItalicText + / ElementPlaceHolder + / DoubleQuoteItalicTextFallbackCharacter) { + return element, nil + } + +QuotedTextInDoubleQuoteItalicText <- + attributes:(LongHandAttributes)? + text:(SingleQuoteItalicText + / BoldText + / MarkedText + / MonospaceText + / SubscriptText + / SuperscriptText) { + return text.(types.QuotedText).WithAttributes(attributes) + } + +DoubleQuoteItalicTextFallbackCharacter <- + [^\r\n_] // anything except EOL and italic delimiter (fallback in case nothing else matched) + / "__" Alphanums { // or a italic delimiter when immediately followed by an alphanum (ie, in the middle of some text) + return types.NewStringElement(string(c.text)) + } + +SingleQuoteItalicText <- + ("_" !"_") elements:(SingleQuoteItalicTextElements) "_" { // single punctuation cannot be followed by a character (needs '__' to emphazise a portion of a word) + 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+ + +SingleQuoteItalicTextElement <- + Word + / Newline !Newline + / QuotedString + / Space+ ('_' !'_')? + / QuotedTextInSingleQuoteItalicText + / ElementPlaceHolder + / SingleQuoteItalicTextFallbackCharacter + +QuotedTextInSingleQuoteItalicText <- + attributes:(LongHandAttributes)? + text:(BoldText + / DoubleQuoteItalicText + / MarkedText + / MonospaceText + / SubscriptText + / SuperscriptText) { + return text.(types.QuotedText).WithAttributes(attributes) + } + +SingleQuoteItalicTextFallbackCharacter <- + [^\r\n_] // anything except EOL 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)) +} + +EscapedItalicText <- + backslashes:(TwoOrMoreBackslashes) "__" elements:(DoubleQuoteItalicTextElements) "__" { // double punctuation must be evaluated first + return types.NewEscapedQuotedText(backslashes.(string), "__", elements.([]interface{})) + } / backslashes:(OneOrMoreBackslashes) "__" elements:(SingleQuoteItalicTextElements) "_" { // unbalanced `__` vs `_` punctuation + result := append([]interface{}{"_"}, elements.([]interface{})) + 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 +// ----------------- +MonospaceText <- DoubleQuoteMonospaceText / SingleQuoteMonospaceText + +DoubleQuoteMonospaceText <- "``" elements:(DoubleQuoteMonospaceTextElements) "``" { // double punctuation must be evaluated first + return types.NewQuotedText(types.DoubleQuoteMonospace, elements.([]interface{})) +} + +DoubleQuoteMonospaceTextElements <- DoubleQuoteMonospaceTextElement* // may start and end with spaces + +DoubleQuoteMonospaceTextElement <- + !("``") element:(Word + / Space // may start and end with spaces + / Newline !Newline + / QuotedString + / RawApostrophe // must be before SingleQuoteMonospaceText + / QuotedTextInDoubleQuoteMonospaceText + / ElementPlaceHolder + / DoubleQuoteMonospaceTextFallbackCharacter) { + return element, nil + } + +QuotedTextInDoubleQuoteMonospaceText <- + attributes:(LongHandAttributes)? + text:(SingleQuoteMonospaceText + / BoldText + / ItalicText + / MarkedText + / SubscriptText + / SuperscriptText) { + return text.(types.QuotedText).WithAttributes(attributes) + } + +DoubleQuoteMonospaceTextFallbackCharacter <- + [^\r\n`] // anything except EOL and monospace delimiter (fallback in case nothing else matched) + / "``" Alphanums { // ` or a monospace delimiter when immediately followed by an alphanum (ie, in the middle of some text) + return types.NewStringElement(string(c.text)) + } + +SingleQuoteMonospaceText <- + ("`" !"`") elements:(SingleQuoteMonospaceTextElements) "`" { // single punctuation cannot be followed by a character (needs "``" to emphazise a portion of a word) + 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+ + +SingleQuoteMonospaceTextElement <- + Word + / Newline !Newline + / QuotedString + / Space+ ('`' !'`')? // allow for content such as "`some `nested monospace`". Also, do not allow for double backticks after spaces. + / QuotedTextInSingleQuoteMonospaceText + / RawApostrophe + / ElementPlaceHolder + / SingleQuoteMonospaceTextFallbackCharacter + +QuotedTextInSingleQuoteMonospaceText <- + attributes:(LongHandAttributes)? + text:(DoubleQuoteMonospaceText + / BoldText + / ItalicText + / MarkedText + / SubscriptText + / SuperscriptText) { + 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) + return types.NewStringElement(string(c.text)) + } + +EscapedMonospaceText <- + backslashes:(TwoOrMoreBackslashes) "``" elements:(DoubleQuoteMonospaceTextElements) "``" { // double punctuation must be evaluated first + return types.NewEscapedQuotedText(backslashes.(string), "``", elements.([]interface{})) + } / backslashes:(OneOrMoreBackslashes) "``" elements:(SingleQuoteMonospaceTextElements) "`" { // unbalanced "``" vs "`" punctuation + result := append([]interface{}{"`"}, elements.([]interface{})) + 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)) +} + + +// ----------------- +// Marked text +// ----------------- + +MarkedText <- DoubleQuoteMarkedText / SingleQuoteMarkedText + +DoubleQuoteMarkedText <- "##" elements:(DoubleQuoteMarkedTextElements) "##" { // double punctuation must be evaluated first + return types.NewQuotedText(types.DoubleQuoteMarked, elements.([]interface{})) +} + +DoubleQuoteMarkedTextElements <- DoubleQuoteMarkedTextElement (!("##") (Space / DoubleQuoteMarkedTextElement))* // may start and end with spaces + +DoubleQuoteMarkedTextElement <- Word + / Newline !Newline + / QuotedString + / NonDoubleQuoteMarkedText + / ElementPlaceHolder + / DoubleQuoteMarkedTextFallbackCharacter + +NonDoubleQuoteMarkedText <- + attributes:(LongHandAttributes)? + text:(BoldText + / ItalicText + / MonospaceText + / SingleQuoteMarkedText + / SubscriptText + / SuperscriptText) { + 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)) +} + +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 +} + +SingleQuoteMarkedTextElements <- !Space SingleQuoteMarkedTextElement+ + +SingleQuoteMarkedTextElement <- Word + / Newline !Newline + / QuotedString + / Space+ ('#' !'#')? + / NonSingleQuoteMarkedText + / ElementPlaceHolder + / SingleQuoteMarkedTextFallbackCharacter + +NonSingleQuoteMarkedText <- + attributes:(LongHandAttributes)? + text:(DoubleQuoteMarkedText + / BoldText + / ItalicText + / MonospaceText + / SubscriptText + / SuperscriptText) { + return text.(types.QuotedText).WithAttributes(attributes) + } +SingleQuoteMarkedTextFallbackCharacter <- + [^\r\n#] // anything except EOL 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)) +} + +EscapedMarkedText <- + backslashes:(TwoOrMoreBackslashes) "##" elements:(DoubleQuoteMarkedTextElements) "##" { // double punctuation must be evaluated first + return types.NewEscapedQuotedText(backslashes.(string), "##", elements.([]interface{})) + } / backslashes:(OneOrMoreBackslashes) "##" elements:(SingleQuoteMarkedTextElements) "#" { // unbalanced `##` vs `#` punctuation + result := append([]interface{}{"#"}, elements.([]interface{})) + return types.NewEscapedQuotedText(backslashes.(string), "#", result) + } / backslashes:(OneOrMoreBackslashes) "#" elements:(SingleQuoteMarkedTextElements) "#" { // simple punctuation must be evaluated last + return types.NewEscapedQuotedText(backslashes.(string), "#", elements.([]interface{})) +} + + +SubscriptText <- "~" element:(SubscriptTextElement) "~" { // wraps a single word + return types.NewQuotedText(types.SingleQuoteSubscript, element) +} + +SubscriptTextElement <- QuotedText / NonSubscriptText + +NonSubscriptText <- [^\r\n ~]+ { // anything except spaces, EOL or '~' + return c.text, nil +} + +EscapedSubscriptText <- backslashes:(OneOrMoreBackslashes) "~" element:(SubscriptTextElement) "~" { // 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) +} + +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 <- "+++" + +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)) +} + +// ------------------------------------------ +// 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)) + }) / + AttrSub / + ("{" { + 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 + } + "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"]) +} + +// ------------------------------------------------------------------------------------ +// 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.([]interface{})) +} / "footnote:" ref:(FootnoteRef) "[" content:(FootnoteContent)? "]" { + return types.NewFootnote(ref.(string), content) +} + +FootnoteRef <- Alphanums + +FootnoteContent <- elements:(!"]" InlineElement)+ { // footnote content may span multiple lines + return types.NewInlineElements(elements.([]interface{})) +} + +// ------------------------------------------------------------------------------------- +// Thematic break +// ------------------------------------------------------------------------------------- + +// Thematic break +ThematicBreak <- ("***" / "* * *" / "---" / "- - -" / "___" / "_ _ _") EOL { + return types.NewThematicBreak() +} + +// ------------------------------------------------------------------------------------- +// +// Delimited blocks +// +// ------------------------------------------------------------------------------------- + +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()) + } + +ExampleBlockDelimiter <- "====" Space* EOL + +ExampleBlockStartDelimiter <- "====" Space* EOL + +ExampleBlockEndDelimiter <- ("====" Space* EOL) / EOF + +ExampleBlockRawContent <- + elements:( + !ExampleBlockEndDelimiter + attributes:(BlockAttributes)? + #{ + c.globalStore.pushAttributes(attributes) + return nil + } + element:( + LabeledListItem // must appear before simple paragraph + / SimpleRawParagraph + / BlankLine + / ImageBlock + / ThematicBreak + / OrderedListElement + / 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() + 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()) + } + +QuoteBlockDelimiter <- "____" Space* EOL // same for verse blocks + +QuoteBlockStartDelimiter <- "____" Space* EOL // same for verse blocks + +QuoteBlockEndDelimiter <- ("____" Space* EOL) / EOF // same for verse blocks + +QuoteBlockRawContent <- + elements:( + !QuoteBlockEndDelimiter + attributes:(BlockAttributes)? + #{ + c.globalStore.pushAttributes(attributes) + return nil + } + element:(LabeledListItem // must appear before simple paragraph + / SimpleRawParagraph + / BlankLine + / ImageBlock + / ThematicBreak + / OrderedListElement + / 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() + 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 + +SidebarBlockRawContent <- + elements:( + !SidebarBlockEndDelimiter + attributes:(BlockAttributes)? + #{ + c.globalStore.pushAttributes(attributes) + return nil + } + element:(LabeledListItem // must appear before simple paragraph + / SimpleRawParagraph + / BlankLine + / ImageBlock + / ThematicBreak + / OrderedListElement + / 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() + return element, nil + } + )* { + return elements, nil + } + +// ------------------------------------------------------------------------------------- +// 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()) +} + +ListingBlockDelimiter <- "----" Space* EOL + +ListingBlockStartDelimiter <- "----" Space* EOL + +ListingBlockEndDelimiter <- ("----" Space* EOL) / EOF + +ListingBlockRawContent <- (!ListingBlockEndDelimiter line:(RawLine) { + return line, nil +})* + +// ------------------------------------------------------------------------------------- +// Verse blocks +// ------------------------------------------------------------------------------------- +VerseBlock <- + &{ + // AttrPositional1 must be equal to `verse` + return types.HasAttributeWithValue(c.globalStore.getAttributes(), types.AttrPositional1, types.Verse), nil + } + QuoteBlockStartDelimiter content:(VerseBlockRawContent) QuoteBlockEndDelimiter { + return types.NewVerseBlock(content.([]interface{}), c.globalStore.getAttributes()) + } + +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 + +PassthroughBlockEndDelimiter <- ("++++" Space* EOL) / EOF + +PassthroughBlockRawContent <- (!PassthroughBlockEndDelimiter line:(RawLine) { + return line, nil +})* + +// ------------------------------------------------------------------------------------- +// Comment blocks +// ------------------------------------------------------------------------------------- +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 <- !CommentBlockDelimiter "//" content:(SingleLineCommentContent) EOL { + return types.NewSingleLineComment(content.(string)) +} + +SingleLineCommentContent <- [^\r\n]* { + return string(c.text), nil +} + +// ------------------------------------------------------------------------------------- +// DelimitedBlock and Paragraph Substitutions (standalone rules) +// ------------------------------------------------------------------------------------- + +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 + +// 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 + +// 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 + +// standalone rule for the "macros" substitution for Markdown Quote blocks +MarkdownQuoteMacroSubs <- lines:(MarkdownQuoteLine)* EOF { + return types.NewParagraph(lines.([]interface{}), nil) +} + +MarkdownQuoteLine <- + elements:(InlineWord // more permissive than the 'Word' rule + / Space+ + / InlineMacros + / ElementPlaceHolder + / AnyChar)+ EOL { + return types.NewInlineElements(elements.([]interface{})) + } + +MarkdownQuoteAttribution <- "-- " author:(([^\r\n]+) { + return string(c.text), nil + }) EOL { + return author, nil +} + +// standalone rule for the "replacements" substitution +ReplacementSubs <- + (InlineWord // more permissive than the 'Word' rule + / Space+ + / Symbol + / ElementPlaceHolder + / AnyChar + / Newline)* EOF + +// 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 + +// ------------------------------------------------------------------------------------- +// Tables +// ------------------------------------------------------------------------------------- +Table <- TableDelimiter + header:(TableLineHeader)? + lines:(TableLine)* + (TableDelimiter / EOF) { // end delimiter or end of file + return types.NewTable(header, lines.([]interface{}), c.globalStore.getAttributes()) + } + +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{})) +} + +TableLine <- !TableDelimiter cells:(TableCell)+ EOL BlankLine* { + return types.NewTableLine(cells.([]interface{})) +} + +TableCell <- TableCellSeparator elements:(!TableCellSeparator !EOL Space* InlineElement Space*)+ { + return types.NewInlineElements(elements) +} + +// ------------------------------------------------------------------------------------- +// Literal Blocks (see http://asciidoctor.org/docs/user-manual/#literal-text-and-blocks) +// ------------------------------------------------------------------------------------- +LiteralBlock <- ParagraphWithLiteralAttribute / ParagraphWithHeadingSpaces / ParagraphWithLiteralBlockDelimiter + +LiteralBlockDelimiter <- "...." + +// paragraph indented with one or more spaces on the first line +ParagraphWithHeadingSpaces <- lines:(ParagraphWithHeadingSpacesLines) { + return types.NewLiteralBlock(types.LiteralBlockWithSpacesOnFirstLine, lines.([]interface{}), c.globalStore.getAttributes()) +} + +// 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 +} + +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 +} + +// 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()) +} + +// include all lines until delimiter is reached +ParagraphWithLiteralBlockDelimiterLines <- lines:(ParagraphWithLiteralBlockDelimiterLine)* { + return lines.([]interface{}), nil +} + +ParagraphWithLiteralBlockDelimiterLine <- + line:(!LiteralBlockDelimiter [^\r\n]* { + return types.NewRawLine(string(c.text)) + }) EOL { + return line, nil // do not include the trailing 'EOL' +} + +// paragraph with the literal attribute (`[literal]`) +ParagraphWithLiteralAttribute <- + &{ + attrs := c.globalStore.getAttributes() + return types.HasAttributeWithValue(attrs, types.AttrPositional1, types.Literal), nil + } + lines:(LiteralParagraphLine)+ { + return types.NewLiteralBlock(types.LiteralBlockWithAttribute, lines.([]interface{}), c.globalStore.getAttributes()) + } + +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) + } + +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. + +ImpliedApostrophe <- Alphanum "'" &[\pL] { + return types.NewStringElement(string(c.text[:1])+"\u2019") +} + +// ------------------------------------------------------------------------------------ +// Special Characters +// They need to be identified as they may have a special treatment during the rendering +// ------------------------------------------------------------------------------------ + +SpecialCharacter <- InternalCrossReference { + // if we have a InternalCrossReference we just return a StringElement. + return types.NewStringElement(string(c.text)) + } / ("<" / ">" / "&" ) { + return types.NewSpecialCharacter(string(c.text)) + } + +// ------------------------------------------ +// Base Types +// ------------------------------------------ +Alphanum <- [\pL0-9] + +Parenthesis <- "(" / ")" / "[" / "]" / "{" / "}" + +Alphanums <- [\pL0-9]+ { + return string(c.text), nil +} + +Word <- + // very straightforward content: alphanums followed by attached simple 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) { + 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) { + return types.NewStringElement(string(c.text)) + } / Word + +// 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)) +} + +FileLocation <- path:(Filename / ElementPlaceHolder)+ { + return types.NewLocation("", path.([]interface{})) +} + +Location <- 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)) +} + +Scheme <- "http://" / "https://" / "ftp://" / "irc://" / "mailto:" + +Id <- [^[\]<>,]+ { // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ + return string(c.text), nil +} + +Digit <- [0-9] { + return string(c.text), nil +} + +Number <- "-"? Digit+ { + return strconv.Atoi(string(c.text)) +} + +Space <- " " / "\t" { + return string(c.text), nil +} + +Newline <- "\r\n" / "\r" / "\n" + +EOF <- !. + +EOL <- Newline / EOF \ No newline at end of file diff --git a/pkg/parser/parser.peg b/pkg/parser/parser.peg index 0b3b77f3..7666dc58 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,127 @@ 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 <- - !EOF +// ------------------------------------------------------------------------------------- +// Document Fragments +// ------------------------------------------------------------------------------------- +DocumentFragment <- attributes:(BlockAttributes)? - #{ - c.globalStore.pushAttributes(attributes) - return nil - } - block:( - LabeledListItem // must appear before simple paragraph - / SimpleRawParagraph - / BlankLine // must be before LiteralBlock - / Section + element:( + FrontMatter + / DocumentHeader + / BlankLine + / AttributeDeclaration + / AttributeReset / DelimitedBlock + / Section // must appear after delimited block (because of example delimiter) + / ThematicBreak // must appear before ListElement :/ + / ListElements / ImageBlock - / SingleLineComment + / FileInclusion / Table - / ThematicBreak - / OrderedListItem - / UnorderedListItem - / CalloutListItem - / ContinuedListItemElement - / LiteralBlock - / AttributeDeclaration - / AttributeReset - / TableOfContentsPlaceHolder + / SingleLineComment + / AdmonitionParagraph + / LiteralParagraph / UserMacroBlock - / RawParagraph - / EOF { // for standalone attributes at the end of the doc - return types.NewStandaloneAttributes(c.globalStore.getAttributes()) // will be discarded anyways - } + / 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) -} - -// "<" marks the beginning of the author email, and ";" is the authors separator -DocumentAuthorName <- [^<;\r\n]+ { - return string(c.text), 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 +143,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 +186,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 +205,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 @@ -320,7 +229,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 +242,13 @@ FirstPositionalAttributes <- ShortHandAttribute )? extras:( - ShortHandIDAttribute - / ShortHandOptionAttribute - / ShortHandDotRoleAttribute + !"," !"]" + extra:( + ShortHandIDAttribute + / ShortHandOptionAttribute + / ShortHandDotRoleAttribute) { + return extra, nil + } )* ("," Space*)? &{ // make sure there was a match @@ -344,50 +259,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 +313,681 @@ 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 <- Space "+" 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 +999,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 +1021,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 +1033,362 @@ 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{})) + }) { + 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 + / LineBreak // must be before spaces + / Spaces + / !EOL ( + SpecialCharacter + / Quote + / AttributeSubstitution + / Replacement + / InlineMacro + / PostReplacement + / ElementPlaceHolder // TODO: needed? + // if anything above did not match... + / AnyChar)) { + 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.(types.InlineElements)) } -// ------------------------------------------ -// Ordered List Items -// ------------------------------------------ -OrderedListItem <- prefix:(OrderedListItemPrefix) content:(OrderedListItemContent) { - return types.NewOrderedListItem(prefix.(types.OrderedListItemPrefix), content.([]interface{}), c.globalStore.getAttributes()) +IndexTermContent <- elements:(Word / QuotedString / QuotedText / Space / SpecialCharacter / ElementPlaceHolder / (!"))" .) { + return string(c.text), nil +})+ { + return types.NewInlineElements(elements.([]interface{})) } -OrderedListItemPrefix <- +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 +} + +// ------------------------------------------------------------------------------------- +// 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:(FirstListElement) + otherElements:(OtherListElements) { + return types.NewListElements(append([]interface{}{firstElement}, otherElements.([]interface{})...)) + } + +FirstListElement <- + OrderedListElement + / UnorderedListElement + / CalloutListElement + / LabeledListElement + +OtherListElements <- otherElements:OtherListElement* { + return types.Flatten(otherElements.([]interface{})), nil +} + +OtherListElement <- // 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 + attributes:(BlockAttributes)? + element:( + BlankLine + / AttributeDeclaration + / AttributeReset + / DelimitedBlock + / ThematicBreak // must appear before ListElement :/ + / ListElements + / 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 +1402,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 +1452,199 @@ 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:( +UnorderedListElementCheckStyle <- + &"[" style:( "[ ]" { return types.Unchecked, nil } / "[*]" { return types.Checked, nil } / "[x]" { return types.Checked, nil } - ) Space+ { + ) Spaces { 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{})) -} +// ------------------------ +// Labelled list elements +// ------------------------ +LabeledListElement <- + term:(LabeledListElementTerm) + separator:(LabeledListElementSeparator) + description:(LabeledListElementDescription) + { + return types.NewLabeledListElement(len(separator.(string)) - 1, term, description) + } -// ------------------------------------------ -// 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 -} +LabeledListElementTerm <- + (!LabeledListElementSeparator !EOL .)+ { + return types.NewRawLine(string(c.text)) + } -// ------------------------------------------ -// 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 +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 <- +// ( +// Space* EOL { // no description on the same line as the term and separate +// return nil, nil +// } +// ) +// / ( +// Spaces // trim spaces right after delimiter +// content:([^\r\n]+ { +// return types.NewRawLine(string(c.text)) +// }) +// EOL { +// return types.NewParagraph(content) +// } +// ) + +LabeledListElementDescription <- + ( + // no description on the same line as the term and separate + Space* EOL + BlankLine* + content:(ListElementParagraphLine)? { + if content == nil { + return nil, nil + } + return types.NewParagraph(content) + } + ) / ( + // description on the same line + 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 + } -// ------------------------------------------ -// Continued Paragraphs -// ------------------------------------------ +CalloutListElementContent <- + rawline:([^\r\n]+ { + return string(c.text), nil + }) + EOL { + return types.NewRawLine(rawline.(string)) + } -// 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()) -} +// ----------------------------------------------------------------------------------------------------------------------- +// Paragraphs +// ----------------------------------------------------------------------------------------------------------------------- +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 +1660,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 +1807,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 <- "_" -DoubleQuoteItalicTextElements <- DoubleQuoteItalicTextElement* +ItalicTextWord <- + [\pL0-9]+ &(Space / ItalicTextDelimiter) { + return types.NewStringElement(string(c.text)) + } -DoubleQuoteItalicTextElement <- - !("__") element:(Word - / Space // may start and end with spaces - / Newline !Newline - / QuotedString - / QuotedTextInDoubleQuoteItalicText - / ElementPlaceHolder - / DoubleQuoteItalicTextFallbackCharacter) { - return element, nil +// --------------------------------- +// Italic text within double quotes +// --------------------------------- +DoubleQuoteItalicTextDelimiter <- "__" + +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 +1861,7 @@ QuotedTextInDoubleQuoteItalicText <- / MonospaceText / SubscriptText / SuperscriptText) { - return text.(types.QuotedText).WithAttributes(attributes) + return text.(*types.QuotedText).WithAttributes(attributes) } DoubleQuoteItalicTextFallbackCharacter <- @@ -1169,20 +1870,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 +1914,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 +1931,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 +1995,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 +2036,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 +2060,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 +2186,708 @@ 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)+ { + return types.Merge(elements), nil + } -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 + / Newline !Newline // 2 newlines split the paragraph + / AttributeSubstitution + / SpecialCharacter + / InlineMacro + / LineBreak !SingleQuoteStringEnd // must be before spaces + / Space !SingleQuoteStringEnd + / Symbol + / QuotedTextInSingleQuotedString + / DoubleQuotedString + / SingleQuotedStringFallbackCharacter + ) { + 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+) { + return types.Merge(elements), nil + } -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 + / LineBreak !SingleQuoteStringEnd // must be before spaces + / Space !DoubleQuoteStringEnd + / Newline !Newline // 2 newlines split the paragraph + / AttributeSubstitution + / SpecialCharacter + / InlineMacro + / QuotedTextInDoubleQuotedString + / SingleQuotedString + / DoubleQuotedStringFallbackCharacter) { + 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]* { + 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.Merge(elements), nil } -ExampleBlockDelimiter <- "====" Space* EOL - -ExampleBlockStartDelimiter <- "====" Space* EOL +// Substitution group element attributes +ElementAttributesGroup <- elements:( + InlineWord + / AttributeSubstitution + / Quote + / SpecialCharacter + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / AnyChar)+ EOF { + return types.Merge(elements), nil + } -ExampleBlockEndDelimiter <- ("====" Space* EOL) / EOF +// Default substitutions for Section Titles +HeaderGroup <- + elements:(HeaderGroupElement)+ EOF { + return types.Merge(elements), nil + } -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 +// 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.Merge(elements), nil } - QuoteBlockStartDelimiter content:(QuoteBlockRawContent) QuoteBlockEndDelimiter { - return types.NewQuoteBlock(content.([]interface{}), c.globalStore.getAttributes()) - } - -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.Merge(elements), nil + } -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 { + return types.Merge(elements), nil + } -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 + / LineBreak // must appear before space :/ + / Space + / Newline + / Quote + / InlinePassthrough + / InlineMacro // must be before 'specialcharacter' (because of 'crossreference') + / SpecialCharacter + / AttributeSubstitution + / Replacement + / PostReplacement + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / AnyChar) { return element, nil } - )* { - return elements, nil +PostReplacementsGroup <- elements:( + InlineWord + / LineBreak // must appear before space :/ + / Space + / Newline + / ElementPlaceHolder // needed when parsing a second time, after first pass returned attribute substitutions + / AnyChar)+ EOF { + return types.Merge(elements), nil } -// ------------------------------------------------------------------------------------- -// 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()) -} - -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.Merge(elements), nil + } -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.Merge(elements), nil + } -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.Merge(elements), nil + } -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.Merge(elements), nil + } + +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 +PostReplacement <- + // check if enabled with the current substitution context + &{ + return c.isSubstitutionEnabled(PostReplacements) + } + element:( + LineBreak + ) { + return element, nil + } -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 -TableDelimiter <- "|===" Space* EOL - -// table line header is a line followed by a blankline -TableLineHeader <- !TableDelimiter cells:(TableCell)+ EOL BlankLine { - return types.NewTableLine(cells.([]interface{})) -} - -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, 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, 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)) - } / Word + }) + &(Space / "." / Alphanum / ElementPlaceHolderDelimiter / EOL) { + return content, nil + } + / Word + / Punctuation + +Punctuation <- ("." / "," / ";" / "!" / "?") &(Space / EOL) { + return types.NewString(string(c.text)) +} // 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{})) -} + 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.Merge(elements.([]interface{})...), nil + } 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)) -} + return strconv.Atoi(string(c.text)) + } Space <- " " / "\t" { - return string(c.text), nil -} + return string(c.text), nil + } + +Spaces <- (" " / "\t")+ { + return string(c.text), nil + } -Newline <- "\r\n" / "\r" / "\n" +Newline <- "\n" / "\r\n" / "\r" { // TODO: just use "\n" + return types.NewStringElement(string(c.text)) +} EOF <- !. -EOL <- Newline / EOF \ No newline at end of file +// TODO: remove and use `EOF` instead? +EOL <- EOF / Newline \ 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..f54cad45 --- /dev/null +++ b/pkg/parser/parser_ext.go @@ -0,0 +1,119 @@ +package parser + +import ( + "errors" + "fmt" + "sort" + "strings" + + "github.com/bytesparadise/libasciidoc/pkg/types" + 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() +} + +// 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..8425daba 100644 --- a/pkg/renderer/sgml/blank_line.go +++ b/pkg/renderer/sgml/blank_line.go @@ -6,7 +6,7 @@ import ( "github.com/bytesparadise/libasciidoc/pkg/types" ) -func (r *sgmlRenderer) renderBlankLine(ctx *Context, _ types.BlankLine) (string, error) { +func (r *sgmlRenderer) renderBlankLine(ctx *Context, _ *types.BlankLine) (string, error) { return "", 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..e85b633c 100644 --- a/pkg/renderer/sgml/elements.go +++ b/pkg/renderer/sgml/elements.go @@ -13,7 +13,7 @@ func (r *sgmlRenderer) renderElements(ctx *renderer.Context, elements []interfac // 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 { + 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:]) @@ -47,12 +47,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 +64,70 @@ 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: + 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.VerbatimLine: + // return r.renderVerbatimLine(e) + 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.AttributeSubstitution: + return r.renderAttributeSubstitution(ctx, e) default: return "", errors.Errorf("unsupported type of element: %T", element) } @@ -152,27 +138,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/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..f9336b23 100644 --- a/pkg/renderer/sgml/html5/section.go +++ b/pkg/renderer/sgml/html5/section.go @@ -2,17 +2,18 @@ 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 = "
\n" + + // "{{ .Header }}" + + // "{{ if eq .Level 1 }}
\n{{ end }}" + + // "{{ .Content }}" + + // "{{ if eq .Level 1 }}
\n{{ end }}" + + // "
\n" + sectionContentTmpl = `
+{{ .Header }}{{ if eq .Level 1 }}
+{{ end }}{{ .Content }}{{ if eq .Level 1 }}
+{{ end }}
+` + // sectionHeaderTmpl = "{{ .Content }}\n" + 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..3a0edfa0 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,64 @@ 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) + +// func (r *sgmlRenderer) withVerbatim() lineRendererOption { +// return func(lr *lineRenderer) { +// lr.render = r.renderPlainText +// } +// } // 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..03294b9e 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,7 +411,7 @@ 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{} } @@ -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..dd793021 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,27 +174,73 @@ 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) + result.AddAll(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) + // if log.IsLevelEnabled(log.DebugLevel) { + // log.Debugf("new attributes: %s", spew.Sdump(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 } +// NilIfEmpty returns `nil` if this `attributes` is empty +func (a Attributes) AddAll(others Attributes) Attributes { + if others == nil { + return a + } + if a == nil { + a = Attributes{} + } + for k, v := range others { + a.Set(k, v) + } + return a +} + +// NilIfEmpty returns `nil` if this `attributes` is empty +func (a Attributes) NilIfEmpty() Attributes { + if len(a) == 0 { + return nil + } + return a +} + func toAttributes(attrs interface{}) Attributes { if attrs, ok := attrs.(Attributes); ok { return attrs @@ -198,13 +250,12 @@ func toAttributes(attrs interface{}) Attributes { 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 +263,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 { @@ -233,7 +284,6 @@ func toAttributesWithMapping(attrs interface{}, mapping map[string]string) Attri } return attrs } - return nil } @@ -309,7 +359,7 @@ func toAttributesWithMapping(attrs interface{}, mapping map[string]string) Attri // 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,7 +382,7 @@ 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: + case *Attribute: if a.Key == key { return false } @@ -357,78 +407,74 @@ 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{ + // if log.IsLevelEnabled(log.DebugLevel) { + // // log.Debugf("new named attribute '%s':", key) + // spew.Fdump(log.StandardLogger().Out, value) + // } + 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) { +func NewInlineIDAttribute(id string) (*Attribute, error) { // log.Debugf("initializing a new inline ElementID with ID=%s", id) - return Attribute{ + 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{ + // log.Debugf("new role attribute: '%v'", spew.Sdump(role)) + 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) { +func NewIDAttribute(id interface{}) (*Attribute, error) { // log.Debugf("initializing a new ID attribute with ID='%v'", id) - return Attribute{ + return &Attribute{ Key: AttrID, Value: id, }, nil @@ -436,27 +482,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 +518,17 @@ func (a Attributes) Set(key string, value interface{}) Attributes { default: a[key] = value } - if log.IsLevelEnabled(log.DebugLevel) { - spew.Fdump(log.StandardLogger().Out, a) + // 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 +585,34 @@ func (a Attributes) GetAsString(key string) (string, bool, error) { return "", false, nil } +// GetAsInt gets the int value for the given key (+ `true`), +// or empty string (+ `false`) if none was found, +// or an error if the value could not be converted to an integer +func (a Attributes) GetAsInt(key string) (int, bool, error) { + if value, found := a[key].(int); found { + return value, true, nil + } + if value, found := a[key].(string); found { + result, err := strconv.Atoi(value) + return result, true, err + } + return -1, 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: 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..57b1121d 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -9,100 +9,85 @@ 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 -} +// // 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 -} +// 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 -} +// 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 -// ------------------------------------------ +// var _ Stringer = RawSection{} -// 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 -} +// // 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 +// } // ------------------------------------------ // common interfaces @@ -113,23 +98,23 @@ 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{} -} +// // 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{} -} +// // 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{} -} +// // 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 @@ -137,71 +122,99 @@ type RawText interface { RawText() (string, error) } +// BlockWithAttributes base interface for types on which attributes can be substituted +type BlockWithAttributes interface { + GetAttributes() Attributes + AddAttributes(Attributes) + SetAttributes(Attributes) +} + +type WithElementAddition interface { + // WithElements + CanAddElement(interface{}) bool + AddElement(interface{}) error +} +type BlockWithElements interface { + BlockWithAttributes + GetElements() []interface{} + SetElements([]interface{}) error + // WithElementAddition +} + +type BlockWithLocation interface { + BlockWithAttributes + GetLocation() *Location + SetLocation(*Location) // TODO: unused? +} + // ------------------------------------------ // Substitution support // ------------------------------------------ -// WithCustomSubstitutions base interface for types on which custom substitutions apply -type WithCustomSubstitutions interface { - SubstitutionsToApply() ([]string, error) - DefaultSubstitutions() []string +// DocumentFragment a single fragment of document +type DocumentFragment struct { + Elements []interface{} + Error error } -// WithAttributesToSubstitute base interface for types on which attributes can be substituted -type WithAttributesToSubstitute interface { - AttributesToSubstitute() Attributes - ReplaceAttributes(Attributes) interface{} +func NewDocumentFragment(elements ...interface{}) DocumentFragment { + return DocumentFragment{ + Elements: elements, + } } -// WithElementsToSubstitute interface for types on which elements can be substituted -type WithElementsToSubstitute interface { - ElementsToSubstitute() []interface{} - ReplaceElements([]interface{}) interface{} +func NewErrorFragment(err error) DocumentFragment { + return DocumentFragment{ + Error: err, + } } -// WithLineSubstitution interface for types on which lines can be substituted -type WithLineSubstitution interface { - WithCustomSubstitutions - LinesToSubstitute() [][]interface{} - SubstituteLines([][]interface{}) interface{} -} +// type RawBlock interface { +// AddLine(l RawLine) +// } -// WithNestedElementSubstitution a block in which nested elements can be substituted -type WithNestedElementSubstitution interface { - WithCustomSubstitutions - WithElementsToSubstitute -} +// type RawParagraph struct { +// Attributes Attributes +// Lines []interface{} +// } -var defaultSubstitutionsForBlockElements = []string{ - "inline_passthrough", - "specialcharacters", - "quotes", - "attributes", - "replacements", - "macros", - "post_replacements", -} -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 +// func NewRawParagraph(attributes Attributes) *RawParagraph { +// return &RawParagraph{ +// Attributes: attributes, +// Lines: []interface{}{}, +// } +// } -// blocks of lines -var defaultSubstitutionsForBlockLines = []string{ - "callouts", // must be executed before "specialcharacters" - "specialcharacters", -} -var defaultFencedBlockSubstitutions = defaultSubstitutionsForBlockLines -var defaultListingBlockSubstitutions = defaultSubstitutionsForBlockLines -var defaultLiteralBlockSubstitutions = defaultSubstitutionsForBlockLines +// var _ RawBlock = &RawParagraph{} -// other blocks -var defaultPassthroughBlockSubstitutions = []string{} +// func (p *RawParagraph) AddLine(l RawLine) { +// p.Lines = append(p.Lines, l) +// } + +// type RawDelimitedBlock struct { +// Attributes Attributes +// Kind string +// Lines []RawLine +// } + +// func NewRawDelimitedBlock(kind string, attributes Attributes) *RawDelimitedBlock { +// return &RawDelimitedBlock{ +// Attributes: attributes, +// Kind: kind, +// Lines: []RawLine{}, +// } +// } + +// // var _ RawBlock = &RawDelimitedBlock{} + +// func (b *RawDelimitedBlock) AddLine(l RawLine) { +// b.Lines = append(b.Lines, l) +// } // ------------------------------------------ // Draft Document: document in which // all substitutions have been applied +// DEPRECATED // ------------------------------------------ // DraftDocument the linear-level structure for a document @@ -217,30 +230,43 @@ 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) CanAddElement(element interface{}) bool { + return true +} + +func (d *Document) AddElement(element interface{}) error { + d.Elements = append(d.Elements, element) + return nil } // ------------------------------------------ @@ -252,13 +278,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 +299,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 +348,126 @@ 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, + }) + } + + } + for _, attr := range extraAttrs { + switch attr := attr.(type) { + case *AttributeDeclaration, *AttributeReset: + elements = append(elements, attr) + default: + return nil, fmt.Errorf("unexpected type of attribute declaration in the document header: '%T'", attr) + } + } + 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 +476,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 +592,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 +622,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,54 +658,29 @@ 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 { + // if log.IsLevelEnabled(log.DebugLevel) { + // // log.Debugf("new AttributeDeclaration: '%s'", name) + // spew.Fdump(log.StandardLogger().Out, value) + // } + return &AttributeDeclaration{ Name: name, Value: value, - }, nil + } } -var _ Stringer = AttributeDeclaration{} +var _ Stringer = &AttributeDeclaration{} // Stringify returns the string representation of this attribute declaration, as it existed in the source document -func (a AttributeDeclaration) Stringify() string { +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 + "}") - } - } - } + result.WriteString(stringify(a.Value)) 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{} { +func (a *AttributeDeclaration) ReplaceElements(value []interface{}) interface{} { a.Value = Reduce(value, strings.TrimSpace) return a } @@ -434,9 +691,9 @@ type AttributeReset struct { } // 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 +701,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 +721,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 { @@ -497,354 +754,348 @@ func NewStandaloneAttributes(attributes interface{}) (StandaloneAttributes, erro } // ------------------------------------------ -// 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%