diff --git a/go.mod b/go.mod index 8ca1aab7..43a9d27b 100644 --- a/go.mod +++ b/go.mod @@ -5,10 +5,12 @@ go 1.11 require ( github.com/alecthomas/chroma v0.7.1 github.com/davecgh/go-spew v1.1.1 - github.com/golangci/golangci-lint v1.25.1 // indirect - github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/mna/pigeon v1.0.1-0.20190909211542-7ee56e19b15c + github.com/golang/protobuf v1.3.2 // indirect + github.com/kr/text v0.2.0 // indirect + github.com/mattn/go-isatty v0.0.8 // indirect + github.com/mna/pigeon v1.0.1-0.20200224192238-18953b277063 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.12.0 github.com/onsi/gomega v1.9.0 github.com/pkg/errors v0.8.1 @@ -16,6 +18,10 @@ require ( github.com/sirupsen/logrus v1.4.2 github.com/sozorogami/gover v0.0.0-20171022184752-b58185e213c5 github.com/spf13/cobra v0.0.5 + github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/testify v1.5.1 // indirect golang.org/x/text v0.3.2 // indirect + golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770 // indirect + gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/yaml.v2 v2.2.8 ) diff --git a/go.sum b/go.sum index 9ed3af17..45506ca8 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,5 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OpenPeeDeeP/depguard v1.0.1 h1:VlW4R6jmBIv3/u1JNlawEvJMM4J+dPORPaZasQee8Us= -github.com/OpenPeeDeeP/depguard v1.0.1/go.mod h1:xsIw86fROiiwelg+jB2uM9PiKihMMmUx/1V+TNhjQvM= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U= github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI= github.com/alecthomas/chroma v0.7.1 h1:G1i02OhUbRi2nJxcNkwJaY/J1gHXj9tt72qN6ZouLFQ= @@ -14,350 +9,116 @@ github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBo github.com/alecthomas/kong v0.2.1-0.20190708041108-0548c6b1afae/go.mod h1:+inYUSluD+p4L8KdviBSgzcqEjUQOfC5fQDRFuc36lI= github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkxI1zYWl1QLnEqAqEARBEYa8FQnQcY= github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/bombsimon/wsl/v3 v3.0.0 h1:w9f49xQatuaeTJFaNP4SpiWSR5vfT6IstPtM62JjcqA= -github.com/bombsimon/wsl/v3 v3.0.0/go.mod h1:st10JtZYLE4D5sC7b8xV4zTKZwAQjCH/Hy2Pm1FNZIc= -github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 h1:y5HC9v93H5EPKqaS1UYVg1uYah5Xf51mBfIoWehClUQ= github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964/go.mod h1:Xd9hchkHSWYkEqJwUGisez3G1QY8Ryz0sdWrLPMGjLk= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= 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 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= 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/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-critic/go-critic v0.4.1 h1:4DTQfT1wWwLg/hzxwD9bkdhDQrdJtxe6DUTadPlrIeE= -github.com/go-critic/go-critic v0.4.1/go.mod h1:7/14rZGnZbY6E38VEGk2kVhoq6itzc1E68facVDK23g= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-lintpack/lintpack v0.5.2 h1:DI5mA3+eKdWeJ40nU4d6Wc26qmdG8RCi/btYq0TuRN0= -github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM= -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-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= -github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-toolsmith/astcast v1.0.0 h1:JojxlmI6STnFVG9yOImLeGREv8W2ocNUM+iOhR6jE7g= -github.com/go-toolsmith/astcast v1.0.0/go.mod h1:mt2OdQTeAQcY4DQgPSArJjHCcOwlX+Wl/kwN+LbLGQ4= -github.com/go-toolsmith/astcopy v1.0.0 h1:OMgl1b1MEpjFQ1m5ztEO06rz5CUd3oBv9RF7+DyvdG8= -github.com/go-toolsmith/astcopy v1.0.0/go.mod h1:vrgyG+5Bxrnz4MZWPF+pI4R8h3qKRjjyvV/DSez4WVQ= -github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= -github.com/go-toolsmith/astequal v1.0.0 h1:4zxD8j3JRFNyLN46lodQuqz3xdKSrur7U/sr0SDS/gQ= -github.com/go-toolsmith/astequal v1.0.0/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= -github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg= -github.com/go-toolsmith/astfmt v1.0.0 h1:A0vDDXt+vsvLEdbMFJAUBI/uTbRw1ffOPnxsILnFL6k= -github.com/go-toolsmith/astfmt v1.0.0/go.mod h1:cnWmsOAuq4jJY6Ct5YWlVLmcmLMn1JUPuQIHCY7CJDw= -github.com/go-toolsmith/astinfo v0.0.0-20180906194353-9809ff7efb21/go.mod h1:dDStQCHtmZpYOmjRP/8gHHnCCch3Zz3oEgCdZVdtweU= -github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk= -github.com/go-toolsmith/astp v1.0.0 h1:alXE75TXgcmupDsMK1fRAy0YUzLzqPVvBKoyWV+KPXg= -github.com/go-toolsmith/astp v1.0.0/go.mod h1:RSyrtpVlfTFGDYRbrjyWP1pYu//tSFcvdYrA8meBmLI= -github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks= -github.com/go-toolsmith/pkgload v1.0.0/go.mod h1:5eFArkbO80v7Z0kdngIxsRXRMTaX4Ilcwuh3clNrQJc= -github.com/go-toolsmith/strparse v1.0.0 h1:Vcw78DnpCAKlM20kSbAyO4mPfJn/lyYA4BJUDxe2Jb4= -github.com/go-toolsmith/strparse v1.0.0/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= -github.com/go-toolsmith/typep v1.0.0 h1:zKymWyA1TRYvqYrYDrfEMZULyrhcnGY3x7LDKU2XQaA= -github.com/go-toolsmith/typep v1.0.0/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= -github.com/go-xmlfmt/xmlfmt v0.0.0-20191208150333-d5b6f63a941b/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= -github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= -github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b h1:ekuhfTjngPhisSjOJ0QWKpPQE8/rbknHaes6WVJj5Hw= -github.com/gofrs/flock v0.0.0-20190320160742-5135e617513b/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= -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= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6 h1:YYWNAGTKWhKpcLLt7aSj/odlKrSrelQwlovBpDuf19w= -github.com/golangci/errcheck v0.0.0-20181223084120-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0= -github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613 h1:9kfjN3AdxcbsZBf8NjltjWihK2QfBBBZuv91cMFfDHw= -github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= -github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3 h1:pe9JHs3cHHDQgOFXJJdYkK6fLz2PWyYtP4hthoCMvs8= -github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o= -github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee h1:J2XAy40+7yz70uaOiMbNnluTg7gyQhtGqLQncQh+4J8= -github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= -github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a h1:iR3fYXUjHCR97qWS8ch1y9zPNsgXThGwjKPrYfqMPks= -github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= -github.com/golangci/golangci-lint v1.25.1 h1:VvdxIp+kVM2GD5USkojH5dlikO9nPEvf1AIeeO5WAIo= -github.com/golangci/golangci-lint v1.25.1/go.mod h1:YhVfe+viTAbvB1UZ2+ck+ixDMWMyPznl9h+dtdjUVnU= -github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc h1:gLLhTLMk2/SutryVJ6D4VZCU3CUqr8YloG7FPIBWFpI= -github.com/golangci/ineffassign v0.0.0-20190609212857-42439a7714cc/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= -github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770 h1:EL/O5HGrF7Jaq0yNhBLucz9hTuRzj2LdwGBOaENgxIk= -github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= -github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21 h1:leSNB7iYzLYSSx3J/s5sVf4Drkc68W2wm4Ixh/mr0us= -github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI= -github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0 h1:HVfrLniijszjS1aiNg8JbBMO2+E1WIQ+j/gL4SQqGPg= -github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= -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/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3 h1:JVnpOZS+qxli+rgVl98ILOXVNbW+kb5wcxeGx8ShUIw= -github.com/gostaticanalysis/analysisutil v0.0.0-20190318220348-4088753ea4d3/go.mod h1:eEOZF4jCKGi+aprrirO9e7WKB3beBRtWgqGunKl6pKE= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a h1:GmsqmapfzSJkm28dhRoHz2tLRbJmqhU86IPgBtN3mmk= -github.com/jingyugao/rowserrcheck v0.0.0-20191204022205-72ab7603b68a/go.mod h1:xRskid8CManxVta/ALEhJha/pweKBaVG6fWgc0yH25s= -github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3 h1:jNYPNLe3d8smommaoQlK7LOA5ESyUJJ+Wf79ZtA7Vp4= -github.com/jirfag/go-printf-func-name v0.0.0-20191110105641-45db9963cdd3/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= -github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.4.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/compress v1.4.1/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= -github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= -github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/maratori/testpackage v1.0.1 h1:QtJ5ZjqapShm0w5DosRjg0PRlSdAdlx+W6cCKoALdbQ= -github.com/maratori/testpackage v1.0.1/go.mod h1:ddKdw+XG0Phzhx8BFDTKgpWP4i7MpApTE5fXSKAqwDU= -github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb h1:RHba4YImhrUVQDHUCe2BNSOz4tVy2yGyXhvYDvxGgeE= -github.com/matoous/godox v0.0.0-20190911065817-5d6d842e92eb/go.mod h1:1BELzlh859Sh1c6+90blK8lbYy0kwQf1bYlBhBysy1s= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= -github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-ps v0.0.0-20190716172923-621e5597135b/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk= 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.20190909211542-7ee56e19b15c h1:QRaadf9Fu8xAfNDS8PvaM0VmY2FnYHlddtnIExKj68k= -github.com/mna/pigeon v1.0.1-0.20190909211542-7ee56e19b15c/go.mod h1:rkFeDZ0gc+YbnrXPw0q2RlI0QRuKBBPu67fgYIyGRNg= +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/modocache/gover v0.0.0-20171022184752-b58185e213c5 h1:8Q0qkMVC/MmWkpIdlvZgcv2o2jrlF6zqVOh7W5YHdMA= github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -github.com/mozilla/tls-observatory v0.0.0-20200220173314-aae45faa4006/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nakabonne/nestif v0.3.0 h1:+yOViDGhg8ygGrmII72nV9B/zGxY188TYpfolntsaPw= -github.com/nakabonne/nestif v0.3.0/go.mod h1:dI314BppzXjJ4HsCnbo7XzrJHPszZsjnk5wEBSYHI2c= -github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d h1:AREM5mwr4u1ORQBMvzfzBgpsctsbQikCVpvC+tX285E= -github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -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.10.1 h1:q/mM8GF/n0shIN8SaAZ0V+jnLPzen6WIVZdiwrRlMlo= -github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= -github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d/go.mod h1:3OzsM7FXDQlpCiw2j81fOmAwQLnZnLGXVKUzeKQXIAw= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= -github.com/quasilyte/go-consistent v0.0.0-20190521200055-c6f3937de18c/go.mod h1:5STLWrekHfjyYwxBRVRXNOSewLJ3PWfDJd1VyTS21fI= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/ryancurrah/gomodguard v1.0.4 h1:oCreMAt9GuFXDe9jW4HBpc3GjdX3R/sUEcLAGh1zPx8= -github.com/ryancurrah/gomodguard v1.0.4/go.mod h1:9T/Cfuxs5StfsocWr4WzDL36HqnX0fVb9d5fSEaLhoE= -github.com/securego/gosec v0.0.0-20200316084457-7da9f46445fd h1:qB+l4fYZsH78xORC1aqVS0zNmgkQp4rkj2rvfxQMtzc= -github.com/securego/gosec v0.0.0-20200316084457-7da9f46445fd/go.mod h1:NurAFZsWJAEZjogSwdVPlHkOZB3DOAU7gsPP8VFZCHc= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/shirou/gopsutil v0.0.0-20190901111213-e4ec7b275ada/go.mod h1:WWnYX4lzhCH5h/3YBfyVA3VbLYjlMZZAQcW9ojMexNc= -github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sourcegraph/go-diff v0.5.1 h1:gO6i5zugwzo1RVTvgvfwCOSVegNuvnNi6bAD1QCmkHs= -github.com/sourcegraph/go-diff v0.5.1/go.mod h1:j2dHj3m8aZgQO8lMTcTnBcXkRRRqi34cd2MNlA9u1mE= github.com/sozorogami/gover v0.0.0-20171022184752-b58185e213c5 h1:TAPeDBsd52dRWoWzf5trgBzxzMYHTYjYI+4xNyCdoCU= github.com/sozorogami/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:nHNlDYIQZn44RvqH0kCpl/dMMVWXkav0QIgzGxV1Ab4= -github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= -github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/spf13/viper v1.6.1 h1:VPZzIkznI1YhVMRi6vNFLHSwhnhReBfgTxIPccpfdZk= -github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= 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.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= -github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= -github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2 h1:Xr9gkxfOP0KQWXKNqmwe8vEeSUiUj4Rlee9CMVX2ZUQ= -github.com/tdakkota/asciicheck v0.0.0-20200416190851-d7f85be797a2/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM= -github.com/tetafro/godot v0.2.5 h1:7+EYJM/Z4gYZhBFdRrVm6JTj5ZLw/QI1j4RfEOXJviE= -github.com/tetafro/godot v0.2.5/go.mod h1:pT6/T8+h6//L/LwQcFc4C0xpfy1euZwzS1sHdrFCms0= -github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e h1:RumXZ56IrCj4CL+g1b9OL/oH0QnsF976bC8xQFYUD5Q= -github.com/timakin/bodyclose v0.0.0-20190930140734-f7f2e9bca95e/go.mod h1:Qimiffbc6q9tBWlVV6x0P9sat/ao1xEkREYPPj9hphk= -github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa h1:RC4maTWLKKwb7p1cnoygsbKIgNlJqSYBeAFON3Ar8As= -github.com/tommy-muehle/go-mnd v1.3.1-0.20200224220436-e6f9a994e8fa/go.mod h1:dSUh0FtTP8VhvkL1S+gUR1OKd9ZnSaozuI6r3m6wOig= -github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ultraware/funlen v0.0.2 h1:Av96YVBwwNSe4MLR7iI/BIa3VyI7/djnto/pK3Uxbdo= -github.com/ultraware/funlen v0.0.2/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/whitespace v0.0.4 h1:If7Va4cM03mpgrNH9k49/VOicWpGoG70XPBFFODYDsg= -github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= -github.com/uudashr/gocognit v1.0.1 h1:MoG2fZ0b/Eo7NXoIwCVFLG5JED3qgQz5/NEE+rOsjPs= -github.com/uudashr/gocognit v1.0.1/go.mod h1:j44Ayx2KW4+oB6SWMv8KsmHzZrOInQav7D3cQMJ5JUM= -github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk8LWSxF3s= -github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4= -github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= -github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= -golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180911220305-26e67e76b6c3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190522155817-f3200d17e092/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-20190909003024-a7b16738d86b h1:XfVGCX+0T4WOStkaOsJRllbsiImhB2jgVBGc9L0lPGc= -golang.org/x/net v0.0.0-20190909003024-a7b16738d86b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/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-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -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= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181128092732-4ed8d59d0b35/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= @@ -365,79 +126,31 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190910064555-bbd175535a8b h1:3S2h5FadpNr0zUUCVZjlKIEYF+KaX/OBplTGo89CYHI= -golang.org/x/sys v0.0.0-20190910064555-bbd175535a8b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -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= -golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190110163146-51295c7ec13a/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190221204921-83362c3779f5/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190311215038-5c2858a9cfe5/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190322203728-c1a832b0ad89/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190521203540-521d6ed310dd/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -golang.org/x/tools v0.0.0-20190719005602-e377ae9d6386/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI= golang.org/x/tools v0.0.0-20190830223141-573d9926052a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20190910044552-dd2b5c81c578/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/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-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20191220234730-f13409bbebaf h1:K7C8vSrr0PeD/cgNkkjpByDFJqzjr2YDmm3VPRjGfJM= -golang.org/x/tools v0.0.0-20191220234730-f13409bbebaf/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200228224639-71482053b885/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= -golang.org/x/tools v0.0.0-20200414032229-332987a829c3/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e h1:3Dzrrxi54Io7Aoyb0PYLsI47K2TxkRQg+cqUn+m04do= -golang.org/x/tools v0.0.0-20200422022333-3d57cf2e726e/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770 h1:M9Fif0OxNji8w+HvmhVQ8KJtiZOsjU9RgslJGhn95XE= +golang.org/x/tools v0.0.0-20200502202811-ed308ab3e770/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= 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= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -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= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno= -gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= 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 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= -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 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= -honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= -mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f h1:Cq7MalBHYACRd6EesksG1Q8EoIAKOsiZviGKbOLIej4= -mvdan.cc/unparam v0.0.0-20190720180237-d51796306d8f/go.mod h1:4G1h5nDURzA3bwVMZIVpwbkw+04kSxk3rAtzlimaUJw= -sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4 h1:JPJh2pk3+X4lXAkZIk2RuE/7/FoK9maXw+TNPJhVS/c= -sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/make/test.mk b/make/test.mk index d885e2c4..3c0d609b 100644 --- a/make/test.mk +++ b/make/test.mk @@ -29,8 +29,6 @@ test-fixtures: generate-optimized .PHONY: bench-parser ## run the benchmarks on the parser -bench-parser: generate-optimized - $(eval GIT_BRANCH:=$(shell git rev-parse --abbrev-ref HEAD)) - go test -run="XXX" -bench=. -benchmem -count=10 \ - github.com/bytesparadise/libasciidoc/pkg/parser | \ - tee ./tmp/bench-$(GIT_BRANCH).txt +bench-parser: generate + @ginkgo -tags bench -focus "real-world doc-based benchmarks" pkg/parser + @ginkgo -tags bench -focus "basic stats" pkg/parser diff --git a/pkg/parser/bench_test.go b/pkg/parser/bench_test.go index de3ecf76..6451ad73 100644 --- a/pkg/parser/bench_test.go +++ b/pkg/parser/bench_test.go @@ -1,16 +1,34 @@ +// +build bench + package parser_test import ( + "encoding/json" + "fmt" "io/ioutil" "os" - "testing" "github.com/bytesparadise/libasciidoc/pkg/parser" + + . "github.com/onsi/ginkgo" //nolint golint + . "github.com/onsi/ginkgo/extensions/table" //nolint golint + . "github.com/onsi/gomega" //nolint golint ) const ( - doc1line = `=== foo1 -bar1` + doc1line = `= 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.` + doc10lines = `=== foo bar @@ -42,82 +60,51 @@ bar bar` ) -func BenchmarkParser(b *testing.B) { - usecases := []struct { - name string - content []byte - }{ - { - name: "1 line", - content: []byte(doc1line), - }, - { - name: "10 lines", - content: []byte(doc10lines), - }, - { - name: "vert.x doc", - content: load(b, "../../test/bench/vertx-examples.adoc"), - }, - } - for _, usecase := range usecases { - name := usecase.name - content := usecase.content - b.Run(name, func(b *testing.B) { - for n := 0; n < b.N; n++ { - _, err := parser.Parse(name, content) - if err != nil { - b.Error(err) - } - } +var _ = DescribeTable("basic stats", + func(title, content string) { + stats := parser.Stats{} + _, err := parser.Parse(title, []byte(content), parser.Statistics(&stats, "no match")) // , parser.Debug(true)) + Expect(err).NotTo(HaveOccurred()) + fmt.Printf("%s\n", title) + fmt.Printf("ExprCnt: %d\n", stats.ExprCnt) + 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), +) + +var _ = Describe("real-world doc-based benchmarks", func() { + + Measure("parse the vert.x examples doc", func(b Benchmarker) { + filename := "../../test/bench/vertx-examples.adoc" + content, err := load(filename) + Expect(err).NotTo(HaveOccurred()) + b.Time("runtime", func() { + _, err := parser.Parse(filename, content) + Expect(err).NotTo(HaveOccurred()) }) - } -} + }, 10) + + Measure("parse the quarkus kafka streams doc", func(b Benchmarker) { + filename := "../../test/bench/kafka-streams.adoc" + content, err := load(filename) + Expect(err).NotTo(HaveOccurred()) + b.Time("runtime", func() { + _, err := parser.Parse(filename, content) + Expect(err).NotTo(HaveOccurred()) + }) + }, 10) -// func TestParserWithStats(t *testing.T) { -// usecases := []struct { -// name string -// content []byte -// }{ -// { -// name: "1 line", -// content: []byte(doc1line), -// }, -// { -// name: "10 lines", -// content: []byte(doc10lines), -// }, -// } -// for _, usecase := range usecases { -// name := usecase.name -// content := usecase.content -// t.Run(name, func(t *testing.T) { -// stats := parser.Stats{} -// _, err := parser.Parse(name, content, parser.Statistics(&stats, "no match"), parser.Debug(true), parser.AllowInvalidUTF8(true)) -// if err != nil { -// t.Error(err) -// } -// t.Logf("ExprCnt: %d", stats.ExprCnt) -// result, _ := json.MarshalIndent(stats.ChoiceAltCnt, " ", " ") -// t.Logf("ChoiceAltCnt: \n%s", result) -// }) -// } -// } - -func load(b *testing.B, filename string) []byte { +}) + +func load(filename string) ([]byte, error) { f, err := os.Open(filename) if err != nil { - b.Error(err) + return nil, err } defer func() { - err2 := f.Close() - if err2 != nil { - b.Error(err2) - } + f.Close() }() - content, err := ioutil.ReadAll(f) - if err != nil { - b.Error(err) - } - return content + return ioutil.ReadAll(f) } diff --git a/pkg/parser/comment_test.go b/pkg/parser/comment_test.go index 6ebe0b6b..e86e583e 100644 --- a/pkg/parser/comment_test.go +++ b/pkg/parser/comment_test.go @@ -146,6 +146,7 @@ with multiple lines It("comment block with paragraphs around", func() { source := `a first paragraph + //// a *comment* block with multiple lines @@ -161,6 +162,7 @@ a second paragraph` }, }, }, + types.BlankLine{}, // blankline is required between a paragraph and the next block types.DelimitedBlock{ Attributes: types.ElementAttributes{}, Kind: types.Comment, @@ -314,6 +316,7 @@ with multiple lines It("comment block with paragraphs around", func() { source := `a first paragraph + //// a *comment* block with multiple lines @@ -350,6 +353,7 @@ a second paragraph` source := `== section 1 a first paragraph + //// a *comment* block with multiple lines diff --git a/pkg/parser/cross_reference_test.go b/pkg/parser/cross_reference_test.go index d8b334ac..42764fa6 100644 --- a/pkg/parser/cross_reference_test.go +++ b/pkg/parser/cross_reference_test.go @@ -114,7 +114,7 @@ with some content linked to <>!` }, types.ExternalCrossReference{ Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "another-doc.adoc", }, @@ -155,7 +155,7 @@ with some content linked to <>!` }, types.ExternalCrossReference{ Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.DocumentAttributeSubstitution{ Name: "foo", }, @@ -310,7 +310,7 @@ with some content linked to <>!` }, types.ExternalCrossReference{ Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "another-doc.adoc", }, @@ -359,7 +359,7 @@ some content linked to xref:{foo}[another_doc()]!` }, types.ExternalCrossReference{ Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "another-doc.adoc", }, diff --git a/pkg/parser/delimited_block_test.go b/pkg/parser/delimited_block_test.go index f9cf7afa..e48d1661 100644 --- a/pkg/parser/delimited_block_test.go +++ b/pkg/parser/delimited_block_test.go @@ -111,7 +111,7 @@ var _ = Describe("delimited blocks", func() { It("fenced block after a paragraph", func() { content := "some fenced code" - source := "a paragraph.\n```\n" + content + "\n" + "```\n" + source := "a paragraph.\n\n```\n" + content + "\n" + "```\n" expected := types.DraftDocument{ Blocks: []interface{}{ types.Paragraph{ @@ -122,6 +122,7 @@ var _ = Describe("delimited blocks", func() { }, }, }, + types.BlankLine{}, types.DelimitedBlock{ Attributes: types.ElementAttributes{}, Kind: types.Fenced, @@ -376,8 +377,9 @@ then a normal paragraph.` Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) - It("listing block just after a paragraph", func() { + It("listing block after a paragraph", func() { source := `a paragraph. + ---- some listing code ----` @@ -391,6 +393,7 @@ some listing code }, }, }, + types.BlankLine{}, // blankline is required between paragraph and the next block types.DelimitedBlock{ Attributes: types.ElementAttributes{}, Kind: types.Listing, @@ -1472,6 +1475,7 @@ some *verse* content source := `.a title **** some *verse* content + ---- foo bar @@ -1506,6 +1510,7 @@ bar }, }, }, + types.BlankLine{}, // blankline is required between paragraph and the next block types.DelimitedBlock{ Attributes: types.ElementAttributes{}, Kind: types.Listing, @@ -1642,7 +1647,7 @@ bar It("fenced block after a paragraph", func() { content := "some fenced code" - source := "a paragraph.\n```\n" + content + "\n" + "```\n" + source := "a paragraph.\n\n```\n" + content + "\n" + "```\n" expected := types.Document{ Attributes: types.DocumentAttributes{}, ElementReferences: types.ElementReferences{}, @@ -1938,8 +1943,9 @@ then a normal paragraph.` Expect(ParseDocument(source)).To(MatchDocument(expected)) }) - It("listing block just after a paragraph", func() { + It("listing block after a paragraph", func() { source := `a paragraph. + ---- some listing code ----` @@ -3145,6 +3151,7 @@ some *verse* content source := `.a title **** some *verse* content + ---- foo bar @@ -3182,6 +3189,7 @@ bar }, }, }, + types.BlankLine{}, // blankline is required between paragraph and the next block types.DelimitedBlock{ Attributes: types.ElementAttributes{}, Kind: types.Listing, diff --git a/pkg/parser/document_processing_apply_substitutions_test.go b/pkg/parser/document_processing_apply_substitutions_test.go index 5a2f1102..ebac30e9 100644 --- a/pkg/parser/document_processing_apply_substitutions_test.go +++ b/pkg/parser/document_processing_apply_substitutions_test.go @@ -271,9 +271,10 @@ var _ = Describe("document attribute subsititutions", func() { types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, diff --git a/pkg/parser/document_processing_rearrange_lists.go b/pkg/parser/document_processing_rearrange_lists.go index 5f32ce03..ce213a35 100644 --- a/pkg/parser/document_processing_rearrange_lists.go +++ b/pkg/parser/document_processing_rearrange_lists.go @@ -15,7 +15,9 @@ func rearrangeListItems(blocks []interface{}, withinDelimitedBlock bool) ([]inte // log.Debugf("rearranging list items in %d blocks...", len(blocks)) result := make([]interface{}, 0, len(blocks)) // maximum capacity cannot exceed initial input lists := []types.List{} // at each level (or depth), we have a list, whatever its type. - blankline := false // track if the previous block was a blank line + // track if the previous block was a blank line. + // also, count the blanklines to determine the level of parent attachment when reaching a `ContinuedListItemElement` + blanklineCount := 0 for _, block := range blocks { switch block := block.(type) { case types.DelimitedBlock: @@ -41,7 +43,7 @@ func rearrangeListItems(blocks []interface{}, withinDelimitedBlock bool) ([]inte case types.OrderedListItem, types.UnorderedListItem, types.LabeledListItem: // 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 blankline && len(block.(types.DocumentElement).GetAttributes()) > 0 { + if blanklineCount > 0 && len(block.(types.DocumentElement).GetAttributes()) > 0 { if len(lists) > 0 { for _, list := range pruneLists(lists, 0) { result = append(result, unPtr(list)) @@ -55,10 +57,11 @@ func rearrangeListItems(blocks []interface{}, withinDelimitedBlock bool) ([]inte if err != nil { return nil, errors.Wrapf(err, "unable to rearrange list items in delimited block") } - blankline = false + blanklineCount = 0 case types.ContinuedListItemElement: + block.Offset = blanklineCount lists = appendContinuedListItemElement(lists, block) - blankline = false + blanklineCount = 0 case 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, @@ -66,9 +69,9 @@ func rearrangeListItems(blocks []interface{}, withinDelimitedBlock bool) ([]inte if withinDelimitedBlock && len(lists) == 0 { // only retain blank lines if within a delimited block, but not currently dealing with a list (or a set of nested lists) result = append(result, block) } - blankline = true + blanklineCount++ default: - blankline = false + blanklineCount = 0 // 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 @@ -227,7 +230,7 @@ func parseLabeledListItemTerm(term string) ([]interface{}, error) { } func appendContinuedListItemElement(lists []types.List, item types.ContinuedListItemElement) []types.List { - lists = pruneLists(lists, len(lists)-1+item.Offset) + lists = pruneLists(lists, len(lists)-1-item.Offset) log.Debugf("appending continued list item element with offset=%d (depth=%d)", item.Offset, len(lists)) // lookup the list at which the item should be attached parentList := &(lists[len(lists)-1]) diff --git a/pkg/parser/element_attributes_test.go b/pkg/parser/element_attributes_test.go index e169241a..e3084366 100644 --- a/pkg/parser/element_attributes_test.go +++ b/pkg/parser/element_attributes_test.go @@ -50,6 +50,7 @@ a paragraph` }) Context("invalid syntax", func() { + It("spaces before keyword", func() { source := `[ link=http://foo.bar] a paragraph` diff --git a/pkg/parser/file_inclusion_test.go b/pkg/parser/file_inclusion_test.go index c543f98c..f6abaa95 100644 --- a/pkg/parser/file_inclusion_test.go +++ b/pkg/parser/file_inclusion_test.go @@ -24,42 +24,42 @@ var _ = DescribeTable("'FileLocation' pattern", Expect(actual).To(Equal(expected)) }, Entry("'chapter'", "chapter", types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "chapter", }, }, }), Entry("'chapter.adoc'", "chapter.adoc", types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "chapter.adoc", }, }, }), Entry("'chapter-a.adoc'", "chapter-a.adoc", types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "chapter-a.adoc", }, }, }), Entry("'chapter_a.adoc'", "chapter_a.adoc", types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "chapter_a.adoc", }, }, }), Entry("'../../test/includes/chapter_a.adoc'", "../../test/includes/chapter_a.adoc", types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter_a.adoc", }, }, }), Entry("'chapter-{foo}.adoc'", "chapter-{foo}.adoc", types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "chapter-", }, @@ -72,7 +72,7 @@ var _ = DescribeTable("'FileLocation' pattern", }, }), Entry("'{includedir}/chapter-{foo}.adoc'", "{includedir}/chapter-{foo}.adoc", types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.DocumentAttributeSubstitution{ Name: "includedir", }, @@ -87,6 +87,19 @@ var _ = DescribeTable("'FileLocation' pattern", }, }, }), + Entry("'{scheme}://{path}'", "{scheme}://{path}", types.Location{ + Path: []interface{}{ + types.DocumentAttributeSubstitution{ + Name: "scheme", + }, + types.StringElement{ + Content: "://", + }, + types.DocumentAttributeSubstitution{ + Name: "path", + }, + }, + }), ) var _ = DescribeTable("check asciidoc file", @@ -117,7 +130,7 @@ var _ = Describe("file inclusions", func() { types.FileInclusion{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -142,7 +155,7 @@ var _ = Describe("file inclusions", func() { types.FileInclusion{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../../test/includes/chapter-a.adoc", }, @@ -167,7 +180,7 @@ var _ = Describe("file inclusions", func() { types.AttrLevelOffset: "+1", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -196,7 +209,7 @@ var _ = Describe("file inclusions", func() { types.FileInclusion{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -224,7 +237,7 @@ var _ = Describe("file inclusions", func() { types.FileInclusion{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -252,7 +265,7 @@ var _ = Describe("file inclusions", func() { types.FileInclusion{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -280,7 +293,7 @@ var _ = Describe("file inclusions", func() { types.FileInclusion{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -311,7 +324,7 @@ var _ = Describe("file inclusions", func() { types.FileInclusion{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -339,7 +352,7 @@ var _ = Describe("file inclusions", func() { types.FileInclusion{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -368,7 +381,7 @@ var _ = Describe("file inclusions", func() { types.FileInclusion{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -399,7 +412,7 @@ var _ = Describe("file inclusions", func() { }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -424,7 +437,7 @@ var _ = Describe("file inclusions", func() { }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -451,7 +464,7 @@ var _ = Describe("file inclusions", func() { }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -474,7 +487,7 @@ var _ = Describe("file inclusions", func() { types.AttrLineRanges: `1;3..4;6..foo`, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -501,7 +514,7 @@ var _ = Describe("file inclusions", func() { "6..-1": nil, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -524,7 +537,7 @@ var _ = Describe("file inclusions", func() { types.AttrLineRanges: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -552,7 +565,7 @@ var _ = Describe("file inclusions", func() { }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -577,7 +590,7 @@ var _ = Describe("file inclusions", func() { }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -604,7 +617,7 @@ var _ = Describe("file inclusions", func() { }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -629,7 +642,7 @@ var _ = Describe("file inclusions", func() { "6..foo": nil, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -652,7 +665,7 @@ var _ = Describe("file inclusions", func() { types.AttrLineRanges: `"1;3..4;6..10"`, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/chapter-a.adoc", }, @@ -683,7 +696,7 @@ var _ = Describe("file inclusions", func() { }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/tag-include.adoc", }, @@ -715,7 +728,7 @@ var _ = Describe("file inclusions", func() { }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "../../test/includes/tag-include.adoc", }, diff --git a/pkg/parser/footnote_test.go b/pkg/parser/footnote_test.go index 912dc11c..654c37f4 100644 --- a/pkg/parser/footnote_test.go +++ b/pkg/parser/footnote_test.go @@ -60,16 +60,17 @@ var _ = Describe("footnotes - draft", func() { }, types.InlineLink{ Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "content", }, }, }, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.com", + Content: "foo.com", }, }, }, @@ -326,16 +327,17 @@ var _ = Describe("footnotes - document", func() { }, types.InlineLink{ Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "content", }, }, }, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.com", + Content: "foo.com", }, }, }, diff --git a/pkg/parser/image_test.go b/pkg/parser/image_test.go index c4c5f9c4..646aa546 100644 --- a/pkg/parser/image_test.go +++ b/pkg/parser/image_test.go @@ -21,7 +21,7 @@ var _ = Describe("images", func() { types.ImageBlock{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -38,7 +38,7 @@ var _ = Describe("images", func() { types.ImageBlock{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -57,7 +57,7 @@ var _ = Describe("images", func() { types.ImageBlock{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -76,7 +76,7 @@ var _ = Describe("images", func() { types.ImageBlock{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -95,7 +95,7 @@ var _ = Describe("images", func() { types.ImageBlock{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -115,7 +115,7 @@ var _ = Describe("images", func() { types.AttrImageAlt: "the foo.png image", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -143,7 +143,7 @@ image::images/foo.png[the foo.png image, 600, 400]` types.AttrImageHeight: "400", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -161,7 +161,7 @@ image::images/bar.png[]` types.ImageBlock{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -169,7 +169,7 @@ image::images/bar.png[]` types.ImageBlock{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/bar.png"}, }, }, @@ -194,7 +194,7 @@ image::images/bar.png[]` types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -221,7 +221,7 @@ image::foo.png[]` types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "./path/to/images/foo.png"}, }, }, @@ -248,7 +248,7 @@ image::{dir}/foo.png[]` types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "./path/to/images/foo.png"}, }, }, @@ -275,7 +275,7 @@ image::foo.png[]` types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "./path/to/images/foo.png"}, }, }, @@ -302,7 +302,7 @@ image::{imagesdir}/foo.png[]` types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "./path/to/images/./path/to/images/foo.png"}, }, }, @@ -375,7 +375,7 @@ image::{imagesdir}/foo.png[]` types.InlineImage{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -399,7 +399,7 @@ image::{imagesdir}/foo.png[]` types.InlineImage{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -429,7 +429,7 @@ image::{imagesdir}/foo.png[]` types.InlineImage{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -458,7 +458,7 @@ image::{imagesdir}/foo.png[]` types.AttrImageAlt: "the foo.png image", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -485,7 +485,7 @@ image::{imagesdir}/foo.png[]` types.AttrImageWidth: "600", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -513,7 +513,7 @@ image::{imagesdir}/foo.png[]` types.AttrImageHeight: "400", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -539,7 +539,7 @@ image::{imagesdir}/foo.png[]` types.AttrImageAlt: "the foo.png image", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -566,7 +566,7 @@ image::{imagesdir}/foo.png[]` types.AttrCustomID: true, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -595,7 +595,7 @@ image::{imagesdir}/foo.png[]` types.AttrRole: "myrole", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -627,7 +627,7 @@ image::{imagesdir}/foo.png[]` types.AttrRole: "myrole", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -654,7 +654,7 @@ image::{imagesdir}/foo.png[]` types.InlineImage{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -681,7 +681,7 @@ image::{imagesdir}/foo.png[]` types.InlineImage{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -708,7 +708,7 @@ image::{imagesdir}/foo.png[]` types.ImageBlock{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.DocumentAttributeSubstitution{ Name: "imagesdir", }, @@ -740,7 +740,7 @@ image::{imagesdir}/foo.png[]` types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "images/foo.png"}, }, }, @@ -775,7 +775,7 @@ an image:{dir}/foo.png[].` types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "./path/to/images/foo.png"}, }, }, @@ -811,7 +811,7 @@ an image:foo.png[].` types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "./path/to/images/foo.png"}, }, }, @@ -847,7 +847,7 @@ an image:{imagesdir}/foo.png[].` types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{Content: "./path/to/images/./path/to/images/foo.png"}, }, }, diff --git a/pkg/parser/index_terms_test.go b/pkg/parser/index_terms_test.go index 0c71b8ef..2c1751ab 100644 --- a/pkg/parser/index_terms_test.go +++ b/pkg/parser/index_terms_test.go @@ -110,7 +110,7 @@ a paragraph with an index term.` }) It("index term in single paragraph line", func() { - source := `((foo_bar_baz _italic_)) + source := `((foo_bar_baz _italic_ normal)) a paragraph with an index term.` expected := types.Document{ Attributes: types.DocumentAttributes{}, @@ -134,6 +134,9 @@ a paragraph with an index term.` }, }, }, + types.StringElement{ + Content: " normal", + }, }, }, }, diff --git a/pkg/parser/labeled_list_test.go b/pkg/parser/labeled_list_test.go index 51f6d294..ef6cc89b 100644 --- a/pkg/parser/labeled_list_test.go +++ b/pkg/parser/labeled_list_test.go @@ -664,7 +664,9 @@ TIP: tip` }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + result, err := ParseDraftDocument(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDraftDocument(expected)) }) It("labeled list with nested unordered list - case 2", func() { diff --git a/pkg/parser/link_test.go b/pkg/parser/link_test.go index 0c342b4f..78b07592 100644 --- a/pkg/parser/link_test.go +++ b/pkg/parser/link_test.go @@ -23,9 +23,10 @@ var _ = Describe("links", func() { types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, @@ -46,9 +47,10 @@ var _ = Describe("links", func() { types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, @@ -69,14 +71,15 @@ var _ = Describe("links", func() { types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "mailto:", + Path: []interface{}{ types.StringElement{ - Content: "mailto:foo@bar", + Content: "foo@bar", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "the foo@bar email", }, @@ -99,14 +102,15 @@ var _ = Describe("links", func() { types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "mailto:", + Path: []interface{}{ types.StringElement{ - Content: "mailto:foo@bar", + Content: "foo@bar", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "the foo@bar email", }, @@ -135,9 +139,10 @@ next lines` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "http://", + Path: []interface{}{ types.StringElement{ - Content: "http://website.com", + Content: "website.com", }, }, }, @@ -173,9 +178,10 @@ next lines` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "http://", + Path: []interface{}{ types.StringElement{ - Content: "http://website.com", + Content: "website.com", }, }, }, @@ -205,9 +211,10 @@ next lines` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, @@ -231,16 +238,27 @@ next lines` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "http://", + Path: []interface{}{ types.StringElement{ - Content: "http://website.com", + Content: "website.com", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ - Content: "A, B, and C", + Content: "A", + }, + }, + "positional-2": []interface{}{ + types.StringElement{ + Content: " B", + }, + }, + "positional-3": []interface{}{ + types.StringElement{ + Content: " and C", }, }, }, @@ -260,14 +278,15 @@ next lines` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "http://", + Path: []interface{}{ types.StringElement{ - Content: "http://website.com", + Content: "website.com", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "A, B, and C", }, @@ -289,14 +308,15 @@ next lines` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "http://", + Path: []interface{}{ types.StringElement{ - Content: "http://website.com", + Content: "website.com", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "A, B, and C", }, @@ -319,21 +339,30 @@ next lines` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "http://", + Path: []interface{}{ types.StringElement{ - Content: "http://website.com", + Content: "website.com", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "A", }, }, - "B": nil, - "and C": nil, - "role": "foo", + "positional-2": []interface{}{ + types.StringElement{ + Content: " B", + }, + }, + "positional-3": []interface{}{ + types.StringElement{ + Content: " and C", + }, + }, + "role": "foo", }, }, }, @@ -345,7 +374,6 @@ next lines` It("external link with special characters", func() { source := "a link to https://foo*_.com" - expected := types.DraftDocument{ Blocks: []interface{}{ types.Paragraph{ @@ -356,9 +384,71 @@ next lines` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ + types.StringElement{ + Content: "foo*_.com", + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("external link with quoted text", func() { + source := "a link to https://foo.com[_a_ *b* `c`]" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a link to "}, + types.InlineLink{ + Attributes: types.ElementAttributes{ + "positional-1": []interface{}{ + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.StringElement{ + Content: "a", + }, + }, + }, types.StringElement{ - Content: "https://foo*_.com", + Content: " ", + }, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{ + Content: "b", + }, + }, + }, + types.StringElement{ + Content: " ", + }, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.StringElement{ + Content: "c", + }, + }, + }, + }, + }, + Location: types.Location{ + Scheme: "https://", + Path: []interface{}{ + types.StringElement{ + Content: "foo.com", }, }, }, @@ -387,9 +477,10 @@ next lines` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.com", + Content: "foo.com", }, }, }, @@ -417,7 +508,8 @@ next lines` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "", + Path: []interface{}{ types.StringElement{ Content: "foo.adoc", }, @@ -440,14 +532,15 @@ next lines` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "", + Path: []interface{}{ types.StringElement{ Content: "foo.adoc", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "foo doc", }, @@ -469,14 +562,15 @@ next lines` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "foo doc", }, @@ -498,14 +592,15 @@ next lines` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "foo doc", }, @@ -528,9 +623,10 @@ next lines` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, @@ -567,14 +663,15 @@ next lines` { types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "", + Path: []interface{}{ types.StringElement{ Content: "/", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "a ", }, @@ -628,7 +725,8 @@ next lines` Elements: []interface{}{ types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "", + Path: []interface{}{ types.StringElement{ Content: "foo", }, @@ -653,14 +751,15 @@ next lines` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "", + Path: []interface{}{ types.StringElement{ Content: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~:/?#@!$&;=()*+,-_.%", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "as expected", }, @@ -686,14 +785,15 @@ Test 2: link:/test/a%20b[with encoded space]` types.StringElement{Content: "Test 2: "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "", + Path: []interface{}{ types.StringElement{ Content: "/test/a%20b", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "with encoded space", }, @@ -730,7 +830,8 @@ a link to {scheme}:{path}[] and https://foo.baz` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "", + Path: []interface{}{ types.StringElement{ Content: "{path}", }, @@ -741,9 +842,10 @@ a link to {scheme}:{path}[] and https://foo.baz` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.baz", + Content: "foo.baz", }, }, }, @@ -767,16 +869,27 @@ a link to {scheme}:{path}[] and https://foo.baz` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ - Content: "A, B, and C", + Content: "A", + }, + }, + "positional-2": []interface{}{ + types.StringElement{ + Content: " B", + }, + }, + "positional-3": []interface{}{ + types.StringElement{ + Content: " and C", }, }, }, @@ -796,14 +909,15 @@ a link to {scheme}:{path}[] and https://foo.baz` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "A, B, and C", }, @@ -825,14 +939,15 @@ a link to {scheme}:{path}[] and https://foo.baz` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "A, B, and C", }, @@ -855,21 +970,30 @@ a link to {scheme}:{path}[] and https://foo.baz` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "A", }, }, - "B": nil, - "and C": nil, - "role": "foo", + "positional-2": []interface{}{ + types.StringElement{ + Content: " B", + }, + }, + "positional-3": []interface{}{ + types.StringElement{ + Content: " and C", + }, + }, + "role": "foo", }, }, }, @@ -1019,9 +1143,126 @@ a link to *{scheme}://{path}[] and https://foo.baz[]*` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.baz", + Content: "foo.baz", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("external link with two document attribute substitutions in italic text", func() { + source := ` +:scheme: https +:path: foo.bar + +a link to _{scheme}://{path}[] and https://foo.baz[]_` + + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.BlankLine{}, + types.DocumentAttributeDeclaration{ + Name: "scheme", + Value: "https", + }, + types.DocumentAttributeDeclaration{ + Name: "path", + Value: "foo.bar", + }, + types.BlankLine{}, + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a link to "}, + types.QuotedText{ + Kind: types.Italic, + Elements: []interface{}{ + types.DocumentAttributeSubstitution{ + Name: "scheme", + }, + types.StringElement{ + Content: "://", + }, + types.DocumentAttributeSubstitution{ + Name: "path", + }, + types.StringElement{Content: "[] and "}, + types.InlineLink{ + Attributes: types.ElementAttributes{}, + Location: types.Location{ + Scheme: "https://", + Path: []interface{}{ + types.StringElement{ + Content: "foo.baz", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + + It("external link with two document attribute substitutions in monospace text", func() { + source := ` +:scheme: https +:path: foo.bar` + "\n\n" + + + "a link to `{scheme}://{path}[] and https://foo.baz[]`" + + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.BlankLine{}, + types.DocumentAttributeDeclaration{ + Name: "scheme", + Value: "https", + }, + types.DocumentAttributeDeclaration{ + Name: "path", + Value: "foo.bar", + }, + types.BlankLine{}, + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a link to "}, + types.QuotedText{ + Kind: types.Monospace, + Elements: []interface{}{ + types.DocumentAttributeSubstitution{ + Name: "scheme", + }, + types.StringElement{ + Content: "://", + }, + types.DocumentAttributeSubstitution{ + Name: "path", + }, + types.StringElement{Content: "[] and "}, + types.InlineLink{ + Attributes: types.ElementAttributes{}, + Location: types.Location{ + Scheme: "https://", + Path: []interface{}{ + types.StringElement{ + Content: "foo.baz", }, }, }, @@ -1056,7 +1297,7 @@ a link to *{scheme}://{path}[] and https://foo.baz[]*` Elements: []interface{}{ types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "foo", }, @@ -1089,9 +1330,10 @@ a link to *{scheme}://{path}[] and https://foo.baz[]*` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo*_.com", + Content: "foo*_.com", }, }, }, @@ -1123,9 +1365,10 @@ a link to *{scheme}://{path}[] and https://foo.baz[]*` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.com", + Content: "foo.com", }, }, }, @@ -1159,9 +1402,10 @@ a link to *{scheme}://{path}[] and https://foo.baz[]*` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.com", + Content: "foo.com", }, }, }, @@ -1199,9 +1443,10 @@ a link to {url}` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo2.bar", + Content: "foo2.bar", }, }, }, @@ -1237,9 +1482,10 @@ a link to {scheme}://{path} and https://foo.baz` types.StringElement{Content: "a link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, @@ -1249,9 +1495,10 @@ a link to {scheme}://{path} and https://foo.baz` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.baz", + Content: "foo.baz", }, }, }, @@ -1289,9 +1536,10 @@ a link to *{scheme}://{path}[] and https://foo.baz[]*` Elements: []interface{}{ types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, @@ -1301,9 +1549,10 @@ a link to *{scheme}://{path}[] and https://foo.baz[]*` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.baz", + Content: "foo.baz", }, }, }, @@ -1342,9 +1591,10 @@ a link to {scheme}://{path} and https://foo.baz` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://{path}", + Content: "{path}", }, }, }, @@ -1353,9 +1603,10 @@ a link to {scheme}://{path} and https://foo.baz` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.baz", + Content: "foo.baz", }, }, }, @@ -1378,9 +1629,10 @@ a link to {scheme}://{path} and https://foo.baz` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, @@ -1389,9 +1641,10 @@ a link to {scheme}://{path} and https://foo.baz` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.baz", + Content: "foo.baz", }, }, }, @@ -1431,9 +1684,10 @@ a link to {scheme}://{path} and https://foo.baz` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, @@ -1442,9 +1696,10 @@ a link to {scheme}://{path} and https://foo.baz` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.baz", + Content: "foo.baz", }, }, }, diff --git a/pkg/parser/literal_block_test.go b/pkg/parser/literal_block_test.go index 98233d8e..855ecfb1 100644 --- a/pkg/parser/literal_block_test.go +++ b/pkg/parser/literal_block_test.go @@ -201,7 +201,9 @@ a normal paragraph.` }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + result, err := ParseDraftDocument(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDraftDocument(expected)) }) }) diff --git a/pkg/parser/paragraph_test.go b/pkg/parser/paragraph_test.go index 5db1d0c3..a45156d4 100644 --- a/pkg/parser/paragraph_test.go +++ b/pkg/parser/paragraph_test.go @@ -218,6 +218,24 @@ baz` Expect(ParseDocumentBlock(source)).To(Equal(expected)) }) + It("not treat plusplus as line break", func() { + source := `C++ +foo` + expected := types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "C++"}, + }, + { + types.StringElement{Content: "foo"}, + }, + }, + } + result, err := ParseDocumentBlock(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(Equal(expected)) + }) }) Context("admonition paragraphs", func() { @@ -658,7 +676,7 @@ a foo image:foo.png[]` types.InlineImage{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "foo.png", }, @@ -683,7 +701,7 @@ image::foo.png[]` types.AttrQuoteTitle: "quote title", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "foo.png", }, diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index 147c66ea..7a498e91 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -145,98 +145,90 @@ var g = &grammar{ { name: "DocumentBlock", pos: position{line: 42, col: 1, offset: 1162}, - expr: &actionExpr{ - pos: position{line: 42, col: 18, offset: 1179}, - run: (*parser).callonDocumentBlock1, - expr: &seqExpr{ - pos: position{line: 42, col: 18, offset: 1179}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 42, col: 18, offset: 1179}, - expr: &ruleRefExpr{ - pos: position{line: 42, col: 19, offset: 1180}, - name: "EOF", - }, - }, - &labeledExpr{ - pos: position{line: 43, col: 5, offset: 1189}, - label: "block", - expr: &choiceExpr{ - pos: position{line: 43, col: 12, offset: 1196}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 43, col: 12, offset: 1196}, - name: "SimpleParagraph", - }, - &ruleRefExpr{ - pos: position{line: 44, col: 11, offset: 1222}, - name: "Section", - }, - &ruleRefExpr{ - pos: position{line: 45, col: 11, offset: 1241}, - name: "DelimitedBlock", - }, - &ruleRefExpr{ - pos: position{line: 46, col: 11, offset: 1266}, - name: "FileInclusion", - }, - &ruleRefExpr{ - pos: position{line: 47, col: 11, offset: 1290}, - name: "VerseParagraph", - }, - &ruleRefExpr{ - pos: position{line: 48, col: 11, offset: 1344}, - name: "ImageBlock", - }, - &ruleRefExpr{ - pos: position{line: 49, col: 11, offset: 1366}, - name: "ListItem", - }, - &ruleRefExpr{ - pos: position{line: 50, col: 11, offset: 1385}, - name: "BlankLine", - }, - &ruleRefExpr{ - pos: position{line: 51, col: 11, offset: 1436}, - name: "LiteralBlock", - }, - &ruleRefExpr{ - pos: position{line: 52, col: 11, offset: 1460}, - name: "DocumentAttributeDeclaration", - }, - &ruleRefExpr{ - pos: position{line: 53, col: 11, offset: 1500}, - name: "DocumentAttributeReset", - }, - &ruleRefExpr{ - pos: position{line: 54, col: 11, offset: 1534}, - name: "TableOfContentsPlaceHolder", - }, - &ruleRefExpr{ - pos: position{line: 55, col: 11, offset: 1571}, - name: "UserMacroBlock", - }, - &ruleRefExpr{ - pos: position{line: 56, col: 11, offset: 1596}, - name: "Paragraph", - }, - }, - }, - }, + expr: &choiceExpr{ + pos: position{line: 43, col: 9, offset: 1188}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 43, col: 9, offset: 1188}, + name: "LabeledListItem", + }, + &ruleRefExpr{ + pos: position{line: 44, col: 11, offset: 1253}, + name: "SimpleParagraph", + }, + &ruleRefExpr{ + pos: position{line: 45, col: 11, offset: 1279}, + name: "BlankLine", + }, + &ruleRefExpr{ + pos: position{line: 46, col: 11, offset: 1331}, + name: "Section", + }, + &ruleRefExpr{ + pos: position{line: 47, col: 11, offset: 1349}, + name: "DelimitedBlock", + }, + &ruleRefExpr{ + pos: position{line: 48, col: 11, offset: 1374}, + name: "FileInclusion", + }, + &ruleRefExpr{ + pos: position{line: 49, col: 11, offset: 1398}, + name: "VerseParagraph", + }, + &ruleRefExpr{ + pos: position{line: 50, col: 11, offset: 1452}, + name: "ImageBlock", + }, + &ruleRefExpr{ + pos: position{line: 51, col: 11, offset: 1474}, + name: "OrderedListItem", + }, + &ruleRefExpr{ + pos: position{line: 52, col: 11, offset: 1501}, + name: "UnorderedListItem", + }, + &ruleRefExpr{ + pos: position{line: 53, col: 11, offset: 1530}, + name: "ContinuedListItemElement", + }, + &ruleRefExpr{ + pos: position{line: 54, col: 11, offset: 1565}, + name: "LiteralBlock", + }, + &ruleRefExpr{ + pos: position{line: 55, col: 11, offset: 1589}, + name: "DocumentAttributeDeclaration", + }, + &ruleRefExpr{ + pos: position{line: 56, col: 11, offset: 1629}, + name: "DocumentAttributeReset", + }, + &ruleRefExpr{ + pos: position{line: 57, col: 11, offset: 1663}, + name: "TableOfContentsPlaceHolder", + }, + &ruleRefExpr{ + pos: position{line: 58, col: 11, offset: 1700}, + name: "UserMacroBlock", + }, + &ruleRefExpr{ + pos: position{line: 59, col: 11, offset: 1725}, + name: "Paragraph", }, }, }, }, { name: "AsciidocDocumentBlocksWithinDelimitedBlock", - pos: position{line: 60, col: 1, offset: 1634}, + pos: position{line: 61, col: 1, offset: 1736}, expr: &labeledExpr{ - pos: position{line: 60, col: 47, offset: 1680}, + pos: position{line: 61, col: 47, offset: 1782}, label: "blocks", expr: &zeroOrMoreExpr{ - pos: position{line: 60, col: 54, offset: 1687}, + pos: position{line: 61, col: 54, offset: 1789}, expr: &ruleRefExpr{ - pos: position{line: 60, col: 55, offset: 1688}, + pos: position{line: 61, col: 55, offset: 1790}, name: "DocumentBlockWithinDelimitedBlock", }, }, @@ -244,72 +236,84 @@ var g = &grammar{ }, { name: "DocumentBlockWithinDelimitedBlock", - pos: position{line: 62, col: 1, offset: 1725}, + pos: position{line: 63, col: 1, offset: 1827}, expr: &actionExpr{ - pos: position{line: 62, col: 38, offset: 1762}, + pos: position{line: 63, col: 38, offset: 1864}, run: (*parser).callonDocumentBlockWithinDelimitedBlock1, expr: &seqExpr{ - pos: position{line: 62, col: 38, offset: 1762}, + pos: position{line: 63, col: 38, offset: 1864}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 62, col: 38, offset: 1762}, + pos: position{line: 63, col: 38, offset: 1864}, expr: &ruleRefExpr{ - pos: position{line: 62, col: 39, offset: 1763}, + pos: position{line: 63, col: 39, offset: 1865}, name: "EOF", }, }, &labeledExpr{ - pos: position{line: 63, col: 5, offset: 1772}, + pos: position{line: 64, col: 5, offset: 1874}, label: "block", expr: &choiceExpr{ - pos: position{line: 63, col: 12, offset: 1779}, + pos: position{line: 64, col: 12, offset: 1881}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 63, col: 12, offset: 1779}, + pos: position{line: 64, col: 12, offset: 1881}, name: "DelimitedBlock", }, &ruleRefExpr{ - pos: position{line: 64, col: 11, offset: 1804}, + pos: position{line: 65, col: 11, offset: 1906}, + name: "BlankLine", + }, + &ruleRefExpr{ + pos: position{line: 66, col: 11, offset: 1958}, name: "FileInclusion", }, &ruleRefExpr{ - pos: position{line: 65, col: 11, offset: 1828}, + pos: position{line: 67, col: 11, offset: 1982}, name: "VerseParagraph", }, &ruleRefExpr{ - pos: position{line: 66, col: 11, offset: 1853}, + pos: position{line: 68, col: 11, offset: 2007}, name: "ImageBlock", }, &ruleRefExpr{ - pos: position{line: 67, col: 11, offset: 1875}, - name: "ListItem", + pos: position{line: 69, col: 11, offset: 2029}, + name: "OrderedListItem", }, &ruleRefExpr{ - pos: position{line: 68, col: 11, offset: 1894}, - name: "BlankLine", + pos: position{line: 70, col: 11, offset: 2056}, + name: "UnorderedListItem", + }, + &ruleRefExpr{ + pos: position{line: 71, col: 11, offset: 2085}, + name: "LabeledListItem", }, &ruleRefExpr{ - pos: position{line: 69, col: 11, offset: 1945}, + pos: position{line: 72, col: 11, offset: 2112}, + name: "ContinuedListItemElement", + }, + &ruleRefExpr{ + pos: position{line: 73, col: 11, offset: 2147}, name: "LiteralBlock", }, &ruleRefExpr{ - pos: position{line: 70, col: 11, offset: 1969}, + pos: position{line: 74, col: 11, offset: 2171}, name: "DocumentAttributeDeclaration", }, &ruleRefExpr{ - pos: position{line: 71, col: 11, offset: 2009}, + pos: position{line: 75, col: 11, offset: 2211}, name: "DocumentAttributeReset", }, &ruleRefExpr{ - pos: position{line: 72, col: 11, offset: 2043}, + pos: position{line: 76, col: 11, offset: 2245}, name: "TableOfContentsPlaceHolder", }, &ruleRefExpr{ - pos: position{line: 73, col: 11, offset: 2080}, + pos: position{line: 77, col: 11, offset: 2282}, name: "UserMacroBlock", }, &ruleRefExpr{ - pos: position{line: 74, col: 11, offset: 2105}, + pos: position{line: 78, col: 11, offset: 2307}, name: "Paragraph", }, }, @@ -321,14 +325,14 @@ var g = &grammar{ }, { name: "TextDocumentBlocks", - pos: position{line: 78, col: 1, offset: 2143}, + pos: position{line: 82, col: 1, offset: 2345}, expr: &labeledExpr{ - pos: position{line: 78, col: 23, offset: 2165}, + pos: position{line: 82, col: 23, offset: 2367}, label: "blocks", expr: &zeroOrMoreExpr{ - pos: position{line: 78, col: 30, offset: 2172}, + pos: position{line: 82, col: 30, offset: 2374}, expr: &ruleRefExpr{ - pos: position{line: 78, col: 31, offset: 2173}, + pos: position{line: 82, col: 31, offset: 2375}, name: "TextDocumentBlock", }, }, @@ -336,32 +340,32 @@ var g = &grammar{ }, { name: "TextDocumentBlock", - pos: position{line: 80, col: 1, offset: 2194}, + pos: position{line: 84, col: 1, offset: 2396}, expr: &actionExpr{ - pos: position{line: 80, col: 22, offset: 2215}, + pos: position{line: 84, col: 22, offset: 2417}, run: (*parser).callonTextDocumentBlock1, expr: &seqExpr{ - pos: position{line: 80, col: 22, offset: 2215}, + pos: position{line: 84, col: 22, offset: 2417}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 80, col: 22, offset: 2215}, + pos: position{line: 84, col: 22, offset: 2417}, expr: &ruleRefExpr{ - pos: position{line: 80, col: 23, offset: 2216}, + pos: position{line: 84, col: 23, offset: 2418}, name: "EOF", }, }, &labeledExpr{ - pos: position{line: 81, col: 5, offset: 2225}, + pos: position{line: 85, col: 5, offset: 2427}, label: "block", expr: &choiceExpr{ - pos: position{line: 81, col: 12, offset: 2232}, + pos: position{line: 85, col: 12, offset: 2434}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 81, col: 12, offset: 2232}, + pos: position{line: 85, col: 12, offset: 2434}, name: "BlankLine", }, &ruleRefExpr{ - pos: position{line: 81, col: 24, offset: 2244}, + pos: position{line: 85, col: 24, offset: 2446}, name: "Paragraph", }, }, @@ -373,38 +377,38 @@ var g = &grammar{ }, { name: "FrontMatter", - pos: position{line: 88, col: 1, offset: 2390}, + pos: position{line: 92, col: 1, offset: 2592}, expr: &ruleRefExpr{ - pos: position{line: 88, col: 16, offset: 2405}, + pos: position{line: 92, col: 16, offset: 2607}, name: "YamlFrontMatter", }, }, { name: "YamlFrontMatter", - pos: position{line: 90, col: 1, offset: 2423}, + pos: position{line: 94, col: 1, offset: 2625}, expr: &actionExpr{ - pos: position{line: 90, col: 20, offset: 2442}, + pos: position{line: 94, col: 20, offset: 2644}, run: (*parser).callonYamlFrontMatter1, expr: &seqExpr{ - pos: position{line: 90, col: 20, offset: 2442}, + pos: position{line: 94, col: 20, offset: 2644}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 90, col: 20, offset: 2442}, + pos: position{line: 94, col: 20, offset: 2644}, name: "YamlFrontMatterToken", }, &labeledExpr{ - pos: position{line: 90, col: 41, offset: 2463}, + pos: position{line: 94, col: 41, offset: 2665}, label: "content", expr: &zeroOrOneExpr{ - pos: position{line: 90, col: 49, offset: 2471}, + pos: position{line: 94, col: 49, offset: 2673}, expr: &ruleRefExpr{ - pos: position{line: 90, col: 50, offset: 2472}, + pos: position{line: 94, col: 50, offset: 2674}, name: "YamlFrontMatterContent", }, }, }, &ruleRefExpr{ - pos: position{line: 90, col: 75, offset: 2497}, + pos: position{line: 94, col: 75, offset: 2699}, name: "YamlFrontMatterToken", }, }, @@ -413,24 +417,25 @@ var g = &grammar{ }, { name: "YamlFrontMatterToken", - pos: position{line: 94, col: 1, offset: 2577}, + pos: position{line: 98, col: 1, offset: 2779}, expr: &seqExpr{ - pos: position{line: 94, col: 26, offset: 2602}, + pos: position{line: 98, col: 26, offset: 2804}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 94, col: 26, offset: 2602}, + pos: position{line: 98, col: 26, offset: 2804}, val: "---", ignoreCase: false, + want: "\"---\"", }, &zeroOrMoreExpr{ - pos: position{line: 94, col: 32, offset: 2608}, + pos: position{line: 98, col: 32, offset: 2810}, expr: &ruleRefExpr{ - pos: position{line: 94, col: 32, offset: 2608}, - name: "WS", + pos: position{line: 98, col: 32, offset: 2810}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 94, col: 36, offset: 2612}, + pos: position{line: 98, col: 39, offset: 2817}, name: "EOL", }, }, @@ -438,26 +443,26 @@ var g = &grammar{ }, { name: "YamlFrontMatterContent", - pos: position{line: 96, col: 1, offset: 2617}, + pos: position{line: 100, col: 1, offset: 2822}, expr: &actionExpr{ - pos: position{line: 96, col: 27, offset: 2643}, + pos: position{line: 100, col: 27, offset: 2848}, run: (*parser).callonYamlFrontMatterContent1, expr: &zeroOrMoreExpr{ - pos: position{line: 96, col: 27, offset: 2643}, + pos: position{line: 100, col: 27, offset: 2848}, expr: &oneOrMoreExpr{ - pos: position{line: 96, col: 28, offset: 2644}, + pos: position{line: 100, col: 28, offset: 2849}, expr: &seqExpr{ - pos: position{line: 96, col: 29, offset: 2645}, + pos: position{line: 100, col: 29, offset: 2850}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 96, col: 29, offset: 2645}, + pos: position{line: 100, col: 29, offset: 2850}, expr: &ruleRefExpr{ - pos: position{line: 96, col: 30, offset: 2646}, + pos: position{line: 100, col: 30, offset: 2851}, name: "YamlFrontMatterToken", }, }, &anyMatcher{ - line: 96, col: 51, offset: 2667, + line: 100, col: 51, offset: 2872, }, }, }, @@ -467,98 +472,99 @@ var g = &grammar{ }, { name: "DocumentHeader", - pos: position{line: 103, col: 1, offset: 2833}, + pos: position{line: 107, col: 1, offset: 3038}, expr: &actionExpr{ - pos: position{line: 103, col: 19, offset: 2851}, + pos: position{line: 107, col: 19, offset: 3056}, run: (*parser).callonDocumentHeader1, expr: &seqExpr{ - pos: position{line: 103, col: 19, offset: 2851}, + pos: position{line: 107, col: 19, offset: 3056}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 103, col: 19, offset: 2851}, + pos: position{line: 107, col: 19, offset: 3056}, val: "=", ignoreCase: false, + want: "\"=\"", }, &oneOrMoreExpr{ - pos: position{line: 103, col: 23, offset: 2855}, + pos: position{line: 107, col: 23, offset: 3060}, expr: &ruleRefExpr{ - pos: position{line: 103, col: 23, offset: 2855}, - name: "WS", + pos: position{line: 107, col: 23, offset: 3060}, + name: "Space", }, }, &labeledExpr{ - pos: position{line: 103, col: 27, offset: 2859}, + pos: position{line: 107, col: 30, offset: 3067}, label: "title", expr: &ruleRefExpr{ - pos: position{line: 103, col: 34, offset: 2866}, + pos: position{line: 107, col: 37, offset: 3074}, name: "TitleElements", }, }, &labeledExpr{ - pos: position{line: 103, col: 49, offset: 2881}, + pos: position{line: 107, col: 52, offset: 3089}, label: "id", expr: &zeroOrMoreExpr{ - pos: position{line: 103, col: 53, offset: 2885}, + pos: position{line: 107, col: 56, offset: 3093}, expr: &ruleRefExpr{ - pos: position{line: 103, col: 53, offset: 2885}, + pos: position{line: 107, col: 56, offset: 3093}, name: "InlineElementID", }, }, }, &ruleRefExpr{ - pos: position{line: 103, col: 71, offset: 2903}, + pos: position{line: 107, col: 74, offset: 3111}, name: "EOL", }, &zeroOrMoreExpr{ - pos: position{line: 104, col: 9, offset: 2915}, + pos: position{line: 108, col: 9, offset: 3123}, expr: &choiceExpr{ - pos: position{line: 104, col: 10, offset: 2916}, + pos: position{line: 108, col: 10, offset: 3124}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 104, col: 10, offset: 2916}, + pos: position{line: 108, col: 10, offset: 3124}, name: "SingleLineComment", }, &ruleRefExpr{ - pos: position{line: 104, col: 30, offset: 2936}, + pos: position{line: 108, col: 30, offset: 3144}, name: "CommentBlock", }, }, }, }, &labeledExpr{ - pos: position{line: 105, col: 9, offset: 2959}, + pos: position{line: 109, col: 9, offset: 3167}, label: "authors", expr: &zeroOrOneExpr{ - pos: position{line: 105, col: 18, offset: 2968}, + pos: position{line: 109, col: 18, offset: 3176}, expr: &ruleRefExpr{ - pos: position{line: 105, col: 18, offset: 2968}, + pos: position{line: 109, col: 18, offset: 3176}, name: "DocumentAuthors", }, }, }, &zeroOrMoreExpr{ - pos: position{line: 106, col: 9, offset: 2995}, + pos: position{line: 110, col: 9, offset: 3203}, expr: &choiceExpr{ - pos: position{line: 106, col: 10, offset: 2996}, + pos: position{line: 110, col: 10, offset: 3204}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 106, col: 10, offset: 2996}, + pos: position{line: 110, col: 10, offset: 3204}, name: "SingleLineComment", }, &ruleRefExpr{ - pos: position{line: 106, col: 30, offset: 3016}, + pos: position{line: 110, col: 30, offset: 3224}, name: "CommentBlock", }, }, }, }, &labeledExpr{ - pos: position{line: 107, col: 9, offset: 3039}, + pos: position{line: 111, col: 9, offset: 3247}, label: "revision", expr: &zeroOrOneExpr{ - pos: position{line: 107, col: 19, offset: 3049}, + pos: position{line: 111, col: 19, offset: 3257}, expr: &ruleRefExpr{ - pos: position{line: 107, col: 19, offset: 3049}, + pos: position{line: 111, col: 19, offset: 3257}, name: "DocumentRevision", }, }, @@ -569,16 +575,16 @@ var g = &grammar{ }, { name: "DocumentAuthors", - pos: position{line: 111, col: 1, offset: 3150}, + pos: position{line: 115, col: 1, offset: 3358}, expr: &choiceExpr{ - pos: position{line: 111, col: 20, offset: 3169}, + pos: position{line: 115, col: 20, offset: 3377}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 111, col: 20, offset: 3169}, + pos: position{line: 115, col: 20, offset: 3377}, name: "DocumentAuthorsInlineForm", }, &ruleRefExpr{ - pos: position{line: 111, col: 48, offset: 3197}, + pos: position{line: 115, col: 48, offset: 3405}, name: "DocumentAuthorsAttributeForm", }, }, @@ -586,41 +592,42 @@ var g = &grammar{ }, { name: "DocumentAuthorsInlineForm", - pos: position{line: 113, col: 1, offset: 3227}, + pos: position{line: 117, col: 1, offset: 3435}, expr: &actionExpr{ - pos: position{line: 113, col: 30, offset: 3256}, + pos: position{line: 117, col: 30, offset: 3464}, run: (*parser).callonDocumentAuthorsInlineForm1, expr: &seqExpr{ - pos: position{line: 113, col: 30, offset: 3256}, + pos: position{line: 117, col: 30, offset: 3464}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 113, col: 30, offset: 3256}, + pos: position{line: 117, col: 30, offset: 3464}, expr: &ruleRefExpr{ - pos: position{line: 113, col: 30, offset: 3256}, - name: "WS", + pos: position{line: 117, col: 30, offset: 3464}, + name: "Space", }, }, ¬Expr{ - pos: position{line: 113, col: 34, offset: 3260}, + pos: position{line: 117, col: 37, offset: 3471}, expr: &litMatcher{ - pos: position{line: 113, col: 35, offset: 3261}, + pos: position{line: 117, col: 38, offset: 3472}, val: ":", ignoreCase: false, + want: "\":\"", }, }, &labeledExpr{ - pos: position{line: 113, col: 39, offset: 3265}, + pos: position{line: 117, col: 42, offset: 3476}, label: "authors", expr: &oneOrMoreExpr{ - pos: position{line: 113, col: 48, offset: 3274}, + pos: position{line: 117, col: 51, offset: 3485}, expr: &ruleRefExpr{ - pos: position{line: 113, col: 48, offset: 3274}, + pos: position{line: 117, col: 51, offset: 3485}, name: "DocumentAuthor", }, }, }, &ruleRefExpr{ - pos: position{line: 113, col: 65, offset: 3291}, + pos: position{line: 117, col: 68, offset: 3502}, name: "EOL", }, }, @@ -629,35 +636,36 @@ var g = &grammar{ }, { name: "DocumentAuthorsAttributeForm", - pos: position{line: 117, col: 1, offset: 3361}, + pos: position{line: 121, col: 1, offset: 3572}, expr: &actionExpr{ - pos: position{line: 117, col: 33, offset: 3393}, + pos: position{line: 121, col: 33, offset: 3604}, run: (*parser).callonDocumentAuthorsAttributeForm1, expr: &seqExpr{ - pos: position{line: 117, col: 33, offset: 3393}, + pos: position{line: 121, col: 33, offset: 3604}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 117, col: 33, offset: 3393}, + pos: position{line: 121, col: 33, offset: 3604}, expr: &ruleRefExpr{ - pos: position{line: 117, col: 33, offset: 3393}, - name: "WS", + pos: position{line: 121, col: 33, offset: 3604}, + name: "Space", }, }, &litMatcher{ - pos: position{line: 117, col: 37, offset: 3397}, + pos: position{line: 121, col: 40, offset: 3611}, val: ":author:", ignoreCase: false, + want: "\":author:\"", }, &labeledExpr{ - pos: position{line: 117, col: 48, offset: 3408}, + pos: position{line: 121, col: 51, offset: 3622}, label: "author", expr: &ruleRefExpr{ - pos: position{line: 117, col: 56, offset: 3416}, + pos: position{line: 121, col: 59, offset: 3630}, name: "DocumentAuthor", }, }, &ruleRefExpr{ - pos: position{line: 117, col: 72, offset: 3432}, + pos: position{line: 121, col: 75, offset: 3646}, name: "EOL", }, }, @@ -666,59 +674,60 @@ var g = &grammar{ }, { name: "DocumentAuthor", - pos: position{line: 121, col: 1, offset: 3511}, + pos: position{line: 125, col: 1, offset: 3725}, expr: &actionExpr{ - pos: position{line: 121, col: 19, offset: 3529}, + pos: position{line: 125, col: 19, offset: 3743}, run: (*parser).callonDocumentAuthor1, expr: &seqExpr{ - pos: position{line: 121, col: 19, offset: 3529}, + pos: position{line: 125, col: 19, offset: 3743}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 121, col: 19, offset: 3529}, + pos: position{line: 125, col: 19, offset: 3743}, expr: &ruleRefExpr{ - pos: position{line: 121, col: 19, offset: 3529}, - name: "WS", + pos: position{line: 125, col: 19, offset: 3743}, + name: "Space", }, }, &labeledExpr{ - pos: position{line: 121, col: 23, offset: 3533}, + pos: position{line: 125, col: 26, offset: 3750}, label: "fullname", expr: &ruleRefExpr{ - pos: position{line: 121, col: 33, offset: 3543}, + pos: position{line: 125, col: 36, offset: 3760}, name: "DocumentAuthorName", }, }, &labeledExpr{ - pos: position{line: 121, col: 53, offset: 3563}, + pos: position{line: 125, col: 56, offset: 3780}, label: "email", expr: &zeroOrOneExpr{ - pos: position{line: 121, col: 59, offset: 3569}, + pos: position{line: 125, col: 62, offset: 3786}, expr: &ruleRefExpr{ - pos: position{line: 121, col: 60, offset: 3570}, + pos: position{line: 125, col: 63, offset: 3787}, name: "DocumentAuthorEmail", }, }, }, &zeroOrMoreExpr{ - pos: position{line: 121, col: 82, offset: 3592}, + pos: position{line: 125, col: 85, offset: 3809}, expr: &ruleRefExpr{ - pos: position{line: 121, col: 82, offset: 3592}, - name: "WS", + pos: position{line: 125, col: 85, offset: 3809}, + name: "Space", }, }, &zeroOrOneExpr{ - pos: position{line: 121, col: 86, offset: 3596}, + pos: position{line: 125, col: 92, offset: 3816}, expr: &litMatcher{ - pos: position{line: 121, col: 86, offset: 3596}, + pos: position{line: 125, col: 92, offset: 3816}, val: ";", ignoreCase: false, + want: "\";\"", }, }, &zeroOrMoreExpr{ - pos: position{line: 121, col: 91, offset: 3601}, + pos: position{line: 125, col: 97, offset: 3821}, expr: &ruleRefExpr{ - pos: position{line: 121, col: 91, offset: 3601}, - name: "WS", + pos: position{line: 125, col: 97, offset: 3821}, + name: "Space", }, }, }, @@ -727,116 +736,60 @@ var g = &grammar{ }, { name: "DocumentAuthorName", - pos: position{line: 126, col: 1, offset: 3743}, + pos: position{line: 130, col: 1, offset: 3966}, expr: &actionExpr{ - pos: position{line: 126, col: 23, offset: 3765}, + pos: position{line: 130, col: 23, offset: 3988}, run: (*parser).callonDocumentAuthorName1, expr: &oneOrMoreExpr{ - pos: position{line: 126, col: 23, offset: 3765}, - expr: &choiceExpr{ - pos: position{line: 126, col: 24, offset: 3766}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 126, col: 24, offset: 3766}, - name: "Alphanums", - }, - &seqExpr{ - pos: position{line: 126, col: 37, offset: 3779}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 126, col: 37, offset: 3779}, - expr: &litMatcher{ - pos: position{line: 126, col: 38, offset: 3780}, - val: "<", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 126, col: 42, offset: 3784}, - expr: &litMatcher{ - pos: position{line: 126, col: 43, offset: 3785}, - val: ";", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 126, col: 47, offset: 3789}, - expr: &ruleRefExpr{ - pos: position{line: 126, col: 48, offset: 3790}, - name: "Newline", - }, - }, - &anyMatcher{ - line: 126, col: 56, offset: 3798, - }, - }, - }, - }, + pos: position{line: 130, col: 23, offset: 3988}, + expr: &charClassMatcher{ + pos: position{line: 130, col: 23, offset: 3988}, + val: "[^<;\\r\\n]", + chars: []rune{'<', ';', '\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, { name: "DocumentAuthorEmail", - pos: position{line: 130, col: 1, offset: 3839}, + pos: position{line: 134, col: 1, offset: 4035}, expr: &actionExpr{ - pos: position{line: 130, col: 24, offset: 3862}, + pos: position{line: 134, col: 24, offset: 4058}, run: (*parser).callonDocumentAuthorEmail1, expr: &seqExpr{ - pos: position{line: 130, col: 24, offset: 3862}, + pos: position{line: 134, col: 24, offset: 4058}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 130, col: 24, offset: 3862}, + pos: position{line: 134, col: 24, offset: 4058}, val: "<", ignoreCase: false, + want: "\"<\"", }, &labeledExpr{ - pos: position{line: 130, col: 28, offset: 3866}, + pos: position{line: 134, col: 28, offset: 4062}, label: "email", expr: &actionExpr{ - pos: position{line: 130, col: 35, offset: 3873}, + pos: position{line: 134, col: 35, offset: 4069}, run: (*parser).callonDocumentAuthorEmail5, expr: &oneOrMoreExpr{ - pos: position{line: 130, col: 35, offset: 3873}, - expr: &choiceExpr{ - pos: position{line: 130, col: 36, offset: 3874}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 130, col: 36, offset: 3874}, - name: "Alphanums", - }, - &seqExpr{ - pos: position{line: 130, col: 49, offset: 3887}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 130, col: 49, offset: 3887}, - expr: &litMatcher{ - pos: position{line: 130, col: 50, offset: 3888}, - val: ">", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 130, col: 54, offset: 3892}, - expr: &ruleRefExpr{ - pos: position{line: 130, col: 55, offset: 3893}, - name: "EOL", - }, - }, - &anyMatcher{ - line: 130, col: 60, offset: 3898, - }, - }, - }, - }, + pos: position{line: 134, col: 36, offset: 4070}, + expr: &charClassMatcher{ + pos: position{line: 134, col: 36, offset: 4070}, + val: "[^>\\r\\n]", + chars: []rune{'>', '\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, &litMatcher{ - pos: position{line: 132, col: 4, offset: 3939}, + pos: position{line: 136, col: 4, offset: 4117}, val: ">", ignoreCase: false, + want: "\">\"", }, }, }, @@ -844,82 +797,85 @@ var g = &grammar{ }, { name: "DocumentRevision", - pos: position{line: 138, col: 1, offset: 4100}, + pos: position{line: 142, col: 1, offset: 4278}, expr: &actionExpr{ - pos: position{line: 138, col: 21, offset: 4120}, + pos: position{line: 142, col: 21, offset: 4298}, run: (*parser).callonDocumentRevision1, expr: &seqExpr{ - pos: position{line: 138, col: 21, offset: 4120}, + pos: position{line: 142, col: 21, offset: 4298}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 138, col: 21, offset: 4120}, + pos: position{line: 142, col: 21, offset: 4298}, expr: &ruleRefExpr{ - pos: position{line: 138, col: 21, offset: 4120}, - name: "WS", + pos: position{line: 142, col: 21, offset: 4298}, + name: "Space", }, }, ¬Expr{ - pos: position{line: 138, col: 25, offset: 4124}, + pos: position{line: 142, col: 28, offset: 4305}, expr: &litMatcher{ - pos: position{line: 138, col: 26, offset: 4125}, + pos: position{line: 142, col: 29, offset: 4306}, val: ":", ignoreCase: false, + want: "\":\"", }, }, &labeledExpr{ - pos: position{line: 138, col: 30, offset: 4129}, + pos: position{line: 142, col: 33, offset: 4310}, label: "revision", expr: &choiceExpr{ - pos: position{line: 139, col: 9, offset: 4148}, + pos: position{line: 143, col: 9, offset: 4329}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 139, col: 10, offset: 4149}, + pos: position{line: 143, col: 10, offset: 4330}, run: (*parser).callonDocumentRevision9, expr: &seqExpr{ - pos: position{line: 139, col: 10, offset: 4149}, + pos: position{line: 143, col: 10, offset: 4330}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 139, col: 10, offset: 4149}, + pos: position{line: 143, col: 10, offset: 4330}, label: "revnumber", expr: &ruleRefExpr{ - pos: position{line: 139, col: 21, offset: 4160}, + pos: position{line: 143, col: 21, offset: 4341}, name: "DocumentRevisionNumber", }, }, &zeroOrOneExpr{ - pos: position{line: 139, col: 45, offset: 4184}, + pos: position{line: 143, col: 45, offset: 4365}, expr: &litMatcher{ - pos: position{line: 139, col: 45, offset: 4184}, + pos: position{line: 143, col: 45, offset: 4365}, val: ",", ignoreCase: false, + want: "\",\"", }, }, &labeledExpr{ - pos: position{line: 139, col: 50, offset: 4189}, + pos: position{line: 143, col: 50, offset: 4370}, label: "revdate", expr: &zeroOrOneExpr{ - pos: position{line: 139, col: 58, offset: 4197}, + pos: position{line: 143, col: 58, offset: 4378}, expr: &ruleRefExpr{ - pos: position{line: 139, col: 59, offset: 4198}, + pos: position{line: 143, col: 59, offset: 4379}, name: "DocumentRevisionDate", }, }, }, &zeroOrOneExpr{ - pos: position{line: 139, col: 82, offset: 4221}, + pos: position{line: 143, col: 82, offset: 4402}, expr: &litMatcher{ - pos: position{line: 139, col: 82, offset: 4221}, + pos: position{line: 143, col: 82, offset: 4402}, val: ":", ignoreCase: false, + want: "\":\"", }, }, &labeledExpr{ - pos: position{line: 139, col: 87, offset: 4226}, + pos: position{line: 143, col: 87, offset: 4407}, label: "revremark", expr: &zeroOrOneExpr{ - pos: position{line: 139, col: 97, offset: 4236}, + pos: position{line: 143, col: 97, offset: 4417}, expr: &ruleRefExpr{ - pos: position{line: 139, col: 98, offset: 4237}, + pos: position{line: 143, col: 98, offset: 4418}, name: "DocumentRevisionRemark", }, }, @@ -928,34 +884,35 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 141, col: 15, offset: 4354}, + pos: position{line: 145, col: 15, offset: 4535}, run: (*parser).callonDocumentRevision23, expr: &seqExpr{ - pos: position{line: 141, col: 15, offset: 4354}, + pos: position{line: 145, col: 15, offset: 4535}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 141, col: 15, offset: 4354}, + pos: position{line: 145, col: 15, offset: 4535}, label: "revdate", expr: &ruleRefExpr{ - pos: position{line: 141, col: 24, offset: 4363}, + pos: position{line: 145, col: 24, offset: 4544}, name: "DocumentRevisionDate", }, }, &zeroOrOneExpr{ - pos: position{line: 141, col: 46, offset: 4385}, + pos: position{line: 145, col: 46, offset: 4566}, expr: &litMatcher{ - pos: position{line: 141, col: 46, offset: 4385}, + pos: position{line: 145, col: 46, offset: 4566}, val: ":", ignoreCase: false, + want: "\":\"", }, }, &labeledExpr{ - pos: position{line: 141, col: 51, offset: 4390}, + pos: position{line: 145, col: 51, offset: 4571}, label: "revremark", expr: &zeroOrOneExpr{ - pos: position{line: 141, col: 61, offset: 4400}, + pos: position{line: 145, col: 61, offset: 4581}, expr: &ruleRefExpr{ - pos: position{line: 141, col: 62, offset: 4401}, + pos: position{line: 145, col: 62, offset: 4582}, name: "DocumentRevisionRemark", }, }, @@ -967,7 +924,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 143, col: 13, offset: 4510}, + pos: position{line: 147, col: 13, offset: 4691}, name: "EOL", }, }, @@ -976,153 +933,82 @@ var g = &grammar{ }, { name: "DocumentRevisionNumber", - pos: position{line: 148, col: 1, offset: 4640}, + pos: position{line: 152, col: 1, offset: 4821}, expr: &choiceExpr{ - pos: position{line: 148, col: 27, offset: 4666}, + pos: position{line: 152, col: 27, offset: 4847}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 148, col: 27, offset: 4666}, + pos: position{line: 152, col: 27, offset: 4847}, run: (*parser).callonDocumentRevisionNumber2, expr: &seqExpr{ - pos: position{line: 148, col: 27, offset: 4666}, + pos: position{line: 152, col: 27, offset: 4847}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 148, col: 27, offset: 4666}, + pos: position{line: 152, col: 27, offset: 4847}, val: "v", ignoreCase: true, + want: "\"v\"i", }, &ruleRefExpr{ - pos: position{line: 148, col: 32, offset: 4671}, + pos: position{line: 152, col: 32, offset: 4852}, name: "DIGIT", }, &oneOrMoreExpr{ - pos: position{line: 148, col: 39, offset: 4678}, - expr: &choiceExpr{ - pos: position{line: 148, col: 40, offset: 4679}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 148, col: 40, offset: 4679}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 148, col: 52, offset: 4691}, - name: "Spaces", - }, - &seqExpr{ - pos: position{line: 148, col: 62, offset: 4701}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 148, col: 62, offset: 4701}, - expr: &ruleRefExpr{ - pos: position{line: 148, col: 63, offset: 4702}, - name: "EOL", - }, - }, - ¬Expr{ - pos: position{line: 148, col: 67, offset: 4706}, - expr: &litMatcher{ - pos: position{line: 148, col: 68, offset: 4707}, - val: ",", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 148, col: 72, offset: 4711}, - expr: &litMatcher{ - pos: position{line: 148, col: 73, offset: 4712}, - val: ":", - ignoreCase: false, - }, - }, - &anyMatcher{ - line: 148, col: 78, offset: 4717, - }, - }, - }, - }, + pos: position{line: 152, col: 39, offset: 4859}, + expr: &charClassMatcher{ + pos: position{line: 152, col: 39, offset: 4859}, + val: "[^:,\\r\\n]", + chars: []rune{':', ',', '\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, }, &actionExpr{ - pos: position{line: 150, col: 5, offset: 4759}, - run: (*parser).callonDocumentRevisionNumber18, + pos: position{line: 154, col: 5, offset: 4907}, + run: (*parser).callonDocumentRevisionNumber8, expr: &seqExpr{ - pos: position{line: 150, col: 5, offset: 4759}, + pos: position{line: 154, col: 5, offset: 4907}, exprs: []interface{}{ &zeroOrOneExpr{ - pos: position{line: 150, col: 5, offset: 4759}, + pos: position{line: 154, col: 5, offset: 4907}, expr: &litMatcher{ - pos: position{line: 150, col: 5, offset: 4759}, + pos: position{line: 154, col: 5, offset: 4907}, val: "v", ignoreCase: true, + want: "\"v\"i", }, }, &ruleRefExpr{ - pos: position{line: 150, col: 11, offset: 4765}, + pos: position{line: 154, col: 11, offset: 4913}, name: "DIGIT", }, &oneOrMoreExpr{ - pos: position{line: 150, col: 18, offset: 4772}, - expr: &choiceExpr{ - pos: position{line: 150, col: 19, offset: 4773}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 150, col: 19, offset: 4773}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 150, col: 31, offset: 4785}, - name: "Spaces", - }, - &seqExpr{ - pos: position{line: 150, col: 41, offset: 4795}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 150, col: 41, offset: 4795}, - expr: &ruleRefExpr{ - pos: position{line: 150, col: 42, offset: 4796}, - name: "EOL", - }, - }, - ¬Expr{ - pos: position{line: 150, col: 46, offset: 4800}, - expr: &litMatcher{ - pos: position{line: 150, col: 47, offset: 4801}, - val: ",", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 150, col: 51, offset: 4805}, - expr: &litMatcher{ - pos: position{line: 150, col: 52, offset: 4806}, - val: ":", - ignoreCase: false, - }, - }, - &anyMatcher{ - line: 150, col: 57, offset: 4811, - }, - }, - }, - }, + pos: position{line: 154, col: 18, offset: 4920}, + expr: &charClassMatcher{ + pos: position{line: 154, col: 18, offset: 4920}, + val: "[^:,\\r\\n]", + chars: []rune{':', ',', '\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, &zeroOrMoreExpr{ - pos: position{line: 150, col: 62, offset: 4816}, + pos: position{line: 154, col: 29, offset: 4931}, expr: &ruleRefExpr{ - pos: position{line: 150, col: 62, offset: 4816}, - name: "WS", + pos: position{line: 154, col: 29, offset: 4931}, + name: "Space", }, }, &andExpr{ - pos: position{line: 150, col: 66, offset: 4820}, + pos: position{line: 154, col: 36, offset: 4938}, expr: &litMatcher{ - pos: position{line: 150, col: 67, offset: 4821}, + pos: position{line: 154, col: 37, offset: 4939}, val: ",", ignoreCase: false, + want: "\",\"", }, }, }, @@ -1133,140 +1019,92 @@ var g = &grammar{ }, { name: "DocumentRevisionDate", - pos: position{line: 154, col: 1, offset: 4861}, + pos: position{line: 158, col: 1, offset: 4979}, expr: &actionExpr{ - pos: position{line: 154, col: 25, offset: 4885}, + pos: position{line: 158, col: 25, offset: 5003}, run: (*parser).callonDocumentRevisionDate1, expr: &oneOrMoreExpr{ - pos: position{line: 154, col: 25, offset: 4885}, - expr: &choiceExpr{ - pos: position{line: 154, col: 26, offset: 4886}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 154, col: 26, offset: 4886}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 154, col: 38, offset: 4898}, - name: "Spaces", - }, - &seqExpr{ - pos: position{line: 154, col: 48, offset: 4908}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 154, col: 48, offset: 4908}, - expr: &ruleRefExpr{ - pos: position{line: 154, col: 49, offset: 4909}, - name: "EOL", - }, - }, - ¬Expr{ - pos: position{line: 154, col: 53, offset: 4913}, - expr: &litMatcher{ - pos: position{line: 154, col: 54, offset: 4914}, - val: ":", - ignoreCase: false, - }, - }, - &anyMatcher{ - line: 154, col: 59, offset: 4919, - }, - }, - }, - }, + pos: position{line: 158, col: 25, offset: 5003}, + expr: &charClassMatcher{ + pos: position{line: 158, col: 25, offset: 5003}, + val: "[^:\\r\\n]", + chars: []rune{':', '\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, { name: "DocumentRevisionRemark", - pos: position{line: 158, col: 1, offset: 4960}, + pos: position{line: 162, col: 1, offset: 5049}, expr: &actionExpr{ - pos: position{line: 158, col: 27, offset: 4986}, + pos: position{line: 162, col: 27, offset: 5075}, run: (*parser).callonDocumentRevisionRemark1, expr: &oneOrMoreExpr{ - pos: position{line: 158, col: 27, offset: 4986}, - expr: &choiceExpr{ - pos: position{line: 158, col: 28, offset: 4987}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 158, col: 28, offset: 4987}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 158, col: 40, offset: 4999}, - name: "Spaces", - }, - &seqExpr{ - pos: position{line: 158, col: 50, offset: 5009}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 158, col: 50, offset: 5009}, - expr: &ruleRefExpr{ - pos: position{line: 158, col: 51, offset: 5010}, - name: "EOL", - }, - }, - &anyMatcher{ - line: 158, col: 56, offset: 5015, - }, - }, - }, - }, + pos: position{line: 162, col: 27, offset: 5075}, + expr: &charClassMatcher{ + pos: position{line: 162, col: 27, offset: 5075}, + val: "[^\\r\\r\\n]", + chars: []rune{'\r', '\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, { name: "DocumentAttributeDeclaration", - pos: position{line: 165, col: 1, offset: 5171}, + pos: position{line: 169, col: 1, offset: 5237}, expr: &actionExpr{ - pos: position{line: 165, col: 33, offset: 5203}, + pos: position{line: 169, col: 33, offset: 5269}, run: (*parser).callonDocumentAttributeDeclaration1, expr: &seqExpr{ - pos: position{line: 165, col: 33, offset: 5203}, + pos: position{line: 169, col: 33, offset: 5269}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 165, col: 33, offset: 5203}, + pos: position{line: 169, col: 33, offset: 5269}, val: ":", ignoreCase: false, + want: "\":\"", }, &labeledExpr{ - pos: position{line: 165, col: 37, offset: 5207}, + pos: position{line: 169, col: 37, offset: 5273}, label: "name", expr: &ruleRefExpr{ - pos: position{line: 165, col: 43, offset: 5213}, + pos: position{line: 169, col: 43, offset: 5279}, name: "DocumentAttributeName", }, }, &litMatcher{ - pos: position{line: 165, col: 66, offset: 5236}, + pos: position{line: 169, col: 66, offset: 5302}, val: ":", ignoreCase: false, + want: "\":\"", }, &labeledExpr{ - pos: position{line: 165, col: 70, offset: 5240}, + pos: position{line: 170, col: 9, offset: 5315}, label: "value", expr: &zeroOrOneExpr{ - pos: position{line: 165, col: 76, offset: 5246}, + pos: position{line: 170, col: 15, offset: 5321}, expr: &actionExpr{ - pos: position{line: 165, col: 77, offset: 5247}, + pos: position{line: 170, col: 16, offset: 5322}, run: (*parser).callonDocumentAttributeDeclaration9, expr: &seqExpr{ - pos: position{line: 165, col: 78, offset: 5248}, + pos: position{line: 170, col: 17, offset: 5323}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 165, col: 78, offset: 5248}, + pos: position{line: 170, col: 17, offset: 5323}, expr: &ruleRefExpr{ - pos: position{line: 165, col: 78, offset: 5248}, - name: "WS", + pos: position{line: 170, col: 17, offset: 5323}, + name: "Space", }, }, &labeledExpr{ - pos: position{line: 165, col: 82, offset: 5252}, + pos: position{line: 170, col: 24, offset: 5330}, label: "value", expr: &ruleRefExpr{ - pos: position{line: 165, col: 89, offset: 5259}, + pos: position{line: 170, col: 31, offset: 5337}, name: "DocumentAttributeValue", }, }, @@ -1276,14 +1114,14 @@ var g = &grammar{ }, }, &zeroOrMoreExpr{ - pos: position{line: 165, col: 138, offset: 5308}, + pos: position{line: 172, col: 13, offset: 5408}, expr: &ruleRefExpr{ - pos: position{line: 165, col: 138, offset: 5308}, - name: "WS", + pos: position{line: 172, col: 13, offset: 5408}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 165, col: 142, offset: 5312}, + pos: position{line: 172, col: 20, offset: 5415}, name: "EOL", }, }, @@ -1292,76 +1130,32 @@ var g = &grammar{ }, { name: "DocumentAttributeName", - pos: position{line: 172, col: 1, offset: 5560}, + pos: position{line: 179, col: 1, offset: 5663}, expr: &actionExpr{ - pos: position{line: 172, col: 26, offset: 5585}, + pos: position{line: 179, col: 26, offset: 5688}, run: (*parser).callonDocumentAttributeName1, expr: &seqExpr{ - pos: position{line: 172, col: 26, offset: 5585}, + pos: position{line: 179, col: 26, offset: 5688}, exprs: []interface{}{ - &choiceExpr{ - pos: position{line: 172, col: 27, offset: 5586}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 172, col: 27, offset: 5586}, - val: "[A-Z]", - ranges: []rune{'A', 'Z'}, - ignoreCase: false, - inverted: false, - }, - &charClassMatcher{ - pos: position{line: 172, col: 35, offset: 5594}, - val: "[a-z]", - ranges: []rune{'a', 'z'}, - ignoreCase: false, - inverted: false, - }, - &charClassMatcher{ - pos: position{line: 172, col: 43, offset: 5602}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - &litMatcher{ - pos: position{line: 172, col: 51, offset: 5610}, - val: "_", - ignoreCase: false, - }, - }, + &charClassMatcher{ + pos: position{line: 179, col: 26, offset: 5688}, + val: "[\\pL0-9_]", + chars: []rune{'_'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, &zeroOrMoreExpr{ - pos: position{line: 172, col: 56, offset: 5615}, - expr: &choiceExpr{ - pos: position{line: 172, col: 57, offset: 5616}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 172, col: 57, offset: 5616}, - val: "[A-Z]", - ranges: []rune{'A', 'Z'}, - ignoreCase: false, - inverted: false, - }, - &charClassMatcher{ - pos: position{line: 172, col: 65, offset: 5624}, - val: "[a-z]", - ranges: []rune{'a', 'z'}, - ignoreCase: false, - inverted: false, - }, - &charClassMatcher{ - pos: position{line: 172, col: 73, offset: 5632}, - val: "[0-9]", - ranges: []rune{'0', '9'}, - ignoreCase: false, - inverted: false, - }, - &litMatcher{ - pos: position{line: 172, col: 81, offset: 5640}, - val: "-", - ignoreCase: false, - }, - }, + pos: position{line: 179, col: 36, offset: 5698}, + expr: &charClassMatcher{ + pos: position{line: 179, col: 37, offset: 5699}, + val: "[\\pL0-9-]", + chars: []rune{'-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, @@ -1370,107 +1164,103 @@ var g = &grammar{ }, { name: "DocumentAttributeValue", - pos: position{line: 176, col: 1, offset: 5682}, + pos: position{line: 183, col: 1, offset: 5747}, expr: &actionExpr{ - pos: position{line: 176, col: 27, offset: 5708}, + pos: position{line: 183, col: 27, offset: 5773}, run: (*parser).callonDocumentAttributeValue1, expr: &oneOrMoreExpr{ - pos: position{line: 176, col: 27, offset: 5708}, - expr: &seqExpr{ - pos: position{line: 176, col: 28, offset: 5709}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 176, col: 28, offset: 5709}, - expr: &ruleRefExpr{ - pos: position{line: 176, col: 29, offset: 5710}, - name: "Newline", - }, - }, - &anyMatcher{ - line: 176, col: 37, offset: 5718, - }, - }, + pos: position{line: 183, col: 27, offset: 5773}, + expr: &charClassMatcher{ + pos: position{line: 183, col: 27, offset: 5773}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, { name: "DocumentAttributeReset", - pos: position{line: 180, col: 1, offset: 5758}, + pos: position{line: 187, col: 1, offset: 5818}, expr: &choiceExpr{ - pos: position{line: 180, col: 27, offset: 5784}, + pos: position{line: 187, col: 27, offset: 5844}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 180, col: 27, offset: 5784}, + pos: position{line: 187, col: 27, offset: 5844}, run: (*parser).callonDocumentAttributeReset2, expr: &seqExpr{ - pos: position{line: 180, col: 27, offset: 5784}, + pos: position{line: 187, col: 27, offset: 5844}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 180, col: 27, offset: 5784}, + pos: position{line: 187, col: 27, offset: 5844}, val: ":!", ignoreCase: false, + want: "\":!\"", }, &labeledExpr{ - pos: position{line: 180, col: 32, offset: 5789}, + pos: position{line: 187, col: 32, offset: 5849}, label: "name", expr: &ruleRefExpr{ - pos: position{line: 180, col: 38, offset: 5795}, + pos: position{line: 187, col: 38, offset: 5855}, name: "DocumentAttributeName", }, }, &litMatcher{ - pos: position{line: 180, col: 61, offset: 5818}, + pos: position{line: 187, col: 61, offset: 5878}, val: ":", ignoreCase: false, + want: "\":\"", }, &zeroOrMoreExpr{ - pos: position{line: 180, col: 65, offset: 5822}, + pos: position{line: 187, col: 65, offset: 5882}, expr: &ruleRefExpr{ - pos: position{line: 180, col: 65, offset: 5822}, - name: "WS", + pos: position{line: 187, col: 65, offset: 5882}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 180, col: 69, offset: 5826}, + pos: position{line: 187, col: 72, offset: 5889}, name: "EOL", }, }, }, }, &actionExpr{ - pos: position{line: 182, col: 5, offset: 5894}, + pos: position{line: 189, col: 5, offset: 5957}, run: (*parser).callonDocumentAttributeReset11, expr: &seqExpr{ - pos: position{line: 182, col: 5, offset: 5894}, + pos: position{line: 189, col: 5, offset: 5957}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 182, col: 5, offset: 5894}, + pos: position{line: 189, col: 5, offset: 5957}, val: ":", ignoreCase: false, + want: "\":\"", }, &labeledExpr{ - pos: position{line: 182, col: 9, offset: 5898}, + pos: position{line: 189, col: 9, offset: 5961}, label: "name", expr: &ruleRefExpr{ - pos: position{line: 182, col: 15, offset: 5904}, + pos: position{line: 189, col: 15, offset: 5967}, name: "DocumentAttributeName", }, }, &litMatcher{ - pos: position{line: 182, col: 38, offset: 5927}, + pos: position{line: 189, col: 38, offset: 5990}, val: "!:", ignoreCase: false, + want: "\"!:\"", }, &zeroOrMoreExpr{ - pos: position{line: 182, col: 43, offset: 5932}, + pos: position{line: 189, col: 43, offset: 5995}, expr: &ruleRefExpr{ - pos: position{line: 182, col: 43, offset: 5932}, - name: "WS", + pos: position{line: 189, col: 43, offset: 5995}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 182, col: 47, offset: 5936}, + pos: position{line: 189, col: 50, offset: 6002}, name: "EOL", }, }, @@ -1481,30 +1271,32 @@ var g = &grammar{ }, { name: "DocumentAttributeSubstitution", - pos: position{line: 186, col: 1, offset: 6003}, + pos: position{line: 193, col: 1, offset: 6069}, expr: &actionExpr{ - pos: position{line: 186, col: 34, offset: 6036}, + pos: position{line: 193, col: 34, offset: 6102}, run: (*parser).callonDocumentAttributeSubstitution1, expr: &seqExpr{ - pos: position{line: 186, col: 34, offset: 6036}, + pos: position{line: 193, col: 34, offset: 6102}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 186, col: 34, offset: 6036}, + pos: position{line: 193, col: 34, offset: 6102}, val: "{", ignoreCase: false, + want: "\"{\"", }, &labeledExpr{ - pos: position{line: 186, col: 38, offset: 6040}, + pos: position{line: 193, col: 38, offset: 6106}, label: "name", expr: &ruleRefExpr{ - pos: position{line: 186, col: 44, offset: 6046}, + pos: position{line: 193, col: 44, offset: 6112}, name: "DocumentAttributeName", }, }, &litMatcher{ - pos: position{line: 186, col: 67, offset: 6069}, + pos: position{line: 193, col: 67, offset: 6135}, val: "}", ignoreCase: false, + want: "\"}\"", }, }, }, @@ -1512,28 +1304,28 @@ var g = &grammar{ }, { name: "ElementAttributes", - pos: position{line: 193, col: 1, offset: 6257}, + pos: position{line: 200, col: 1, offset: 6323}, expr: &actionExpr{ - pos: position{line: 193, col: 22, offset: 6278}, + pos: position{line: 200, col: 22, offset: 6344}, run: (*parser).callonElementAttributes1, expr: &seqExpr{ - pos: position{line: 193, col: 22, offset: 6278}, + pos: position{line: 200, col: 22, offset: 6344}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 193, col: 22, offset: 6278}, + pos: position{line: 200, col: 22, offset: 6344}, label: "attrs", expr: &oneOrMoreExpr{ - pos: position{line: 193, col: 28, offset: 6284}, + pos: position{line: 200, col: 28, offset: 6350}, expr: &ruleRefExpr{ - pos: position{line: 193, col: 29, offset: 6285}, + pos: position{line: 200, col: 29, offset: 6351}, name: "ElementAttribute", }, }, }, &zeroOrMoreExpr{ - pos: position{line: 193, col: 48, offset: 6304}, + pos: position{line: 200, col: 48, offset: 6370}, expr: &ruleRefExpr{ - pos: position{line: 193, col: 48, offset: 6304}, + pos: position{line: 200, col: 48, offset: 6370}, name: "BlankLine", }, }, @@ -1543,80 +1335,83 @@ var g = &grammar{ }, { name: "ElementAttribute", - pos: position{line: 197, col: 1, offset: 6386}, + pos: position{line: 204, col: 1, offset: 6452}, expr: &actionExpr{ - pos: position{line: 197, col: 21, offset: 6406}, + pos: position{line: 204, col: 21, offset: 6472}, run: (*parser).callonElementAttribute1, expr: &seqExpr{ - pos: position{line: 197, col: 21, offset: 6406}, + pos: position{line: 204, col: 21, offset: 6472}, exprs: []interface{}{ &andExpr{ - pos: position{line: 197, col: 21, offset: 6406}, + pos: position{line: 204, col: 21, offset: 6472}, expr: &choiceExpr{ - pos: position{line: 197, col: 23, offset: 6408}, + pos: position{line: 204, col: 23, offset: 6474}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 197, col: 23, offset: 6408}, + pos: position{line: 204, col: 23, offset: 6474}, val: "[", ignoreCase: false, + want: "\"[\"", }, &litMatcher{ - pos: position{line: 197, col: 29, offset: 6414}, + pos: position{line: 204, col: 29, offset: 6480}, val: ".", ignoreCase: false, + want: "\".\"", }, &litMatcher{ - pos: position{line: 197, col: 35, offset: 6420}, + pos: position{line: 204, col: 35, offset: 6486}, val: "#", ignoreCase: false, + want: "\"#\"", }, }, }, }, &labeledExpr{ - pos: position{line: 198, col: 5, offset: 6496}, + pos: position{line: 205, col: 5, offset: 6562}, label: "attr", expr: &choiceExpr{ - pos: position{line: 198, col: 11, offset: 6502}, + pos: position{line: 205, col: 11, offset: 6568}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 198, col: 11, offset: 6502}, + pos: position{line: 205, col: 11, offset: 6568}, name: "ElementID", }, &ruleRefExpr{ - pos: position{line: 199, col: 9, offset: 6523}, + pos: position{line: 206, col: 9, offset: 6589}, name: "ElementTitle", }, &ruleRefExpr{ - pos: position{line: 200, col: 9, offset: 6547}, + pos: position{line: 207, col: 9, offset: 6613}, name: "ElementRole", }, &ruleRefExpr{ - pos: position{line: 201, col: 9, offset: 6570}, + pos: position{line: 208, col: 9, offset: 6636}, name: "LiteralAttribute", }, &ruleRefExpr{ - pos: position{line: 202, col: 9, offset: 6598}, + pos: position{line: 209, col: 9, offset: 6664}, name: "SourceAttributes", }, &ruleRefExpr{ - pos: position{line: 203, col: 9, offset: 6626}, + pos: position{line: 210, col: 9, offset: 6692}, name: "QuoteAttributes", }, &ruleRefExpr{ - pos: position{line: 204, col: 9, offset: 6653}, + pos: position{line: 211, col: 9, offset: 6719}, name: "VerseAttributes", }, &ruleRefExpr{ - pos: position{line: 205, col: 9, offset: 6680}, + pos: position{line: 212, col: 9, offset: 6746}, name: "AdmonitionMarkerAttribute", }, &ruleRefExpr{ - pos: position{line: 206, col: 9, offset: 6717}, + pos: position{line: 213, col: 9, offset: 6783}, name: "HorizontalLayout", }, &ruleRefExpr{ - pos: position{line: 207, col: 9, offset: 6745}, + pos: position{line: 214, col: 9, offset: 6811}, name: "AttributeGroup", }, }, @@ -1628,16 +1423,16 @@ var g = &grammar{ }, { name: "MasqueradeAttribute", - pos: position{line: 212, col: 1, offset: 6928}, + pos: position{line: 219, col: 1, offset: 6994}, expr: &choiceExpr{ - pos: position{line: 212, col: 24, offset: 6951}, + pos: position{line: 219, col: 24, offset: 7017}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 212, col: 24, offset: 6951}, + pos: position{line: 219, col: 24, offset: 7017}, name: "QuoteAttributes", }, &ruleRefExpr{ - pos: position{line: 212, col: 42, offset: 6969}, + pos: position{line: 219, col: 42, offset: 7035}, name: "VerseAttributes", }, }, @@ -1645,81 +1440,85 @@ var g = &grammar{ }, { name: "ElementID", - pos: position{line: 214, col: 1, offset: 6986}, + pos: position{line: 221, col: 1, offset: 7052}, expr: &choiceExpr{ - pos: position{line: 214, col: 14, offset: 6999}, + pos: position{line: 221, col: 14, offset: 7065}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 214, col: 14, offset: 6999}, + pos: position{line: 221, col: 14, offset: 7065}, run: (*parser).callonElementID2, expr: &seqExpr{ - pos: position{line: 214, col: 14, offset: 6999}, + pos: position{line: 221, col: 14, offset: 7065}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 214, col: 14, offset: 6999}, + pos: position{line: 221, col: 14, offset: 7065}, val: "[[", ignoreCase: false, + want: "\"[[\"", }, &labeledExpr{ - pos: position{line: 214, col: 19, offset: 7004}, + pos: position{line: 221, col: 19, offset: 7070}, label: "id", expr: &ruleRefExpr{ - pos: position{line: 214, col: 23, offset: 7008}, + pos: position{line: 221, col: 23, offset: 7074}, name: "ID", }, }, &litMatcher{ - pos: position{line: 214, col: 27, offset: 7012}, + pos: position{line: 221, col: 27, offset: 7078}, val: "]]", ignoreCase: false, + want: "\"]]\"", }, &zeroOrMoreExpr{ - pos: position{line: 214, col: 32, offset: 7017}, + pos: position{line: 221, col: 32, offset: 7083}, expr: &ruleRefExpr{ - pos: position{line: 214, col: 32, offset: 7017}, - name: "WS", + pos: position{line: 221, col: 32, offset: 7083}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 214, col: 36, offset: 7021}, + pos: position{line: 221, col: 39, offset: 7090}, name: "EOL", }, }, }, }, &actionExpr{ - pos: position{line: 216, col: 5, offset: 7074}, + pos: position{line: 223, col: 5, offset: 7143}, run: (*parser).callonElementID11, expr: &seqExpr{ - pos: position{line: 216, col: 5, offset: 7074}, + pos: position{line: 223, col: 5, offset: 7143}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 216, col: 5, offset: 7074}, + pos: position{line: 223, col: 5, offset: 7143}, val: "[#", ignoreCase: false, + want: "\"[#\"", }, &labeledExpr{ - pos: position{line: 216, col: 10, offset: 7079}, + pos: position{line: 223, col: 10, offset: 7148}, label: "id", expr: &ruleRefExpr{ - pos: position{line: 216, col: 14, offset: 7083}, + pos: position{line: 223, col: 14, offset: 7152}, name: "ID", }, }, &litMatcher{ - pos: position{line: 216, col: 18, offset: 7087}, + pos: position{line: 223, col: 18, offset: 7156}, val: "]", ignoreCase: false, + want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 216, col: 23, offset: 7092}, + pos: position{line: 223, col: 23, offset: 7161}, expr: &ruleRefExpr{ - pos: position{line: 216, col: 23, offset: 7092}, - name: "WS", + pos: position{line: 223, col: 23, offset: 7161}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 216, col: 27, offset: 7096}, + pos: position{line: 223, col: 30, offset: 7168}, name: "EOL", }, }, @@ -1730,36 +1529,38 @@ var g = &grammar{ }, { name: "InlineElementID", - pos: position{line: 220, col: 1, offset: 7148}, + pos: position{line: 227, col: 1, offset: 7220}, expr: &actionExpr{ - pos: position{line: 220, col: 20, offset: 7167}, + pos: position{line: 227, col: 20, offset: 7239}, run: (*parser).callonInlineElementID1, expr: &seqExpr{ - pos: position{line: 220, col: 20, offset: 7167}, + pos: position{line: 227, col: 20, offset: 7239}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 220, col: 20, offset: 7167}, + pos: position{line: 227, col: 20, offset: 7239}, val: "[[", ignoreCase: false, + want: "\"[[\"", }, &labeledExpr{ - pos: position{line: 220, col: 25, offset: 7172}, + pos: position{line: 227, col: 25, offset: 7244}, label: "id", expr: &ruleRefExpr{ - pos: position{line: 220, col: 29, offset: 7176}, + pos: position{line: 227, col: 29, offset: 7248}, name: "ID", }, }, &litMatcher{ - pos: position{line: 220, col: 33, offset: 7180}, + pos: position{line: 227, col: 33, offset: 7252}, val: "]]", ignoreCase: false, + want: "\"]]\"", }, &zeroOrMoreExpr{ - pos: position{line: 220, col: 38, offset: 7185}, + pos: position{line: 227, col: 38, offset: 7257}, expr: &ruleRefExpr{ - pos: position{line: 220, col: 38, offset: 7185}, - name: "WS", + pos: position{line: 227, col: 38, offset: 7257}, + name: "Space", }, }, }, @@ -1768,138 +1569,106 @@ var g = &grammar{ }, { name: "ElementTitle", - pos: position{line: 226, col: 1, offset: 7459}, + pos: position{line: 233, col: 1, offset: 7534}, expr: &actionExpr{ - pos: position{line: 226, col: 17, offset: 7475}, + pos: position{line: 233, col: 17, offset: 7550}, run: (*parser).callonElementTitle1, expr: &seqExpr{ - pos: position{line: 226, col: 17, offset: 7475}, + pos: position{line: 233, col: 17, offset: 7550}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 226, col: 17, offset: 7475}, + pos: position{line: 233, col: 17, offset: 7550}, val: ".", ignoreCase: false, + want: "\".\"", }, &labeledExpr{ - pos: position{line: 226, col: 21, offset: 7479}, + pos: position{line: 233, col: 21, offset: 7554}, label: "title", - expr: &actionExpr{ - pos: position{line: 226, col: 28, offset: 7486}, - run: (*parser).callonElementTitle5, - expr: &seqExpr{ - pos: position{line: 226, col: 28, offset: 7486}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 226, col: 28, offset: 7486}, - name: "Alphanums", - }, - &zeroOrMoreExpr{ - pos: position{line: 226, col: 38, offset: 7496}, - expr: &choiceExpr{ - pos: position{line: 226, col: 39, offset: 7497}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 226, col: 39, offset: 7497}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 226, col: 51, offset: 7509}, - name: "Spaces", - }, - &seqExpr{ - pos: position{line: 226, col: 61, offset: 7519}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 226, col: 61, offset: 7519}, - expr: &ruleRefExpr{ - pos: position{line: 226, col: 62, offset: 7520}, - name: "Newline", - }, - }, - &anyMatcher{ - line: 226, col: 70, offset: 7528, - }, - }, - }, - }, - }, - }, - }, - }, + expr: &ruleRefExpr{ + pos: position{line: 233, col: 28, offset: 7561}, + name: "ElementTitleContent", }, }, &ruleRefExpr{ - pos: position{line: 228, col: 4, offset: 7569}, + pos: position{line: 233, col: 49, offset: 7582}, name: "EOL", }, }, }, }, }, + { + name: "ElementTitleContent", + pos: position{line: 237, col: 1, offset: 7640}, + expr: &actionExpr{ + pos: position{line: 237, col: 24, offset: 7663}, + run: (*parser).callonElementTitleContent1, + expr: &seqExpr{ + pos: position{line: 237, col: 24, offset: 7663}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 237, col: 24, offset: 7663}, + val: "[\\pL0-9]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + &zeroOrMoreExpr{ + pos: position{line: 237, col: 32, offset: 7671}, + expr: &charClassMatcher{ + pos: position{line: 237, col: 32, offset: 7671}, + val: "[^\\r\\n<>]", + chars: []rune{'\r', '\n', '<', '>'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, { name: "ElementRole", - pos: position{line: 234, col: 1, offset: 7721}, + pos: position{line: 243, col: 1, offset: 7898}, expr: &actionExpr{ - pos: position{line: 234, col: 16, offset: 7736}, + pos: position{line: 243, col: 16, offset: 7913}, run: (*parser).callonElementRole1, expr: &seqExpr{ - pos: position{line: 234, col: 16, offset: 7736}, + pos: position{line: 243, col: 16, offset: 7913}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 234, col: 16, offset: 7736}, + pos: position{line: 243, col: 16, offset: 7913}, val: "[.", ignoreCase: false, + want: "\"[.\"", }, &labeledExpr{ - pos: position{line: 234, col: 21, offset: 7741}, + pos: position{line: 243, col: 21, offset: 7918}, label: "role", expr: &actionExpr{ - pos: position{line: 234, col: 27, offset: 7747}, + pos: position{line: 243, col: 27, offset: 7924}, run: (*parser).callonElementRole5, expr: &seqExpr{ - pos: position{line: 234, col: 27, offset: 7747}, + pos: position{line: 243, col: 27, offset: 7924}, exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 234, col: 27, offset: 7747}, - name: "Alphanums", + &charClassMatcher{ + pos: position{line: 243, col: 27, offset: 7924}, + val: "[\\pL0-9]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, &zeroOrMoreExpr{ - pos: position{line: 234, col: 37, offset: 7757}, - expr: &choiceExpr{ - pos: position{line: 234, col: 38, offset: 7758}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 234, col: 38, offset: 7758}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 234, col: 50, offset: 7770}, - name: "Spaces", - }, - &seqExpr{ - pos: position{line: 234, col: 60, offset: 7780}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 234, col: 60, offset: 7780}, - expr: &ruleRefExpr{ - pos: position{line: 234, col: 61, offset: 7781}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 234, col: 69, offset: 7789}, - expr: &litMatcher{ - pos: position{line: 234, col: 70, offset: 7790}, - val: "]", - ignoreCase: false, - }, - }, - &anyMatcher{ - line: 234, col: 74, offset: 7794, - }, - }, - }, - }, + pos: position{line: 243, col: 36, offset: 7933}, + expr: &charClassMatcher{ + pos: position{line: 243, col: 36, offset: 7933}, + val: "[^\\]\\r\\n]", + chars: []rune{']', '\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, @@ -1907,19 +1676,20 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 236, col: 4, offset: 7835}, + pos: position{line: 245, col: 4, offset: 7980}, val: "]", ignoreCase: false, + want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 236, col: 8, offset: 7839}, + pos: position{line: 245, col: 8, offset: 7984}, expr: &ruleRefExpr{ - pos: position{line: 236, col: 8, offset: 7839}, - name: "WS", + pos: position{line: 245, col: 8, offset: 7984}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 236, col: 12, offset: 7843}, + pos: position{line: 245, col: 15, offset: 7991}, name: "EOL", }, }, @@ -1928,27 +1698,28 @@ var g = &grammar{ }, { name: "LiteralAttribute", - pos: position{line: 240, col: 1, offset: 7899}, + pos: position{line: 249, col: 1, offset: 8047}, expr: &actionExpr{ - pos: position{line: 240, col: 21, offset: 7919}, + pos: position{line: 249, col: 21, offset: 8067}, run: (*parser).callonLiteralAttribute1, expr: &seqExpr{ - pos: position{line: 240, col: 21, offset: 7919}, + pos: position{line: 249, col: 21, offset: 8067}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 240, col: 21, offset: 7919}, + pos: position{line: 249, col: 21, offset: 8067}, val: "[literal]", ignoreCase: false, + want: "\"[literal]\"", }, &zeroOrMoreExpr{ - pos: position{line: 240, col: 33, offset: 7931}, + pos: position{line: 249, col: 33, offset: 8079}, expr: &ruleRefExpr{ - pos: position{line: 240, col: 33, offset: 7931}, - name: "WS", + pos: position{line: 249, col: 33, offset: 8079}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 240, col: 37, offset: 7935}, + pos: position{line: 249, col: 40, offset: 8086}, name: "Newline", }, }, @@ -1957,40 +1728,42 @@ var g = &grammar{ }, { name: "AdmonitionMarkerAttribute", - pos: position{line: 245, col: 1, offset: 8067}, + pos: position{line: 254, col: 1, offset: 8218}, expr: &actionExpr{ - pos: position{line: 245, col: 30, offset: 8096}, + pos: position{line: 254, col: 30, offset: 8247}, run: (*parser).callonAdmonitionMarkerAttribute1, expr: &seqExpr{ - pos: position{line: 245, col: 30, offset: 8096}, + pos: position{line: 254, col: 30, offset: 8247}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 245, col: 30, offset: 8096}, + pos: position{line: 254, col: 30, offset: 8247}, val: "[", ignoreCase: false, + want: "\"[\"", }, &labeledExpr{ - pos: position{line: 245, col: 34, offset: 8100}, + pos: position{line: 254, col: 34, offset: 8251}, label: "k", expr: &ruleRefExpr{ - pos: position{line: 245, col: 37, offset: 8103}, + pos: position{line: 254, col: 37, offset: 8254}, name: "AdmonitionKind", }, }, &litMatcher{ - pos: position{line: 245, col: 53, offset: 8119}, + pos: position{line: 254, col: 53, offset: 8270}, val: "]", ignoreCase: false, + want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 245, col: 57, offset: 8123}, + pos: position{line: 254, col: 57, offset: 8274}, expr: &ruleRefExpr{ - pos: position{line: 245, col: 57, offset: 8123}, - name: "WS", + pos: position{line: 254, col: 57, offset: 8274}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 245, col: 61, offset: 8127}, + pos: position{line: 254, col: 64, offset: 8281}, name: "EOL", }, }, @@ -1999,41 +1772,43 @@ var g = &grammar{ }, { name: "SourceAttributes", - pos: position{line: 250, col: 1, offset: 8282}, + pos: position{line: 259, col: 1, offset: 8436}, expr: &actionExpr{ - pos: position{line: 250, col: 21, offset: 8302}, + pos: position{line: 259, col: 21, offset: 8456}, run: (*parser).callonSourceAttributes1, expr: &seqExpr{ - pos: position{line: 250, col: 21, offset: 8302}, + pos: position{line: 259, col: 21, offset: 8456}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 250, col: 21, offset: 8302}, + pos: position{line: 259, col: 21, offset: 8456}, val: "[source", ignoreCase: false, + want: "\"[source\"", }, &labeledExpr{ - pos: position{line: 251, col: 5, offset: 8317}, + pos: position{line: 260, col: 5, offset: 8471}, label: "language", expr: &zeroOrOneExpr{ - pos: position{line: 251, col: 14, offset: 8326}, + pos: position{line: 260, col: 14, offset: 8480}, expr: &actionExpr{ - pos: position{line: 251, col: 15, offset: 8327}, + pos: position{line: 260, col: 15, offset: 8481}, run: (*parser).callonSourceAttributes6, expr: &seqExpr{ - pos: position{line: 251, col: 15, offset: 8327}, + pos: position{line: 260, col: 15, offset: 8481}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 251, col: 15, offset: 8327}, + pos: position{line: 260, col: 15, offset: 8481}, val: ",", ignoreCase: false, + want: "\",\"", }, &labeledExpr{ - pos: position{line: 251, col: 19, offset: 8331}, + pos: position{line: 260, col: 19, offset: 8485}, label: "attr", expr: &zeroOrOneExpr{ - pos: position{line: 251, col: 24, offset: 8336}, + pos: position{line: 260, col: 24, offset: 8490}, expr: &ruleRefExpr{ - pos: position{line: 251, col: 25, offset: 8337}, + pos: position{line: 260, col: 25, offset: 8491}, name: "StandaloneAttributeValue", }, }, @@ -2044,28 +1819,29 @@ var g = &grammar{ }, }, &labeledExpr{ - pos: position{line: 252, col: 5, offset: 8392}, + pos: position{line: 261, col: 5, offset: 8546}, label: "others", expr: &zeroOrMoreExpr{ - pos: position{line: 252, col: 12, offset: 8399}, + pos: position{line: 261, col: 12, offset: 8553}, expr: &actionExpr{ - pos: position{line: 252, col: 13, offset: 8400}, + pos: position{line: 261, col: 13, offset: 8554}, run: (*parser).callonSourceAttributes14, expr: &seqExpr{ - pos: position{line: 252, col: 13, offset: 8400}, + pos: position{line: 261, col: 13, offset: 8554}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 252, col: 13, offset: 8400}, + pos: position{line: 261, col: 13, offset: 8554}, val: ",", ignoreCase: false, + want: "\",\"", }, &labeledExpr{ - pos: position{line: 252, col: 17, offset: 8404}, + pos: position{line: 261, col: 17, offset: 8558}, label: "attr", expr: &zeroOrOneExpr{ - pos: position{line: 252, col: 22, offset: 8409}, + pos: position{line: 261, col: 22, offset: 8563}, expr: &ruleRefExpr{ - pos: position{line: 252, col: 23, offset: 8410}, + pos: position{line: 261, col: 23, offset: 8564}, name: "GenericAttribute", }, }, @@ -2076,19 +1852,20 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 253, col: 5, offset: 8457}, + pos: position{line: 262, col: 5, offset: 8611}, val: "]", ignoreCase: false, + want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 253, col: 9, offset: 8461}, + pos: position{line: 262, col: 9, offset: 8615}, expr: &ruleRefExpr{ - pos: position{line: 253, col: 9, offset: 8461}, - name: "WS", + pos: position{line: 262, col: 9, offset: 8615}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 253, col: 13, offset: 8465}, + pos: position{line: 262, col: 16, offset: 8622}, name: "EOL", }, }, @@ -2097,43 +1874,45 @@ var g = &grammar{ }, { name: "AttributeGroup", - pos: position{line: 258, col: 1, offset: 8616}, + pos: position{line: 267, col: 1, offset: 8773}, expr: &actionExpr{ - pos: position{line: 258, col: 19, offset: 8634}, + pos: position{line: 267, col: 19, offset: 8791}, run: (*parser).callonAttributeGroup1, expr: &seqExpr{ - pos: position{line: 258, col: 19, offset: 8634}, + pos: position{line: 267, col: 19, offset: 8791}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 258, col: 19, offset: 8634}, + pos: position{line: 267, col: 19, offset: 8791}, val: "[", ignoreCase: false, + want: "\"[\"", }, &labeledExpr{ - pos: position{line: 258, col: 23, offset: 8638}, + pos: position{line: 267, col: 23, offset: 8795}, label: "attributes", expr: &zeroOrMoreExpr{ - pos: position{line: 258, col: 34, offset: 8649}, + pos: position{line: 267, col: 34, offset: 8806}, expr: &ruleRefExpr{ - pos: position{line: 258, col: 35, offset: 8650}, + pos: position{line: 267, col: 35, offset: 8807}, name: "GenericAttribute", }, }, }, &litMatcher{ - pos: position{line: 258, col: 54, offset: 8669}, + pos: position{line: 267, col: 54, offset: 8826}, val: "]", ignoreCase: false, + want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 258, col: 58, offset: 8673}, + pos: position{line: 267, col: 58, offset: 8830}, expr: &ruleRefExpr{ - pos: position{line: 258, col: 58, offset: 8673}, - name: "WS", + pos: position{line: 267, col: 58, offset: 8830}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 258, col: 62, offset: 8677}, + pos: position{line: 267, col: 65, offset: 8837}, name: "EOL", }, }, @@ -2142,16 +1921,16 @@ var g = &grammar{ }, { name: "GenericAttribute", - pos: position{line: 262, col: 1, offset: 8749}, + pos: position{line: 271, col: 1, offset: 8909}, expr: &choiceExpr{ - pos: position{line: 262, col: 21, offset: 8769}, + pos: position{line: 271, col: 21, offset: 8929}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 262, col: 21, offset: 8769}, + pos: position{line: 271, col: 21, offset: 8929}, name: "GenericAttributeWithValue", }, &ruleRefExpr{ - pos: position{line: 262, col: 49, offset: 8797}, + pos: position{line: 271, col: 49, offset: 8957}, name: "GenericAttributeWithoutValue", }, }, @@ -2159,50 +1938,52 @@ var g = &grammar{ }, { name: "GenericAttributeWithValue", - pos: position{line: 264, col: 1, offset: 8827}, + pos: position{line: 273, col: 1, offset: 8987}, expr: &actionExpr{ - pos: position{line: 264, col: 30, offset: 8856}, + pos: position{line: 273, col: 30, offset: 9016}, run: (*parser).callonGenericAttributeWithValue1, expr: &seqExpr{ - pos: position{line: 264, col: 30, offset: 8856}, + pos: position{line: 273, col: 30, offset: 9016}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 264, col: 30, offset: 8856}, + pos: position{line: 273, col: 30, offset: 9016}, label: "key", expr: &ruleRefExpr{ - pos: position{line: 264, col: 35, offset: 8861}, + pos: position{line: 273, col: 35, offset: 9021}, name: "AttributeKey", }, }, &litMatcher{ - pos: position{line: 264, col: 49, offset: 8875}, + pos: position{line: 273, col: 49, offset: 9035}, val: "=", ignoreCase: false, + want: "\"=\"", }, &labeledExpr{ - pos: position{line: 264, col: 53, offset: 8879}, + pos: position{line: 273, col: 53, offset: 9039}, label: "value", expr: &zeroOrOneExpr{ - pos: position{line: 264, col: 59, offset: 8885}, + pos: position{line: 273, col: 59, offset: 9045}, expr: &ruleRefExpr{ - pos: position{line: 264, col: 60, offset: 8886}, + pos: position{line: 273, col: 60, offset: 9046}, name: "AttributeValue", }, }, }, &zeroOrOneExpr{ - pos: position{line: 264, col: 77, offset: 8903}, + pos: position{line: 273, col: 77, offset: 9063}, expr: &litMatcher{ - pos: position{line: 264, col: 77, offset: 8903}, + pos: position{line: 273, col: 77, offset: 9063}, val: ",", ignoreCase: false, + want: "\",\"", }, }, &zeroOrMoreExpr{ - pos: position{line: 264, col: 82, offset: 8908}, + pos: position{line: 273, col: 82, offset: 9068}, expr: &ruleRefExpr{ - pos: position{line: 264, col: 82, offset: 8908}, - name: "WS", + pos: position{line: 273, col: 82, offset: 9068}, + name: "Space", }, }, }, @@ -2211,34 +1992,35 @@ var g = &grammar{ }, { name: "GenericAttributeWithoutValue", - pos: position{line: 268, col: 1, offset: 9004}, + pos: position{line: 277, col: 1, offset: 9167}, expr: &actionExpr{ - pos: position{line: 268, col: 33, offset: 9036}, + pos: position{line: 277, col: 33, offset: 9199}, run: (*parser).callonGenericAttributeWithoutValue1, expr: &seqExpr{ - pos: position{line: 268, col: 33, offset: 9036}, + pos: position{line: 277, col: 33, offset: 9199}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 268, col: 33, offset: 9036}, + pos: position{line: 277, col: 33, offset: 9199}, label: "key", expr: &ruleRefExpr{ - pos: position{line: 268, col: 38, offset: 9041}, + pos: position{line: 277, col: 38, offset: 9204}, name: "AttributeKey", }, }, &zeroOrOneExpr{ - pos: position{line: 268, col: 52, offset: 9055}, + pos: position{line: 277, col: 52, offset: 9218}, expr: &litMatcher{ - pos: position{line: 268, col: 52, offset: 9055}, + pos: position{line: 277, col: 52, offset: 9218}, val: ",", ignoreCase: false, + want: "\",\"", }, }, &zeroOrMoreExpr{ - pos: position{line: 268, col: 57, offset: 9060}, + pos: position{line: 277, col: 57, offset: 9223}, expr: &ruleRefExpr{ - pos: position{line: 268, col: 57, offset: 9060}, - name: "WS", + pos: position{line: 277, col: 57, offset: 9223}, + name: "Space", }, }, }, @@ -2247,69 +2029,69 @@ var g = &grammar{ }, { name: "AttributeKey", - pos: position{line: 272, col: 1, offset: 9145}, + pos: position{line: 281, col: 1, offset: 9311}, expr: &actionExpr{ - pos: position{line: 272, col: 17, offset: 9161}, + pos: position{line: 281, col: 17, offset: 9327}, run: (*parser).callonAttributeKey1, expr: &seqExpr{ - pos: position{line: 272, col: 17, offset: 9161}, + pos: position{line: 281, col: 17, offset: 9327}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 272, col: 17, offset: 9161}, + pos: position{line: 281, col: 17, offset: 9327}, expr: &litMatcher{ - pos: position{line: 272, col: 18, offset: 9162}, + pos: position{line: 281, col: 18, offset: 9328}, val: "quote", ignoreCase: false, + want: "\"quote\"", }, }, ¬Expr{ - pos: position{line: 272, col: 26, offset: 9170}, + pos: position{line: 281, col: 26, offset: 9336}, expr: &litMatcher{ - pos: position{line: 272, col: 27, offset: 9171}, + pos: position{line: 281, col: 27, offset: 9337}, val: "verse", ignoreCase: false, + want: "\"verse\"", }, }, ¬Expr{ - pos: position{line: 272, col: 35, offset: 9179}, + pos: position{line: 281, col: 35, offset: 9345}, expr: &litMatcher{ - pos: position{line: 272, col: 36, offset: 9180}, + pos: position{line: 281, col: 36, offset: 9346}, val: "literal", ignoreCase: false, + want: "\"literal\"", }, }, ¬Expr{ - pos: position{line: 272, col: 46, offset: 9190}, - expr: &ruleRefExpr{ - pos: position{line: 272, col: 47, offset: 9191}, - name: "Spaces", + pos: position{line: 281, col: 46, offset: 9356}, + expr: &oneOrMoreExpr{ + pos: position{line: 281, col: 48, offset: 9358}, + expr: &ruleRefExpr{ + pos: position{line: 281, col: 48, offset: 9358}, + name: "Space", + }, }, }, &labeledExpr{ - pos: position{line: 272, col: 54, offset: 9198}, + pos: position{line: 281, col: 56, offset: 9366}, label: "key", expr: &oneOrMoreExpr{ - pos: position{line: 272, col: 58, offset: 9202}, - expr: &choiceExpr{ - pos: position{line: 272, col: 59, offset: 9203}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 272, col: 59, offset: 9203}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 272, col: 71, offset: 9215}, - name: "OtherAttributeChar", - }, - }, + pos: position{line: 281, col: 61, offset: 9371}, + expr: &charClassMatcher{ + pos: position{line: 281, col: 61, offset: 9371}, + val: "[^\\r\\n=,\\]]", + chars: []rune{'\r', '\n', '=', ',', ']'}, + ignoreCase: false, + inverted: true, }, }, }, &zeroOrMoreExpr{ - pos: position{line: 272, col: 92, offset: 9236}, + pos: position{line: 281, col: 75, offset: 9385}, expr: &ruleRefExpr{ - pos: position{line: 272, col: 92, offset: 9236}, - name: "WS", + pos: position{line: 281, col: 75, offset: 9385}, + name: "Space", }, }, }, @@ -2318,31 +2100,21 @@ var g = &grammar{ }, { name: "AttributeValue", - pos: position{line: 276, col: 1, offset: 9276}, + pos: position{line: 285, col: 1, offset: 9428}, expr: &actionExpr{ - pos: position{line: 276, col: 19, offset: 9294}, + pos: position{line: 285, col: 19, offset: 9446}, run: (*parser).callonAttributeValue1, expr: &labeledExpr{ - pos: position{line: 276, col: 19, offset: 9294}, + pos: position{line: 285, col: 19, offset: 9446}, label: "value", expr: &oneOrMoreExpr{ - pos: position{line: 276, col: 25, offset: 9300}, - expr: &choiceExpr{ - pos: position{line: 276, col: 26, offset: 9301}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 276, col: 26, offset: 9301}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 276, col: 38, offset: 9313}, - name: "Spaces", - }, - &ruleRefExpr{ - pos: position{line: 276, col: 47, offset: 9322}, - name: "OtherAttributeChar", - }, - }, + pos: position{line: 285, col: 26, offset: 9453}, + expr: &charClassMatcher{ + pos: position{line: 285, col: 26, offset: 9453}, + val: "[^\\r\\n=,\\]]", + chars: []rune{'\r', '\n', '=', ',', ']'}, + ignoreCase: false, + inverted: true, }, }, }, @@ -2350,115 +2122,64 @@ var g = &grammar{ }, { name: "StandaloneAttributeValue", - pos: position{line: 280, col: 1, offset: 9380}, + pos: position{line: 289, col: 1, offset: 9504}, expr: &actionExpr{ - pos: position{line: 280, col: 29, offset: 9408}, + pos: position{line: 289, col: 29, offset: 9532}, run: (*parser).callonStandaloneAttributeValue1, expr: &seqExpr{ - pos: position{line: 280, col: 29, offset: 9408}, + pos: position{line: 289, col: 29, offset: 9532}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 280, col: 29, offset: 9408}, + pos: position{line: 289, col: 29, offset: 9532}, label: "value", expr: &oneOrMoreExpr{ - pos: position{line: 280, col: 35, offset: 9414}, - expr: &choiceExpr{ - pos: position{line: 280, col: 36, offset: 9415}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 280, col: 36, offset: 9415}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 280, col: 48, offset: 9427}, - name: "Spaces", - }, - &ruleRefExpr{ - pos: position{line: 280, col: 57, offset: 9436}, - name: "OtherAttributeChar", - }, - }, + pos: position{line: 289, col: 36, offset: 9539}, + expr: &charClassMatcher{ + pos: position{line: 289, col: 36, offset: 9539}, + val: "[^\\r\\n=,\\]]", + chars: []rune{'\r', '\n', '=', ',', ']'}, + ignoreCase: false, + inverted: true, }, }, }, ¬Expr{ - pos: position{line: 280, col: 78, offset: 9457}, + pos: position{line: 289, col: 50, offset: 9553}, expr: &litMatcher{ - pos: position{line: 280, col: 79, offset: 9458}, + pos: position{line: 289, col: 51, offset: 9554}, val: "=", ignoreCase: false, + want: "\"=\"", }, }, }, }, }, }, - { - name: "OtherAttributeChar", - pos: position{line: 284, col: 1, offset: 9624}, - expr: &seqExpr{ - pos: position{line: 284, col: 24, offset: 9647}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 284, col: 24, offset: 9647}, - expr: &ruleRefExpr{ - pos: position{line: 284, col: 25, offset: 9648}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 284, col: 33, offset: 9656}, - expr: &litMatcher{ - pos: position{line: 284, col: 34, offset: 9657}, - val: "=", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 284, col: 38, offset: 9661}, - expr: &litMatcher{ - pos: position{line: 284, col: 39, offset: 9662}, - val: ",", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 284, col: 43, offset: 9666}, - expr: &litMatcher{ - pos: position{line: 284, col: 44, offset: 9667}, - val: "]", - ignoreCase: false, - }, - }, - &anyMatcher{ - line: 284, col: 48, offset: 9671, - }, - }, - }, - }, { name: "HorizontalLayout", - pos: position{line: 286, col: 1, offset: 9675}, + pos: position{line: 293, col: 1, offset: 9720}, expr: &actionExpr{ - pos: position{line: 286, col: 21, offset: 9695}, + pos: position{line: 293, col: 21, offset: 9740}, run: (*parser).callonHorizontalLayout1, expr: &seqExpr{ - pos: position{line: 286, col: 21, offset: 9695}, + pos: position{line: 293, col: 21, offset: 9740}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 286, col: 21, offset: 9695}, + pos: position{line: 293, col: 21, offset: 9740}, val: "[horizontal]", ignoreCase: false, + want: "\"[horizontal]\"", }, &zeroOrMoreExpr{ - pos: position{line: 286, col: 36, offset: 9710}, + pos: position{line: 293, col: 36, offset: 9755}, expr: &ruleRefExpr{ - pos: position{line: 286, col: 36, offset: 9710}, - name: "WS", + pos: position{line: 293, col: 36, offset: 9755}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 286, col: 40, offset: 9714}, + pos: position{line: 293, col: 43, offset: 9762}, name: "EOL", }, }, @@ -2467,77 +2188,81 @@ var g = &grammar{ }, { name: "QuoteAttributes", - pos: position{line: 290, col: 1, offset: 9787}, + pos: position{line: 297, col: 1, offset: 9835}, expr: &actionExpr{ - pos: position{line: 290, col: 20, offset: 9806}, + pos: position{line: 297, col: 20, offset: 9854}, run: (*parser).callonQuoteAttributes1, expr: &seqExpr{ - pos: position{line: 290, col: 20, offset: 9806}, + pos: position{line: 297, col: 20, offset: 9854}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 290, col: 20, offset: 9806}, + pos: position{line: 297, col: 20, offset: 9854}, val: "[quote", ignoreCase: false, + want: "\"[quote\"", }, &zeroOrMoreExpr{ - pos: position{line: 290, col: 29, offset: 9815}, + pos: position{line: 297, col: 29, offset: 9863}, expr: &ruleRefExpr{ - pos: position{line: 290, col: 29, offset: 9815}, - name: "WS", + pos: position{line: 297, col: 29, offset: 9863}, + name: "Space", }, }, &zeroOrOneExpr{ - pos: position{line: 290, col: 33, offset: 9819}, + pos: position{line: 297, col: 36, offset: 9870}, expr: &litMatcher{ - pos: position{line: 290, col: 33, offset: 9819}, + pos: position{line: 297, col: 36, offset: 9870}, val: ",", ignoreCase: false, + want: "\",\"", }, }, &labeledExpr{ - pos: position{line: 290, col: 38, offset: 9824}, + pos: position{line: 297, col: 41, offset: 9875}, label: "author", expr: &zeroOrOneExpr{ - pos: position{line: 290, col: 45, offset: 9831}, + pos: position{line: 297, col: 48, offset: 9882}, expr: &ruleRefExpr{ - pos: position{line: 290, col: 46, offset: 9832}, + pos: position{line: 297, col: 49, offset: 9883}, name: "QuoteAttribute", }, }, }, &zeroOrOneExpr{ - pos: position{line: 290, col: 63, offset: 9849}, + pos: position{line: 297, col: 66, offset: 9900}, expr: &litMatcher{ - pos: position{line: 290, col: 63, offset: 9849}, + pos: position{line: 297, col: 66, offset: 9900}, val: ",", ignoreCase: false, + want: "\",\"", }, }, &labeledExpr{ - pos: position{line: 290, col: 68, offset: 9854}, + pos: position{line: 297, col: 71, offset: 9905}, label: "title", expr: &zeroOrOneExpr{ - pos: position{line: 290, col: 74, offset: 9860}, + pos: position{line: 297, col: 77, offset: 9911}, expr: &ruleRefExpr{ - pos: position{line: 290, col: 75, offset: 9861}, + pos: position{line: 297, col: 78, offset: 9912}, name: "QuoteAttribute", }, }, }, &litMatcher{ - pos: position{line: 290, col: 92, offset: 9878}, + pos: position{line: 297, col: 95, offset: 9929}, val: "]", ignoreCase: false, + want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 290, col: 96, offset: 9882}, + pos: position{line: 297, col: 99, offset: 9933}, expr: &ruleRefExpr{ - pos: position{line: 290, col: 96, offset: 9882}, - name: "WS", + pos: position{line: 297, col: 99, offset: 9933}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 290, col: 100, offset: 9886}, + pos: position{line: 297, col: 106, offset: 9940}, name: "EOL", }, }, @@ -2546,77 +2271,81 @@ var g = &grammar{ }, { name: "VerseAttributes", - pos: position{line: 294, col: 1, offset: 9955}, + pos: position{line: 301, col: 1, offset: 10009}, expr: &actionExpr{ - pos: position{line: 294, col: 20, offset: 9974}, + pos: position{line: 301, col: 20, offset: 10028}, run: (*parser).callonVerseAttributes1, expr: &seqExpr{ - pos: position{line: 294, col: 20, offset: 9974}, + pos: position{line: 301, col: 20, offset: 10028}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 294, col: 20, offset: 9974}, + pos: position{line: 301, col: 20, offset: 10028}, val: "[verse", ignoreCase: false, + want: "\"[verse\"", }, &zeroOrMoreExpr{ - pos: position{line: 294, col: 29, offset: 9983}, + pos: position{line: 301, col: 29, offset: 10037}, expr: &ruleRefExpr{ - pos: position{line: 294, col: 29, offset: 9983}, - name: "WS", + pos: position{line: 301, col: 29, offset: 10037}, + name: "Space", }, }, &zeroOrOneExpr{ - pos: position{line: 294, col: 33, offset: 9987}, + pos: position{line: 301, col: 36, offset: 10044}, expr: &litMatcher{ - pos: position{line: 294, col: 33, offset: 9987}, + pos: position{line: 301, col: 36, offset: 10044}, val: ",", ignoreCase: false, + want: "\",\"", }, }, &labeledExpr{ - pos: position{line: 294, col: 38, offset: 9992}, + pos: position{line: 301, col: 41, offset: 10049}, label: "author", expr: &zeroOrOneExpr{ - pos: position{line: 294, col: 45, offset: 9999}, + pos: position{line: 301, col: 48, offset: 10056}, expr: &ruleRefExpr{ - pos: position{line: 294, col: 46, offset: 10000}, + pos: position{line: 301, col: 49, offset: 10057}, name: "QuoteAttribute", }, }, }, &zeroOrOneExpr{ - pos: position{line: 294, col: 63, offset: 10017}, + pos: position{line: 301, col: 66, offset: 10074}, expr: &litMatcher{ - pos: position{line: 294, col: 63, offset: 10017}, + pos: position{line: 301, col: 66, offset: 10074}, val: ",", ignoreCase: false, + want: "\",\"", }, }, &labeledExpr{ - pos: position{line: 294, col: 68, offset: 10022}, + pos: position{line: 301, col: 71, offset: 10079}, label: "title", expr: &zeroOrOneExpr{ - pos: position{line: 294, col: 74, offset: 10028}, + pos: position{line: 301, col: 77, offset: 10085}, expr: &ruleRefExpr{ - pos: position{line: 294, col: 75, offset: 10029}, + pos: position{line: 301, col: 78, offset: 10086}, name: "QuoteAttribute", }, }, }, &litMatcher{ - pos: position{line: 294, col: 92, offset: 10046}, + pos: position{line: 301, col: 95, offset: 10103}, val: "]", ignoreCase: false, + want: "\"]\"", }, &zeroOrMoreExpr{ - pos: position{line: 294, col: 96, offset: 10050}, + pos: position{line: 301, col: 99, offset: 10107}, expr: &ruleRefExpr{ - pos: position{line: 294, col: 96, offset: 10050}, - name: "WS", + pos: position{line: 301, col: 99, offset: 10107}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 294, col: 100, offset: 10054}, + pos: position{line: 301, col: 106, offset: 10114}, name: "EOL", }, }, @@ -2625,88 +2354,53 @@ var g = &grammar{ }, { name: "QuoteAttribute", - pos: position{line: 298, col: 1, offset: 10141}, + pos: position{line: 305, col: 1, offset: 10201}, expr: &actionExpr{ - pos: position{line: 298, col: 19, offset: 10159}, + pos: position{line: 305, col: 19, offset: 10219}, run: (*parser).callonQuoteAttribute1, expr: &zeroOrMoreExpr{ - pos: position{line: 298, col: 19, offset: 10159}, - expr: &choiceExpr{ - pos: position{line: 298, col: 20, offset: 10160}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 298, col: 20, offset: 10160}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 298, col: 32, offset: 10172}, - name: "Spaces", - }, - &seqExpr{ - pos: position{line: 298, col: 42, offset: 10182}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 298, col: 42, offset: 10182}, - expr: &litMatcher{ - pos: position{line: 298, col: 43, offset: 10183}, - val: ",", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 298, col: 47, offset: 10187}, - expr: &litMatcher{ - pos: position{line: 298, col: 48, offset: 10188}, - val: "]", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 298, col: 52, offset: 10192}, - expr: &ruleRefExpr{ - pos: position{line: 298, col: 53, offset: 10193}, - name: "EOL", - }, - }, - &anyMatcher{ - line: 298, col: 57, offset: 10197, - }, - }, - }, - }, + pos: position{line: 305, col: 20, offset: 10220}, + expr: &charClassMatcher{ + pos: position{line: 305, col: 20, offset: 10220}, + val: "[^\\r\\n,\\]]", + chars: []rune{'\r', '\n', ',', ']'}, + ignoreCase: false, + inverted: true, }, }, }, }, { name: "InlineAttributes", - pos: position{line: 302, col: 1, offset: 10238}, + pos: position{line: 309, col: 1, offset: 10269}, expr: &actionExpr{ - pos: position{line: 302, col: 21, offset: 10258}, + pos: position{line: 309, col: 21, offset: 10289}, run: (*parser).callonInlineAttributes1, expr: &seqExpr{ - pos: position{line: 302, col: 21, offset: 10258}, + pos: position{line: 309, col: 21, offset: 10289}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 302, col: 21, offset: 10258}, + pos: position{line: 309, col: 21, offset: 10289}, val: "[", ignoreCase: false, + want: "\"[\"", }, &labeledExpr{ - pos: position{line: 302, col: 25, offset: 10262}, + pos: position{line: 309, col: 25, offset: 10293}, label: "attrs", expr: &zeroOrMoreExpr{ - pos: position{line: 302, col: 31, offset: 10268}, + pos: position{line: 309, col: 31, offset: 10299}, expr: &ruleRefExpr{ - pos: position{line: 302, col: 32, offset: 10269}, + pos: position{line: 309, col: 32, offset: 10300}, name: "GenericAttribute", }, }, }, &litMatcher{ - pos: position{line: 302, col: 51, offset: 10288}, + pos: position{line: 309, col: 51, offset: 10319}, val: "]", ignoreCase: false, + want: "\"]\"", }, }, }, @@ -2714,72 +2408,73 @@ var g = &grammar{ }, { name: "Section", - pos: position{line: 309, col: 1, offset: 10462}, + pos: position{line: 316, col: 1, offset: 10493}, expr: &actionExpr{ - pos: position{line: 309, col: 12, offset: 10473}, + pos: position{line: 316, col: 12, offset: 10504}, run: (*parser).callonSection1, expr: &seqExpr{ - pos: position{line: 309, col: 12, offset: 10473}, + pos: position{line: 316, col: 12, offset: 10504}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 309, col: 12, offset: 10473}, + pos: position{line: 316, col: 12, offset: 10504}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 309, col: 23, offset: 10484}, + pos: position{line: 316, col: 23, offset: 10515}, expr: &ruleRefExpr{ - pos: position{line: 309, col: 24, offset: 10485}, + pos: position{line: 316, col: 24, offset: 10516}, name: "ElementAttributes", }, }, }, &labeledExpr{ - pos: position{line: 310, col: 5, offset: 10509}, + pos: position{line: 317, col: 5, offset: 10540}, label: "level", expr: &actionExpr{ - pos: position{line: 310, col: 12, offset: 10516}, + pos: position{line: 317, col: 12, offset: 10547}, run: (*parser).callonSection7, expr: &oneOrMoreExpr{ - pos: position{line: 310, col: 12, offset: 10516}, + pos: position{line: 317, col: 12, offset: 10547}, expr: &litMatcher{ - pos: position{line: 310, col: 13, offset: 10517}, + pos: position{line: 317, col: 13, offset: 10548}, val: "=", ignoreCase: false, + want: "\"=\"", }, }, }, }, &andCodeExpr{ - pos: position{line: 314, col: 5, offset: 10608}, + pos: position{line: 321, col: 5, offset: 10639}, run: (*parser).callonSection10, }, &oneOrMoreExpr{ - pos: position{line: 318, col: 5, offset: 10760}, + pos: position{line: 325, col: 5, offset: 10791}, expr: &ruleRefExpr{ - pos: position{line: 318, col: 5, offset: 10760}, - name: "WS", + pos: position{line: 325, col: 5, offset: 10791}, + name: "Space", }, }, &labeledExpr{ - pos: position{line: 318, col: 9, offset: 10764}, + pos: position{line: 325, col: 12, offset: 10798}, label: "title", expr: &ruleRefExpr{ - pos: position{line: 318, col: 16, offset: 10771}, + pos: position{line: 325, col: 19, offset: 10805}, name: "TitleElements", }, }, &labeledExpr{ - pos: position{line: 318, col: 31, offset: 10786}, + pos: position{line: 325, col: 34, offset: 10820}, label: "id", expr: &zeroOrMoreExpr{ - pos: position{line: 318, col: 35, offset: 10790}, + pos: position{line: 325, col: 38, offset: 10824}, expr: &ruleRefExpr{ - pos: position{line: 318, col: 35, offset: 10790}, + pos: position{line: 325, col: 38, offset: 10824}, name: "InlineElementID", }, }, }, &ruleRefExpr{ - pos: position{line: 318, col: 53, offset: 10808}, + pos: position{line: 325, col: 56, offset: 10842}, name: "EOL", }, }, @@ -2788,34 +2483,34 @@ var g = &grammar{ }, { name: "TitleElements", - pos: position{line: 322, col: 1, offset: 10914}, + pos: position{line: 329, col: 1, offset: 10948}, expr: &actionExpr{ - pos: position{line: 322, col: 18, offset: 10931}, + pos: position{line: 329, col: 18, offset: 10965}, run: (*parser).callonTitleElements1, expr: &labeledExpr{ - pos: position{line: 322, col: 18, offset: 10931}, + pos: position{line: 329, col: 18, offset: 10965}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 322, col: 27, offset: 10940}, + pos: position{line: 329, col: 27, offset: 10974}, expr: &seqExpr{ - pos: position{line: 322, col: 28, offset: 10941}, + pos: position{line: 329, col: 28, offset: 10975}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 322, col: 28, offset: 10941}, + pos: position{line: 329, col: 28, offset: 10975}, expr: &ruleRefExpr{ - pos: position{line: 322, col: 29, offset: 10942}, + pos: position{line: 329, col: 29, offset: 10976}, name: "Newline", }, }, ¬Expr{ - pos: position{line: 322, col: 37, offset: 10950}, + pos: position{line: 329, col: 37, offset: 10984}, expr: &ruleRefExpr{ - pos: position{line: 322, col: 38, offset: 10951}, + pos: position{line: 329, col: 38, offset: 10985}, name: "InlineElementID", }, }, &ruleRefExpr{ - pos: position{line: 322, col: 54, offset: 10967}, + pos: position{line: 329, col: 54, offset: 11001}, name: "TitleElement", }, }, @@ -2826,66 +2521,61 @@ var g = &grammar{ }, { name: "TitleElement", - pos: position{line: 326, col: 1, offset: 11088}, + pos: position{line: 333, col: 1, offset: 11122}, expr: &actionExpr{ - pos: position{line: 326, col: 17, offset: 11104}, + pos: position{line: 333, col: 17, offset: 11138}, run: (*parser).callonTitleElement1, expr: &labeledExpr{ - pos: position{line: 326, col: 17, offset: 11104}, + pos: position{line: 333, col: 17, offset: 11138}, label: "element", expr: &choiceExpr{ - pos: position{line: 326, col: 26, offset: 11113}, + pos: position{line: 333, col: 26, offset: 11147}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 326, col: 26, offset: 11113}, - name: "SimpleWord", + pos: position{line: 333, col: 26, offset: 11147}, + name: "Word", }, &ruleRefExpr{ - pos: position{line: 327, col: 11, offset: 11134}, - name: "Spaces", + pos: position{line: 334, col: 11, offset: 11162}, + name: "LineBreak", + }, + &oneOrMoreExpr{ + pos: position{line: 335, col: 11, offset: 11207}, + expr: &ruleRefExpr{ + pos: position{line: 335, col: 11, offset: 11207}, + name: "Space", + }, }, &ruleRefExpr{ - pos: position{line: 328, col: 11, offset: 11152}, + pos: position{line: 336, col: 11, offset: 11225}, name: "CrossReference", }, &ruleRefExpr{ - pos: position{line: 329, col: 11, offset: 11177}, + pos: position{line: 337, col: 11, offset: 11250}, name: "Passthrough", }, &ruleRefExpr{ - pos: position{line: 330, col: 11, offset: 11199}, + pos: position{line: 338, col: 11, offset: 11272}, name: "InlineImage", }, &ruleRefExpr{ - pos: position{line: 331, col: 11, offset: 11222}, + pos: position{line: 339, col: 11, offset: 11295}, name: "Link", }, &ruleRefExpr{ - pos: position{line: 332, col: 11, offset: 11237}, + pos: position{line: 340, col: 11, offset: 11310}, name: "InlineFootnote", }, &ruleRefExpr{ - pos: position{line: 333, col: 11, offset: 11262}, + pos: position{line: 341, col: 11, offset: 11335}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 334, col: 11, offset: 11283}, + pos: position{line: 342, col: 11, offset: 11356}, name: "DocumentAttributeSubstitution", }, &ruleRefExpr{ - pos: position{line: 335, col: 11, offset: 11323}, - name: "LineBreak", - }, - &ruleRefExpr{ - pos: position{line: 336, col: 11, offset: 11343}, - name: "Parenthesis", - }, - &ruleRefExpr{ - pos: position{line: 337, col: 11, offset: 11365}, - name: "AnyChars", - }, - &ruleRefExpr{ - pos: position{line: 338, col: 11, offset: 11384}, + pos: position{line: 343, col: 11, offset: 11396}, name: "AnyChar", }, }, @@ -2895,17 +2585,18 @@ var g = &grammar{ }, { name: "TableOfContentsPlaceHolder", - pos: position{line: 345, col: 1, offset: 11536}, + pos: position{line: 350, col: 1, offset: 11547}, expr: &seqExpr{ - pos: position{line: 345, col: 31, offset: 11566}, + pos: position{line: 350, col: 31, offset: 11577}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 345, col: 31, offset: 11566}, + pos: position{line: 350, col: 31, offset: 11577}, val: "toc::[]", ignoreCase: false, + want: "\"toc::[]\"", }, &ruleRefExpr{ - pos: position{line: 345, col: 41, offset: 11576}, + pos: position{line: 350, col: 41, offset: 11587}, name: "EOL", }, }, @@ -2913,39 +2604,40 @@ var g = &grammar{ }, { name: "UserMacroBlock", - pos: position{line: 350, col: 1, offset: 11687}, + pos: position{line: 355, col: 1, offset: 11698}, expr: &actionExpr{ - pos: position{line: 350, col: 19, offset: 11705}, + pos: position{line: 355, col: 19, offset: 11716}, run: (*parser).callonUserMacroBlock1, expr: &seqExpr{ - pos: position{line: 350, col: 19, offset: 11705}, + pos: position{line: 355, col: 19, offset: 11716}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 350, col: 19, offset: 11705}, + pos: position{line: 355, col: 19, offset: 11716}, label: "name", expr: &ruleRefExpr{ - pos: position{line: 350, col: 25, offset: 11711}, + pos: position{line: 355, col: 25, offset: 11722}, name: "UserMacroName", }, }, &litMatcher{ - pos: position{line: 350, col: 40, offset: 11726}, + pos: position{line: 355, col: 40, offset: 11737}, val: "::", ignoreCase: false, + want: "\"::\"", }, &labeledExpr{ - pos: position{line: 350, col: 45, offset: 11731}, + pos: position{line: 355, col: 45, offset: 11742}, label: "value", expr: &ruleRefExpr{ - pos: position{line: 350, col: 52, offset: 11738}, + pos: position{line: 355, col: 52, offset: 11749}, name: "UserMacroValue", }, }, &labeledExpr{ - pos: position{line: 350, col: 68, offset: 11754}, + pos: position{line: 355, col: 68, offset: 11765}, label: "attrs", expr: &ruleRefExpr{ - pos: position{line: 350, col: 75, offset: 11761}, + pos: position{line: 355, col: 75, offset: 11772}, name: "UserMacroAttributes", }, }, @@ -2955,39 +2647,40 @@ var g = &grammar{ }, { name: "InlineUserMacro", - pos: position{line: 354, col: 1, offset: 11902}, + pos: position{line: 359, col: 1, offset: 11913}, expr: &actionExpr{ - pos: position{line: 354, col: 20, offset: 11921}, + pos: position{line: 359, col: 20, offset: 11932}, run: (*parser).callonInlineUserMacro1, expr: &seqExpr{ - pos: position{line: 354, col: 20, offset: 11921}, + pos: position{line: 359, col: 20, offset: 11932}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 354, col: 20, offset: 11921}, + pos: position{line: 359, col: 20, offset: 11932}, label: "name", expr: &ruleRefExpr{ - pos: position{line: 354, col: 26, offset: 11927}, + pos: position{line: 359, col: 26, offset: 11938}, name: "UserMacroName", }, }, &litMatcher{ - pos: position{line: 354, col: 41, offset: 11942}, + pos: position{line: 359, col: 41, offset: 11953}, val: ":", ignoreCase: false, + want: "\":\"", }, &labeledExpr{ - pos: position{line: 354, col: 45, offset: 11946}, + pos: position{line: 359, col: 45, offset: 11957}, label: "value", expr: &ruleRefExpr{ - pos: position{line: 354, col: 52, offset: 11953}, + pos: position{line: 359, col: 52, offset: 11964}, name: "UserMacroValue", }, }, &labeledExpr{ - pos: position{line: 354, col: 68, offset: 11969}, + pos: position{line: 359, col: 68, offset: 11980}, label: "attrs", expr: &ruleRefExpr{ - pos: position{line: 354, col: 75, offset: 11976}, + pos: position{line: 359, col: 75, offset: 11987}, name: "UserMacroAttributes", }, }, @@ -2997,124 +2690,73 @@ var g = &grammar{ }, { name: "UserMacroName", - pos: position{line: 358, col: 1, offset: 12118}, + pos: position{line: 363, col: 1, offset: 12129}, expr: &actionExpr{ - pos: position{line: 358, col: 18, offset: 12135}, + pos: position{line: 363, col: 18, offset: 12146}, run: (*parser).callonUserMacroName1, expr: &oneOrMoreExpr{ - pos: position{line: 358, col: 18, offset: 12135}, - expr: &choiceExpr{ - pos: position{line: 358, col: 19, offset: 12136}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 358, col: 19, offset: 12136}, - val: "[a-zA-Z0-9]", - ranges: []rune{'a', 'z', 'A', 'Z', '0', '9'}, - ignoreCase: false, - inverted: false, - }, - &litMatcher{ - pos: position{line: 358, col: 33, offset: 12150}, - val: "_", - ignoreCase: false, - }, - &litMatcher{ - pos: position{line: 358, col: 39, offset: 12156}, - val: "-", - ignoreCase: false, - }, - }, + pos: position{line: 363, col: 19, offset: 12147}, + expr: &charClassMatcher{ + pos: position{line: 363, col: 19, offset: 12147}, + val: "[\\pL0-9_-]", + chars: []rune{'_', '-'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, }, }, { name: "UserMacroValue", - pos: position{line: 362, col: 1, offset: 12198}, + pos: position{line: 367, col: 1, offset: 12196}, expr: &actionExpr{ - pos: position{line: 362, col: 19, offset: 12216}, + pos: position{line: 367, col: 19, offset: 12214}, run: (*parser).callonUserMacroValue1, expr: &zeroOrMoreExpr{ - pos: position{line: 362, col: 19, offset: 12216}, - expr: &choiceExpr{ - pos: position{line: 362, col: 20, offset: 12217}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 362, col: 20, offset: 12217}, - name: "Alphanums", - }, - &seqExpr{ - pos: position{line: 362, col: 33, offset: 12230}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 362, col: 33, offset: 12230}, - expr: &ruleRefExpr{ - pos: position{line: 362, col: 34, offset: 12231}, - name: "WS", - }, - }, - ¬Expr{ - pos: position{line: 362, col: 37, offset: 12234}, - expr: &litMatcher{ - pos: position{line: 362, col: 38, offset: 12235}, - val: ":", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 362, col: 42, offset: 12239}, - expr: &litMatcher{ - pos: position{line: 362, col: 43, offset: 12240}, - val: "[", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 362, col: 47, offset: 12244}, - expr: &ruleRefExpr{ - pos: position{line: 362, col: 48, offset: 12245}, - name: "EOL", - }, - }, - &anyMatcher{ - line: 362, col: 52, offset: 12249, - }, - }, - }, - }, + pos: position{line: 367, col: 19, offset: 12214}, + expr: &charClassMatcher{ + pos: position{line: 367, col: 19, offset: 12214}, + val: "[^:[ \\r\\n]", + chars: []rune{':', '[', ' ', '\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, { name: "UserMacroAttributes", - pos: position{line: 366, col: 1, offset: 12290}, + pos: position{line: 371, col: 1, offset: 12262}, expr: &actionExpr{ - pos: position{line: 366, col: 24, offset: 12313}, + pos: position{line: 371, col: 24, offset: 12285}, run: (*parser).callonUserMacroAttributes1, expr: &seqExpr{ - pos: position{line: 366, col: 24, offset: 12313}, + pos: position{line: 371, col: 24, offset: 12285}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 366, col: 24, offset: 12313}, + pos: position{line: 371, col: 24, offset: 12285}, val: "[", ignoreCase: false, + want: "\"[\"", }, &labeledExpr{ - pos: position{line: 366, col: 28, offset: 12317}, + pos: position{line: 371, col: 28, offset: 12289}, label: "attrs", expr: &zeroOrMoreExpr{ - pos: position{line: 366, col: 34, offset: 12323}, + pos: position{line: 371, col: 34, offset: 12295}, expr: &ruleRefExpr{ - pos: position{line: 366, col: 35, offset: 12324}, + pos: position{line: 371, col: 35, offset: 12296}, name: "GenericAttribute", }, }, }, &litMatcher{ - pos: position{line: 366, col: 54, offset: 12343}, + pos: position{line: 371, col: 54, offset: 12315}, val: "]", ignoreCase: false, + want: "\"]\"", }, }, }, @@ -3122,40 +2764,41 @@ var g = &grammar{ }, { name: "FileInclusion", - pos: position{line: 373, col: 1, offset: 12523}, + pos: position{line: 378, col: 1, offset: 12495}, expr: &actionExpr{ - pos: position{line: 373, col: 18, offset: 12540}, + pos: position{line: 378, col: 18, offset: 12512}, run: (*parser).callonFileInclusion1, expr: &seqExpr{ - pos: position{line: 373, col: 18, offset: 12540}, + pos: position{line: 378, col: 18, offset: 12512}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 373, col: 18, offset: 12540}, + pos: position{line: 378, col: 18, offset: 12512}, label: "incl", expr: &actionExpr{ - pos: position{line: 373, col: 24, offset: 12546}, + pos: position{line: 378, col: 24, offset: 12518}, run: (*parser).callonFileInclusion4, expr: &seqExpr{ - pos: position{line: 373, col: 24, offset: 12546}, + pos: position{line: 378, col: 24, offset: 12518}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 373, col: 24, offset: 12546}, + pos: position{line: 378, col: 24, offset: 12518}, val: "include::", ignoreCase: false, + want: "\"include::\"", }, &labeledExpr{ - pos: position{line: 373, col: 36, offset: 12558}, + pos: position{line: 378, col: 36, offset: 12530}, label: "path", expr: &ruleRefExpr{ - pos: position{line: 373, col: 42, offset: 12564}, + pos: position{line: 378, col: 42, offset: 12536}, name: "FileLocation", }, }, &labeledExpr{ - pos: position{line: 373, col: 56, offset: 12578}, + pos: position{line: 378, col: 56, offset: 12550}, label: "inlineAttributes", expr: &ruleRefExpr{ - pos: position{line: 373, col: 74, offset: 12596}, + pos: position{line: 378, col: 74, offset: 12568}, name: "FileIncludeAttributes", }, }, @@ -3164,14 +2807,14 @@ var g = &grammar{ }, }, &zeroOrMoreExpr{ - pos: position{line: 375, col: 8, offset: 12750}, + pos: position{line: 380, col: 8, offset: 12722}, expr: &ruleRefExpr{ - pos: position{line: 375, col: 8, offset: 12750}, - name: "WS", + pos: position{line: 380, col: 8, offset: 12722}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 375, col: 12, offset: 12754}, + pos: position{line: 380, col: 15, offset: 12729}, name: "EOL", }, }, @@ -3180,36 +2823,37 @@ var g = &grammar{ }, { name: "FileIncludeAttributes", - pos: position{line: 379, col: 1, offset: 12806}, + pos: position{line: 384, col: 1, offset: 12781}, expr: &actionExpr{ - pos: position{line: 379, col: 26, offset: 12831}, + pos: position{line: 384, col: 26, offset: 12806}, run: (*parser).callonFileIncludeAttributes1, expr: &seqExpr{ - pos: position{line: 379, col: 26, offset: 12831}, + pos: position{line: 384, col: 26, offset: 12806}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 379, col: 26, offset: 12831}, + pos: position{line: 384, col: 26, offset: 12806}, val: "[", ignoreCase: false, + want: "\"[\"", }, &labeledExpr{ - pos: position{line: 379, col: 30, offset: 12835}, + pos: position{line: 384, col: 30, offset: 12810}, label: "attrs", expr: &zeroOrMoreExpr{ - pos: position{line: 379, col: 36, offset: 12841}, + pos: position{line: 384, col: 36, offset: 12816}, expr: &choiceExpr{ - pos: position{line: 379, col: 37, offset: 12842}, + pos: position{line: 384, col: 37, offset: 12817}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 379, col: 37, offset: 12842}, + pos: position{line: 384, col: 37, offset: 12817}, name: "LineRangesAttribute", }, &ruleRefExpr{ - pos: position{line: 379, col: 59, offset: 12864}, + pos: position{line: 384, col: 59, offset: 12839}, name: "TagRangesAttribute", }, &ruleRefExpr{ - pos: position{line: 379, col: 80, offset: 12885}, + pos: position{line: 384, col: 80, offset: 12860}, name: "GenericAttribute", }, }, @@ -3217,9 +2861,10 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 379, col: 99, offset: 12904}, + pos: position{line: 384, col: 99, offset: 12879}, val: "]", ignoreCase: false, + want: "\"]\"", }, }, }, @@ -3227,32 +2872,34 @@ var g = &grammar{ }, { name: "LineRangesAttribute", - pos: position{line: 383, col: 1, offset: 12974}, + pos: position{line: 388, col: 1, offset: 12949}, expr: &actionExpr{ - pos: position{line: 383, col: 24, offset: 12997}, + pos: position{line: 388, col: 24, offset: 12972}, run: (*parser).callonLineRangesAttribute1, expr: &seqExpr{ - pos: position{line: 383, col: 24, offset: 12997}, + pos: position{line: 388, col: 24, offset: 12972}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 383, col: 24, offset: 12997}, + pos: position{line: 388, col: 24, offset: 12972}, val: "lines=", ignoreCase: false, + want: "\"lines=\"", }, &labeledExpr{ - pos: position{line: 383, col: 33, offset: 13006}, + pos: position{line: 388, col: 33, offset: 12981}, label: "lines", expr: &ruleRefExpr{ - pos: position{line: 383, col: 40, offset: 13013}, + pos: position{line: 388, col: 40, offset: 12988}, name: "LineRangesAttributeValue", }, }, &zeroOrOneExpr{ - pos: position{line: 383, col: 66, offset: 13039}, + pos: position{line: 388, col: 66, offset: 13014}, expr: &litMatcher{ - pos: position{line: 383, col: 66, offset: 13039}, + pos: position{line: 388, col: 66, offset: 13014}, val: ",", ignoreCase: false, + want: "\",\"", }, }, }, @@ -3261,74 +2908,76 @@ var g = &grammar{ }, { name: "LineRangesAttributeValue", - pos: position{line: 387, col: 1, offset: 13098}, + pos: position{line: 392, col: 1, offset: 13073}, expr: &actionExpr{ - pos: position{line: 387, col: 29, offset: 13126}, + pos: position{line: 392, col: 29, offset: 13101}, run: (*parser).callonLineRangesAttributeValue1, expr: &seqExpr{ - pos: position{line: 387, col: 29, offset: 13126}, + pos: position{line: 392, col: 29, offset: 13101}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 387, col: 29, offset: 13126}, + pos: position{line: 392, col: 29, offset: 13101}, label: "value", expr: &choiceExpr{ - pos: position{line: 387, col: 36, offset: 13133}, + pos: position{line: 392, col: 36, offset: 13108}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 387, col: 36, offset: 13133}, + pos: position{line: 392, col: 36, offset: 13108}, name: "MultipleLineRanges", }, &ruleRefExpr{ - pos: position{line: 388, col: 11, offset: 13250}, + pos: position{line: 393, col: 11, offset: 13225}, name: "MultipleQuotedLineRanges", }, &ruleRefExpr{ - pos: position{line: 389, col: 11, offset: 13286}, + pos: position{line: 394, col: 11, offset: 13261}, name: "MultiLineRange", }, &ruleRefExpr{ - pos: position{line: 390, col: 11, offset: 13312}, + pos: position{line: 395, col: 11, offset: 13287}, name: "MultiLineQuotedRange", }, &ruleRefExpr{ - pos: position{line: 391, col: 11, offset: 13344}, + pos: position{line: 396, col: 11, offset: 13319}, name: "SingleLineQuotedRange", }, &ruleRefExpr{ - pos: position{line: 392, col: 11, offset: 13376}, + pos: position{line: 397, col: 11, offset: 13351}, name: "SingleLineRange", }, &ruleRefExpr{ - pos: position{line: 393, col: 11, offset: 13403}, + pos: position{line: 398, col: 11, offset: 13378}, name: "UndefinedLineRange", }, }, }, }, &zeroOrMoreExpr{ - pos: position{line: 393, col: 31, offset: 13423}, + pos: position{line: 398, col: 31, offset: 13398}, expr: &ruleRefExpr{ - pos: position{line: 393, col: 31, offset: 13423}, - name: "WS", + pos: position{line: 398, col: 31, offset: 13398}, + name: "Space", }, }, &choiceExpr{ - pos: position{line: 393, col: 36, offset: 13428}, + pos: position{line: 398, col: 39, offset: 13406}, alternatives: []interface{}{ &andExpr{ - pos: position{line: 393, col: 36, offset: 13428}, + pos: position{line: 398, col: 39, offset: 13406}, expr: &litMatcher{ - pos: position{line: 393, col: 37, offset: 13429}, + pos: position{line: 398, col: 40, offset: 13407}, val: ",", ignoreCase: false, + want: "\",\"", }, }, &andExpr{ - pos: position{line: 393, col: 43, offset: 13435}, + pos: position{line: 398, col: 46, offset: 13413}, expr: &litMatcher{ - pos: position{line: 393, col: 44, offset: 13436}, + pos: position{line: 398, col: 47, offset: 13414}, val: "]", ignoreCase: false, + want: "\"]\"", }, }, }, @@ -3339,58 +2988,59 @@ var g = &grammar{ }, { name: "MultipleLineRanges", - pos: position{line: 397, col: 1, offset: 13468}, + pos: position{line: 402, col: 1, offset: 13446}, expr: &actionExpr{ - pos: position{line: 397, col: 23, offset: 13490}, + pos: position{line: 402, col: 23, offset: 13468}, run: (*parser).callonMultipleLineRanges1, expr: &seqExpr{ - pos: position{line: 397, col: 23, offset: 13490}, + pos: position{line: 402, col: 23, offset: 13468}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 397, col: 23, offset: 13490}, + pos: position{line: 402, col: 23, offset: 13468}, label: "first", expr: &choiceExpr{ - pos: position{line: 397, col: 30, offset: 13497}, + pos: position{line: 402, col: 30, offset: 13475}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 397, col: 30, offset: 13497}, + pos: position{line: 402, col: 30, offset: 13475}, name: "MultiLineRange", }, &ruleRefExpr{ - pos: position{line: 397, col: 47, offset: 13514}, + pos: position{line: 402, col: 47, offset: 13492}, name: "SingleLineRange", }, }, }, }, &labeledExpr{ - pos: position{line: 398, col: 5, offset: 13536}, + pos: position{line: 403, col: 5, offset: 13514}, label: "others", expr: &oneOrMoreExpr{ - pos: position{line: 398, col: 12, offset: 13543}, + pos: position{line: 403, col: 12, offset: 13521}, expr: &actionExpr{ - pos: position{line: 398, col: 13, offset: 13544}, + pos: position{line: 403, col: 13, offset: 13522}, run: (*parser).callonMultipleLineRanges9, expr: &seqExpr{ - pos: position{line: 398, col: 13, offset: 13544}, + pos: position{line: 403, col: 13, offset: 13522}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 398, col: 13, offset: 13544}, + pos: position{line: 403, col: 13, offset: 13522}, val: ";", ignoreCase: false, + want: "\";\"", }, &labeledExpr{ - pos: position{line: 398, col: 17, offset: 13548}, + pos: position{line: 403, col: 17, offset: 13526}, label: "other", expr: &choiceExpr{ - pos: position{line: 398, col: 24, offset: 13555}, + pos: position{line: 403, col: 24, offset: 13533}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 398, col: 24, offset: 13555}, + pos: position{line: 403, col: 24, offset: 13533}, name: "MultiLineRange", }, &ruleRefExpr{ - pos: position{line: 398, col: 41, offset: 13572}, + pos: position{line: 403, col: 41, offset: 13550}, name: "SingleLineRange", }, }, @@ -3407,63 +3057,65 @@ var g = &grammar{ }, { name: "MultipleQuotedLineRanges", - pos: position{line: 404, col: 1, offset: 13710}, + pos: position{line: 409, col: 1, offset: 13688}, expr: &actionExpr{ - pos: position{line: 404, col: 29, offset: 13738}, + pos: position{line: 409, col: 29, offset: 13716}, run: (*parser).callonMultipleQuotedLineRanges1, expr: &seqExpr{ - pos: position{line: 404, col: 29, offset: 13738}, + pos: position{line: 409, col: 29, offset: 13716}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 404, col: 29, offset: 13738}, + pos: position{line: 409, col: 29, offset: 13716}, val: "\"", ignoreCase: false, + want: "\"\\\"\"", }, &labeledExpr{ - pos: position{line: 404, col: 34, offset: 13743}, + pos: position{line: 409, col: 34, offset: 13721}, label: "first", expr: &choiceExpr{ - pos: position{line: 404, col: 41, offset: 13750}, + pos: position{line: 409, col: 41, offset: 13728}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 404, col: 41, offset: 13750}, + pos: position{line: 409, col: 41, offset: 13728}, name: "MultiLineRange", }, &ruleRefExpr{ - pos: position{line: 404, col: 58, offset: 13767}, + pos: position{line: 409, col: 58, offset: 13745}, name: "SingleLineRange", }, }, }, }, &labeledExpr{ - pos: position{line: 405, col: 5, offset: 13789}, + pos: position{line: 410, col: 5, offset: 13767}, label: "others", expr: &oneOrMoreExpr{ - pos: position{line: 405, col: 12, offset: 13796}, + pos: position{line: 410, col: 12, offset: 13774}, expr: &actionExpr{ - pos: position{line: 405, col: 13, offset: 13797}, + pos: position{line: 410, col: 13, offset: 13775}, run: (*parser).callonMultipleQuotedLineRanges10, expr: &seqExpr{ - pos: position{line: 405, col: 13, offset: 13797}, + pos: position{line: 410, col: 13, offset: 13775}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 405, col: 13, offset: 13797}, + pos: position{line: 410, col: 13, offset: 13775}, val: ",", ignoreCase: false, + want: "\",\"", }, &labeledExpr{ - pos: position{line: 405, col: 17, offset: 13801}, + pos: position{line: 410, col: 17, offset: 13779}, label: "other", expr: &choiceExpr{ - pos: position{line: 405, col: 24, offset: 13808}, + pos: position{line: 410, col: 24, offset: 13786}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 405, col: 24, offset: 13808}, + pos: position{line: 410, col: 24, offset: 13786}, name: "MultiLineRange", }, &ruleRefExpr{ - pos: position{line: 405, col: 41, offset: 13825}, + pos: position{line: 410, col: 41, offset: 13803}, name: "SingleLineRange", }, }, @@ -3475,9 +3127,10 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 407, col: 9, offset: 13878}, + pos: position{line: 412, col: 9, offset: 13856}, val: "\"", ignoreCase: false, + want: "\"\\\"\"", }, }, }, @@ -3485,31 +3138,32 @@ var g = &grammar{ }, { name: "MultiLineRange", - pos: position{line: 411, col: 1, offset: 13968}, + pos: position{line: 416, col: 1, offset: 13946}, expr: &actionExpr{ - pos: position{line: 411, col: 19, offset: 13986}, + pos: position{line: 416, col: 19, offset: 13964}, run: (*parser).callonMultiLineRange1, expr: &seqExpr{ - pos: position{line: 411, col: 19, offset: 13986}, + pos: position{line: 416, col: 19, offset: 13964}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 411, col: 19, offset: 13986}, + pos: position{line: 416, col: 19, offset: 13964}, label: "start", expr: &ruleRefExpr{ - pos: position{line: 411, col: 26, offset: 13993}, + pos: position{line: 416, col: 26, offset: 13971}, name: "NUMBER", }, }, &litMatcher{ - pos: position{line: 411, col: 34, offset: 14001}, + pos: position{line: 416, col: 34, offset: 13979}, val: "..", ignoreCase: false, + want: "\"..\"", }, &labeledExpr{ - pos: position{line: 411, col: 39, offset: 14006}, + pos: position{line: 416, col: 39, offset: 13984}, label: "end", expr: &ruleRefExpr{ - pos: position{line: 411, col: 44, offset: 14011}, + pos: position{line: 416, col: 44, offset: 13989}, name: "NUMBER", }, }, @@ -3519,43 +3173,46 @@ var g = &grammar{ }, { name: "MultiLineQuotedRange", - pos: position{line: 415, col: 1, offset: 14099}, + pos: position{line: 420, col: 1, offset: 14077}, expr: &actionExpr{ - pos: position{line: 415, col: 25, offset: 14123}, + pos: position{line: 420, col: 25, offset: 14101}, run: (*parser).callonMultiLineQuotedRange1, expr: &seqExpr{ - pos: position{line: 415, col: 25, offset: 14123}, + pos: position{line: 420, col: 25, offset: 14101}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 415, col: 25, offset: 14123}, + pos: position{line: 420, col: 25, offset: 14101}, val: "\"", ignoreCase: false, + want: "\"\\\"\"", }, &labeledExpr{ - pos: position{line: 415, col: 30, offset: 14128}, + pos: position{line: 420, col: 30, offset: 14106}, label: "start", expr: &ruleRefExpr{ - pos: position{line: 415, col: 37, offset: 14135}, + pos: position{line: 420, col: 37, offset: 14113}, name: "NUMBER", }, }, &litMatcher{ - pos: position{line: 415, col: 45, offset: 14143}, + pos: position{line: 420, col: 45, offset: 14121}, val: "..", ignoreCase: false, + want: "\"..\"", }, &labeledExpr{ - pos: position{line: 415, col: 50, offset: 14148}, + pos: position{line: 420, col: 50, offset: 14126}, label: "end", expr: &ruleRefExpr{ - pos: position{line: 415, col: 55, offset: 14153}, + pos: position{line: 420, col: 55, offset: 14131}, name: "NUMBER", }, }, &litMatcher{ - pos: position{line: 415, col: 63, offset: 14161}, + pos: position{line: 420, col: 63, offset: 14139}, val: "\"", ignoreCase: false, + want: "\"\\\"\"", }, }, }, @@ -3563,15 +3220,15 @@ var g = &grammar{ }, { name: "SingleLineRange", - pos: position{line: 419, col: 1, offset: 14246}, + pos: position{line: 424, col: 1, offset: 14224}, expr: &actionExpr{ - pos: position{line: 419, col: 20, offset: 14265}, + pos: position{line: 424, col: 20, offset: 14243}, run: (*parser).callonSingleLineRange1, expr: &labeledExpr{ - pos: position{line: 419, col: 20, offset: 14265}, + pos: position{line: 424, col: 20, offset: 14243}, label: "singleline", expr: &ruleRefExpr{ - pos: position{line: 419, col: 32, offset: 14277}, + pos: position{line: 424, col: 32, offset: 14255}, name: "NUMBER", }, }, @@ -3579,30 +3236,32 @@ var g = &grammar{ }, { name: "SingleLineQuotedRange", - pos: position{line: 423, col: 1, offset: 14372}, + pos: position{line: 428, col: 1, offset: 14350}, expr: &actionExpr{ - pos: position{line: 423, col: 26, offset: 14397}, + pos: position{line: 428, col: 26, offset: 14375}, run: (*parser).callonSingleLineQuotedRange1, expr: &seqExpr{ - pos: position{line: 423, col: 26, offset: 14397}, + pos: position{line: 428, col: 26, offset: 14375}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 423, col: 26, offset: 14397}, + pos: position{line: 428, col: 26, offset: 14375}, val: "\"", ignoreCase: false, + want: "\"\\\"\"", }, &labeledExpr{ - pos: position{line: 423, col: 31, offset: 14402}, + pos: position{line: 428, col: 31, offset: 14380}, label: "singleline", expr: &ruleRefExpr{ - pos: position{line: 423, col: 43, offset: 14414}, + pos: position{line: 428, col: 43, offset: 14392}, name: "NUMBER", }, }, &litMatcher{ - pos: position{line: 423, col: 51, offset: 14422}, + pos: position{line: 428, col: 51, offset: 14400}, val: "\"", ignoreCase: false, + want: "\"\\\"\"", }, }, }, @@ -3610,84 +3269,63 @@ var g = &grammar{ }, { name: "UndefinedLineRange", - pos: position{line: 427, col: 1, offset: 14514}, + pos: position{line: 432, col: 1, offset: 14492}, expr: &actionExpr{ - pos: position{line: 427, col: 23, offset: 14536}, + pos: position{line: 432, col: 23, offset: 14514}, run: (*parser).callonUndefinedLineRange1, expr: &zeroOrMoreExpr{ - pos: position{line: 427, col: 23, offset: 14536}, - expr: &seqExpr{ - pos: position{line: 427, col: 24, offset: 14537}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 427, col: 24, offset: 14537}, - expr: &litMatcher{ - pos: position{line: 427, col: 25, offset: 14538}, - val: "]", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 427, col: 29, offset: 14542}, - expr: &litMatcher{ - pos: position{line: 427, col: 30, offset: 14543}, - val: ",", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 427, col: 34, offset: 14547}, - expr: &ruleRefExpr{ - pos: position{line: 427, col: 35, offset: 14548}, - name: "WS", - }, - }, - &anyMatcher{ - line: 427, col: 38, offset: 14551, - }, - }, + pos: position{line: 432, col: 23, offset: 14514}, + expr: &charClassMatcher{ + pos: position{line: 432, col: 23, offset: 14514}, + val: "[^\\], ]", + chars: []rune{']', ',', ' '}, + ignoreCase: false, + inverted: true, }, }, }, }, { name: "TagRangesAttribute", - pos: position{line: 431, col: 1, offset: 14591}, + pos: position{line: 436, col: 1, offset: 14559}, expr: &actionExpr{ - pos: position{line: 431, col: 23, offset: 14613}, + pos: position{line: 436, col: 23, offset: 14581}, run: (*parser).callonTagRangesAttribute1, expr: &seqExpr{ - pos: position{line: 431, col: 23, offset: 14613}, + pos: position{line: 436, col: 23, offset: 14581}, exprs: []interface{}{ &choiceExpr{ - pos: position{line: 431, col: 24, offset: 14614}, + pos: position{line: 436, col: 24, offset: 14582}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 431, col: 24, offset: 14614}, + pos: position{line: 436, col: 24, offset: 14582}, val: "tags=", ignoreCase: false, + want: "\"tags=\"", }, &litMatcher{ - pos: position{line: 431, col: 34, offset: 14624}, + pos: position{line: 436, col: 34, offset: 14592}, val: "tag=", ignoreCase: false, + want: "\"tag=\"", }, }, }, &labeledExpr{ - pos: position{line: 431, col: 42, offset: 14632}, + pos: position{line: 436, col: 42, offset: 14600}, label: "tags", expr: &ruleRefExpr{ - pos: position{line: 431, col: 48, offset: 14638}, + pos: position{line: 436, col: 48, offset: 14606}, name: "TagRangesAttributeValue", }, }, &zeroOrOneExpr{ - pos: position{line: 431, col: 73, offset: 14663}, + pos: position{line: 436, col: 73, offset: 14631}, expr: &litMatcher{ - pos: position{line: 431, col: 73, offset: 14663}, + pos: position{line: 436, col: 73, offset: 14631}, val: ",", ignoreCase: false, + want: "\",\"", }, }, }, @@ -3696,45 +3334,47 @@ var g = &grammar{ }, { name: "TagRangesAttributeValue", - pos: position{line: 435, col: 1, offset: 14812}, + pos: position{line: 440, col: 1, offset: 14780}, expr: &actionExpr{ - pos: position{line: 435, col: 28, offset: 14839}, + pos: position{line: 440, col: 28, offset: 14807}, run: (*parser).callonTagRangesAttributeValue1, expr: &seqExpr{ - pos: position{line: 435, col: 28, offset: 14839}, + pos: position{line: 440, col: 28, offset: 14807}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 435, col: 28, offset: 14839}, + pos: position{line: 440, col: 28, offset: 14807}, label: "value", expr: &ruleRefExpr{ - pos: position{line: 435, col: 35, offset: 14846}, + pos: position{line: 440, col: 35, offset: 14814}, name: "MultipleTagRanges", }, }, &zeroOrMoreExpr{ - pos: position{line: 435, col: 54, offset: 14865}, + pos: position{line: 440, col: 54, offset: 14833}, expr: &ruleRefExpr{ - pos: position{line: 435, col: 54, offset: 14865}, - name: "WS", + pos: position{line: 440, col: 54, offset: 14833}, + name: "Space", }, }, &choiceExpr{ - pos: position{line: 435, col: 59, offset: 14870}, + pos: position{line: 440, col: 62, offset: 14841}, alternatives: []interface{}{ &andExpr{ - pos: position{line: 435, col: 59, offset: 14870}, + pos: position{line: 440, col: 62, offset: 14841}, expr: &litMatcher{ - pos: position{line: 435, col: 60, offset: 14871}, + pos: position{line: 440, col: 63, offset: 14842}, val: ",", ignoreCase: false, + want: "\",\"", }, }, &andExpr{ - pos: position{line: 435, col: 66, offset: 14877}, + pos: position{line: 440, col: 69, offset: 14848}, expr: &litMatcher{ - pos: position{line: 435, col: 67, offset: 14878}, + pos: position{line: 440, col: 70, offset: 14849}, val: "]", ignoreCase: false, + want: "\"]\"", }, }, }, @@ -3745,42 +3385,43 @@ var g = &grammar{ }, { name: "MultipleTagRanges", - pos: position{line: 439, col: 1, offset: 14910}, + pos: position{line: 444, col: 1, offset: 14881}, expr: &actionExpr{ - pos: position{line: 439, col: 22, offset: 14931}, + pos: position{line: 444, col: 22, offset: 14902}, run: (*parser).callonMultipleTagRanges1, expr: &seqExpr{ - pos: position{line: 439, col: 22, offset: 14931}, + pos: position{line: 444, col: 22, offset: 14902}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 439, col: 22, offset: 14931}, + pos: position{line: 444, col: 22, offset: 14902}, label: "first", expr: &ruleRefExpr{ - pos: position{line: 439, col: 29, offset: 14938}, + pos: position{line: 444, col: 29, offset: 14909}, name: "TagRange", }, }, &labeledExpr{ - pos: position{line: 440, col: 5, offset: 14952}, + pos: position{line: 445, col: 5, offset: 14923}, label: "others", expr: &zeroOrMoreExpr{ - pos: position{line: 440, col: 12, offset: 14959}, + pos: position{line: 445, col: 12, offset: 14930}, expr: &actionExpr{ - pos: position{line: 440, col: 13, offset: 14960}, + pos: position{line: 445, col: 13, offset: 14931}, run: (*parser).callonMultipleTagRanges7, expr: &seqExpr{ - pos: position{line: 440, col: 13, offset: 14960}, + pos: position{line: 445, col: 13, offset: 14931}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 440, col: 13, offset: 14960}, + pos: position{line: 445, col: 13, offset: 14931}, val: ";", ignoreCase: false, + want: "\";\"", }, &labeledExpr{ - pos: position{line: 440, col: 17, offset: 14964}, + pos: position{line: 445, col: 17, offset: 14935}, label: "other", expr: &ruleRefExpr{ - pos: position{line: 440, col: 24, offset: 14971}, + pos: position{line: 445, col: 24, offset: 14942}, name: "TagRange", }, }, @@ -3795,25 +3436,25 @@ var g = &grammar{ }, { name: "TagRange", - pos: position{line: 446, col: 1, offset: 15102}, + pos: position{line: 451, col: 1, offset: 15073}, expr: &choiceExpr{ - pos: position{line: 446, col: 13, offset: 15114}, + pos: position{line: 451, col: 13, offset: 15085}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 446, col: 13, offset: 15114}, + pos: position{line: 451, col: 13, offset: 15085}, run: (*parser).callonTagRange2, expr: &labeledExpr{ - pos: position{line: 446, col: 13, offset: 15114}, + pos: position{line: 451, col: 13, offset: 15085}, label: "tag", expr: &choiceExpr{ - pos: position{line: 446, col: 18, offset: 15119}, + pos: position{line: 451, col: 18, offset: 15090}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 446, col: 18, offset: 15119}, + pos: position{line: 451, col: 18, offset: 15090}, name: "Alphanums", }, &ruleRefExpr{ - pos: position{line: 446, col: 30, offset: 15131}, + pos: position{line: 451, col: 30, offset: 15102}, name: "TagWildcard", }, }, @@ -3821,28 +3462,29 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 448, col: 5, offset: 15199}, + pos: position{line: 453, col: 5, offset: 15170}, run: (*parser).callonTagRange7, expr: &seqExpr{ - pos: position{line: 448, col: 5, offset: 15199}, + pos: position{line: 453, col: 5, offset: 15170}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 448, col: 5, offset: 15199}, + pos: position{line: 453, col: 5, offset: 15170}, val: "!", ignoreCase: false, + want: "\"!\"", }, &labeledExpr{ - pos: position{line: 448, col: 9, offset: 15203}, + pos: position{line: 453, col: 9, offset: 15174}, label: "tag", expr: &choiceExpr{ - pos: position{line: 448, col: 14, offset: 15208}, + pos: position{line: 453, col: 14, offset: 15179}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 448, col: 14, offset: 15208}, + pos: position{line: 453, col: 14, offset: 15179}, name: "Alphanums", }, &ruleRefExpr{ - pos: position{line: 448, col: 26, offset: 15220}, + pos: position{line: 453, col: 26, offset: 15191}, name: "TagWildcard", }, }, @@ -3856,31 +3498,32 @@ var g = &grammar{ }, { name: "TagWildcard", - pos: position{line: 452, col: 1, offset: 15288}, + pos: position{line: 457, col: 1, offset: 15259}, expr: &actionExpr{ - pos: position{line: 452, col: 16, offset: 15303}, + pos: position{line: 457, col: 16, offset: 15274}, run: (*parser).callonTagWildcard1, expr: &seqExpr{ - pos: position{line: 452, col: 16, offset: 15303}, + pos: position{line: 457, col: 16, offset: 15274}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 452, col: 16, offset: 15303}, + pos: position{line: 457, col: 16, offset: 15274}, label: "stars", expr: &actionExpr{ - pos: position{line: 452, col: 23, offset: 15310}, + pos: position{line: 457, col: 23, offset: 15281}, run: (*parser).callonTagWildcard4, expr: &oneOrMoreExpr{ - pos: position{line: 452, col: 23, offset: 15310}, + pos: position{line: 457, col: 23, offset: 15281}, expr: &litMatcher{ - pos: position{line: 452, col: 24, offset: 15311}, + pos: position{line: 457, col: 24, offset: 15282}, val: "*", ignoreCase: false, + want: "\"*\"", }, }, }, }, &andCodeExpr{ - pos: position{line: 455, col: 5, offset: 15365}, + pos: position{line: 460, col: 5, offset: 15336}, run: (*parser).callonTagWildcard7, }, }, @@ -3889,18 +3532,18 @@ var g = &grammar{ }, { name: "VerbatimFileContent", - pos: position{line: 463, col: 1, offset: 15607}, + pos: position{line: 468, col: 1, offset: 15578}, expr: &zeroOrMoreExpr{ - pos: position{line: 463, col: 24, offset: 15630}, + pos: position{line: 468, col: 24, offset: 15601}, expr: &choiceExpr{ - pos: position{line: 463, col: 25, offset: 15631}, + pos: position{line: 468, col: 25, offset: 15602}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 463, col: 25, offset: 15631}, + pos: position{line: 468, col: 25, offset: 15602}, name: "FileInclusion", }, &ruleRefExpr{ - pos: position{line: 463, col: 41, offset: 15647}, + pos: position{line: 468, col: 41, offset: 15618}, name: "VerbatimLine", }, }, @@ -3909,57 +3552,40 @@ var g = &grammar{ }, { name: "VerbatimLine", - pos: position{line: 465, col: 1, offset: 15663}, + pos: position{line: 470, col: 1, offset: 15634}, expr: &actionExpr{ - pos: position{line: 465, col: 17, offset: 15679}, + pos: position{line: 470, col: 17, offset: 15650}, run: (*parser).callonVerbatimLine1, expr: &seqExpr{ - pos: position{line: 465, col: 17, offset: 15679}, + pos: position{line: 470, col: 17, offset: 15650}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 465, col: 17, offset: 15679}, + pos: position{line: 470, col: 17, offset: 15650}, expr: &ruleRefExpr{ - pos: position{line: 465, col: 18, offset: 15680}, + pos: position{line: 470, col: 18, offset: 15651}, name: "EOF", }, }, &labeledExpr{ - pos: position{line: 465, col: 22, offset: 15684}, + pos: position{line: 470, col: 22, offset: 15655}, label: "content", expr: &actionExpr{ - pos: position{line: 465, col: 31, offset: 15693}, + pos: position{line: 470, col: 31, offset: 15664}, run: (*parser).callonVerbatimLine6, expr: &zeroOrMoreExpr{ - pos: position{line: 465, col: 31, offset: 15693}, - expr: &choiceExpr{ - pos: position{line: 465, col: 32, offset: 15694}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 465, col: 32, offset: 15694}, - name: "AlphanumsAndSpaces", - }, - &seqExpr{ - pos: position{line: 465, col: 53, offset: 15715}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 465, col: 53, offset: 15715}, - expr: &ruleRefExpr{ - pos: position{line: 465, col: 54, offset: 15716}, - name: "EOL", - }, - }, - &anyMatcher{ - line: 465, col: 58, offset: 15720, - }, - }, - }, - }, + pos: position{line: 470, col: 31, offset: 15664}, + expr: &charClassMatcher{ + pos: position{line: 470, col: 31, offset: 15664}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, &ruleRefExpr{ - pos: position{line: 467, col: 12, offset: 15777}, + pos: position{line: 472, col: 12, offset: 15726}, name: "EOL", }, }, @@ -3968,34 +3594,34 @@ var g = &grammar{ }, { name: "IncludedFileLine", - pos: position{line: 474, col: 1, offset: 15972}, + pos: position{line: 479, col: 1, offset: 15921}, expr: &actionExpr{ - pos: position{line: 474, col: 21, offset: 15992}, + pos: position{line: 479, col: 21, offset: 15941}, run: (*parser).callonIncludedFileLine1, expr: &seqExpr{ - pos: position{line: 474, col: 21, offset: 15992}, + pos: position{line: 479, col: 21, offset: 15941}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 474, col: 21, offset: 15992}, + pos: position{line: 479, col: 21, offset: 15941}, label: "content", expr: &zeroOrMoreExpr{ - pos: position{line: 474, col: 29, offset: 16000}, + pos: position{line: 479, col: 29, offset: 15949}, expr: &choiceExpr{ - pos: position{line: 474, col: 30, offset: 16001}, + pos: position{line: 479, col: 30, offset: 15950}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 474, col: 30, offset: 16001}, + pos: position{line: 479, col: 30, offset: 15950}, name: "IncludedFileStartTag", }, &ruleRefExpr{ - pos: position{line: 474, col: 53, offset: 16024}, + pos: position{line: 479, col: 53, offset: 15973}, name: "IncludedFileEndTag", }, &actionExpr{ - pos: position{line: 474, col: 74, offset: 16045}, + pos: position{line: 479, col: 74, offset: 15994}, run: (*parser).callonIncludedFileLine8, expr: &anyMatcher{ - line: 474, col: 74, offset: 16045, + line: 479, col: 74, offset: 15994, }, }, }, @@ -4003,7 +3629,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 474, col: 107, offset: 16078}, + pos: position{line: 479, col: 107, offset: 16027}, name: "EOL", }, }, @@ -4012,34 +3638,36 @@ var g = &grammar{ }, { name: "IncludedFileStartTag", - pos: position{line: 478, col: 1, offset: 16149}, + pos: position{line: 483, col: 1, offset: 16098}, expr: &actionExpr{ - pos: position{line: 478, col: 25, offset: 16173}, + pos: position{line: 483, col: 25, offset: 16122}, run: (*parser).callonIncludedFileStartTag1, expr: &seqExpr{ - pos: position{line: 478, col: 25, offset: 16173}, + pos: position{line: 483, col: 25, offset: 16122}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 478, col: 25, offset: 16173}, + pos: position{line: 483, col: 25, offset: 16122}, val: "tag::", ignoreCase: false, + want: "\"tag::\"", }, &labeledExpr{ - pos: position{line: 478, col: 33, offset: 16181}, + pos: position{line: 483, col: 33, offset: 16130}, label: "tag", expr: &actionExpr{ - pos: position{line: 478, col: 38, offset: 16186}, + pos: position{line: 483, col: 38, offset: 16135}, run: (*parser).callonIncludedFileStartTag5, expr: &ruleRefExpr{ - pos: position{line: 478, col: 38, offset: 16186}, + pos: position{line: 483, col: 38, offset: 16135}, name: "Alphanums", }, }, }, &litMatcher{ - pos: position{line: 478, col: 78, offset: 16226}, + pos: position{line: 483, col: 78, offset: 16175}, val: "[]", ignoreCase: false, + want: "\"[]\"", }, }, }, @@ -4047,103 +3675,69 @@ var g = &grammar{ }, { name: "IncludedFileEndTag", - pos: position{line: 482, col: 1, offset: 16291}, + pos: position{line: 487, col: 1, offset: 16240}, expr: &actionExpr{ - pos: position{line: 482, col: 23, offset: 16313}, + pos: position{line: 487, col: 23, offset: 16262}, run: (*parser).callonIncludedFileEndTag1, expr: &seqExpr{ - pos: position{line: 482, col: 23, offset: 16313}, + pos: position{line: 487, col: 23, offset: 16262}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 482, col: 23, offset: 16313}, + pos: position{line: 487, col: 23, offset: 16262}, val: "end::", ignoreCase: false, + want: "\"end::\"", }, &labeledExpr{ - pos: position{line: 482, col: 31, offset: 16321}, + pos: position{line: 487, col: 31, offset: 16270}, label: "tag", expr: &actionExpr{ - pos: position{line: 482, col: 36, offset: 16326}, + pos: position{line: 487, col: 36, offset: 16275}, run: (*parser).callonIncludedFileEndTag5, expr: &ruleRefExpr{ - pos: position{line: 482, col: 36, offset: 16326}, + pos: position{line: 487, col: 36, offset: 16275}, name: "Alphanums", }, }, }, &litMatcher{ - pos: position{line: 482, col: 76, offset: 16366}, + pos: position{line: 487, col: 76, offset: 16315}, val: "[]", ignoreCase: false, + want: "\"[]\"", }, }, }, }, }, - { - name: "ListItems", - pos: position{line: 489, col: 1, offset: 16530}, - expr: &oneOrMoreExpr{ - pos: position{line: 489, col: 14, offset: 16543}, - expr: &ruleRefExpr{ - pos: position{line: 489, col: 14, offset: 16543}, - name: "ListItem", - }, - }, - }, - { - name: "ListItem", - pos: position{line: 491, col: 1, offset: 16554}, - expr: &choiceExpr{ - pos: position{line: 491, col: 13, offset: 16566}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 491, col: 13, offset: 16566}, - name: "OrderedListItem", - }, - &ruleRefExpr{ - pos: position{line: 491, col: 31, offset: 16584}, - name: "UnorderedListItem", - }, - &ruleRefExpr{ - pos: position{line: 491, col: 51, offset: 16604}, - name: "LabeledListItem", - }, - &ruleRefExpr{ - pos: position{line: 491, col: 69, offset: 16622}, - name: "ContinuedListItemElement", - }, - }, - }, - }, { name: "ListParagraph", - pos: position{line: 493, col: 1, offset: 16648}, + pos: position{line: 494, col: 1, offset: 16479}, expr: &choiceExpr{ - pos: position{line: 493, col: 18, offset: 16665}, + pos: position{line: 494, col: 18, offset: 16496}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 493, col: 18, offset: 16665}, + pos: position{line: 494, col: 18, offset: 16496}, run: (*parser).callonListParagraph2, expr: &labeledExpr{ - pos: position{line: 493, col: 18, offset: 16665}, + pos: position{line: 494, col: 18, offset: 16496}, label: "comment", expr: &ruleRefExpr{ - pos: position{line: 493, col: 27, offset: 16674}, + pos: position{line: 494, col: 27, offset: 16505}, name: "SingleLineComment", }, }, }, &actionExpr{ - pos: position{line: 495, col: 9, offset: 16731}, + pos: position{line: 496, col: 9, offset: 16562}, run: (*parser).callonListParagraph5, expr: &labeledExpr{ - pos: position{line: 495, col: 9, offset: 16731}, + pos: position{line: 496, col: 9, offset: 16562}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 495, col: 15, offset: 16737}, + pos: position{line: 496, col: 15, offset: 16568}, expr: &ruleRefExpr{ - pos: position{line: 495, col: 16, offset: 16738}, + pos: position{line: 496, col: 16, offset: 16569}, name: "ListParagraphLine", }, }, @@ -4154,122 +3748,97 @@ var g = &grammar{ }, { name: "ListParagraphLine", - pos: position{line: 499, col: 1, offset: 16830}, + pos: position{line: 500, col: 1, offset: 16661}, expr: &actionExpr{ - pos: position{line: 499, col: 22, offset: 16851}, + pos: position{line: 500, col: 22, offset: 16682}, run: (*parser).callonListParagraphLine1, expr: &seqExpr{ - pos: position{line: 499, col: 22, offset: 16851}, + pos: position{line: 500, col: 22, offset: 16682}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 499, col: 22, offset: 16851}, + pos: position{line: 500, col: 22, offset: 16682}, expr: &ruleRefExpr{ - pos: position{line: 499, col: 23, offset: 16852}, + pos: position{line: 500, col: 23, offset: 16683}, name: "EOF", }, }, ¬Expr{ - pos: position{line: 500, col: 5, offset: 16860}, + pos: position{line: 501, col: 5, offset: 16691}, expr: &ruleRefExpr{ - pos: position{line: 500, col: 6, offset: 16861}, + pos: position{line: 501, col: 6, offset: 16692}, name: "BlankLine", }, }, ¬Expr{ - pos: position{line: 501, col: 5, offset: 16876}, + pos: position{line: 502, col: 5, offset: 16707}, expr: &ruleRefExpr{ - pos: position{line: 501, col: 6, offset: 16877}, + pos: position{line: 502, col: 6, offset: 16708}, name: "SingleLineComment", }, }, ¬Expr{ - pos: position{line: 502, col: 5, offset: 16899}, + pos: position{line: 503, col: 5, offset: 16730}, expr: &ruleRefExpr{ - pos: position{line: 502, col: 6, offset: 16900}, + pos: position{line: 503, col: 6, offset: 16731}, name: "OrderedListItemPrefix", }, }, ¬Expr{ - pos: position{line: 503, col: 5, offset: 16926}, + pos: position{line: 504, col: 5, offset: 16757}, expr: &ruleRefExpr{ - pos: position{line: 503, col: 6, offset: 16927}, + pos: position{line: 504, col: 6, offset: 16758}, name: "UnorderedListItemPrefix", }, }, ¬Expr{ - pos: position{line: 504, col: 5, offset: 16955}, + pos: position{line: 505, col: 5, offset: 16786}, expr: &ruleRefExpr{ - pos: position{line: 504, col: 6, offset: 16956}, + pos: position{line: 505, col: 6, offset: 16787}, name: "ListItemContinuation", }, }, ¬Expr{ - pos: position{line: 505, col: 5, offset: 16981}, + pos: position{line: 506, col: 5, offset: 16812}, expr: &ruleRefExpr{ - pos: position{line: 505, col: 6, offset: 16982}, + pos: position{line: 506, col: 6, offset: 16813}, name: "ElementAttribute", }, }, ¬Expr{ - pos: position{line: 506, col: 5, offset: 17003}, + pos: position{line: 507, col: 5, offset: 16834}, expr: &ruleRefExpr{ - pos: position{line: 506, col: 6, offset: 17004}, + pos: position{line: 507, col: 6, offset: 16835}, name: "BlockDelimiter", }, }, ¬Expr{ - pos: position{line: 507, col: 5, offset: 17023}, - expr: &seqExpr{ - pos: position{line: 507, col: 7, offset: 17025}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 507, col: 7, offset: 17025}, - name: "SimpleLabeledListItemTerm", - }, - &ruleRefExpr{ - pos: position{line: 507, col: 33, offset: 17051}, - name: "LabeledListItemSeparator", - }, - }, + pos: position{line: 508, col: 5, offset: 16854}, + expr: &ruleRefExpr{ + pos: position{line: 508, col: 6, offset: 16855}, + name: "LabeledListItemPrefix", }, }, &labeledExpr{ - pos: position{line: 508, col: 5, offset: 17082}, + pos: position{line: 509, col: 5, offset: 16882}, label: "line", expr: &actionExpr{ - pos: position{line: 509, col: 9, offset: 17097}, - run: (*parser).callonListParagraphLine24, - expr: &seqExpr{ - pos: position{line: 509, col: 9, offset: 17097}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 509, col: 9, offset: 17097}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 509, col: 18, offset: 17106}, - expr: &ruleRefExpr{ - pos: position{line: 509, col: 19, offset: 17107}, - name: "InlineElement", - }, - }, - }, - &labeledExpr{ - pos: position{line: 509, col: 35, offset: 17123}, - label: "linebreak", - expr: &zeroOrOneExpr{ - pos: position{line: 509, col: 45, offset: 17133}, - expr: &ruleRefExpr{ - pos: position{line: 509, col: 46, offset: 17134}, - name: "LineBreak", - }, - }, + pos: position{line: 509, col: 11, offset: 16888}, + run: (*parser).callonListParagraphLine22, + expr: &labeledExpr{ + pos: position{line: 509, col: 11, offset: 16888}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 509, col: 20, offset: 16897}, + expr: &ruleRefExpr{ + pos: position{line: 509, col: 21, offset: 16898}, + name: "InlineElement", }, }, }, }, }, &ruleRefExpr{ - pos: position{line: 511, col: 12, offset: 17286}, + pos: position{line: 511, col: 12, offset: 16997}, name: "EOL", }, }, @@ -4278,59 +3847,49 @@ var g = &grammar{ }, { name: "ListItemContinuation", - pos: position{line: 515, col: 1, offset: 17333}, + pos: position{line: 515, col: 1, offset: 17036}, expr: &seqExpr{ - pos: position{line: 515, col: 25, offset: 17357}, + pos: position{line: 515, col: 25, offset: 17060}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 515, col: 25, offset: 17357}, + pos: position{line: 515, col: 25, offset: 17060}, val: "+", ignoreCase: false, + want: "\"+\"", }, &zeroOrMoreExpr{ - pos: position{line: 515, col: 29, offset: 17361}, + pos: position{line: 515, col: 29, offset: 17064}, expr: &ruleRefExpr{ - pos: position{line: 515, col: 29, offset: 17361}, - name: "WS", + pos: position{line: 515, col: 29, offset: 17064}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 515, col: 33, offset: 17365}, - name: "EOL", + pos: position{line: 515, col: 36, offset: 17071}, + name: "Newline", }, }, }, }, { name: "ContinuedListItemElement", - pos: position{line: 517, col: 1, offset: 17371}, + pos: position{line: 517, col: 1, offset: 17143}, expr: &actionExpr{ - pos: position{line: 517, col: 29, offset: 17399}, + pos: position{line: 517, col: 29, offset: 17171}, run: (*parser).callonContinuedListItemElement1, expr: &seqExpr{ - pos: position{line: 517, col: 29, offset: 17399}, + pos: position{line: 517, col: 29, offset: 17171}, exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 517, col: 29, offset: 17399}, - label: "blanklines", - expr: &zeroOrMoreExpr{ - pos: position{line: 517, col: 41, offset: 17411}, - expr: &ruleRefExpr{ - pos: position{line: 517, col: 41, offset: 17411}, - name: "BlankLine", - }, - }, - }, &ruleRefExpr{ - pos: position{line: 517, col: 53, offset: 17423}, + pos: position{line: 517, col: 29, offset: 17171}, name: "ListItemContinuation", }, &labeledExpr{ - pos: position{line: 517, col: 74, offset: 17444}, + pos: position{line: 517, col: 50, offset: 17192}, label: "element", expr: &ruleRefExpr{ - pos: position{line: 517, col: 82, offset: 17452}, - name: "ContinuedListItemBlock", + pos: position{line: 517, col: 58, offset: 17200}, + name: "ContinuedListItemContent", }, }, }, @@ -4338,73 +3897,81 @@ var g = &grammar{ }, }, { - name: "ContinuedListItemBlock", - pos: position{line: 521, col: 1, offset: 17590}, + name: "ContinuedListItemContent", + pos: position{line: 521, col: 1, offset: 17306}, expr: &actionExpr{ - pos: position{line: 521, col: 27, offset: 17616}, - run: (*parser).callonContinuedListItemBlock1, + pos: position{line: 521, col: 29, offset: 17334}, + run: (*parser).callonContinuedListItemContent1, expr: &seqExpr{ - pos: position{line: 521, col: 27, offset: 17616}, + pos: position{line: 521, col: 29, offset: 17334}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 521, col: 27, offset: 17616}, + pos: position{line: 521, col: 29, offset: 17334}, expr: &ruleRefExpr{ - pos: position{line: 521, col: 28, offset: 17617}, + pos: position{line: 521, col: 30, offset: 17335}, name: "EOF", }, }, &labeledExpr{ - pos: position{line: 522, col: 5, offset: 17626}, - label: "block", + pos: position{line: 522, col: 5, offset: 17344}, + label: "content", expr: &choiceExpr{ - pos: position{line: 522, col: 12, offset: 17633}, + pos: position{line: 522, col: 14, offset: 17353}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 522, col: 12, offset: 17633}, + pos: position{line: 522, col: 14, offset: 17353}, name: "DelimitedBlock", }, &ruleRefExpr{ - pos: position{line: 523, col: 11, offset: 17658}, + pos: position{line: 523, col: 11, offset: 17378}, name: "FileInclusion", }, &ruleRefExpr{ - pos: position{line: 524, col: 11, offset: 17682}, + pos: position{line: 524, col: 11, offset: 17402}, name: "VerseParagraph", }, &ruleRefExpr{ - pos: position{line: 525, col: 11, offset: 17736}, + pos: position{line: 525, col: 11, offset: 17456}, name: "ImageBlock", }, &ruleRefExpr{ - pos: position{line: 526, col: 11, offset: 17758}, - name: "ListItem", + pos: position{line: 526, col: 11, offset: 17478}, + name: "OrderedListItem", + }, + &ruleRefExpr{ + pos: position{line: 527, col: 11, offset: 17505}, + name: "UnorderedListItem", + }, + &ruleRefExpr{ + pos: position{line: 528, col: 11, offset: 17534}, + name: "LabeledListItem", }, &ruleRefExpr{ - pos: position{line: 527, col: 11, offset: 17777}, + pos: position{line: 530, col: 11, offset: 17599}, name: "BlankLine", }, &ruleRefExpr{ - pos: position{line: 528, col: 11, offset: 17828}, + pos: position{line: 531, col: 11, offset: 17650}, name: "LiteralBlock", }, &ruleRefExpr{ - pos: position{line: 529, col: 11, offset: 17852}, + pos: position{line: 532, col: 11, offset: 17674}, name: "DocumentAttributeDeclaration", }, &ruleRefExpr{ - pos: position{line: 530, col: 11, offset: 17892}, + pos: position{line: 533, col: 11, offset: 17714}, name: "DocumentAttributeReset", }, &ruleRefExpr{ - pos: position{line: 531, col: 11, offset: 17926}, + pos: position{line: 534, col: 11, offset: 17748}, name: "TableOfContentsPlaceHolder", }, &ruleRefExpr{ - pos: position{line: 532, col: 11, offset: 17963}, + pos: position{line: 535, col: 11, offset: 17785}, name: "UserMacroBlock", }, &ruleRefExpr{ - pos: position{line: 533, col: 11, offset: 17988}, + pos: position{line: 536, col: 11, offset: 17810}, name: "ContinuedParagraph", }, }, @@ -4416,37 +3983,37 @@ var g = &grammar{ }, { name: "OrderedListItem", - pos: position{line: 540, col: 1, offset: 18149}, + pos: position{line: 543, col: 1, offset: 17973}, expr: &actionExpr{ - pos: position{line: 540, col: 20, offset: 18168}, + pos: position{line: 543, col: 20, offset: 17992}, run: (*parser).callonOrderedListItem1, expr: &seqExpr{ - pos: position{line: 540, col: 20, offset: 18168}, + pos: position{line: 543, col: 20, offset: 17992}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 540, col: 20, offset: 18168}, + pos: position{line: 543, col: 20, offset: 17992}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 540, col: 31, offset: 18179}, + pos: position{line: 543, col: 31, offset: 18003}, expr: &ruleRefExpr{ - pos: position{line: 540, col: 32, offset: 18180}, + pos: position{line: 543, col: 32, offset: 18004}, name: "ElementAttributes", }, }, }, &labeledExpr{ - pos: position{line: 540, col: 52, offset: 18200}, + pos: position{line: 543, col: 52, offset: 18024}, label: "prefix", expr: &ruleRefExpr{ - pos: position{line: 540, col: 60, offset: 18208}, + pos: position{line: 543, col: 60, offset: 18032}, name: "OrderedListItemPrefix", }, }, &labeledExpr{ - pos: position{line: 540, col: 83, offset: 18231}, + pos: position{line: 543, col: 83, offset: 18055}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 540, col: 92, offset: 18240}, + pos: position{line: 543, col: 92, offset: 18064}, name: "OrderedListItemContent", }, }, @@ -4456,65 +4023,66 @@ var g = &grammar{ }, { name: "OrderedListItemPrefix", - pos: position{line: 544, col: 1, offset: 18380}, + pos: position{line: 547, col: 1, offset: 18204}, expr: &actionExpr{ - pos: position{line: 545, col: 5, offset: 18410}, + pos: position{line: 548, col: 5, offset: 18234}, run: (*parser).callonOrderedListItemPrefix1, expr: &seqExpr{ - pos: position{line: 545, col: 5, offset: 18410}, + pos: position{line: 548, col: 5, offset: 18234}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 545, col: 5, offset: 18410}, + pos: position{line: 548, col: 5, offset: 18234}, expr: &ruleRefExpr{ - pos: position{line: 545, col: 5, offset: 18410}, - name: "WS", + pos: position{line: 548, col: 5, offset: 18234}, + name: "Space", }, }, &labeledExpr{ - pos: position{line: 545, col: 9, offset: 18414}, + pos: position{line: 548, col: 12, offset: 18241}, label: "prefix", expr: &choiceExpr{ - pos: position{line: 547, col: 9, offset: 18477}, + pos: position{line: 550, col: 9, offset: 18304}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 547, col: 9, offset: 18477}, + pos: position{line: 550, col: 9, offset: 18304}, run: (*parser).callonOrderedListItemPrefix7, expr: &seqExpr{ - pos: position{line: 547, col: 9, offset: 18477}, + pos: position{line: 550, col: 9, offset: 18304}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 547, col: 9, offset: 18477}, + pos: position{line: 550, col: 9, offset: 18304}, label: "depth", expr: &actionExpr{ - pos: position{line: 547, col: 16, offset: 18484}, + pos: position{line: 550, col: 16, offset: 18311}, run: (*parser).callonOrderedListItemPrefix10, expr: &oneOrMoreExpr{ - pos: position{line: 547, col: 16, offset: 18484}, + pos: position{line: 550, col: 16, offset: 18311}, expr: &litMatcher{ - pos: position{line: 547, col: 17, offset: 18485}, + pos: position{line: 550, col: 17, offset: 18312}, val: ".", ignoreCase: false, + want: "\".\"", }, }, }, }, &andCodeExpr{ - pos: position{line: 551, col: 9, offset: 18585}, + pos: position{line: 554, col: 9, offset: 18412}, run: (*parser).callonOrderedListItemPrefix13, }, }, }, }, &actionExpr{ - pos: position{line: 570, col: 11, offset: 19302}, + pos: position{line: 573, col: 11, offset: 19129}, run: (*parser).callonOrderedListItemPrefix14, expr: &seqExpr{ - pos: position{line: 570, col: 11, offset: 19302}, + pos: position{line: 573, col: 11, offset: 19129}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 570, col: 11, offset: 19302}, + pos: position{line: 573, col: 11, offset: 19129}, expr: &charClassMatcher{ - pos: position{line: 570, col: 12, offset: 19303}, + pos: position{line: 573, col: 12, offset: 19130}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -4522,65 +4090,68 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 570, col: 20, offset: 19311}, + pos: position{line: 573, col: 20, offset: 19138}, val: ".", ignoreCase: false, + want: "\".\"", }, }, }, }, &actionExpr{ - pos: position{line: 572, col: 13, offset: 19422}, + pos: position{line: 575, col: 13, offset: 19249}, run: (*parser).callonOrderedListItemPrefix19, expr: &seqExpr{ - pos: position{line: 572, col: 13, offset: 19422}, + pos: position{line: 575, col: 13, offset: 19249}, exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 572, col: 14, offset: 19423}, + pos: position{line: 575, col: 14, offset: 19250}, val: "[a-z]", ranges: []rune{'a', 'z'}, ignoreCase: false, inverted: false, }, &litMatcher{ - pos: position{line: 572, col: 21, offset: 19430}, + pos: position{line: 575, col: 21, offset: 19257}, val: ".", ignoreCase: false, + want: "\".\"", }, }, }, }, &actionExpr{ - pos: position{line: 574, col: 13, offset: 19544}, + pos: position{line: 577, col: 13, offset: 19371}, run: (*parser).callonOrderedListItemPrefix23, expr: &seqExpr{ - pos: position{line: 574, col: 13, offset: 19544}, + pos: position{line: 577, col: 13, offset: 19371}, exprs: []interface{}{ &charClassMatcher{ - pos: position{line: 574, col: 14, offset: 19545}, + pos: position{line: 577, col: 14, offset: 19372}, val: "[A-Z]", ranges: []rune{'A', 'Z'}, ignoreCase: false, inverted: false, }, &litMatcher{ - pos: position{line: 574, col: 21, offset: 19552}, + pos: position{line: 577, col: 21, offset: 19379}, val: ".", ignoreCase: false, + want: "\".\"", }, }, }, }, &actionExpr{ - pos: position{line: 576, col: 13, offset: 19666}, + pos: position{line: 579, col: 13, offset: 19493}, run: (*parser).callonOrderedListItemPrefix27, expr: &seqExpr{ - pos: position{line: 576, col: 13, offset: 19666}, + pos: position{line: 579, col: 13, offset: 19493}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 576, col: 13, offset: 19666}, + pos: position{line: 579, col: 13, offset: 19493}, expr: &charClassMatcher{ - pos: position{line: 576, col: 14, offset: 19667}, + pos: position{line: 579, col: 14, offset: 19494}, val: "[a-z]", ranges: []rune{'a', 'z'}, ignoreCase: false, @@ -4588,23 +4159,24 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 576, col: 22, offset: 19675}, + pos: position{line: 579, col: 22, offset: 19502}, val: ")", ignoreCase: false, + want: "\")\"", }, }, }, }, &actionExpr{ - pos: position{line: 578, col: 13, offset: 19789}, + pos: position{line: 581, col: 13, offset: 19616}, run: (*parser).callonOrderedListItemPrefix32, expr: &seqExpr{ - pos: position{line: 578, col: 13, offset: 19789}, + pos: position{line: 581, col: 13, offset: 19616}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 578, col: 13, offset: 19789}, + pos: position{line: 581, col: 13, offset: 19616}, expr: &charClassMatcher{ - pos: position{line: 578, col: 14, offset: 19790}, + pos: position{line: 581, col: 14, offset: 19617}, val: "[A-Z]", ranges: []rune{'A', 'Z'}, ignoreCase: false, @@ -4612,9 +4184,10 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 578, col: 22, offset: 19798}, + pos: position{line: 581, col: 22, offset: 19625}, val: ")", ignoreCase: false, + want: "\")\"", }, }, }, @@ -4623,10 +4196,10 @@ var g = &grammar{ }, }, &oneOrMoreExpr{ - pos: position{line: 580, col: 12, offset: 19911}, + pos: position{line: 583, col: 12, offset: 19738}, expr: &ruleRefExpr{ - pos: position{line: 580, col: 12, offset: 19911}, - name: "WS", + pos: position{line: 583, col: 12, offset: 19738}, + name: "Space", }, }, }, @@ -4635,17 +4208,17 @@ var g = &grammar{ }, { name: "OrderedListItemContent", - pos: position{line: 584, col: 1, offset: 19943}, + pos: position{line: 587, col: 1, offset: 19773}, expr: &actionExpr{ - pos: position{line: 584, col: 27, offset: 19969}, + pos: position{line: 587, col: 27, offset: 19799}, run: (*parser).callonOrderedListItemContent1, expr: &labeledExpr{ - pos: position{line: 584, col: 27, offset: 19969}, + pos: position{line: 587, col: 27, offset: 19799}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 584, col: 37, offset: 19979}, + pos: position{line: 587, col: 37, offset: 19809}, expr: &ruleRefExpr{ - pos: position{line: 584, col: 37, offset: 19979}, + pos: position{line: 587, col: 37, offset: 19809}, name: "ListParagraph", }, }, @@ -4654,48 +4227,48 @@ var g = &grammar{ }, { name: "UnorderedListItem", - pos: position{line: 591, col: 1, offset: 20179}, + pos: position{line: 594, col: 1, offset: 20009}, expr: &actionExpr{ - pos: position{line: 591, col: 22, offset: 20200}, + pos: position{line: 594, col: 22, offset: 20030}, run: (*parser).callonUnorderedListItem1, expr: &seqExpr{ - pos: position{line: 591, col: 22, offset: 20200}, + pos: position{line: 594, col: 22, offset: 20030}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 591, col: 22, offset: 20200}, + pos: position{line: 594, col: 22, offset: 20030}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 591, col: 33, offset: 20211}, + pos: position{line: 594, col: 33, offset: 20041}, expr: &ruleRefExpr{ - pos: position{line: 591, col: 34, offset: 20212}, + pos: position{line: 594, col: 34, offset: 20042}, name: "ElementAttributes", }, }, }, &labeledExpr{ - pos: position{line: 591, col: 54, offset: 20232}, + pos: position{line: 594, col: 54, offset: 20062}, label: "prefix", expr: &ruleRefExpr{ - pos: position{line: 591, col: 62, offset: 20240}, + pos: position{line: 594, col: 62, offset: 20070}, name: "UnorderedListItemPrefix", }, }, &labeledExpr{ - pos: position{line: 591, col: 87, offset: 20265}, + pos: position{line: 594, col: 87, offset: 20095}, label: "checkstyle", expr: &zeroOrOneExpr{ - pos: position{line: 591, col: 98, offset: 20276}, + pos: position{line: 594, col: 98, offset: 20106}, expr: &ruleRefExpr{ - pos: position{line: 591, col: 99, offset: 20277}, + pos: position{line: 594, col: 99, offset: 20107}, name: "UnorderedListItemCheckStyle", }, }, }, &labeledExpr{ - pos: position{line: 591, col: 129, offset: 20307}, + pos: position{line: 594, col: 129, offset: 20137}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 591, col: 138, offset: 20316}, + pos: position{line: 594, col: 138, offset: 20146}, name: "UnorderedListItemContent", }, }, @@ -4705,65 +4278,67 @@ var g = &grammar{ }, { name: "UnorderedListItemPrefix", - pos: position{line: 595, col: 1, offset: 20474}, + pos: position{line: 598, col: 1, offset: 20304}, expr: &actionExpr{ - pos: position{line: 596, col: 5, offset: 20506}, + pos: position{line: 599, col: 5, offset: 20336}, run: (*parser).callonUnorderedListItemPrefix1, expr: &seqExpr{ - pos: position{line: 596, col: 5, offset: 20506}, + pos: position{line: 599, col: 5, offset: 20336}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 596, col: 5, offset: 20506}, + pos: position{line: 599, col: 5, offset: 20336}, expr: &ruleRefExpr{ - pos: position{line: 596, col: 5, offset: 20506}, - name: "WS", + pos: position{line: 599, col: 5, offset: 20336}, + name: "Space", }, }, &labeledExpr{ - pos: position{line: 596, col: 9, offset: 20510}, + pos: position{line: 599, col: 12, offset: 20343}, label: "prefix", expr: &choiceExpr{ - pos: position{line: 596, col: 17, offset: 20518}, + pos: position{line: 599, col: 20, offset: 20351}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 598, col: 9, offset: 20575}, + pos: position{line: 601, col: 9, offset: 20408}, run: (*parser).callonUnorderedListItemPrefix7, expr: &seqExpr{ - pos: position{line: 598, col: 9, offset: 20575}, + pos: position{line: 601, col: 9, offset: 20408}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 598, col: 9, offset: 20575}, + pos: position{line: 601, col: 9, offset: 20408}, label: "depth", expr: &actionExpr{ - pos: position{line: 598, col: 16, offset: 20582}, + pos: position{line: 601, col: 16, offset: 20415}, run: (*parser).callonUnorderedListItemPrefix10, expr: &oneOrMoreExpr{ - pos: position{line: 598, col: 16, offset: 20582}, + pos: position{line: 601, col: 16, offset: 20415}, expr: &litMatcher{ - pos: position{line: 598, col: 17, offset: 20583}, + pos: position{line: 601, col: 17, offset: 20416}, val: "*", ignoreCase: false, + want: "\"*\"", }, }, }, }, &andCodeExpr{ - pos: position{line: 602, col: 9, offset: 20683}, + pos: position{line: 605, col: 9, offset: 20516}, run: (*parser).callonUnorderedListItemPrefix13, }, }, }, }, &labeledExpr{ - pos: position{line: 619, col: 14, offset: 21390}, + pos: position{line: 622, col: 14, offset: 21223}, label: "depth", expr: &actionExpr{ - pos: position{line: 619, col: 21, offset: 21397}, + pos: position{line: 622, col: 21, offset: 21230}, run: (*parser).callonUnorderedListItemPrefix15, expr: &litMatcher{ - pos: position{line: 619, col: 22, offset: 21398}, + pos: position{line: 622, col: 22, offset: 21231}, val: "-", ignoreCase: false, + want: "\"-\"", }, }, }, @@ -4771,10 +4346,10 @@ var g = &grammar{ }, }, &oneOrMoreExpr{ - pos: position{line: 621, col: 13, offset: 21484}, + pos: position{line: 624, col: 13, offset: 21317}, expr: &ruleRefExpr{ - pos: position{line: 621, col: 13, offset: 21484}, - name: "WS", + pos: position{line: 624, col: 13, offset: 21317}, + name: "Space", }, }, }, @@ -4783,62 +4358,66 @@ var g = &grammar{ }, { name: "UnorderedListItemCheckStyle", - pos: position{line: 625, col: 1, offset: 21517}, + pos: position{line: 628, col: 1, offset: 21353}, expr: &actionExpr{ - pos: position{line: 625, col: 32, offset: 21548}, + pos: position{line: 628, col: 32, offset: 21384}, run: (*parser).callonUnorderedListItemCheckStyle1, expr: &seqExpr{ - pos: position{line: 625, col: 32, offset: 21548}, + pos: position{line: 628, col: 32, offset: 21384}, exprs: []interface{}{ &andExpr{ - pos: position{line: 625, col: 32, offset: 21548}, + pos: position{line: 628, col: 32, offset: 21384}, expr: &litMatcher{ - pos: position{line: 625, col: 33, offset: 21549}, + pos: position{line: 628, col: 33, offset: 21385}, val: "[", ignoreCase: false, + want: "\"[\"", }, }, &labeledExpr{ - pos: position{line: 625, col: 37, offset: 21553}, + pos: position{line: 628, col: 37, offset: 21389}, label: "style", expr: &choiceExpr{ - pos: position{line: 626, col: 7, offset: 21567}, + pos: position{line: 629, col: 7, offset: 21403}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 626, col: 7, offset: 21567}, + pos: position{line: 629, col: 7, offset: 21403}, run: (*parser).callonUnorderedListItemCheckStyle7, expr: &litMatcher{ - pos: position{line: 626, col: 7, offset: 21567}, + pos: position{line: 629, col: 7, offset: 21403}, val: "[ ]", ignoreCase: false, + want: "\"[ ]\"", }, }, &actionExpr{ - pos: position{line: 627, col: 7, offset: 21612}, + pos: position{line: 630, col: 7, offset: 21448}, run: (*parser).callonUnorderedListItemCheckStyle9, expr: &litMatcher{ - pos: position{line: 627, col: 7, offset: 21612}, + pos: position{line: 630, col: 7, offset: 21448}, val: "[*]", ignoreCase: false, + want: "\"[*]\"", }, }, &actionExpr{ - pos: position{line: 628, col: 7, offset: 21655}, + pos: position{line: 631, col: 7, offset: 21491}, run: (*parser).callonUnorderedListItemCheckStyle11, expr: &litMatcher{ - pos: position{line: 628, col: 7, offset: 21655}, + pos: position{line: 631, col: 7, offset: 21491}, val: "[x]", ignoreCase: false, + want: "\"[x]\"", }, }, }, }, }, &oneOrMoreExpr{ - pos: position{line: 629, col: 7, offset: 21697}, + pos: position{line: 632, col: 7, offset: 21533}, expr: &ruleRefExpr{ - pos: position{line: 629, col: 7, offset: 21697}, - name: "WS", + pos: position{line: 632, col: 7, offset: 21533}, + name: "Space", }, }, }, @@ -4847,17 +4426,17 @@ var g = &grammar{ }, { name: "UnorderedListItemContent", - pos: position{line: 633, col: 1, offset: 21736}, + pos: position{line: 636, col: 1, offset: 21575}, expr: &actionExpr{ - pos: position{line: 633, col: 29, offset: 21764}, + pos: position{line: 636, col: 29, offset: 21603}, run: (*parser).callonUnorderedListItemContent1, expr: &labeledExpr{ - pos: position{line: 633, col: 29, offset: 21764}, + pos: position{line: 636, col: 29, offset: 21603}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 633, col: 39, offset: 21774}, + pos: position{line: 636, col: 39, offset: 21613}, expr: &ruleRefExpr{ - pos: position{line: 633, col: 39, offset: 21774}, + pos: position{line: 636, col: 39, offset: 21613}, name: "ListParagraph", }, }, @@ -4866,47 +4445,47 @@ var g = &grammar{ }, { name: "LabeledListItem", - pos: position{line: 640, col: 1, offset: 22090}, + pos: position{line: 643, col: 1, offset: 21929}, expr: &actionExpr{ - pos: position{line: 640, col: 20, offset: 22109}, + pos: position{line: 643, col: 20, offset: 21948}, run: (*parser).callonLabeledListItem1, expr: &seqExpr{ - pos: position{line: 640, col: 20, offset: 22109}, + pos: position{line: 643, col: 20, offset: 21948}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 640, col: 20, offset: 22109}, + pos: position{line: 643, col: 20, offset: 21948}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 640, col: 31, offset: 22120}, + pos: position{line: 643, col: 31, offset: 21959}, expr: &ruleRefExpr{ - pos: position{line: 640, col: 32, offset: 22121}, + pos: position{line: 643, col: 32, offset: 21960}, name: "ElementAttributes", }, }, }, &labeledExpr{ - pos: position{line: 640, col: 52, offset: 22141}, + pos: position{line: 643, col: 52, offset: 21980}, label: "term", expr: &ruleRefExpr{ - pos: position{line: 640, col: 58, offset: 22147}, - name: "SimpleLabeledListItemTerm", + pos: position{line: 643, col: 58, offset: 21986}, + name: "VerbatimLabeledListItemTerm", }, }, &labeledExpr{ - pos: position{line: 640, col: 85, offset: 22174}, + pos: position{line: 643, col: 87, offset: 22015}, label: "separator", expr: &ruleRefExpr{ - pos: position{line: 640, col: 96, offset: 22185}, + pos: position{line: 643, col: 98, offset: 22026}, name: "LabeledListItemSeparator", }, }, &labeledExpr{ - pos: position{line: 640, col: 122, offset: 22211}, + pos: position{line: 643, col: 124, offset: 22052}, label: "description", expr: &zeroOrOneExpr{ - pos: position{line: 640, col: 134, offset: 22223}, + pos: position{line: 643, col: 136, offset: 22064}, expr: &ruleRefExpr{ - pos: position{line: 640, col: 135, offset: 22224}, + pos: position{line: 643, col: 137, offset: 22065}, name: "LabeledListItemDescription", }, }, @@ -4916,53 +4495,42 @@ var g = &grammar{ }, }, { - name: "SimpleLabeledListItemTerm", - pos: position{line: 644, col: 1, offset: 22370}, + name: "LabeledListItemPrefix", + pos: position{line: 647, col: 1, offset: 22211}, + expr: &seqExpr{ + pos: position{line: 647, col: 26, offset: 22236}, + exprs: []interface{}{ + &ruleRefExpr{ + pos: position{line: 647, col: 26, offset: 22236}, + name: "VerbatimLabeledListItemTerm", + }, + &ruleRefExpr{ + pos: position{line: 647, col: 54, offset: 22264}, + name: "LabeledListItemSeparator", + }, + }, + }, + }, + { + name: "VerbatimLabeledListItemTerm", + pos: position{line: 649, col: 1, offset: 22290}, expr: &actionExpr{ - pos: position{line: 644, col: 30, offset: 22399}, - run: (*parser).callonSimpleLabeledListItemTerm1, + pos: position{line: 649, col: 32, offset: 22321}, + run: (*parser).callonVerbatimLabeledListItemTerm1, expr: &labeledExpr{ - pos: position{line: 644, col: 30, offset: 22399}, + pos: position{line: 649, col: 32, offset: 22321}, label: "content", expr: &actionExpr{ - pos: position{line: 644, col: 39, offset: 22408}, - run: (*parser).callonSimpleLabeledListItemTerm3, + pos: position{line: 649, col: 41, offset: 22330}, + run: (*parser).callonVerbatimLabeledListItemTerm3, expr: &oneOrMoreExpr{ - pos: position{line: 644, col: 39, offset: 22408}, - expr: &choiceExpr{ - pos: position{line: 644, col: 40, offset: 22409}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 644, col: 40, offset: 22409}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 644, col: 52, offset: 22421}, - name: "Spaces", - }, - &seqExpr{ - pos: position{line: 644, col: 62, offset: 22431}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 644, col: 62, offset: 22431}, - expr: &ruleRefExpr{ - pos: position{line: 644, col: 63, offset: 22432}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 644, col: 71, offset: 22440}, - expr: &ruleRefExpr{ - pos: position{line: 644, col: 72, offset: 22441}, - name: "LabeledListItemSeparator", - }, - }, - &anyMatcher{ - line: 644, col: 97, offset: 22466, - }, - }, - }, - }, + pos: position{line: 649, col: 41, offset: 22330}, + expr: &charClassMatcher{ + pos: position{line: 649, col: 41, offset: 22330}, + val: "[^:\\r\\n]", + chars: []rune{':', '\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, @@ -4971,34 +4539,36 @@ var g = &grammar{ }, { name: "LabeledListItemTerm", - pos: position{line: 650, col: 1, offset: 22595}, + pos: position{line: 655, col: 1, offset: 22464}, expr: &actionExpr{ - pos: position{line: 650, col: 24, offset: 22618}, + pos: position{line: 655, col: 24, offset: 22487}, run: (*parser).callonLabeledListItemTerm1, expr: &labeledExpr{ - pos: position{line: 650, col: 24, offset: 22618}, + pos: position{line: 655, col: 24, offset: 22487}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 650, col: 33, offset: 22627}, + pos: position{line: 655, col: 33, offset: 22496}, expr: &seqExpr{ - pos: position{line: 650, col: 34, offset: 22628}, + pos: position{line: 655, col: 34, offset: 22497}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 650, col: 34, offset: 22628}, + pos: position{line: 655, col: 34, offset: 22497}, expr: &ruleRefExpr{ - pos: position{line: 650, col: 35, offset: 22629}, + pos: position{line: 655, col: 35, offset: 22498}, name: "Newline", }, }, ¬Expr{ - pos: position{line: 650, col: 43, offset: 22637}, - expr: &ruleRefExpr{ - pos: position{line: 650, col: 44, offset: 22638}, - name: "LabeledListItemSeparator", + pos: position{line: 655, col: 43, offset: 22506}, + expr: &litMatcher{ + pos: position{line: 655, col: 44, offset: 22507}, + val: "::", + ignoreCase: false, + want: "\"::\"", }, }, &ruleRefExpr{ - pos: position{line: 650, col: 69, offset: 22663}, + pos: position{line: 655, col: 49, offset: 22512}, name: "LabeledListItemTermElement", }, }, @@ -5009,74 +4579,69 @@ var g = &grammar{ }, { name: "LabeledListItemTermElement", - pos: position{line: 654, col: 1, offset: 22798}, + pos: position{line: 659, col: 1, offset: 22639}, expr: &actionExpr{ - pos: position{line: 654, col: 31, offset: 22828}, + pos: position{line: 659, col: 31, offset: 22669}, run: (*parser).callonLabeledListItemTermElement1, expr: &labeledExpr{ - pos: position{line: 654, col: 31, offset: 22828}, + pos: position{line: 659, col: 31, offset: 22669}, label: "element", expr: &choiceExpr{ - pos: position{line: 654, col: 40, offset: 22837}, + pos: position{line: 659, col: 40, offset: 22678}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 654, col: 40, offset: 22837}, - name: "SimpleWord", + pos: position{line: 659, col: 40, offset: 22678}, + name: "Word", }, &ruleRefExpr{ - pos: position{line: 655, col: 11, offset: 22858}, - name: "Spaces", + pos: position{line: 660, col: 11, offset: 22693}, + name: "LineBreak", + }, + &oneOrMoreExpr{ + pos: position{line: 661, col: 11, offset: 22742}, + expr: &ruleRefExpr{ + pos: position{line: 661, col: 11, offset: 22742}, + name: "Space", + }, }, &ruleRefExpr{ - pos: position{line: 656, col: 11, offset: 22876}, + pos: position{line: 662, col: 11, offset: 22760}, name: "CrossReference", }, &ruleRefExpr{ - pos: position{line: 657, col: 11, offset: 22901}, + pos: position{line: 663, col: 11, offset: 22785}, name: "ConcealedIndexTerm", }, &ruleRefExpr{ - pos: position{line: 658, col: 11, offset: 22930}, + pos: position{line: 664, col: 11, offset: 22814}, name: "IndexTerm", }, &ruleRefExpr{ - pos: position{line: 659, col: 11, offset: 22950}, + pos: position{line: 665, col: 11, offset: 22834}, name: "Passthrough", }, &ruleRefExpr{ - pos: position{line: 660, col: 11, offset: 22972}, + pos: position{line: 666, col: 11, offset: 22856}, name: "InlineImage", }, &ruleRefExpr{ - pos: position{line: 661, col: 11, offset: 22995}, + pos: position{line: 667, col: 11, offset: 22879}, name: "Link", }, &ruleRefExpr{ - pos: position{line: 662, col: 11, offset: 23010}, + pos: position{line: 668, col: 11, offset: 22894}, name: "InlineFootnote", }, &ruleRefExpr{ - pos: position{line: 663, col: 11, offset: 23035}, + pos: position{line: 669, col: 11, offset: 22919}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 664, col: 11, offset: 23056}, + pos: position{line: 670, col: 11, offset: 22940}, name: "DocumentAttributeSubstitution", }, &ruleRefExpr{ - pos: position{line: 665, col: 11, offset: 23096}, - name: "LineBreak", - }, - &ruleRefExpr{ - pos: position{line: 666, col: 11, offset: 23116}, - name: "Parenthesis", - }, - &ruleRefExpr{ - pos: position{line: 667, col: 11, offset: 23138}, - name: "AnyChars", - }, - &ruleRefExpr{ - pos: position{line: 668, col: 11, offset: 23157}, + pos: position{line: 671, col: 11, offset: 22980}, name: "AnyChar", }, }, @@ -5086,54 +4651,55 @@ var g = &grammar{ }, { name: "LabeledListItemSeparator", - pos: position{line: 672, col: 1, offset: 23196}, + pos: position{line: 675, col: 1, offset: 23019}, expr: &actionExpr{ - pos: position{line: 673, col: 5, offset: 23229}, + pos: position{line: 676, col: 5, offset: 23052}, run: (*parser).callonLabeledListItemSeparator1, expr: &seqExpr{ - pos: position{line: 673, col: 5, offset: 23229}, + pos: position{line: 676, col: 5, offset: 23052}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 673, col: 5, offset: 23229}, + pos: position{line: 676, col: 5, offset: 23052}, label: "separator", expr: &actionExpr{ - pos: position{line: 673, col: 16, offset: 23240}, + pos: position{line: 676, col: 16, offset: 23063}, run: (*parser).callonLabeledListItemSeparator4, expr: &oneOrMoreExpr{ - pos: position{line: 673, col: 16, offset: 23240}, + pos: position{line: 676, col: 16, offset: 23063}, expr: &litMatcher{ - pos: position{line: 673, col: 17, offset: 23241}, + pos: position{line: 676, col: 17, offset: 23064}, val: ":", ignoreCase: false, + want: "\":\"", }, }, }, }, &andCodeExpr{ - pos: position{line: 676, col: 5, offset: 23299}, + pos: position{line: 679, col: 5, offset: 23122}, run: (*parser).callonLabeledListItemSeparator7, }, &choiceExpr{ - pos: position{line: 680, col: 6, offset: 23475}, + pos: position{line: 683, col: 6, offset: 23298}, alternatives: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 680, col: 6, offset: 23475}, + pos: position{line: 683, col: 6, offset: 23298}, expr: &choiceExpr{ - pos: position{line: 680, col: 7, offset: 23476}, + pos: position{line: 683, col: 7, offset: 23299}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 680, col: 7, offset: 23476}, - name: "WS", + pos: position{line: 683, col: 7, offset: 23299}, + name: "Space", }, &ruleRefExpr{ - pos: position{line: 680, col: 12, offset: 23481}, + pos: position{line: 683, col: 15, offset: 23307}, name: "Newline", }, }, }, }, &ruleRefExpr{ - pos: position{line: 680, col: 24, offset: 23493}, + pos: position{line: 683, col: 27, offset: 23319}, name: "EOL", }, }, @@ -5144,17 +4710,17 @@ var g = &grammar{ }, { name: "LabeledListItemDescription", - pos: position{line: 684, col: 1, offset: 23533}, + pos: position{line: 687, col: 1, offset: 23359}, expr: &actionExpr{ - pos: position{line: 684, col: 31, offset: 23563}, + pos: position{line: 687, col: 31, offset: 23389}, run: (*parser).callonLabeledListItemDescription1, expr: &labeledExpr{ - pos: position{line: 684, col: 31, offset: 23563}, + pos: position{line: 687, col: 31, offset: 23389}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 684, col: 40, offset: 23572}, + pos: position{line: 687, col: 40, offset: 23398}, expr: &ruleRefExpr{ - pos: position{line: 684, col: 41, offset: 23573}, + pos: position{line: 687, col: 41, offset: 23399}, name: "ListParagraph", }, }, @@ -5163,53 +4729,58 @@ var g = &grammar{ }, { name: "AdmonitionKind", - pos: position{line: 691, col: 1, offset: 23764}, + pos: position{line: 694, col: 1, offset: 23590}, expr: &choiceExpr{ - pos: position{line: 691, col: 19, offset: 23782}, + pos: position{line: 694, col: 19, offset: 23608}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 691, col: 19, offset: 23782}, + pos: position{line: 694, col: 19, offset: 23608}, run: (*parser).callonAdmonitionKind2, expr: &litMatcher{ - pos: position{line: 691, col: 19, offset: 23782}, + pos: position{line: 694, col: 19, offset: 23608}, val: "TIP", ignoreCase: false, + want: "\"TIP\"", }, }, &actionExpr{ - pos: position{line: 693, col: 9, offset: 23828}, + pos: position{line: 696, col: 9, offset: 23654}, run: (*parser).callonAdmonitionKind4, expr: &litMatcher{ - pos: position{line: 693, col: 9, offset: 23828}, + pos: position{line: 696, col: 9, offset: 23654}, val: "NOTE", ignoreCase: false, + want: "\"NOTE\"", }, }, &actionExpr{ - pos: position{line: 695, col: 9, offset: 23876}, + pos: position{line: 698, col: 9, offset: 23702}, run: (*parser).callonAdmonitionKind6, expr: &litMatcher{ - pos: position{line: 695, col: 9, offset: 23876}, + pos: position{line: 698, col: 9, offset: 23702}, val: "IMPORTANT", ignoreCase: false, + want: "\"IMPORTANT\"", }, }, &actionExpr{ - pos: position{line: 697, col: 9, offset: 23934}, + pos: position{line: 700, col: 9, offset: 23760}, run: (*parser).callonAdmonitionKind8, expr: &litMatcher{ - pos: position{line: 697, col: 9, offset: 23934}, + pos: position{line: 700, col: 9, offset: 23760}, val: "WARNING", ignoreCase: false, + want: "\"WARNING\"", }, }, &actionExpr{ - pos: position{line: 699, col: 9, offset: 23988}, + pos: position{line: 702, col: 9, offset: 23814}, run: (*parser).callonAdmonitionKind10, expr: &litMatcher{ - pos: position{line: 699, col: 9, offset: 23988}, + pos: position{line: 702, col: 9, offset: 23814}, val: "CAUTION", ignoreCase: false, + want: "\"CAUTION\"", }, }, }, @@ -5217,47 +4788,48 @@ var g = &grammar{ }, { name: "Paragraph", - pos: position{line: 708, col: 1, offset: 24295}, + pos: position{line: 711, col: 1, offset: 24121}, expr: &choiceExpr{ - pos: position{line: 710, col: 5, offset: 24342}, + pos: position{line: 713, col: 5, offset: 24168}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 710, col: 5, offset: 24342}, + pos: position{line: 713, col: 5, offset: 24168}, run: (*parser).callonParagraph2, expr: &seqExpr{ - pos: position{line: 710, col: 5, offset: 24342}, + pos: position{line: 713, col: 5, offset: 24168}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 710, col: 5, offset: 24342}, + pos: position{line: 713, col: 5, offset: 24168}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 710, col: 16, offset: 24353}, + pos: position{line: 713, col: 16, offset: 24179}, expr: &ruleRefExpr{ - pos: position{line: 710, col: 17, offset: 24354}, + pos: position{line: 713, col: 17, offset: 24180}, name: "ElementAttributes", }, }, }, &labeledExpr{ - pos: position{line: 710, col: 37, offset: 24374}, + pos: position{line: 713, col: 37, offset: 24200}, label: "t", expr: &ruleRefExpr{ - pos: position{line: 710, col: 40, offset: 24377}, + pos: position{line: 713, col: 40, offset: 24203}, name: "AdmonitionKind", }, }, &litMatcher{ - pos: position{line: 710, col: 56, offset: 24393}, + pos: position{line: 713, col: 56, offset: 24219}, val: ": ", ignoreCase: false, + want: "\": \"", }, &labeledExpr{ - pos: position{line: 710, col: 61, offset: 24398}, + pos: position{line: 713, col: 61, offset: 24224}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 710, col: 67, offset: 24404}, + pos: position{line: 713, col: 67, offset: 24230}, expr: &ruleRefExpr{ - pos: position{line: 710, col: 68, offset: 24405}, + pos: position{line: 713, col: 68, offset: 24231}, name: "InlineElements", }, }, @@ -5266,29 +4838,36 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 714, col: 5, offset: 24597}, + pos: position{line: 717, col: 5, offset: 24423}, run: (*parser).callonParagraph13, expr: &seqExpr{ - pos: position{line: 714, col: 5, offset: 24597}, + pos: position{line: 717, col: 5, offset: 24423}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 714, col: 5, offset: 24597}, + pos: position{line: 717, col: 5, offset: 24423}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 714, col: 16, offset: 24608}, + pos: position{line: 717, col: 16, offset: 24434}, expr: &ruleRefExpr{ - pos: position{line: 714, col: 17, offset: 24609}, + pos: position{line: 717, col: 17, offset: 24435}, name: "ElementAttributes", }, }, }, + ¬Expr{ + pos: position{line: 717, col: 37, offset: 24455}, + expr: &ruleRefExpr{ + pos: position{line: 717, col: 38, offset: 24456}, + name: "BlockDelimiter", + }, + }, &labeledExpr{ - pos: position{line: 714, col: 37, offset: 24629}, + pos: position{line: 717, col: 53, offset: 24471}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 714, col: 43, offset: 24635}, + pos: position{line: 717, col: 59, offset: 24477}, expr: &ruleRefExpr{ - pos: position{line: 714, col: 44, offset: 24636}, + pos: position{line: 717, col: 60, offset: 24478}, name: "InlineElements", }, }, @@ -5301,43 +4880,43 @@ var g = &grammar{ }, { name: "SimpleParagraph", - pos: position{line: 719, col: 1, offset: 24801}, + pos: position{line: 722, col: 1, offset: 24643}, expr: &actionExpr{ - pos: position{line: 719, col: 20, offset: 24820}, + pos: position{line: 722, col: 20, offset: 24662}, run: (*parser).callonSimpleParagraph1, expr: &seqExpr{ - pos: position{line: 719, col: 20, offset: 24820}, + pos: position{line: 722, col: 20, offset: 24662}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 719, col: 20, offset: 24820}, + pos: position{line: 722, col: 20, offset: 24662}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 719, col: 31, offset: 24831}, + pos: position{line: 722, col: 31, offset: 24673}, expr: &ruleRefExpr{ - pos: position{line: 719, col: 32, offset: 24832}, + pos: position{line: 722, col: 32, offset: 24674}, name: "ElementAttributes", }, }, }, &andCodeExpr{ - pos: position{line: 720, col: 5, offset: 24857}, + pos: position{line: 723, col: 5, offset: 24699}, run: (*parser).callonSimpleParagraph6, }, &labeledExpr{ - pos: position{line: 728, col: 5, offset: 25148}, + pos: position{line: 731, col: 5, offset: 24990}, label: "firstLine", expr: &ruleRefExpr{ - pos: position{line: 728, col: 16, offset: 25159}, + pos: position{line: 731, col: 16, offset: 25001}, name: "FirstParagraphLine", }, }, &labeledExpr{ - pos: position{line: 729, col: 5, offset: 25182}, + pos: position{line: 732, col: 5, offset: 25024}, label: "otherLines", expr: &zeroOrMoreExpr{ - pos: position{line: 729, col: 16, offset: 25193}, + pos: position{line: 732, col: 16, offset: 25035}, expr: &ruleRefExpr{ - pos: position{line: 729, col: 17, offset: 25194}, + pos: position{line: 732, col: 17, offset: 25036}, name: "OtherParagraphLine", }, }, @@ -5346,47 +4925,101 @@ var g = &grammar{ }, }, }, + { + name: "FirstParagraphLine", + pos: position{line: 736, col: 1, offset: 25170}, + expr: &actionExpr{ + pos: position{line: 737, col: 5, offset: 25197}, + run: (*parser).callonFirstParagraphLine1, + expr: &seqExpr{ + pos: position{line: 737, col: 5, offset: 25197}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 737, col: 5, offset: 25197}, + label: "elements", + expr: &seqExpr{ + pos: position{line: 737, col: 15, offset: 25207}, + exprs: []interface{}{ + &ruleRefExpr{ + pos: position{line: 737, col: 15, offset: 25207}, + name: "Word", + }, + &zeroOrMoreExpr{ + pos: position{line: 737, col: 20, offset: 25212}, + expr: &ruleRefExpr{ + pos: position{line: 737, col: 20, offset: 25212}, + name: "InlineElement", + }, + }, + }, + }, + }, + &ruleRefExpr{ + pos: position{line: 737, col: 36, offset: 25228}, + name: "EOL", + }, + }, + }, + }, + }, + { + name: "OtherParagraphLine", + pos: position{line: 741, col: 1, offset: 25299}, + expr: &actionExpr{ + pos: position{line: 741, col: 23, offset: 25321}, + run: (*parser).callonOtherParagraphLine1, + expr: &labeledExpr{ + pos: position{line: 741, col: 23, offset: 25321}, + label: "elements", + expr: &ruleRefExpr{ + pos: position{line: 741, col: 33, offset: 25331}, + name: "InlineElements", + }, + }, + }, + }, { name: "ContinuedParagraph", - pos: position{line: 734, col: 1, offset: 25402}, + pos: position{line: 746, col: 1, offset: 25451}, expr: &choiceExpr{ - pos: position{line: 736, col: 5, offset: 25458}, + pos: position{line: 748, col: 5, offset: 25507}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 736, col: 5, offset: 25458}, + pos: position{line: 748, col: 5, offset: 25507}, run: (*parser).callonContinuedParagraph2, expr: &seqExpr{ - pos: position{line: 736, col: 5, offset: 25458}, + pos: position{line: 748, col: 5, offset: 25507}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 736, col: 5, offset: 25458}, + pos: position{line: 748, col: 5, offset: 25507}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 736, col: 16, offset: 25469}, + pos: position{line: 748, col: 16, offset: 25518}, expr: &ruleRefExpr{ - pos: position{line: 736, col: 17, offset: 25470}, + pos: position{line: 748, col: 17, offset: 25519}, name: "ElementAttributes", }, }, }, &labeledExpr{ - pos: position{line: 736, col: 37, offset: 25490}, + pos: position{line: 748, col: 37, offset: 25539}, label: "t", expr: &ruleRefExpr{ - pos: position{line: 736, col: 40, offset: 25493}, + pos: position{line: 748, col: 40, offset: 25542}, name: "AdmonitionKind", }, }, &litMatcher{ - pos: position{line: 736, col: 56, offset: 25509}, + pos: position{line: 748, col: 56, offset: 25558}, val: ": ", ignoreCase: false, + want: "\": \"", }, &labeledExpr{ - pos: position{line: 736, col: 61, offset: 25514}, + pos: position{line: 748, col: 61, offset: 25563}, label: "lines", expr: &ruleRefExpr{ - pos: position{line: 736, col: 68, offset: 25521}, + pos: position{line: 748, col: 68, offset: 25570}, name: "ContinuedParagraphLines", }, }, @@ -5394,27 +5027,27 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 740, col: 5, offset: 25721}, + pos: position{line: 752, col: 5, offset: 25770}, run: (*parser).callonContinuedParagraph12, expr: &seqExpr{ - pos: position{line: 740, col: 5, offset: 25721}, + pos: position{line: 752, col: 5, offset: 25770}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 740, col: 5, offset: 25721}, + pos: position{line: 752, col: 5, offset: 25770}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 740, col: 16, offset: 25732}, + pos: position{line: 752, col: 16, offset: 25781}, expr: &ruleRefExpr{ - pos: position{line: 740, col: 17, offset: 25733}, + pos: position{line: 752, col: 17, offset: 25782}, name: "ElementAttributes", }, }, }, &labeledExpr{ - pos: position{line: 740, col: 37, offset: 25753}, + pos: position{line: 752, col: 37, offset: 25802}, label: "lines", expr: &ruleRefExpr{ - pos: position{line: 740, col: 44, offset: 25760}, + pos: position{line: 752, col: 44, offset: 25809}, name: "ContinuedParagraphLines", }, }, @@ -5426,38 +5059,38 @@ var g = &grammar{ }, { name: "ContinuedParagraphLines", - pos: position{line: 744, col: 1, offset: 25861}, + pos: position{line: 756, col: 1, offset: 25910}, expr: &actionExpr{ - pos: position{line: 744, col: 28, offset: 25888}, + pos: position{line: 756, col: 28, offset: 25937}, run: (*parser).callonContinuedParagraphLines1, expr: &seqExpr{ - pos: position{line: 744, col: 28, offset: 25888}, + pos: position{line: 756, col: 28, offset: 25937}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 744, col: 28, offset: 25888}, + pos: position{line: 756, col: 28, offset: 25937}, label: "firstLine", expr: &ruleRefExpr{ - pos: position{line: 744, col: 39, offset: 25899}, + pos: position{line: 756, col: 39, offset: 25948}, name: "FirstParagraphLine", }, }, &labeledExpr{ - pos: position{line: 744, col: 59, offset: 25919}, + pos: position{line: 756, col: 59, offset: 25968}, label: "otherLines", expr: &zeroOrMoreExpr{ - pos: position{line: 744, col: 70, offset: 25930}, + pos: position{line: 756, col: 70, offset: 25979}, expr: &seqExpr{ - pos: position{line: 744, col: 71, offset: 25931}, + pos: position{line: 756, col: 71, offset: 25980}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 744, col: 71, offset: 25931}, + pos: position{line: 756, col: 71, offset: 25980}, expr: &ruleRefExpr{ - pos: position{line: 744, col: 72, offset: 25932}, + pos: position{line: 756, col: 72, offset: 25981}, name: "ListItemContinuation", }, }, &ruleRefExpr{ - pos: position{line: 744, col: 93, offset: 25953}, + pos: position{line: 756, col: 93, offset: 26002}, name: "OtherParagraphLine", }, }, @@ -5468,133 +5101,54 @@ var g = &grammar{ }, }, }, - { - name: "FirstParagraphLine", - pos: position{line: 748, col: 1, offset: 26059}, - expr: &actionExpr{ - pos: position{line: 748, col: 23, offset: 26081}, - run: (*parser).callonFirstParagraphLine1, - expr: &seqExpr{ - pos: position{line: 748, col: 23, offset: 26081}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 748, col: 23, offset: 26081}, - expr: &seqExpr{ - pos: position{line: 748, col: 25, offset: 26083}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 748, col: 25, offset: 26083}, - name: "SimpleLabeledListItemTerm", - }, - &ruleRefExpr{ - pos: position{line: 748, col: 51, offset: 26109}, - name: "LabeledListItemSeparator", - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 749, col: 5, offset: 26139}, - label: "elements", - expr: &seqExpr{ - pos: position{line: 749, col: 15, offset: 26149}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 749, col: 15, offset: 26149}, - name: "SimpleWord", - }, - &zeroOrMoreExpr{ - pos: position{line: 749, col: 26, offset: 26160}, - expr: &ruleRefExpr{ - pos: position{line: 749, col: 26, offset: 26160}, - name: "InlineElement", - }, - }, - }, - }, - }, - &labeledExpr{ - pos: position{line: 749, col: 42, offset: 26176}, - label: "linebreak", - expr: &zeroOrOneExpr{ - pos: position{line: 749, col: 52, offset: 26186}, - expr: &ruleRefExpr{ - pos: position{line: 749, col: 53, offset: 26187}, - name: "LineBreak", - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 749, col: 65, offset: 26199}, - name: "EOL", - }, - }, - }, - }, - }, - { - name: "OtherParagraphLine", - pos: position{line: 753, col: 1, offset: 26289}, - expr: &actionExpr{ - pos: position{line: 753, col: 23, offset: 26311}, - run: (*parser).callonOtherParagraphLine1, - expr: &labeledExpr{ - pos: position{line: 753, col: 23, offset: 26311}, - label: "elements", - expr: &ruleRefExpr{ - pos: position{line: 753, col: 33, offset: 26321}, - name: "InlineElements", - }, - }, - }, - }, { name: "VerseParagraph", - pos: position{line: 757, col: 1, offset: 26367}, + pos: position{line: 760, col: 1, offset: 26108}, expr: &choiceExpr{ - pos: position{line: 759, col: 5, offset: 26419}, + pos: position{line: 762, col: 5, offset: 26160}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 759, col: 5, offset: 26419}, + pos: position{line: 762, col: 5, offset: 26160}, run: (*parser).callonVerseParagraph2, expr: &seqExpr{ - pos: position{line: 759, col: 5, offset: 26419}, + pos: position{line: 762, col: 5, offset: 26160}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 759, col: 5, offset: 26419}, + pos: position{line: 762, col: 5, offset: 26160}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 759, col: 16, offset: 26430}, + pos: position{line: 762, col: 16, offset: 26171}, expr: &ruleRefExpr{ - pos: position{line: 759, col: 17, offset: 26431}, + pos: position{line: 762, col: 17, offset: 26172}, name: "ElementAttributes", }, }, }, &andCodeExpr{ - pos: position{line: 760, col: 5, offset: 26455}, + pos: position{line: 763, col: 5, offset: 26196}, run: (*parser).callonVerseParagraph7, }, &labeledExpr{ - pos: position{line: 767, col: 5, offset: 26667}, + pos: position{line: 770, col: 5, offset: 26408}, label: "t", expr: &ruleRefExpr{ - pos: position{line: 767, col: 8, offset: 26670}, + pos: position{line: 770, col: 8, offset: 26411}, name: "AdmonitionKind", }, }, &litMatcher{ - pos: position{line: 767, col: 24, offset: 26686}, + pos: position{line: 770, col: 24, offset: 26427}, val: ": ", ignoreCase: false, + want: "\": \"", }, &labeledExpr{ - pos: position{line: 767, col: 29, offset: 26691}, + pos: position{line: 770, col: 29, offset: 26432}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 767, col: 35, offset: 26697}, + pos: position{line: 770, col: 35, offset: 26438}, expr: &ruleRefExpr{ - pos: position{line: 767, col: 36, offset: 26698}, + pos: position{line: 770, col: 36, offset: 26439}, name: "InlineElements", }, }, @@ -5603,33 +5157,33 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 771, col: 5, offset: 26890}, + pos: position{line: 774, col: 5, offset: 26631}, run: (*parser).callonVerseParagraph14, expr: &seqExpr{ - pos: position{line: 771, col: 5, offset: 26890}, + pos: position{line: 774, col: 5, offset: 26631}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 771, col: 5, offset: 26890}, + pos: position{line: 774, col: 5, offset: 26631}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 771, col: 16, offset: 26901}, + pos: position{line: 774, col: 16, offset: 26642}, expr: &ruleRefExpr{ - pos: position{line: 771, col: 17, offset: 26902}, + pos: position{line: 774, col: 17, offset: 26643}, name: "ElementAttributes", }, }, }, &andCodeExpr{ - pos: position{line: 772, col: 5, offset: 26926}, + pos: position{line: 775, col: 5, offset: 26667}, run: (*parser).callonVerseParagraph19, }, &labeledExpr{ - pos: position{line: 779, col: 5, offset: 27138}, + pos: position{line: 782, col: 5, offset: 26879}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 779, col: 11, offset: 27144}, + pos: position{line: 782, col: 11, offset: 26885}, expr: &ruleRefExpr{ - pos: position{line: 779, col: 12, offset: 27145}, + pos: position{line: 782, col: 12, offset: 26886}, name: "InlineElements", }, }, @@ -5642,82 +5196,57 @@ var g = &grammar{ }, { name: "InlineElements", - pos: position{line: 783, col: 1, offset: 27246}, + pos: position{line: 786, col: 1, offset: 26987}, expr: &actionExpr{ - pos: position{line: 783, col: 19, offset: 27264}, + pos: position{line: 786, col: 19, offset: 27005}, run: (*parser).callonInlineElements1, expr: &seqExpr{ - pos: position{line: 783, col: 19, offset: 27264}, + pos: position{line: 786, col: 19, offset: 27005}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 783, col: 19, offset: 27264}, - expr: &ruleRefExpr{ - pos: position{line: 783, col: 20, offset: 27265}, - name: "EOF", - }, - }, - ¬Expr{ - pos: position{line: 783, col: 24, offset: 27269}, + pos: position{line: 786, col: 19, offset: 27005}, expr: &ruleRefExpr{ - pos: position{line: 783, col: 25, offset: 27270}, + pos: position{line: 786, col: 20, offset: 27006}, name: "BlankLine", }, }, &labeledExpr{ - pos: position{line: 784, col: 5, offset: 27284}, + pos: position{line: 787, col: 5, offset: 27020}, label: "elements", expr: &choiceExpr{ - pos: position{line: 784, col: 15, offset: 27294}, + pos: position{line: 787, col: 15, offset: 27030}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 784, col: 15, offset: 27294}, - run: (*parser).callonInlineElements9, + pos: position{line: 787, col: 15, offset: 27030}, + run: (*parser).callonInlineElements7, expr: &labeledExpr{ - pos: position{line: 784, col: 15, offset: 27294}, + pos: position{line: 787, col: 15, offset: 27030}, label: "comment", expr: &ruleRefExpr{ - pos: position{line: 784, col: 24, offset: 27303}, + pos: position{line: 787, col: 24, offset: 27039}, name: "SingleLineComment", }, }, }, &actionExpr{ - pos: position{line: 786, col: 9, offset: 27395}, - run: (*parser).callonInlineElements12, + pos: position{line: 789, col: 9, offset: 27131}, + run: (*parser).callonInlineElements10, expr: &seqExpr{ - pos: position{line: 786, col: 9, offset: 27395}, + pos: position{line: 789, col: 9, offset: 27131}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 786, col: 9, offset: 27395}, - expr: &ruleRefExpr{ - pos: position{line: 786, col: 10, offset: 27396}, - name: "BlockDelimiter", - }, - }, &labeledExpr{ - pos: position{line: 786, col: 25, offset: 27411}, + pos: position{line: 789, col: 9, offset: 27131}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 786, col: 34, offset: 27420}, + pos: position{line: 789, col: 18, offset: 27140}, expr: &ruleRefExpr{ - pos: position{line: 786, col: 35, offset: 27421}, + pos: position{line: 789, col: 19, offset: 27141}, name: "InlineElement", }, }, }, - &labeledExpr{ - pos: position{line: 786, col: 51, offset: 27437}, - label: "linebreak", - expr: &zeroOrOneExpr{ - pos: position{line: 786, col: 61, offset: 27447}, - expr: &ruleRefExpr{ - pos: position{line: 786, col: 62, offset: 27448}, - name: "LineBreak", - }, - }, - }, &ruleRefExpr{ - pos: position{line: 786, col: 74, offset: 27460}, + pos: position{line: 789, col: 35, offset: 27157}, name: "EOL", }, }, @@ -5732,229 +5261,91 @@ var g = &grammar{ }, { name: "InlineElement", - pos: position{line: 792, col: 1, offset: 27596}, + pos: position{line: 795, col: 1, offset: 27274}, expr: &actionExpr{ - pos: position{line: 792, col: 18, offset: 27613}, + pos: position{line: 796, col: 5, offset: 27297}, run: (*parser).callonInlineElement1, - expr: &seqExpr{ - pos: position{line: 792, col: 18, offset: 27613}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 792, col: 18, offset: 27613}, - expr: &ruleRefExpr{ - pos: position{line: 792, col: 19, offset: 27614}, - name: "EOL", + expr: &labeledExpr{ + pos: position{line: 796, col: 5, offset: 27297}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 796, col: 14, offset: 27306}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 796, col: 14, offset: 27306}, + name: "InlineWord", }, - }, - ¬Expr{ - pos: position{line: 792, col: 23, offset: 27618}, - expr: &ruleRefExpr{ - pos: position{line: 792, col: 24, offset: 27619}, + &ruleRefExpr{ + pos: position{line: 797, col: 11, offset: 27357}, name: "LineBreak", }, - }, - &labeledExpr{ - pos: position{line: 793, col: 5, offset: 27634}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 793, col: 14, offset: 27643}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 793, col: 14, offset: 27643}, - name: "SimpleWord", - }, - &ruleRefExpr{ - pos: position{line: 794, col: 11, offset: 27664}, - name: "QuotedText", + &oneOrMoreExpr{ + pos: position{line: 798, col: 11, offset: 27402}, + expr: &ruleRefExpr{ + pos: position{line: 798, col: 11, offset: 27402}, + name: "Space", + }, + }, + &seqExpr{ + pos: position{line: 799, col: 11, offset: 27420}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 799, col: 11, offset: 27420}, + expr: &ruleRefExpr{ + pos: position{line: 799, col: 12, offset: 27421}, + name: "EOL", + }, }, - &ruleRefExpr{ - pos: position{line: 795, col: 11, offset: 27686}, - name: "Spaces", - }, - &ruleRefExpr{ - pos: position{line: 796, col: 11, offset: 27704}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 797, col: 11, offset: 27727}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 798, col: 11, offset: 27743}, - name: "Passthrough", - }, - &ruleRefExpr{ - pos: position{line: 799, col: 11, offset: 27766}, - name: "InlineFootnote", - }, - &ruleRefExpr{ - pos: position{line: 800, col: 11, offset: 27792}, - name: "CrossReference", - }, - &ruleRefExpr{ - pos: position{line: 801, col: 11, offset: 27818}, - name: "InlineUserMacro", - }, - &ruleRefExpr{ - pos: position{line: 802, col: 11, offset: 27845}, - name: "DocumentAttributeSubstitution", - }, - &ruleRefExpr{ - pos: position{line: 803, col: 11, offset: 27886}, - name: "InlineElementID", - }, - &ruleRefExpr{ - pos: position{line: 804, col: 11, offset: 27913}, - name: "ConcealedIndexTerm", - }, - &ruleRefExpr{ - pos: position{line: 805, col: 11, offset: 27942}, - name: "IndexTerm", - }, - &ruleRefExpr{ - pos: position{line: 806, col: 11, offset: 27962}, - name: "Parenthesis", - }, - &ruleRefExpr{ - pos: position{line: 807, col: 11, offset: 27984}, - name: "AnyChars", - }, - &ruleRefExpr{ - pos: position{line: 808, col: 11, offset: 28003}, - name: "AnyChar", - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "InlineElementWithoutSubtitution", - pos: position{line: 812, col: 1, offset: 28042}, - expr: &actionExpr{ - pos: position{line: 812, col: 36, offset: 28077}, - run: (*parser).callonInlineElementWithoutSubtitution1, - expr: &seqExpr{ - pos: position{line: 812, col: 36, offset: 28077}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 812, col: 36, offset: 28077}, - expr: &ruleRefExpr{ - pos: position{line: 812, col: 37, offset: 28078}, - name: "EOL", - }, - }, - ¬Expr{ - pos: position{line: 812, col: 41, offset: 28082}, - expr: &ruleRefExpr{ - pos: position{line: 812, col: 42, offset: 28083}, - name: "LineBreak", - }, - }, - &labeledExpr{ - pos: position{line: 813, col: 5, offset: 28098}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 813, col: 14, offset: 28107}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 813, col: 14, offset: 28107}, - name: "SimpleWord", - }, - &ruleRefExpr{ - pos: position{line: 814, col: 11, offset: 28128}, - name: "QuotedText", - }, - &ruleRefExpr{ - pos: position{line: 815, col: 11, offset: 28150}, - name: "Spaces", - }, - &ruleRefExpr{ - pos: position{line: 816, col: 11, offset: 28168}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 817, col: 11, offset: 28191}, - name: "Link", - }, - &ruleRefExpr{ - pos: position{line: 818, col: 11, offset: 28207}, - name: "Passthrough", - }, - &ruleRefExpr{ - pos: position{line: 819, col: 11, offset: 28230}, - name: "CrossReference", - }, - &ruleRefExpr{ - pos: position{line: 820, col: 11, offset: 28256}, - name: "InlineElementID", - }, - &ruleRefExpr{ - pos: position{line: 821, col: 11, offset: 28282}, - name: "Parenthesis", - }, - &ruleRefExpr{ - pos: position{line: 822, col: 11, offset: 28304}, - name: "AnyChars", - }, - &ruleRefExpr{ - pos: position{line: 823, col: 11, offset: 28323}, - name: "AnyChar", - }, - }, - }, - }, - }, - }, - }, - }, - { - name: "VerbatimParagraph", - pos: position{line: 827, col: 1, offset: 28362}, - expr: &actionExpr{ - pos: position{line: 827, col: 22, offset: 28383}, - run: (*parser).callonVerbatimParagraph1, - expr: &seqExpr{ - pos: position{line: 827, col: 22, offset: 28383}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 827, col: 22, offset: 28383}, - label: "attributes", - expr: &zeroOrOneExpr{ - pos: position{line: 827, col: 33, offset: 28394}, - expr: &ruleRefExpr{ - pos: position{line: 827, col: 34, offset: 28395}, - name: "ElementAttributes", - }, - }, - }, - &labeledExpr{ - pos: position{line: 827, col: 54, offset: 28415}, - label: "lines", - expr: &oneOrMoreExpr{ - pos: position{line: 827, col: 60, offset: 28421}, - expr: &actionExpr{ - pos: position{line: 827, col: 61, offset: 28422}, - run: (*parser).callonVerbatimParagraph8, - expr: &seqExpr{ - pos: position{line: 827, col: 61, offset: 28422}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 827, col: 61, offset: 28422}, - expr: &ruleRefExpr{ - pos: position{line: 827, col: 62, offset: 28423}, - name: "EOF", - }, + &choiceExpr{ + pos: position{line: 800, col: 13, offset: 27440}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 800, col: 13, offset: 27440}, + name: "QuotedText", }, - &labeledExpr{ - pos: position{line: 827, col: 66, offset: 28427}, - label: "line", - expr: &ruleRefExpr{ - pos: position{line: 827, col: 72, offset: 28433}, - name: "VerbatimParagraphLine", - }, + &ruleRefExpr{ + pos: position{line: 801, col: 15, offset: 27466}, + name: "InlineImage", + }, + &ruleRefExpr{ + pos: position{line: 802, col: 15, offset: 27493}, + name: "Link", + }, + &ruleRefExpr{ + pos: position{line: 803, col: 15, offset: 27513}, + name: "Passthrough", + }, + &ruleRefExpr{ + pos: position{line: 804, col: 15, offset: 27540}, + name: "InlineFootnote", + }, + &ruleRefExpr{ + pos: position{line: 805, col: 15, offset: 27570}, + name: "CrossReference", + }, + &ruleRefExpr{ + pos: position{line: 806, col: 15, offset: 27600}, + name: "InlineUserMacro", + }, + &ruleRefExpr{ + pos: position{line: 807, col: 15, offset: 27631}, + name: "DocumentAttributeSubstitution", + }, + &ruleRefExpr{ + pos: position{line: 808, col: 15, offset: 27676}, + name: "InlineElementID", + }, + &ruleRefExpr{ + pos: position{line: 809, col: 15, offset: 27707}, + name: "ConcealedIndexTerm", + }, + &ruleRefExpr{ + pos: position{line: 810, col: 15, offset: 27740}, + name: "IndexTerm", + }, + &ruleRefExpr{ + pos: position{line: 811, col: 15, offset: 27764}, + name: "AnyChar", }, }, }, @@ -5965,121 +5356,36 @@ var g = &grammar{ }, }, }, - { - name: "VerbatimParagraphLine", - pos: position{line: 833, col: 1, offset: 28553}, - expr: &actionExpr{ - pos: position{line: 833, col: 26, offset: 28578}, - run: (*parser).callonVerbatimParagraphLine1, - expr: &seqExpr{ - pos: position{line: 833, col: 26, offset: 28578}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 833, col: 26, offset: 28578}, - expr: &ruleRefExpr{ - pos: position{line: 833, col: 27, offset: 28579}, - name: "BlockDelimiter", - }, - }, - ¬Expr{ - pos: position{line: 833, col: 42, offset: 28594}, - expr: &ruleRefExpr{ - pos: position{line: 833, col: 43, offset: 28595}, - name: "BlankLine", - }, - }, - &labeledExpr{ - pos: position{line: 833, col: 53, offset: 28605}, - label: "elements", - expr: &zeroOrMoreExpr{ - pos: position{line: 833, col: 62, offset: 28614}, - expr: &ruleRefExpr{ - pos: position{line: 833, col: 63, offset: 28615}, - name: "VerbatimParagraphLineElement", - }, - }, - }, - &labeledExpr{ - pos: position{line: 833, col: 94, offset: 28646}, - label: "linebreak", - expr: &zeroOrOneExpr{ - pos: position{line: 833, col: 104, offset: 28656}, - expr: &ruleRefExpr{ - pos: position{line: 833, col: 105, offset: 28657}, - name: "LineBreak", - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 833, col: 117, offset: 28669}, - name: "EOL", - }, - }, - }, - }, - }, - { - name: "VerbatimParagraphLineElement", - pos: position{line: 837, col: 1, offset: 28760}, - expr: &actionExpr{ - pos: position{line: 837, col: 33, offset: 28792}, - run: (*parser).callonVerbatimParagraphLineElement1, - expr: &oneOrMoreExpr{ - pos: position{line: 837, col: 33, offset: 28792}, - expr: &seqExpr{ - pos: position{line: 837, col: 34, offset: 28793}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 837, col: 34, offset: 28793}, - expr: &ruleRefExpr{ - pos: position{line: 837, col: 35, offset: 28794}, - name: "EOL", - }, - }, - ¬Expr{ - pos: position{line: 837, col: 39, offset: 28798}, - expr: &ruleRefExpr{ - pos: position{line: 837, col: 40, offset: 28799}, - name: "LineBreak", - }, - }, - &anyMatcher{ - line: 837, col: 50, offset: 28809, - }, - }, - }, - }, - }, - }, { name: "LineBreak", - pos: position{line: 844, col: 1, offset: 29033}, + pos: position{line: 818, col: 1, offset: 27987}, expr: &actionExpr{ - pos: position{line: 844, col: 14, offset: 29046}, + pos: position{line: 818, col: 14, offset: 28000}, run: (*parser).callonLineBreak1, expr: &seqExpr{ - pos: position{line: 844, col: 14, offset: 29046}, + pos: position{line: 818, col: 14, offset: 28000}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 844, col: 14, offset: 29046}, - name: "WS", + pos: position{line: 818, col: 14, offset: 28000}, + name: "Space", }, &litMatcher{ - pos: position{line: 844, col: 17, offset: 29049}, + pos: position{line: 818, col: 20, offset: 28006}, val: "+", ignoreCase: false, + want: "\"+\"", }, &zeroOrMoreExpr{ - pos: position{line: 844, col: 21, offset: 29053}, + pos: position{line: 818, col: 24, offset: 28010}, expr: &ruleRefExpr{ - pos: position{line: 844, col: 21, offset: 29053}, - name: "WS", + pos: position{line: 818, col: 24, offset: 28010}, + name: "Space", }, }, &andExpr{ - pos: position{line: 844, col: 25, offset: 29057}, + pos: position{line: 818, col: 31, offset: 28017}, expr: &ruleRefExpr{ - pos: position{line: 844, col: 26, offset: 29058}, + pos: position{line: 818, col: 32, offset: 28018}, name: "EOL", }, }, @@ -6089,20 +5395,20 @@ var g = &grammar{ }, { name: "QuotedText", - pos: position{line: 851, col: 1, offset: 29342}, + pos: position{line: 825, col: 1, offset: 28302}, expr: &choiceExpr{ - pos: position{line: 851, col: 15, offset: 29356}, + pos: position{line: 825, col: 15, offset: 28316}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 851, col: 15, offset: 29356}, + pos: position{line: 825, col: 15, offset: 28316}, name: "UnconstrainedQuotedText", }, &ruleRefExpr{ - pos: position{line: 851, col: 41, offset: 29382}, + pos: position{line: 825, col: 41, offset: 28342}, name: "ConstrainedQuotedText", }, &ruleRefExpr{ - pos: position{line: 851, col: 65, offset: 29406}, + pos: position{line: 825, col: 65, offset: 28366}, name: "EscapedQuotedText", }, }, @@ -6110,60 +5416,66 @@ var g = &grammar{ }, { name: "ConstrainedQuotedTextMarker", - pos: position{line: 853, col: 1, offset: 29425}, + pos: position{line: 827, col: 1, offset: 28385}, expr: &choiceExpr{ - pos: position{line: 853, col: 32, offset: 29456}, + pos: position{line: 827, col: 32, offset: 28416}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 853, col: 32, offset: 29456}, + pos: position{line: 827, col: 32, offset: 28416}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 853, col: 32, offset: 29456}, + pos: position{line: 827, col: 32, offset: 28416}, val: "*", ignoreCase: false, + want: "\"*\"", }, ¬Expr{ - pos: position{line: 853, col: 36, offset: 29460}, + pos: position{line: 827, col: 36, offset: 28420}, expr: &litMatcher{ - pos: position{line: 853, col: 37, offset: 29461}, + pos: position{line: 827, col: 37, offset: 28421}, val: "*", ignoreCase: false, + want: "\"*\"", }, }, }, }, &seqExpr{ - pos: position{line: 853, col: 43, offset: 29467}, + pos: position{line: 827, col: 43, offset: 28427}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 853, col: 43, offset: 29467}, + pos: position{line: 827, col: 43, offset: 28427}, val: "_", ignoreCase: false, + want: "\"_\"", }, ¬Expr{ - pos: position{line: 853, col: 47, offset: 29471}, + pos: position{line: 827, col: 47, offset: 28431}, expr: &litMatcher{ - pos: position{line: 853, col: 48, offset: 29472}, + pos: position{line: 827, col: 48, offset: 28432}, val: "_", ignoreCase: false, + want: "\"_\"", }, }, }, }, &seqExpr{ - pos: position{line: 853, col: 54, offset: 29478}, + pos: position{line: 827, col: 54, offset: 28438}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 853, col: 54, offset: 29478}, + pos: position{line: 827, col: 54, offset: 28438}, val: "`", ignoreCase: false, + want: "\"`\"", }, ¬Expr{ - pos: position{line: 853, col: 58, offset: 29482}, + pos: position{line: 827, col: 58, offset: 28442}, expr: &litMatcher{ - pos: position{line: 853, col: 59, offset: 29483}, + pos: position{line: 827, col: 59, offset: 28443}, val: "`", ignoreCase: false, + want: "\"`\"", }, }, }, @@ -6173,85 +5485,78 @@ var g = &grammar{ }, { name: "UnconstrainedQuotedTextPrefix", - pos: position{line: 855, col: 1, offset: 29489}, + pos: position{line: 829, col: 1, offset: 28449}, expr: &choiceExpr{ - pos: position{line: 855, col: 34, offset: 29522}, + pos: position{line: 829, col: 34, offset: 28482}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 855, col: 34, offset: 29522}, + pos: position{line: 829, col: 34, offset: 28482}, val: "**", ignoreCase: false, + want: "\"**\"", }, &litMatcher{ - pos: position{line: 855, col: 41, offset: 29529}, + pos: position{line: 829, col: 41, offset: 28489}, val: "__", ignoreCase: false, + want: "\"__\"", }, &litMatcher{ - pos: position{line: 855, col: 48, offset: 29536}, + pos: position{line: 829, col: 48, offset: 28496}, val: "``", ignoreCase: false, + want: "\"``\"", }, &litMatcher{ - pos: position{line: 855, col: 55, offset: 29543}, + pos: position{line: 829, col: 55, offset: 28503}, val: "^", ignoreCase: false, + want: "\"^\"", }, &litMatcher{ - pos: position{line: 855, col: 61, offset: 29549}, + pos: position{line: 829, col: 61, offset: 28509}, val: "~", ignoreCase: false, + want: "\"~\"", }, }, }, }, { name: "ConstrainedQuotedText", - pos: position{line: 857, col: 1, offset: 29554}, + pos: position{line: 831, col: 1, offset: 28514}, expr: &actionExpr{ - pos: position{line: 857, col: 26, offset: 29579}, + pos: position{line: 831, col: 26, offset: 28539}, run: (*parser).callonConstrainedQuotedText1, - expr: &seqExpr{ - pos: position{line: 857, col: 26, offset: 29579}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 857, col: 26, offset: 29579}, - expr: &ruleRefExpr{ - pos: position{line: 857, col: 27, offset: 29580}, - name: "WS", + expr: &labeledExpr{ + pos: position{line: 831, col: 26, offset: 28539}, + label: "text", + expr: &choiceExpr{ + pos: position{line: 831, col: 32, offset: 28545}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 831, col: 32, offset: 28545}, + name: "SingleQuoteBoldText", }, - }, - &labeledExpr{ - pos: position{line: 857, col: 30, offset: 29583}, - label: "text", - expr: &choiceExpr{ - pos: position{line: 857, col: 36, offset: 29589}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 857, col: 36, offset: 29589}, - name: "SingleQuoteBoldText", - }, - &ruleRefExpr{ - pos: position{line: 858, col: 15, offset: 29624}, - name: "SingleQuoteItalicText", - }, - &ruleRefExpr{ - pos: position{line: 859, col: 15, offset: 29661}, - name: "SingleQuoteMonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 860, col: 15, offset: 29701}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 861, col: 15, offset: 29730}, - name: "SuperscriptText", - }, - &ruleRefExpr{ - pos: position{line: 862, col: 15, offset: 29761}, - name: "SubscriptOrSuperscriptPrefix", - }, - }, + &ruleRefExpr{ + pos: position{line: 832, col: 15, offset: 28580}, + name: "SingleQuoteItalicText", + }, + &ruleRefExpr{ + pos: position{line: 833, col: 15, offset: 28617}, + name: "SingleQuoteMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 834, col: 15, offset: 28657}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 835, col: 15, offset: 28686}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 836, col: 15, offset: 28717}, + name: "SubscriptOrSuperscriptPrefix", }, }, }, @@ -6260,20 +5565,20 @@ var g = &grammar{ }, { name: "UnconstrainedQuotedText", - pos: position{line: 866, col: 1, offset: 29915}, + pos: position{line: 840, col: 1, offset: 28871}, expr: &choiceExpr{ - pos: position{line: 866, col: 28, offset: 29942}, + pos: position{line: 840, col: 28, offset: 28898}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 866, col: 28, offset: 29942}, + pos: position{line: 840, col: 28, offset: 28898}, name: "DoubleQuoteBoldText", }, &ruleRefExpr{ - pos: position{line: 867, col: 15, offset: 29976}, + pos: position{line: 841, col: 15, offset: 28932}, name: "DoubleQuoteItalicText", }, &ruleRefExpr{ - pos: position{line: 868, col: 15, offset: 30012}, + pos: position{line: 842, col: 15, offset: 28968}, name: "DoubleQuoteMonospaceText", }, }, @@ -6281,28 +5586,28 @@ var g = &grammar{ }, { name: "EscapedQuotedText", - pos: position{line: 870, col: 1, offset: 30038}, + pos: position{line: 844, col: 1, offset: 28994}, expr: &choiceExpr{ - pos: position{line: 870, col: 22, offset: 30059}, + pos: position{line: 844, col: 22, offset: 29015}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 870, col: 22, offset: 30059}, + pos: position{line: 844, col: 22, offset: 29015}, name: "EscapedBoldText", }, &ruleRefExpr{ - pos: position{line: 871, col: 15, offset: 30090}, + pos: position{line: 845, col: 15, offset: 29046}, name: "EscapedItalicText", }, &ruleRefExpr{ - pos: position{line: 872, col: 15, offset: 30123}, + pos: position{line: 846, col: 15, offset: 29079}, name: "EscapedMonospaceText", }, &ruleRefExpr{ - pos: position{line: 873, col: 15, offset: 30159}, + pos: position{line: 847, col: 15, offset: 29115}, name: "EscapedSubscriptText", }, &ruleRefExpr{ - pos: position{line: 874, col: 15, offset: 30195}, + pos: position{line: 848, col: 15, offset: 29151}, name: "EscapedSuperscriptText", }, }, @@ -6310,22 +5615,24 @@ var g = &grammar{ }, { name: "SubscriptOrSuperscriptPrefix", - pos: position{line: 876, col: 1, offset: 30219}, + pos: position{line: 850, col: 1, offset: 29175}, expr: &choiceExpr{ - pos: position{line: 876, col: 33, offset: 30251}, + pos: position{line: 850, col: 33, offset: 29207}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 876, col: 33, offset: 30251}, + pos: position{line: 850, col: 33, offset: 29207}, val: "^", ignoreCase: false, + want: "\"^\"", }, &actionExpr{ - pos: position{line: 876, col: 39, offset: 30257}, + pos: position{line: 850, col: 39, offset: 29213}, run: (*parser).callonSubscriptOrSuperscriptPrefix3, expr: &litMatcher{ - pos: position{line: 876, col: 39, offset: 30257}, + pos: position{line: 850, col: 39, offset: 29213}, val: "~", ignoreCase: false, + want: "\"~\"", }, }, }, @@ -6333,40 +5640,43 @@ var g = &grammar{ }, { name: "OneOrMoreBackslashes", - pos: position{line: 880, col: 1, offset: 30390}, + pos: position{line: 854, col: 1, offset: 29346}, expr: &actionExpr{ - pos: position{line: 880, col: 25, offset: 30414}, + pos: position{line: 854, col: 25, offset: 29370}, run: (*parser).callonOneOrMoreBackslashes1, expr: &oneOrMoreExpr{ - pos: position{line: 880, col: 25, offset: 30414}, + pos: position{line: 854, col: 25, offset: 29370}, expr: &litMatcher{ - pos: position{line: 880, col: 25, offset: 30414}, + pos: position{line: 854, col: 25, offset: 29370}, val: "\\", ignoreCase: false, + want: "\"\\\\\"", }, }, }, }, { name: "TwoOrMoreBackslashes", - pos: position{line: 884, col: 1, offset: 30455}, + pos: position{line: 858, col: 1, offset: 29411}, expr: &actionExpr{ - pos: position{line: 884, col: 25, offset: 30479}, + pos: position{line: 858, col: 25, offset: 29435}, run: (*parser).callonTwoOrMoreBackslashes1, expr: &seqExpr{ - pos: position{line: 884, col: 25, offset: 30479}, + pos: position{line: 858, col: 25, offset: 29435}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 884, col: 25, offset: 30479}, + pos: position{line: 858, col: 25, offset: 29435}, val: "\\\\", ignoreCase: false, + want: "\"\\\\\\\\\"", }, &zeroOrMoreExpr{ - pos: position{line: 884, col: 30, offset: 30484}, + pos: position{line: 858, col: 30, offset: 29440}, expr: &litMatcher{ - pos: position{line: 884, col: 30, offset: 30484}, + pos: position{line: 858, col: 30, offset: 29440}, val: "\\", ignoreCase: false, + want: "\"\\\\\"", }, }, }, @@ -6375,16 +5685,16 @@ var g = &grammar{ }, { name: "BoldText", - pos: position{line: 892, col: 1, offset: 30581}, + pos: position{line: 866, col: 1, offset: 29537}, expr: &choiceExpr{ - pos: position{line: 892, col: 13, offset: 30593}, + pos: position{line: 866, col: 13, offset: 29549}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 892, col: 13, offset: 30593}, + pos: position{line: 866, col: 13, offset: 29549}, name: "DoubleQuoteBoldText", }, &ruleRefExpr{ - pos: position{line: 892, col: 35, offset: 30615}, + pos: position{line: 866, col: 35, offset: 29571}, name: "SingleQuoteBoldText", }, }, @@ -6392,38 +5702,41 @@ var g = &grammar{ }, { name: "DoubleQuoteBoldText", - pos: position{line: 894, col: 1, offset: 30682}, + pos: position{line: 868, col: 1, offset: 29638}, expr: &actionExpr{ - pos: position{line: 894, col: 24, offset: 30705}, + pos: position{line: 868, col: 24, offset: 29661}, run: (*parser).callonDoubleQuoteBoldText1, expr: &seqExpr{ - pos: position{line: 894, col: 24, offset: 30705}, + pos: position{line: 868, col: 24, offset: 29661}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 894, col: 24, offset: 30705}, + pos: position{line: 868, col: 24, offset: 29661}, expr: &litMatcher{ - pos: position{line: 894, col: 25, offset: 30706}, + pos: position{line: 868, col: 25, offset: 29662}, val: "\\\\", ignoreCase: false, + want: "\"\\\\\\\\\"", }, }, &litMatcher{ - pos: position{line: 894, col: 30, offset: 30711}, + pos: position{line: 868, col: 30, offset: 29667}, val: "**", ignoreCase: false, + want: "\"**\"", }, &labeledExpr{ - pos: position{line: 894, col: 35, offset: 30716}, + pos: position{line: 868, col: 35, offset: 29672}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 894, col: 45, offset: 30726}, + pos: position{line: 868, col: 45, offset: 29682}, name: "DoubleQuoteBoldTextElements", }, }, &litMatcher{ - pos: position{line: 894, col: 74, offset: 30755}, + pos: position{line: 868, col: 74, offset: 29711}, val: "**", ignoreCase: false, + want: "\"**\"", }, }, }, @@ -6431,36 +5744,37 @@ var g = &grammar{ }, { name: "DoubleQuoteBoldTextElements", - pos: position{line: 898, col: 1, offset: 30836}, + pos: position{line: 872, col: 1, offset: 29792}, expr: &seqExpr{ - pos: position{line: 898, col: 32, offset: 30867}, + pos: position{line: 872, col: 32, offset: 29823}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 898, col: 32, offset: 30867}, + pos: position{line: 872, col: 32, offset: 29823}, name: "DoubleQuoteBoldTextElement", }, &zeroOrMoreExpr{ - pos: position{line: 898, col: 59, offset: 30894}, + pos: position{line: 872, col: 59, offset: 29850}, expr: &seqExpr{ - pos: position{line: 898, col: 60, offset: 30895}, + pos: position{line: 872, col: 60, offset: 29851}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 898, col: 60, offset: 30895}, + pos: position{line: 872, col: 60, offset: 29851}, expr: &litMatcher{ - pos: position{line: 898, col: 62, offset: 30897}, + pos: position{line: 872, col: 62, offset: 29853}, val: "**", ignoreCase: false, + want: "\"**\"", }, }, &choiceExpr{ - pos: position{line: 898, col: 69, offset: 30904}, + pos: position{line: 872, col: 69, offset: 29860}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 898, col: 69, offset: 30904}, - name: "WS", + pos: position{line: 872, col: 69, offset: 29860}, + name: "Space", }, &ruleRefExpr{ - pos: position{line: 898, col: 74, offset: 30909}, + pos: position{line: 872, col: 77, offset: 29868}, name: "DoubleQuoteBoldTextElement", }, }, @@ -6473,154 +5787,121 @@ var g = &grammar{ }, { name: "DoubleQuoteBoldTextElement", - pos: position{line: 900, col: 1, offset: 30974}, + pos: position{line: 874, col: 1, offset: 29933}, + expr: &choiceExpr{ + pos: position{line: 874, col: 31, offset: 29963}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 874, col: 31, offset: 29963}, + name: "Word", + }, + &ruleRefExpr{ + pos: position{line: 875, col: 11, offset: 29979}, + name: "SingleQuoteBoldText", + }, + &ruleRefExpr{ + pos: position{line: 876, col: 11, offset: 30010}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 877, col: 11, offset: 30032}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 878, col: 11, offset: 30056}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 879, col: 11, offset: 30080}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 880, col: 11, offset: 30106}, + name: "InlineImage", + }, + &ruleRefExpr{ + pos: position{line: 881, col: 11, offset: 30129}, + name: "Link", + }, + &ruleRefExpr{ + pos: position{line: 882, col: 11, offset: 30145}, + name: "Passthrough", + }, + &ruleRefExpr{ + pos: position{line: 883, col: 11, offset: 30168}, + name: "DocumentAttributeSubstitution", + }, + &ruleRefExpr{ + pos: position{line: 884, col: 11, offset: 30208}, + name: "DoubleQuoteBoldTextStringElement", + }, + &ruleRefExpr{ + pos: position{line: 885, col: 11, offset: 30251}, + name: "DoubleQuoteBoldTextFallbackCharacter", + }, + }, + }, + }, + { + name: "DoubleQuoteBoldTextStringElement", + pos: position{line: 888, col: 1, offset: 30290}, expr: &actionExpr{ - pos: position{line: 900, col: 31, offset: 31004}, - run: (*parser).callonDoubleQuoteBoldTextElement1, - expr: &seqExpr{ - pos: position{line: 900, col: 31, offset: 31004}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 900, col: 31, offset: 31004}, - expr: &ruleRefExpr{ - pos: position{line: 900, col: 32, offset: 31005}, - name: "Newline", - }, - }, - &labeledExpr{ - pos: position{line: 900, col: 40, offset: 31013}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 900, col: 49, offset: 31022}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 900, col: 49, offset: 31022}, - name: "SimpleWord", - }, - &ruleRefExpr{ - pos: position{line: 901, col: 11, offset: 31044}, - name: "SingleQuoteBoldText", - }, - &ruleRefExpr{ - pos: position{line: 902, col: 11, offset: 31075}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 903, col: 11, offset: 31097}, - name: "MonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 904, col: 11, offset: 31121}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 905, col: 11, offset: 31145}, - name: "SuperscriptText", - }, - &ruleRefExpr{ - pos: position{line: 906, col: 11, offset: 31171}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 907, col: 11, offset: 31194}, - name: "QuotedLink", - }, - &ruleRefExpr{ - pos: position{line: 908, col: 11, offset: 31216}, - name: "Passthrough", - }, - &ruleRefExpr{ - pos: position{line: 909, col: 11, offset: 31239}, - name: "DocumentAttributeSubstitution", - }, - &ruleRefExpr{ - pos: position{line: 910, col: 11, offset: 31279}, - name: "NonDoubleQuoteBoldText", - }, - &ruleRefExpr{ - pos: position{line: 911, col: 11, offset: 31312}, - name: "Parenthesis", - }, - &ruleRefExpr{ - pos: position{line: 912, col: 11, offset: 31334}, - name: "AnyChars", - }, - &ruleRefExpr{ - pos: position{line: 913, col: 11, offset: 31353}, - name: "AnyChar", - }, + pos: position{line: 888, col: 37, offset: 30326}, + run: (*parser).callonDoubleQuoteBoldTextStringElement1, + expr: &oneOrMoreExpr{ + pos: position{line: 888, col: 37, offset: 30326}, + expr: &seqExpr{ + pos: position{line: 888, col: 38, offset: 30327}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 888, col: 38, offset: 30327}, + expr: &litMatcher{ + pos: position{line: 888, col: 39, offset: 30328}, + val: "**", + ignoreCase: false, + want: "\"**\"", }, }, + &charClassMatcher{ + pos: position{line: 888, col: 44, offset: 30333}, + val: "[^\\r\\n ^~{}]", + chars: []rune{'\r', '\n', ' ', '^', '~', '{', '}'}, + ignoreCase: false, + inverted: true, + }, }, }, }, }, }, { - name: "NonDoubleQuoteBoldText", - pos: position{line: 917, col: 1, offset: 31495}, - expr: &actionExpr{ - pos: position{line: 917, col: 27, offset: 31521}, - run: (*parser).callonNonDoubleQuoteBoldText1, - expr: &seqExpr{ - pos: position{line: 917, col: 27, offset: 31521}, - exprs: []interface{}{ - &anyMatcher{ - line: 917, col: 28, offset: 31522, - }, - &zeroOrMoreExpr{ - pos: position{line: 917, col: 31, offset: 31525}, - expr: &seqExpr{ - pos: position{line: 917, col: 32, offset: 31526}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 917, col: 32, offset: 31526}, - expr: &litMatcher{ - pos: position{line: 917, col: 33, offset: 31527}, - val: "**", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 917, col: 38, offset: 31532}, - expr: &ruleRefExpr{ - pos: position{line: 917, col: 39, offset: 31533}, - name: "WS", - }, - }, - ¬Expr{ - pos: position{line: 917, col: 42, offset: 31536}, - expr: &litMatcher{ - pos: position{line: 917, col: 43, offset: 31537}, - val: "^", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 917, col: 47, offset: 31541}, - expr: &litMatcher{ - pos: position{line: 917, col: 48, offset: 31542}, - val: "~", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 917, col: 52, offset: 31546}, - expr: &ruleRefExpr{ - pos: position{line: 917, col: 53, offset: 31547}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 917, col: 61, offset: 31555}, - expr: &ruleRefExpr{ - pos: position{line: 917, col: 62, offset: 31556}, - name: "Parenthesis", - }, - }, - &anyMatcher{ - line: 917, col: 74, offset: 31568, - }, + name: "DoubleQuoteBoldTextFallbackCharacter", + pos: position{line: 892, col: 1, offset: 30404}, + expr: &choiceExpr{ + pos: position{line: 893, col: 5, offset: 30449}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 893, col: 5, offset: 30449}, + val: "[^\\r\\n*]", + chars: []rune{'\r', '\n', '*'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 894, col: 7, offset: 30546}, + run: (*parser).callonDoubleQuoteBoldTextFallbackCharacter3, + expr: &seqExpr{ + pos: position{line: 894, col: 7, offset: 30546}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 894, col: 7, offset: 30546}, + val: "**", + ignoreCase: false, + want: "\"**\"", + }, + &ruleRefExpr{ + pos: position{line: 894, col: 12, offset: 30551}, + name: "Alphanums", }, }, }, @@ -6630,94 +5911,117 @@ var g = &grammar{ }, { name: "SingleQuoteBoldText", - pos: position{line: 921, col: 1, offset: 31628}, + pos: position{line: 898, col: 1, offset: 30714}, expr: &choiceExpr{ - pos: position{line: 921, col: 24, offset: 31651}, + pos: position{line: 898, col: 24, offset: 30737}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 921, col: 24, offset: 31651}, + pos: position{line: 898, col: 24, offset: 30737}, run: (*parser).callonSingleQuoteBoldText2, expr: &seqExpr{ - pos: position{line: 921, col: 24, offset: 31651}, + pos: position{line: 898, col: 24, offset: 30737}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 921, col: 24, offset: 31651}, - expr: &litMatcher{ - pos: position{line: 921, col: 25, offset: 31652}, - val: "\\", - ignoreCase: false, - }, - }, - &litMatcher{ - pos: position{line: 921, col: 29, offset: 31656}, - val: "*", - ignoreCase: false, - }, - ¬Expr{ - pos: position{line: 921, col: 33, offset: 31660}, - expr: &litMatcher{ - pos: position{line: 921, col: 34, offset: 31661}, - val: "*", - ignoreCase: false, + &seqExpr{ + pos: position{line: 898, col: 25, offset: 30738}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 898, col: 25, offset: 30738}, + expr: &litMatcher{ + pos: position{line: 898, col: 26, offset: 30739}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &litMatcher{ + pos: position{line: 898, col: 30, offset: 30743}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + ¬Expr{ + pos: position{line: 898, col: 34, offset: 30747}, + expr: &litMatcher{ + pos: position{line: 898, col: 35, offset: 30748}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + }, }, }, &labeledExpr{ - pos: position{line: 921, col: 38, offset: 31665}, + pos: position{line: 898, col: 40, offset: 30753}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 921, col: 48, offset: 31675}, + pos: position{line: 898, col: 50, offset: 30763}, name: "SingleQuoteBoldTextElements", }, }, &litMatcher{ - pos: position{line: 921, col: 77, offset: 31704}, + pos: position{line: 898, col: 79, offset: 30792}, val: "*", ignoreCase: false, + want: "\"*\"", + }, + &andExpr{ + pos: position{line: 898, col: 83, offset: 30796}, + expr: ¬Expr{ + pos: position{line: 898, col: 85, offset: 30798}, + expr: &ruleRefExpr{ + pos: position{line: 898, col: 86, offset: 30799}, + name: "Alphanum", + }, + }, }, }, }, }, &actionExpr{ - pos: position{line: 923, col: 5, offset: 31885}, - run: (*parser).callonSingleQuoteBoldText12, + pos: position{line: 900, col: 5, offset: 30986}, + run: (*parser).callonSingleQuoteBoldText16, expr: &seqExpr{ - pos: position{line: 923, col: 5, offset: 31885}, + pos: position{line: 900, col: 5, offset: 30986}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 923, col: 5, offset: 31885}, + pos: position{line: 900, col: 5, offset: 30986}, expr: &litMatcher{ - pos: position{line: 923, col: 6, offset: 31886}, + pos: position{line: 900, col: 6, offset: 30987}, val: "\\\\", ignoreCase: false, + want: "\"\\\\\\\\\"", }, }, &litMatcher{ - pos: position{line: 923, col: 11, offset: 31891}, + pos: position{line: 900, col: 11, offset: 30992}, val: "*", ignoreCase: false, + want: "\"*\"", }, &labeledExpr{ - pos: position{line: 923, col: 15, offset: 31895}, + pos: position{line: 900, col: 15, offset: 30996}, label: "elements", expr: &seqExpr{ - pos: position{line: 923, col: 25, offset: 31905}, + pos: position{line: 900, col: 25, offset: 31006}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 923, col: 25, offset: 31905}, + pos: position{line: 900, col: 25, offset: 31006}, val: "*", ignoreCase: false, + want: "\"*\"", }, &ruleRefExpr{ - pos: position{line: 923, col: 29, offset: 31909}, + pos: position{line: 900, col: 29, offset: 31010}, name: "SingleQuoteBoldTextElements", }, }, }, }, &litMatcher{ - pos: position{line: 923, col: 58, offset: 31938}, + pos: position{line: 900, col: 58, offset: 31039}, val: "*", ignoreCase: false, + want: "\"*\"", }, }, }, @@ -6727,213 +6031,165 @@ var g = &grammar{ }, { name: "SingleQuoteBoldTextElements", - pos: position{line: 927, col: 1, offset: 32137}, + pos: position{line: 904, col: 1, offset: 31238}, expr: &seqExpr{ - pos: position{line: 927, col: 32, offset: 32168}, + pos: position{line: 904, col: 32, offset: 31269}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 927, col: 32, offset: 32168}, + pos: position{line: 904, col: 32, offset: 31269}, + expr: &ruleRefExpr{ + pos: position{line: 904, col: 33, offset: 31270}, + name: "Space", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 904, col: 39, offset: 31276}, expr: &ruleRefExpr{ - pos: position{line: 927, col: 33, offset: 32169}, - name: "WS", + pos: position{line: 904, col: 39, offset: 31276}, + name: "SingleQuoteBoldTextElement", }, }, + }, + }, + }, + { + name: "SingleQuoteBoldTextElement", + pos: position{line: 906, col: 1, offset: 31305}, + expr: &choiceExpr{ + pos: position{line: 906, col: 31, offset: 31335}, + alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 927, col: 36, offset: 32172}, - name: "SingleQuoteBoldTextElement", + pos: position{line: 906, col: 31, offset: 31335}, + name: "Word", }, - &zeroOrMoreExpr{ - pos: position{line: 927, col: 63, offset: 32199}, - expr: &seqExpr{ - pos: position{line: 927, col: 64, offset: 32200}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 927, col: 64, offset: 32200}, - expr: &seqExpr{ - pos: position{line: 927, col: 66, offset: 32202}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 927, col: 66, offset: 32202}, + &ruleRefExpr{ + pos: position{line: 907, col: 11, offset: 31351}, + name: "DoubleQuoteBoldText", + }, + &seqExpr{ + pos: position{line: 908, col: 11, offset: 31381}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 908, col: 11, offset: 31381}, + expr: &ruleRefExpr{ + pos: position{line: 908, col: 11, offset: 31381}, + name: "Space", + }, + }, + &zeroOrOneExpr{ + pos: position{line: 908, col: 18, offset: 31388}, + expr: &seqExpr{ + pos: position{line: 908, col: 19, offset: 31389}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 908, col: 19, offset: 31389}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + ¬Expr{ + pos: position{line: 908, col: 23, offset: 31393}, + expr: &litMatcher{ + pos: position{line: 908, col: 24, offset: 31394}, val: "*", ignoreCase: false, - }, - ¬Expr{ - pos: position{line: 927, col: 70, offset: 32206}, - expr: &ruleRefExpr{ - pos: position{line: 927, col: 71, offset: 32207}, - name: "Alphanum", - }, + want: "\"*\"", }, }, }, }, - &zeroOrMoreExpr{ - pos: position{line: 927, col: 81, offset: 32217}, - expr: &ruleRefExpr{ - pos: position{line: 927, col: 81, offset: 32217}, - name: "WS", - }, - }, - &ruleRefExpr{ - pos: position{line: 927, col: 85, offset: 32221}, - name: "SingleQuoteBoldTextElement", - }, }, }, }, + &ruleRefExpr{ + pos: position{line: 909, col: 11, offset: 31410}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 910, col: 11, offset: 31432}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 911, col: 11, offset: 31456}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 912, col: 11, offset: 31480}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 913, col: 11, offset: 31506}, + name: "InlineImage", + }, + &ruleRefExpr{ + pos: position{line: 914, col: 11, offset: 31529}, + name: "Link", + }, + &ruleRefExpr{ + pos: position{line: 915, col: 11, offset: 31546}, + name: "Passthrough", + }, + &ruleRefExpr{ + pos: position{line: 916, col: 11, offset: 31569}, + name: "DocumentAttributeSubstitution", + }, + &ruleRefExpr{ + pos: position{line: 917, col: 11, offset: 31609}, + name: "SingleQuoteBoldTextStringElement", + }, + &ruleRefExpr{ + pos: position{line: 918, col: 11, offset: 31652}, + name: "SingleQuoteBoldTextFallbackCharacter", + }, }, }, }, { - name: "SingleQuoteBoldTextElement", - pos: position{line: 929, col: 1, offset: 32252}, + name: "SingleQuoteBoldTextStringElement", + pos: position{line: 920, col: 1, offset: 31690}, expr: &actionExpr{ - pos: position{line: 929, col: 31, offset: 32282}, - run: (*parser).callonSingleQuoteBoldTextElement1, - expr: &seqExpr{ - pos: position{line: 929, col: 31, offset: 32282}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 929, col: 31, offset: 32282}, - expr: &ruleRefExpr{ - pos: position{line: 929, col: 32, offset: 32283}, - name: "Newline", - }, - }, - &labeledExpr{ - pos: position{line: 929, col: 40, offset: 32291}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 929, col: 49, offset: 32300}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 929, col: 49, offset: 32300}, - name: "SimpleWord", - }, - &ruleRefExpr{ - pos: position{line: 930, col: 11, offset: 32322}, - name: "DoubleQuoteBoldText", - }, - &ruleRefExpr{ - pos: position{line: 931, col: 11, offset: 32352}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 932, col: 11, offset: 32374}, - name: "MonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 933, col: 11, offset: 32398}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 934, col: 11, offset: 32422}, - name: "SuperscriptText", - }, - &ruleRefExpr{ - pos: position{line: 935, col: 11, offset: 32448}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 936, col: 11, offset: 32471}, - name: "QuotedLink", - }, - &ruleRefExpr{ - pos: position{line: 937, col: 11, offset: 32493}, - name: "Passthrough", - }, - &ruleRefExpr{ - pos: position{line: 938, col: 11, offset: 32516}, - name: "DocumentAttributeSubstitution", - }, - &ruleRefExpr{ - pos: position{line: 939, col: 11, offset: 32556}, - name: "NonSingleQuoteBoldText", - }, - &ruleRefExpr{ - pos: position{line: 940, col: 11, offset: 32589}, - name: "Parenthesis", - }, - &ruleRefExpr{ - pos: position{line: 941, col: 11, offset: 32611}, - name: "AnyChars", - }, - &ruleRefExpr{ - pos: position{line: 942, col: 11, offset: 32630}, - name: "AnyChar", - }, - }, - }, - }, + pos: position{line: 920, col: 37, offset: 31726}, + run: (*parser).callonSingleQuoteBoldTextStringElement1, + expr: &oneOrMoreExpr{ + pos: position{line: 920, col: 37, offset: 31726}, + expr: &charClassMatcher{ + pos: position{line: 920, col: 37, offset: 31726}, + val: "[^\\r\\n{} *^~]", + chars: []rune{'\r', '\n', '{', '}', ' ', '*', '^', '~'}, + ignoreCase: false, + inverted: true, }, }, }, }, { - name: "NonSingleQuoteBoldText", - pos: position{line: 946, col: 1, offset: 32772}, - expr: &actionExpr{ - pos: position{line: 946, col: 27, offset: 32798}, - run: (*parser).callonNonSingleQuoteBoldText1, - expr: &seqExpr{ - pos: position{line: 946, col: 27, offset: 32798}, - exprs: []interface{}{ - &anyMatcher{ - line: 946, col: 28, offset: 32799, - }, - &zeroOrMoreExpr{ - pos: position{line: 946, col: 31, offset: 32802}, - expr: &seqExpr{ - pos: position{line: 946, col: 32, offset: 32803}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 946, col: 32, offset: 32803}, - expr: &litMatcher{ - pos: position{line: 946, col: 33, offset: 32804}, - val: "*", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 946, col: 37, offset: 32808}, - expr: &ruleRefExpr{ - pos: position{line: 946, col: 38, offset: 32809}, - name: "WS", - }, - }, - ¬Expr{ - pos: position{line: 946, col: 41, offset: 32812}, - expr: &litMatcher{ - pos: position{line: 946, col: 42, offset: 32813}, - val: "^", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 946, col: 46, offset: 32817}, - expr: &litMatcher{ - pos: position{line: 946, col: 47, offset: 32818}, - val: "~", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 946, col: 51, offset: 32822}, - expr: &ruleRefExpr{ - pos: position{line: 946, col: 52, offset: 32823}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 946, col: 60, offset: 32831}, - expr: &ruleRefExpr{ - pos: position{line: 946, col: 61, offset: 32832}, - name: "Parenthesis", - }, - }, - &anyMatcher{ - line: 946, col: 73, offset: 32844, - }, + name: "SingleQuoteBoldTextFallbackCharacter", + pos: position{line: 924, col: 1, offset: 31960}, + expr: &choiceExpr{ + pos: position{line: 925, col: 5, offset: 32005}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 925, col: 5, offset: 32005}, + val: "[^\\r\\n*]", + chars: []rune{'\r', '\n', '*'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 926, col: 7, offset: 32102}, + run: (*parser).callonSingleQuoteBoldTextFallbackCharacter3, + expr: &seqExpr{ + pos: position{line: 926, col: 7, offset: 32102}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 926, col: 7, offset: 32102}, + val: "*", + ignoreCase: false, + want: "\"*\"", + }, + &ruleRefExpr{ + pos: position{line: 926, col: 11, offset: 32106}, + name: "Alphanums", }, }, }, @@ -6943,111 +6199,117 @@ var g = &grammar{ }, { name: "EscapedBoldText", - pos: position{line: 950, col: 1, offset: 32904}, + pos: position{line: 930, col: 1, offset: 32269}, expr: &choiceExpr{ - pos: position{line: 951, col: 5, offset: 32928}, + pos: position{line: 931, col: 5, offset: 32293}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 951, col: 5, offset: 32928}, + pos: position{line: 931, col: 5, offset: 32293}, run: (*parser).callonEscapedBoldText2, expr: &seqExpr{ - pos: position{line: 951, col: 5, offset: 32928}, + pos: position{line: 931, col: 5, offset: 32293}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 951, col: 5, offset: 32928}, + pos: position{line: 931, col: 5, offset: 32293}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 951, col: 18, offset: 32941}, + pos: position{line: 931, col: 18, offset: 32306}, name: "TwoOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 951, col: 40, offset: 32963}, + pos: position{line: 931, col: 40, offset: 32328}, val: "**", ignoreCase: false, + want: "\"**\"", }, &labeledExpr{ - pos: position{line: 951, col: 45, offset: 32968}, + pos: position{line: 931, col: 45, offset: 32333}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 951, col: 55, offset: 32978}, + pos: position{line: 931, col: 55, offset: 32343}, name: "DoubleQuoteBoldTextElements", }, }, &litMatcher{ - pos: position{line: 951, col: 84, offset: 33007}, + pos: position{line: 931, col: 84, offset: 32372}, val: "**", ignoreCase: false, + want: "\"**\"", }, }, }, }, &actionExpr{ - pos: position{line: 953, col: 9, offset: 33164}, + pos: position{line: 933, col: 9, offset: 32529}, run: (*parser).callonEscapedBoldText10, expr: &seqExpr{ - pos: position{line: 953, col: 9, offset: 33164}, + pos: position{line: 933, col: 9, offset: 32529}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 953, col: 9, offset: 33164}, + pos: position{line: 933, col: 9, offset: 32529}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 953, col: 22, offset: 33177}, + pos: position{line: 933, col: 22, offset: 32542}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 953, col: 44, offset: 33199}, + pos: position{line: 933, col: 44, offset: 32564}, val: "**", ignoreCase: false, + want: "\"**\"", }, &labeledExpr{ - pos: position{line: 953, col: 49, offset: 33204}, + pos: position{line: 933, col: 49, offset: 32569}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 953, col: 59, offset: 33214}, + pos: position{line: 933, col: 59, offset: 32579}, name: "SingleQuoteBoldTextElements", }, }, &litMatcher{ - pos: position{line: 953, col: 88, offset: 33243}, + pos: position{line: 933, col: 88, offset: 32608}, val: "*", ignoreCase: false, + want: "\"*\"", }, }, }, }, &actionExpr{ - pos: position{line: 956, col: 9, offset: 33443}, + pos: position{line: 936, col: 9, offset: 32808}, run: (*parser).callonEscapedBoldText18, expr: &seqExpr{ - pos: position{line: 956, col: 9, offset: 33443}, + pos: position{line: 936, col: 9, offset: 32808}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 956, col: 9, offset: 33443}, + pos: position{line: 936, col: 9, offset: 32808}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 956, col: 22, offset: 33456}, + pos: position{line: 936, col: 22, offset: 32821}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 956, col: 44, offset: 33478}, + pos: position{line: 936, col: 44, offset: 32843}, val: "*", ignoreCase: false, + want: "\"*\"", }, &labeledExpr{ - pos: position{line: 956, col: 48, offset: 33482}, + pos: position{line: 936, col: 48, offset: 32847}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 956, col: 58, offset: 33492}, + pos: position{line: 936, col: 58, offset: 32857}, name: "SingleQuoteBoldTextElements", }, }, &litMatcher{ - pos: position{line: 956, col: 87, offset: 33521}, + pos: position{line: 936, col: 87, offset: 32886}, val: "*", ignoreCase: false, + want: "\"*\"", }, }, }, @@ -7057,16 +6319,16 @@ var g = &grammar{ }, { name: "ItalicText", - pos: position{line: 964, col: 1, offset: 33729}, + pos: position{line: 944, col: 1, offset: 33094}, expr: &choiceExpr{ - pos: position{line: 964, col: 15, offset: 33743}, + pos: position{line: 944, col: 15, offset: 33108}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 964, col: 15, offset: 33743}, + pos: position{line: 944, col: 15, offset: 33108}, name: "DoubleQuoteItalicText", }, &ruleRefExpr{ - pos: position{line: 964, col: 39, offset: 33767}, + pos: position{line: 944, col: 39, offset: 33132}, name: "SingleQuoteItalicText", }, }, @@ -7074,38 +6336,41 @@ var g = &grammar{ }, { name: "DoubleQuoteItalicText", - pos: position{line: 966, col: 1, offset: 33790}, + pos: position{line: 946, col: 1, offset: 33155}, expr: &actionExpr{ - pos: position{line: 966, col: 26, offset: 33815}, + pos: position{line: 946, col: 26, offset: 33180}, run: (*parser).callonDoubleQuoteItalicText1, expr: &seqExpr{ - pos: position{line: 966, col: 26, offset: 33815}, + pos: position{line: 946, col: 26, offset: 33180}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 966, col: 26, offset: 33815}, + pos: position{line: 946, col: 26, offset: 33180}, expr: &litMatcher{ - pos: position{line: 966, col: 27, offset: 33816}, + pos: position{line: 946, col: 27, offset: 33181}, val: "\\\\", ignoreCase: false, + want: "\"\\\\\\\\\"", }, }, &litMatcher{ - pos: position{line: 966, col: 32, offset: 33821}, + pos: position{line: 946, col: 32, offset: 33186}, val: "__", ignoreCase: false, + want: "\"__\"", }, &labeledExpr{ - pos: position{line: 966, col: 37, offset: 33826}, + pos: position{line: 946, col: 37, offset: 33191}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 966, col: 47, offset: 33836}, + pos: position{line: 946, col: 47, offset: 33201}, name: "DoubleQuoteItalicTextElements", }, }, &litMatcher{ - pos: position{line: 966, col: 78, offset: 33867}, + pos: position{line: 946, col: 78, offset: 33232}, val: "__", ignoreCase: false, + want: "\"__\"", }, }, }, @@ -7113,36 +6378,37 @@ var g = &grammar{ }, { name: "DoubleQuoteItalicTextElements", - pos: position{line: 970, col: 1, offset: 33994}, + pos: position{line: 950, col: 1, offset: 33359}, expr: &seqExpr{ - pos: position{line: 970, col: 34, offset: 34027}, + pos: position{line: 950, col: 34, offset: 33392}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 970, col: 34, offset: 34027}, + pos: position{line: 950, col: 34, offset: 33392}, name: "DoubleQuoteItalicTextElement", }, &zeroOrMoreExpr{ - pos: position{line: 970, col: 63, offset: 34056}, + pos: position{line: 950, col: 63, offset: 33421}, expr: &seqExpr{ - pos: position{line: 970, col: 64, offset: 34057}, + pos: position{line: 950, col: 64, offset: 33422}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 970, col: 64, offset: 34057}, + pos: position{line: 950, col: 64, offset: 33422}, expr: &litMatcher{ - pos: position{line: 970, col: 66, offset: 34059}, + pos: position{line: 950, col: 66, offset: 33424}, val: "__", ignoreCase: false, + want: "\"__\"", }, }, &choiceExpr{ - pos: position{line: 970, col: 73, offset: 34066}, + pos: position{line: 950, col: 73, offset: 33431}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 970, col: 73, offset: 34066}, - name: "WS", + pos: position{line: 950, col: 73, offset: 33431}, + name: "Space", }, &ruleRefExpr{ - pos: position{line: 970, col: 78, offset: 34071}, + pos: position{line: 950, col: 81, offset: 33439}, name: "DoubleQuoteItalicTextElement", }, }, @@ -7155,143 +6421,117 @@ var g = &grammar{ }, { name: "DoubleQuoteItalicTextElement", - pos: position{line: 972, col: 1, offset: 34138}, + pos: position{line: 952, col: 1, offset: 33506}, + expr: &choiceExpr{ + pos: position{line: 952, col: 33, offset: 33538}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 952, col: 33, offset: 33538}, + name: "Word", + }, + &ruleRefExpr{ + pos: position{line: 953, col: 11, offset: 33554}, + name: "SingleQuoteItalicText", + }, + &ruleRefExpr{ + pos: position{line: 954, col: 11, offset: 33587}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 955, col: 11, offset: 33607}, + name: "MonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 956, col: 11, offset: 33631}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 957, col: 11, offset: 33655}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 958, col: 11, offset: 33681}, + name: "InlineImage", + }, + &ruleRefExpr{ + pos: position{line: 959, col: 11, offset: 33704}, + name: "Link", + }, + &ruleRefExpr{ + pos: position{line: 960, col: 11, offset: 33720}, + name: "Passthrough", + }, + &ruleRefExpr{ + pos: position{line: 961, col: 11, offset: 33743}, + name: "DoubleQuoteItalicTextStringElement", + }, + &ruleRefExpr{ + pos: position{line: 962, col: 11, offset: 33788}, + name: "DoubleQuoteItalicTextFallbackCharacter", + }, + }, + }, + }, + { + name: "DoubleQuoteItalicTextStringElement", + pos: position{line: 964, col: 1, offset: 33828}, expr: &actionExpr{ - pos: position{line: 972, col: 33, offset: 34170}, - run: (*parser).callonDoubleQuoteItalicTextElement1, - expr: &seqExpr{ - pos: position{line: 972, col: 33, offset: 34170}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 972, col: 33, offset: 34170}, - expr: &ruleRefExpr{ - pos: position{line: 972, col: 34, offset: 34171}, - name: "Newline", - }, - }, - &labeledExpr{ - pos: position{line: 972, col: 42, offset: 34179}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 972, col: 51, offset: 34188}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 972, col: 51, offset: 34188}, - name: "SimpleWord", - }, - &ruleRefExpr{ - pos: position{line: 973, col: 11, offset: 34210}, - name: "SingleQuoteItalicText", - }, - &ruleRefExpr{ - pos: position{line: 974, col: 11, offset: 34243}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 975, col: 11, offset: 34263}, - name: "MonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 976, col: 11, offset: 34287}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 977, col: 11, offset: 34311}, - name: "SuperscriptText", - }, - &ruleRefExpr{ - pos: position{line: 978, col: 11, offset: 34337}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 979, col: 11, offset: 34360}, - name: "QuotedLink", - }, - &ruleRefExpr{ - pos: position{line: 980, col: 11, offset: 34382}, - name: "Passthrough", - }, - &ruleRefExpr{ - pos: position{line: 981, col: 11, offset: 34405}, - name: "NonDoubleQuoteItalicText", - }, - &ruleRefExpr{ - pos: position{line: 982, col: 11, offset: 34440}, - name: "Parenthesis", - }, - &ruleRefExpr{ - pos: position{line: 983, col: 11, offset: 34462}, - name: "AnyChars", - }, - &ruleRefExpr{ - pos: position{line: 984, col: 11, offset: 34481}, - name: "AnyChar", - }, + pos: position{line: 964, col: 39, offset: 33866}, + run: (*parser).callonDoubleQuoteItalicTextStringElement1, + expr: &oneOrMoreExpr{ + pos: position{line: 964, col: 39, offset: 33866}, + expr: &seqExpr{ + pos: position{line: 964, col: 40, offset: 33867}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 964, col: 40, offset: 33867}, + expr: &litMatcher{ + pos: position{line: 964, col: 41, offset: 33868}, + val: "__", + ignoreCase: false, + want: "\"__\"", }, }, + &charClassMatcher{ + pos: position{line: 964, col: 46, offset: 33873}, + val: "[^\\r\\n ^~{}]", + chars: []rune{'\r', '\n', ' ', '^', '~', '{', '}'}, + ignoreCase: false, + inverted: true, + }, }, }, }, }, }, { - name: "NonDoubleQuoteItalicText", - pos: position{line: 988, col: 1, offset: 34623}, - expr: &actionExpr{ - pos: position{line: 988, col: 29, offset: 34651}, - run: (*parser).callonNonDoubleQuoteItalicText1, - expr: &seqExpr{ - pos: position{line: 988, col: 29, offset: 34651}, - exprs: []interface{}{ - &anyMatcher{ - line: 988, col: 30, offset: 34652, - }, - &zeroOrMoreExpr{ - pos: position{line: 988, col: 33, offset: 34655}, - expr: &seqExpr{ - pos: position{line: 988, col: 34, offset: 34656}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 988, col: 34, offset: 34656}, - expr: &litMatcher{ - pos: position{line: 988, col: 35, offset: 34657}, - val: "__", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 988, col: 40, offset: 34662}, - expr: &litMatcher{ - pos: position{line: 988, col: 41, offset: 34663}, - val: "^", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 988, col: 45, offset: 34667}, - expr: &litMatcher{ - pos: position{line: 988, col: 46, offset: 34668}, - val: "~", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 988, col: 50, offset: 34672}, - expr: &ruleRefExpr{ - pos: position{line: 988, col: 51, offset: 34673}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 988, col: 59, offset: 34681}, - expr: &ruleRefExpr{ - pos: position{line: 988, col: 60, offset: 34682}, - name: "Parenthesis", - }, - }, - &anyMatcher{ - line: 988, col: 72, offset: 34694, - }, + name: "DoubleQuoteItalicTextFallbackCharacter", + pos: position{line: 968, col: 1, offset: 33944}, + expr: &choiceExpr{ + pos: position{line: 969, col: 5, offset: 33991}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 969, col: 5, offset: 33991}, + val: "[^\\r\\n_]", + chars: []rune{'\r', '\n', '_'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 970, col: 7, offset: 34090}, + run: (*parser).callonDoubleQuoteItalicTextFallbackCharacter3, + expr: &seqExpr{ + pos: position{line: 970, col: 7, offset: 34090}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 970, col: 7, offset: 34090}, + val: "__", + ignoreCase: false, + want: "\"__\"", + }, + &ruleRefExpr{ + pos: position{line: 970, col: 12, offset: 34095}, + name: "Alphanums", }, }, }, @@ -7301,306 +6541,275 @@ var g = &grammar{ }, { name: "SingleQuoteItalicText", - pos: position{line: 992, col: 1, offset: 34754}, + pos: position{line: 974, col: 1, offset: 34260}, expr: &choiceExpr{ - pos: position{line: 992, col: 26, offset: 34779}, + pos: position{line: 974, col: 26, offset: 34285}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 992, col: 26, offset: 34779}, + pos: position{line: 974, col: 26, offset: 34285}, run: (*parser).callonSingleQuoteItalicText2, expr: &seqExpr{ - pos: position{line: 992, col: 26, offset: 34779}, + pos: position{line: 974, col: 26, offset: 34285}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 992, col: 26, offset: 34779}, - expr: &litMatcher{ - pos: position{line: 992, col: 27, offset: 34780}, - val: "\\", - ignoreCase: false, - }, - }, - &litMatcher{ - pos: position{line: 992, col: 31, offset: 34784}, - val: "_", - ignoreCase: false, - }, - ¬Expr{ - pos: position{line: 992, col: 35, offset: 34788}, - expr: &litMatcher{ - pos: position{line: 992, col: 36, offset: 34789}, - val: "_", - ignoreCase: false, + &seqExpr{ + pos: position{line: 974, col: 27, offset: 34286}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 974, col: 27, offset: 34286}, + expr: &litMatcher{ + pos: position{line: 974, col: 28, offset: 34287}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &litMatcher{ + pos: position{line: 974, col: 32, offset: 34291}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + ¬Expr{ + pos: position{line: 974, col: 36, offset: 34295}, + expr: &litMatcher{ + pos: position{line: 974, col: 37, offset: 34296}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + }, }, }, &labeledExpr{ - pos: position{line: 992, col: 40, offset: 34793}, + pos: position{line: 974, col: 42, offset: 34301}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 992, col: 50, offset: 34803}, + pos: position{line: 974, col: 52, offset: 34311}, name: "SingleQuoteItalicTextElements", }, }, &litMatcher{ - pos: position{line: 992, col: 81, offset: 34834}, + pos: position{line: 974, col: 83, offset: 34342}, val: "_", ignoreCase: false, + want: "\"_\"", }, }, }, }, &actionExpr{ - pos: position{line: 994, col: 5, offset: 35017}, - run: (*parser).callonSingleQuoteItalicText12, + pos: position{line: 976, col: 5, offset: 34525}, + run: (*parser).callonSingleQuoteItalicText13, expr: &seqExpr{ - pos: position{line: 994, col: 5, offset: 35017}, + pos: position{line: 976, col: 5, offset: 34525}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 994, col: 5, offset: 35017}, + pos: position{line: 976, col: 5, offset: 34525}, expr: &litMatcher{ - pos: position{line: 994, col: 6, offset: 35018}, + pos: position{line: 976, col: 6, offset: 34526}, val: "\\\\", ignoreCase: false, + want: "\"\\\\\\\\\"", }, }, &litMatcher{ - pos: position{line: 994, col: 11, offset: 35023}, + pos: position{line: 976, col: 11, offset: 34531}, val: "_", ignoreCase: false, + want: "\"_\"", }, &labeledExpr{ - pos: position{line: 994, col: 15, offset: 35027}, + pos: position{line: 976, col: 15, offset: 34535}, label: "elements", expr: &seqExpr{ - pos: position{line: 994, col: 25, offset: 35037}, + pos: position{line: 976, col: 25, offset: 34545}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 994, col: 25, offset: 35037}, + pos: position{line: 976, col: 25, offset: 34545}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + &ruleRefExpr{ + pos: position{line: 976, col: 29, offset: 34549}, + name: "SingleQuoteItalicTextElements", + }, + }, + }, + }, + &litMatcher{ + pos: position{line: 976, col: 60, offset: 34580}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + }, + }, + }, + }, + }, + }, + { + name: "SingleQuoteItalicTextElements", + pos: position{line: 980, col: 1, offset: 34783}, + expr: &seqExpr{ + pos: position{line: 980, col: 34, offset: 34816}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 980, col: 34, offset: 34816}, + expr: &ruleRefExpr{ + pos: position{line: 980, col: 35, offset: 34817}, + name: "Space", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 980, col: 41, offset: 34823}, + expr: &ruleRefExpr{ + pos: position{line: 980, col: 41, offset: 34823}, + name: "SingleQuoteItalicTextElement", + }, + }, + }, + }, + }, + { + name: "SingleQuoteItalicTextElement", + pos: position{line: 982, col: 1, offset: 34854}, + expr: &choiceExpr{ + pos: position{line: 982, col: 33, offset: 34886}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 982, col: 33, offset: 34886}, + name: "Word", + }, + &ruleRefExpr{ + pos: position{line: 983, col: 11, offset: 34902}, + name: "DoubleQuoteItalicText", + }, + &seqExpr{ + pos: position{line: 984, col: 11, offset: 34934}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 984, col: 11, offset: 34934}, + expr: &ruleRefExpr{ + pos: position{line: 984, col: 11, offset: 34934}, + name: "Space", + }, + }, + &zeroOrOneExpr{ + pos: position{line: 984, col: 18, offset: 34941}, + expr: &seqExpr{ + pos: position{line: 984, col: 19, offset: 34942}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 984, col: 19, offset: 34942}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + ¬Expr{ + pos: position{line: 984, col: 23, offset: 34946}, + expr: &litMatcher{ + pos: position{line: 984, col: 24, offset: 34947}, val: "_", ignoreCase: false, - }, - &ruleRefExpr{ - pos: position{line: 994, col: 29, offset: 35041}, - name: "SingleQuoteItalicTextElements", + want: "\"_\"", }, }, }, }, - &litMatcher{ - pos: position{line: 994, col: 60, offset: 35072}, - val: "_", - ignoreCase: false, - }, }, }, }, - }, - }, - }, - { - name: "SingleQuoteItalicTextElements", - pos: position{line: 998, col: 1, offset: 35275}, - expr: &seqExpr{ - pos: position{line: 998, col: 34, offset: 35308}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 998, col: 34, offset: 35308}, - expr: &ruleRefExpr{ - pos: position{line: 998, col: 35, offset: 35309}, - name: "WS", - }, + &ruleRefExpr{ + pos: position{line: 985, col: 11, offset: 34963}, + name: "BoldText", }, &ruleRefExpr{ - pos: position{line: 998, col: 38, offset: 35312}, - name: "SingleQuoteItalicTextElement", + pos: position{line: 986, col: 11, offset: 34983}, + name: "MonospaceText", }, - &zeroOrMoreExpr{ - pos: position{line: 998, col: 67, offset: 35341}, - expr: &seqExpr{ - pos: position{line: 998, col: 68, offset: 35342}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 998, col: 68, offset: 35342}, - expr: &seqExpr{ - pos: position{line: 998, col: 70, offset: 35344}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 998, col: 70, offset: 35344}, - val: "_", - ignoreCase: false, - }, - ¬Expr{ - pos: position{line: 998, col: 74, offset: 35348}, - expr: &ruleRefExpr{ - pos: position{line: 998, col: 75, offset: 35349}, - name: "Alphanum", - }, - }, - }, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 998, col: 85, offset: 35359}, - expr: &ruleRefExpr{ - pos: position{line: 998, col: 85, offset: 35359}, - name: "WS", - }, - }, - &ruleRefExpr{ - pos: position{line: 998, col: 89, offset: 35363}, - name: "SingleQuoteItalicTextElement", - }, - }, - }, + &ruleRefExpr{ + pos: position{line: 987, col: 11, offset: 35007}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 988, col: 11, offset: 35031}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 989, col: 11, offset: 35057}, + name: "InlineImage", + }, + &ruleRefExpr{ + pos: position{line: 990, col: 11, offset: 35080}, + name: "Link", + }, + &ruleRefExpr{ + pos: position{line: 991, col: 11, offset: 35097}, + name: "Passthrough", + }, + &ruleRefExpr{ + pos: position{line: 992, col: 11, offset: 35120}, + name: "DocumentAttributeSubstitution", + }, + &ruleRefExpr{ + pos: position{line: 993, col: 11, offset: 35160}, + name: "SingleQuoteItalicTextStringElement", + }, + &ruleRefExpr{ + pos: position{line: 994, col: 11, offset: 35205}, + name: "SingleQuoteItalicTextFallbackCharacter", }, }, }, }, { - name: "SingleQuoteItalicTextElement", - pos: position{line: 1000, col: 1, offset: 35395}, + name: "SingleQuoteItalicTextStringElement", + pos: position{line: 996, col: 1, offset: 35245}, expr: &actionExpr{ - pos: position{line: 1000, col: 33, offset: 35427}, - run: (*parser).callonSingleQuoteItalicTextElement1, - expr: &seqExpr{ - pos: position{line: 1000, col: 33, offset: 35427}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1000, col: 33, offset: 35427}, - expr: &ruleRefExpr{ - pos: position{line: 1000, col: 34, offset: 35428}, - name: "Newline", - }, - }, - &labeledExpr{ - pos: position{line: 1000, col: 42, offset: 35436}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 1000, col: 51, offset: 35445}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1000, col: 51, offset: 35445}, - name: "SimpleWord", - }, - &ruleRefExpr{ - pos: position{line: 1001, col: 11, offset: 35467}, - name: "DoubleQuoteItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1002, col: 11, offset: 35499}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 1003, col: 11, offset: 35519}, - name: "MonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1004, col: 11, offset: 35543}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1005, col: 11, offset: 35567}, - name: "SuperscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1006, col: 11, offset: 35593}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 1007, col: 11, offset: 35616}, - name: "QuotedLink", - }, - &ruleRefExpr{ - pos: position{line: 1008, col: 11, offset: 35638}, - name: "Passthrough", - }, - &ruleRefExpr{ - pos: position{line: 1009, col: 11, offset: 35661}, - name: "NonSingleQuoteItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1010, col: 11, offset: 35696}, - name: "Parenthesis", - }, - &ruleRefExpr{ - pos: position{line: 1011, col: 11, offset: 35718}, - name: "AnyChars", - }, - &ruleRefExpr{ - pos: position{line: 1012, col: 11, offset: 35737}, - name: "AnyChar", - }, - }, - }, - }, + pos: position{line: 996, col: 39, offset: 35283}, + run: (*parser).callonSingleQuoteItalicTextStringElement1, + expr: &oneOrMoreExpr{ + pos: position{line: 996, col: 39, offset: 35283}, + expr: &charClassMatcher{ + pos: position{line: 996, col: 39, offset: 35283}, + val: "[^\\r\\n{} _^~]", + chars: []rune{'\r', '\n', '{', '}', ' ', '_', '^', '~'}, + ignoreCase: false, + inverted: true, }, }, }, }, { - name: "NonSingleQuoteItalicText", - pos: position{line: 1016, col: 1, offset: 35879}, - expr: &actionExpr{ - pos: position{line: 1016, col: 29, offset: 35907}, - run: (*parser).callonNonSingleQuoteItalicText1, - expr: &seqExpr{ - pos: position{line: 1016, col: 29, offset: 35907}, - exprs: []interface{}{ - &anyMatcher{ - line: 1016, col: 30, offset: 35908, - }, - &zeroOrMoreExpr{ - pos: position{line: 1016, col: 33, offset: 35911}, - expr: &seqExpr{ - pos: position{line: 1016, col: 34, offset: 35912}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1016, col: 34, offset: 35912}, - expr: &litMatcher{ - pos: position{line: 1016, col: 35, offset: 35913}, - val: "_", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1016, col: 39, offset: 35917}, - expr: &ruleRefExpr{ - pos: position{line: 1016, col: 40, offset: 35918}, - name: "WS", - }, - }, - ¬Expr{ - pos: position{line: 1016, col: 43, offset: 35921}, - expr: &litMatcher{ - pos: position{line: 1016, col: 44, offset: 35922}, - val: "^", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1016, col: 48, offset: 35926}, - expr: &litMatcher{ - pos: position{line: 1016, col: 49, offset: 35927}, - val: "~", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1016, col: 53, offset: 35931}, - expr: &ruleRefExpr{ - pos: position{line: 1016, col: 54, offset: 35932}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 1016, col: 62, offset: 35940}, - expr: &ruleRefExpr{ - pos: position{line: 1016, col: 63, offset: 35941}, - name: "Parenthesis", - }, - }, - &anyMatcher{ - line: 1016, col: 75, offset: 35953, - }, + name: "SingleQuoteItalicTextFallbackCharacter", + pos: position{line: 1000, col: 1, offset: 35517}, + expr: &choiceExpr{ + pos: position{line: 1001, col: 5, offset: 35564}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 1001, col: 5, offset: 35564}, + val: "[^\\r\\n_]", + chars: []rune{'\r', '\n', '_'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 1002, col: 7, offset: 35663}, + run: (*parser).callonSingleQuoteItalicTextFallbackCharacter3, + expr: &seqExpr{ + pos: position{line: 1002, col: 7, offset: 35663}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1002, col: 7, offset: 35663}, + val: "_", + ignoreCase: false, + want: "\"_\"", + }, + &ruleRefExpr{ + pos: position{line: 1002, col: 11, offset: 35667}, + name: "Alphanums", }, }, }, @@ -7610,111 +6819,117 @@ var g = &grammar{ }, { name: "EscapedItalicText", - pos: position{line: 1020, col: 1, offset: 36013}, + pos: position{line: 1006, col: 1, offset: 35833}, expr: &choiceExpr{ - pos: position{line: 1021, col: 5, offset: 36039}, + pos: position{line: 1007, col: 5, offset: 35859}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1021, col: 5, offset: 36039}, + pos: position{line: 1007, col: 5, offset: 35859}, run: (*parser).callonEscapedItalicText2, expr: &seqExpr{ - pos: position{line: 1021, col: 5, offset: 36039}, + pos: position{line: 1007, col: 5, offset: 35859}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1021, col: 5, offset: 36039}, + pos: position{line: 1007, col: 5, offset: 35859}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1021, col: 18, offset: 36052}, + pos: position{line: 1007, col: 18, offset: 35872}, name: "TwoOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1021, col: 40, offset: 36074}, + pos: position{line: 1007, col: 40, offset: 35894}, val: "__", ignoreCase: false, + want: "\"__\"", }, &labeledExpr{ - pos: position{line: 1021, col: 45, offset: 36079}, + pos: position{line: 1007, col: 45, offset: 35899}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1021, col: 55, offset: 36089}, + pos: position{line: 1007, col: 55, offset: 35909}, name: "DoubleQuoteItalicTextElements", }, }, &litMatcher{ - pos: position{line: 1021, col: 86, offset: 36120}, + pos: position{line: 1007, col: 86, offset: 35940}, val: "__", ignoreCase: false, + want: "\"__\"", }, }, }, }, &actionExpr{ - pos: position{line: 1023, col: 9, offset: 36277}, + pos: position{line: 1009, col: 9, offset: 36097}, run: (*parser).callonEscapedItalicText10, expr: &seqExpr{ - pos: position{line: 1023, col: 9, offset: 36277}, + pos: position{line: 1009, col: 9, offset: 36097}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1023, col: 9, offset: 36277}, + pos: position{line: 1009, col: 9, offset: 36097}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1023, col: 22, offset: 36290}, + pos: position{line: 1009, col: 22, offset: 36110}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1023, col: 44, offset: 36312}, + pos: position{line: 1009, col: 44, offset: 36132}, val: "__", ignoreCase: false, + want: "\"__\"", }, &labeledExpr{ - pos: position{line: 1023, col: 49, offset: 36317}, + pos: position{line: 1009, col: 49, offset: 36137}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1023, col: 59, offset: 36327}, + pos: position{line: 1009, col: 59, offset: 36147}, name: "SingleQuoteItalicTextElements", }, }, &litMatcher{ - pos: position{line: 1023, col: 90, offset: 36358}, + pos: position{line: 1009, col: 90, offset: 36178}, val: "_", ignoreCase: false, + want: "\"_\"", }, }, }, }, &actionExpr{ - pos: position{line: 1026, col: 9, offset: 36558}, + pos: position{line: 1012, col: 9, offset: 36378}, run: (*parser).callonEscapedItalicText18, expr: &seqExpr{ - pos: position{line: 1026, col: 9, offset: 36558}, + pos: position{line: 1012, col: 9, offset: 36378}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1026, col: 9, offset: 36558}, + pos: position{line: 1012, col: 9, offset: 36378}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1026, col: 22, offset: 36571}, + pos: position{line: 1012, col: 22, offset: 36391}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1026, col: 44, offset: 36593}, + pos: position{line: 1012, col: 44, offset: 36413}, val: "_", ignoreCase: false, + want: "\"_\"", }, &labeledExpr{ - pos: position{line: 1026, col: 48, offset: 36597}, + pos: position{line: 1012, col: 48, offset: 36417}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1026, col: 58, offset: 36607}, + pos: position{line: 1012, col: 58, offset: 36427}, name: "SingleQuoteItalicTextElements", }, }, &litMatcher{ - pos: position{line: 1026, col: 89, offset: 36638}, + pos: position{line: 1012, col: 89, offset: 36458}, val: "_", ignoreCase: false, + want: "\"_\"", }, }, }, @@ -7724,16 +6939,16 @@ var g = &grammar{ }, { name: "MonospaceText", - pos: position{line: 1033, col: 1, offset: 36848}, + pos: position{line: 1019, col: 1, offset: 36668}, expr: &choiceExpr{ - pos: position{line: 1033, col: 18, offset: 36865}, + pos: position{line: 1019, col: 18, offset: 36685}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1033, col: 18, offset: 36865}, + pos: position{line: 1019, col: 18, offset: 36685}, name: "DoubleQuoteMonospaceText", }, &ruleRefExpr{ - pos: position{line: 1033, col: 45, offset: 36892}, + pos: position{line: 1019, col: 45, offset: 36712}, name: "SingleQuoteMonospaceText", }, }, @@ -7741,38 +6956,41 @@ var g = &grammar{ }, { name: "DoubleQuoteMonospaceText", - pos: position{line: 1035, col: 1, offset: 36918}, + pos: position{line: 1021, col: 1, offset: 36738}, expr: &actionExpr{ - pos: position{line: 1035, col: 29, offset: 36946}, + pos: position{line: 1021, col: 29, offset: 36766}, run: (*parser).callonDoubleQuoteMonospaceText1, expr: &seqExpr{ - pos: position{line: 1035, col: 29, offset: 36946}, + pos: position{line: 1021, col: 29, offset: 36766}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1035, col: 29, offset: 36946}, + pos: position{line: 1021, col: 29, offset: 36766}, expr: &litMatcher{ - pos: position{line: 1035, col: 30, offset: 36947}, + pos: position{line: 1021, col: 30, offset: 36767}, val: "\\\\", ignoreCase: false, + want: "\"\\\\\\\\\"", }, }, &litMatcher{ - pos: position{line: 1035, col: 35, offset: 36952}, + pos: position{line: 1021, col: 35, offset: 36772}, val: "``", ignoreCase: false, + want: "\"``\"", }, &labeledExpr{ - pos: position{line: 1035, col: 40, offset: 36957}, + pos: position{line: 1021, col: 40, offset: 36777}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1035, col: 50, offset: 36967}, + pos: position{line: 1021, col: 50, offset: 36787}, name: "DoubleQuoteMonospaceTextElements", }, }, &litMatcher{ - pos: position{line: 1035, col: 84, offset: 37001}, + pos: position{line: 1021, col: 84, offset: 36821}, val: "``", ignoreCase: false, + want: "\"``\"", }, }, }, @@ -7780,36 +6998,37 @@ var g = &grammar{ }, { name: "DoubleQuoteMonospaceTextElements", - pos: position{line: 1039, col: 1, offset: 37131}, + pos: position{line: 1025, col: 1, offset: 36951}, expr: &seqExpr{ - pos: position{line: 1039, col: 37, offset: 37167}, + pos: position{line: 1025, col: 37, offset: 36987}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1039, col: 37, offset: 37167}, + pos: position{line: 1025, col: 37, offset: 36987}, name: "DoubleQuoteMonospaceTextElement", }, &zeroOrMoreExpr{ - pos: position{line: 1039, col: 69, offset: 37199}, + pos: position{line: 1025, col: 69, offset: 37019}, expr: &seqExpr{ - pos: position{line: 1039, col: 70, offset: 37200}, + pos: position{line: 1025, col: 70, offset: 37020}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1039, col: 70, offset: 37200}, + pos: position{line: 1025, col: 70, offset: 37020}, expr: &litMatcher{ - pos: position{line: 1039, col: 72, offset: 37202}, + pos: position{line: 1025, col: 72, offset: 37022}, val: "``", ignoreCase: false, + want: "\"``\"", }, }, &choiceExpr{ - pos: position{line: 1039, col: 79, offset: 37209}, + pos: position{line: 1025, col: 79, offset: 37029}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1039, col: 79, offset: 37209}, - name: "WS", + pos: position{line: 1025, col: 79, offset: 37029}, + name: "Space", }, &ruleRefExpr{ - pos: position{line: 1039, col: 84, offset: 37214}, + pos: position{line: 1025, col: 87, offset: 37037}, name: "DoubleQuoteMonospaceTextElement", }, }, @@ -7822,150 +7041,117 @@ var g = &grammar{ }, { name: "DoubleQuoteMonospaceTextElement", - pos: position{line: 1041, col: 1, offset: 37283}, - expr: &actionExpr{ - pos: position{line: 1041, col: 36, offset: 37318}, - run: (*parser).callonDoubleQuoteMonospaceTextElement1, - expr: &seqExpr{ - pos: position{line: 1041, col: 36, offset: 37318}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1041, col: 36, offset: 37318}, - expr: &ruleRefExpr{ - pos: position{line: 1041, col: 37, offset: 37319}, - name: "Newline", - }, - }, - &labeledExpr{ - pos: position{line: 1041, col: 45, offset: 37327}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 1041, col: 54, offset: 37336}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1041, col: 54, offset: 37336}, - name: "SimpleWord", - }, - &ruleRefExpr{ - pos: position{line: 1042, col: 11, offset: 37358}, - name: "SingleQuoteMonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1043, col: 11, offset: 37394}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 1044, col: 11, offset: 37413}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1045, col: 11, offset: 37435}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1046, col: 11, offset: 37459}, - name: "SuperscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1047, col: 11, offset: 37485}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 1048, col: 11, offset: 37508}, - name: "QuotedLink", - }, - &ruleRefExpr{ - pos: position{line: 1049, col: 11, offset: 37530}, - name: "Passthrough", - }, - &ruleRefExpr{ - pos: position{line: 1050, col: 11, offset: 37553}, - name: "NonDoubleQuoteMonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1051, col: 11, offset: 37591}, - name: "Parenthesis", - }, - &ruleRefExpr{ - pos: position{line: 1052, col: 11, offset: 37613}, - name: "AnyChars", - }, - &ruleRefExpr{ - pos: position{line: 1053, col: 11, offset: 37632}, - name: "AnyChar", - }, - }, - }, - }, + pos: position{line: 1027, col: 1, offset: 37106}, + expr: &choiceExpr{ + pos: position{line: 1027, col: 36, offset: 37141}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1027, col: 36, offset: 37141}, + name: "Word", }, - }, - }, - }, - { - name: "NonDoubleQuoteMonospaceText", - pos: position{line: 1057, col: 1, offset: 37774}, - expr: &actionExpr{ - pos: position{line: 1057, col: 32, offset: 37805}, - run: (*parser).callonNonDoubleQuoteMonospaceText1, - expr: &seqExpr{ - pos: position{line: 1057, col: 32, offset: 37805}, - exprs: []interface{}{ - &anyMatcher{ - line: 1057, col: 33, offset: 37806, - }, - &zeroOrMoreExpr{ - pos: position{line: 1057, col: 36, offset: 37809}, - expr: &seqExpr{ - pos: position{line: 1057, col: 37, offset: 37810}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1057, col: 37, offset: 37810}, - expr: &litMatcher{ - pos: position{line: 1057, col: 38, offset: 37811}, - val: "``", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1057, col: 43, offset: 37816}, - expr: &ruleRefExpr{ - pos: position{line: 1057, col: 44, offset: 37817}, - name: "WS", - }, - }, - ¬Expr{ - pos: position{line: 1057, col: 47, offset: 37820}, - expr: &litMatcher{ - pos: position{line: 1057, col: 48, offset: 37821}, - val: "^", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1057, col: 52, offset: 37825}, - expr: &litMatcher{ - pos: position{line: 1057, col: 53, offset: 37826}, - val: "~", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1057, col: 57, offset: 37830}, - expr: &ruleRefExpr{ - pos: position{line: 1057, col: 58, offset: 37831}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 1057, col: 66, offset: 37839}, - expr: &ruleRefExpr{ - pos: position{line: 1057, col: 67, offset: 37840}, - name: "Parenthesis", - }, - }, - &anyMatcher{ - line: 1057, col: 79, offset: 37852, - }, + &ruleRefExpr{ + pos: position{line: 1028, col: 11, offset: 37157}, + name: "SingleQuoteMonospaceText", + }, + &ruleRefExpr{ + pos: position{line: 1029, col: 11, offset: 37193}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 1030, col: 11, offset: 37212}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1031, col: 11, offset: 37234}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1032, col: 11, offset: 37258}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1033, col: 11, offset: 37284}, + name: "InlineImage", + }, + &ruleRefExpr{ + pos: position{line: 1034, col: 11, offset: 37307}, + name: "Link", + }, + &ruleRefExpr{ + pos: position{line: 1035, col: 11, offset: 37323}, + name: "Passthrough", + }, + &ruleRefExpr{ + pos: position{line: 1036, col: 11, offset: 37346}, + name: "DoubleQuoteMonospaceTextStringElement", + }, + &ruleRefExpr{ + pos: position{line: 1037, col: 11, offset: 37394}, + name: "DoubleQuoteMonospaceTextFallbackCharacter", + }, + }, + }, + }, + { + name: "DoubleQuoteMonospaceTextStringElement", + pos: position{line: 1039, col: 1, offset: 37437}, + expr: &actionExpr{ + pos: position{line: 1039, col: 42, offset: 37478}, + run: (*parser).callonDoubleQuoteMonospaceTextStringElement1, + expr: &oneOrMoreExpr{ + pos: position{line: 1039, col: 42, offset: 37478}, + expr: &seqExpr{ + pos: position{line: 1039, col: 43, offset: 37479}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1039, col: 43, offset: 37479}, + expr: &litMatcher{ + pos: position{line: 1039, col: 44, offset: 37480}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + }, + &charClassMatcher{ + pos: position{line: 1039, col: 49, offset: 37485}, + val: "[^\\r\\n ^~{}]", + chars: []rune{'\r', '\n', ' ', '^', '~', '{', '}'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, + }, + }, + { + name: "DoubleQuoteMonospaceTextFallbackCharacter", + pos: position{line: 1043, col: 1, offset: 37556}, + expr: &choiceExpr{ + pos: position{line: 1044, col: 5, offset: 37606}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 1044, col: 5, offset: 37606}, + val: "[^\\r\\n`]", + chars: []rune{'\r', '\n', '`'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 1045, col: 7, offset: 37708}, + run: (*parser).callonDoubleQuoteMonospaceTextFallbackCharacter3, + expr: &seqExpr{ + pos: position{line: 1045, col: 7, offset: 37708}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1045, col: 7, offset: 37708}, + val: "``", + ignoreCase: false, + want: "\"``\"", + }, + &ruleRefExpr{ + pos: position{line: 1045, col: 12, offset: 37713}, + name: "Alphanums", }, }, }, @@ -7975,94 +7161,107 @@ var g = &grammar{ }, { name: "SingleQuoteMonospaceText", - pos: position{line: 1061, col: 1, offset: 37912}, + pos: position{line: 1049, col: 1, offset: 37881}, expr: &choiceExpr{ - pos: position{line: 1061, col: 29, offset: 37940}, + pos: position{line: 1049, col: 29, offset: 37909}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1061, col: 29, offset: 37940}, + pos: position{line: 1049, col: 29, offset: 37909}, run: (*parser).callonSingleQuoteMonospaceText2, expr: &seqExpr{ - pos: position{line: 1061, col: 29, offset: 37940}, + pos: position{line: 1049, col: 29, offset: 37909}, exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1061, col: 29, offset: 37940}, - expr: &litMatcher{ - pos: position{line: 1061, col: 30, offset: 37941}, - val: "\\", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1061, col: 34, offset: 37945}, - expr: &litMatcher{ - pos: position{line: 1061, col: 35, offset: 37946}, - val: "``", - ignoreCase: false, + &seqExpr{ + pos: position{line: 1049, col: 30, offset: 37910}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1049, col: 30, offset: 37910}, + expr: &litMatcher{ + pos: position{line: 1049, col: 31, offset: 37911}, + val: "\\", + ignoreCase: false, + want: "\"\\\\\"", + }, + }, + &litMatcher{ + pos: position{line: 1049, col: 35, offset: 37915}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + ¬Expr{ + pos: position{line: 1049, col: 39, offset: 37919}, + expr: &litMatcher{ + pos: position{line: 1049, col: 40, offset: 37920}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + }, }, }, - &litMatcher{ - pos: position{line: 1061, col: 40, offset: 37951}, - val: "`", - ignoreCase: false, - }, &labeledExpr{ - pos: position{line: 1061, col: 44, offset: 37955}, + pos: position{line: 1049, col: 45, offset: 37925}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1061, col: 54, offset: 37965}, + pos: position{line: 1049, col: 55, offset: 37935}, name: "SingleQuoteMonospaceTextElements", }, }, &litMatcher{ - pos: position{line: 1061, col: 88, offset: 37999}, + pos: position{line: 1049, col: 89, offset: 37969}, val: "`", ignoreCase: false, + want: "\"`\"", }, }, }, }, &actionExpr{ - pos: position{line: 1063, col: 5, offset: 38185}, - run: (*parser).callonSingleQuoteMonospaceText12, + pos: position{line: 1051, col: 5, offset: 38155}, + run: (*parser).callonSingleQuoteMonospaceText13, expr: &seqExpr{ - pos: position{line: 1063, col: 5, offset: 38185}, + pos: position{line: 1051, col: 5, offset: 38155}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1063, col: 5, offset: 38185}, + pos: position{line: 1051, col: 5, offset: 38155}, expr: &litMatcher{ - pos: position{line: 1063, col: 6, offset: 38186}, + pos: position{line: 1051, col: 6, offset: 38156}, val: "\\\\", ignoreCase: false, + want: "\"\\\\\\\\\"", }, }, &litMatcher{ - pos: position{line: 1063, col: 11, offset: 38191}, + pos: position{line: 1051, col: 11, offset: 38161}, val: "`", ignoreCase: false, + want: "\"`\"", }, &labeledExpr{ - pos: position{line: 1063, col: 15, offset: 38195}, + pos: position{line: 1051, col: 15, offset: 38165}, label: "elements", expr: &seqExpr{ - pos: position{line: 1063, col: 25, offset: 38205}, + pos: position{line: 1051, col: 25, offset: 38175}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1063, col: 25, offset: 38205}, + pos: position{line: 1051, col: 25, offset: 38175}, val: "`", ignoreCase: false, + want: "\"`\"", }, &ruleRefExpr{ - pos: position{line: 1063, col: 29, offset: 38209}, + pos: position{line: 1051, col: 29, offset: 38179}, name: "SingleQuoteMonospaceTextElements", }, }, }, }, &litMatcher{ - pos: position{line: 1063, col: 63, offset: 38243}, + pos: position{line: 1051, col: 63, offset: 38213}, val: "`", ignoreCase: false, + want: "\"`\"", }, }, }, @@ -8072,201 +7271,169 @@ var g = &grammar{ }, { name: "SingleQuoteMonospaceTextElements", - pos: position{line: 1067, col: 1, offset: 38452}, + pos: position{line: 1055, col: 1, offset: 38422}, expr: &seqExpr{ - pos: position{line: 1067, col: 37, offset: 38488}, + pos: position{line: 1055, col: 37, offset: 38458}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1067, col: 37, offset: 38488}, + pos: position{line: 1055, col: 37, offset: 38458}, + expr: &ruleRefExpr{ + pos: position{line: 1055, col: 38, offset: 38459}, + name: "Space", + }, + }, + &oneOrMoreExpr{ + pos: position{line: 1055, col: 44, offset: 38465}, expr: &ruleRefExpr{ - pos: position{line: 1067, col: 38, offset: 38489}, - name: "WS", + pos: position{line: 1055, col: 44, offset: 38465}, + name: "SingleQuoteMonospaceTextElement", }, }, + }, + }, + }, + { + name: "SingleQuoteMonospaceTextElement", + pos: position{line: 1057, col: 1, offset: 38499}, + expr: &choiceExpr{ + pos: position{line: 1057, col: 37, offset: 38535}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1057, col: 37, offset: 38535}, + name: "Word", + }, &ruleRefExpr{ - pos: position{line: 1067, col: 41, offset: 38492}, - name: "SingleQuoteMonospaceTextElement", + pos: position{line: 1058, col: 11, offset: 38551}, + name: "DoubleQuoteMonospaceText", }, - &zeroOrMoreExpr{ - pos: position{line: 1067, col: 73, offset: 38524}, - expr: &seqExpr{ - pos: position{line: 1067, col: 74, offset: 38525}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1067, col: 74, offset: 38525}, - expr: &seqExpr{ - pos: position{line: 1067, col: 76, offset: 38527}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1067, col: 76, offset: 38527}, + &seqExpr{ + pos: position{line: 1059, col: 11, offset: 38587}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1059, col: 11, offset: 38587}, + expr: &ruleRefExpr{ + pos: position{line: 1059, col: 11, offset: 38587}, + name: "Space", + }, + }, + &zeroOrOneExpr{ + pos: position{line: 1059, col: 18, offset: 38594}, + expr: &seqExpr{ + pos: position{line: 1059, col: 19, offset: 38595}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1059, col: 19, offset: 38595}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + ¬Expr{ + pos: position{line: 1059, col: 23, offset: 38599}, + expr: &litMatcher{ + pos: position{line: 1059, col: 24, offset: 38600}, val: "`", ignoreCase: false, - }, - ¬Expr{ - pos: position{line: 1067, col: 80, offset: 38531}, - expr: &ruleRefExpr{ - pos: position{line: 1067, col: 81, offset: 38532}, - name: "Alphanum", - }, + want: "\"`\"", }, }, }, }, - &zeroOrMoreExpr{ - pos: position{line: 1067, col: 91, offset: 38542}, - expr: &ruleRefExpr{ - pos: position{line: 1067, col: 91, offset: 38542}, - name: "WS", - }, - }, - &ruleRefExpr{ - pos: position{line: 1067, col: 95, offset: 38546}, - name: "SingleQuoteMonospaceTextElement", - }, }, }, }, + &ruleRefExpr{ + pos: position{line: 1060, col: 11, offset: 38728}, + name: "Newline", + }, + &ruleRefExpr{ + pos: position{line: 1061, col: 11, offset: 38766}, + name: "BoldText", + }, + &ruleRefExpr{ + pos: position{line: 1062, col: 11, offset: 38785}, + name: "ItalicText", + }, + &ruleRefExpr{ + pos: position{line: 1063, col: 11, offset: 38806}, + name: "SubscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1064, col: 11, offset: 38830}, + name: "SuperscriptText", + }, + &ruleRefExpr{ + pos: position{line: 1065, col: 11, offset: 38856}, + name: "InlineImage", + }, + &ruleRefExpr{ + pos: position{line: 1066, col: 11, offset: 38879}, + name: "Link", + }, + &ruleRefExpr{ + pos: position{line: 1067, col: 11, offset: 38895}, + name: "Passthrough", + }, + &ruleRefExpr{ + pos: position{line: 1068, col: 11, offset: 38918}, + name: "DocumentAttributeSubstitution", + }, + &ruleRefExpr{ + pos: position{line: 1069, col: 11, offset: 38958}, + name: "SingleQuoteMonospaceTextStringElement", + }, + &ruleRefExpr{ + pos: position{line: 1070, col: 11, offset: 39006}, + name: "SingleQuoteMonospaceTextFallbackCharacter", + }, }, }, }, { - name: "SingleQuoteMonospaceTextElement", - pos: position{line: 1069, col: 1, offset: 38581}, + name: "SingleQuoteMonospaceTextStringElement", + pos: position{line: 1072, col: 1, offset: 39049}, expr: &actionExpr{ - pos: position{line: 1069, col: 37, offset: 38617}, - run: (*parser).callonSingleQuoteMonospaceTextElement1, - expr: &labeledExpr{ - pos: position{line: 1069, col: 37, offset: 38617}, - label: "element", - expr: &choiceExpr{ - pos: position{line: 1069, col: 46, offset: 38626}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1069, col: 46, offset: 38626}, - name: "SimpleWord", - }, - &ruleRefExpr{ - pos: position{line: 1070, col: 11, offset: 38648}, - name: "Newline", - }, - &ruleRefExpr{ - pos: position{line: 1071, col: 11, offset: 38686}, - name: "DoubleQuoteMonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1072, col: 11, offset: 38722}, - name: "BoldText", - }, - &ruleRefExpr{ - pos: position{line: 1073, col: 11, offset: 38741}, - name: "ItalicText", - }, - &ruleRefExpr{ - pos: position{line: 1074, col: 11, offset: 38762}, - name: "SubscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1075, col: 11, offset: 38786}, - name: "SuperscriptText", - }, - &ruleRefExpr{ - pos: position{line: 1076, col: 11, offset: 38812}, - name: "InlineImage", - }, - &ruleRefExpr{ - pos: position{line: 1077, col: 11, offset: 38835}, - name: "QuotedLink", - }, - &ruleRefExpr{ - pos: position{line: 1078, col: 11, offset: 38857}, - name: "Passthrough", - }, - &ruleRefExpr{ - pos: position{line: 1079, col: 11, offset: 38880}, - name: "NonSingleQuoteMonospaceText", - }, - &ruleRefExpr{ - pos: position{line: 1080, col: 11, offset: 38918}, - name: "Parenthesis", - }, - &ruleRefExpr{ - pos: position{line: 1081, col: 11, offset: 38940}, - name: "AnyChars", - }, - &ruleRefExpr{ - pos: position{line: 1082, col: 11, offset: 38959}, - name: "AnyChar", - }, - }, + pos: position{line: 1072, col: 42, offset: 39090}, + run: (*parser).callonSingleQuoteMonospaceTextStringElement1, + expr: &oneOrMoreExpr{ + pos: position{line: 1072, col: 42, offset: 39090}, + expr: &charClassMatcher{ + pos: position{line: 1072, col: 42, offset: 39090}, + val: "[^\\r\\n {}`^~]", + chars: []rune{'\r', '\n', ' ', '{', '}', '`', '^', '~'}, + ignoreCase: false, + inverted: true, }, }, }, }, { - name: "NonSingleQuoteMonospaceText", - pos: position{line: 1086, col: 1, offset: 39101}, - expr: &actionExpr{ - pos: position{line: 1086, col: 32, offset: 39132}, - run: (*parser).callonNonSingleQuoteMonospaceText1, - expr: &seqExpr{ - pos: position{line: 1086, col: 32, offset: 39132}, - exprs: []interface{}{ - &anyMatcher{ - line: 1086, col: 33, offset: 39133, - }, - &zeroOrMoreExpr{ - pos: position{line: 1086, col: 36, offset: 39136}, - expr: &seqExpr{ - pos: position{line: 1086, col: 37, offset: 39137}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1086, col: 37, offset: 39137}, - expr: &ruleRefExpr{ - pos: position{line: 1086, col: 38, offset: 39138}, - name: "WS", - }, - }, - ¬Expr{ - pos: position{line: 1086, col: 41, offset: 39141}, - expr: &litMatcher{ - pos: position{line: 1086, col: 42, offset: 39142}, - val: "`", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1086, col: 46, offset: 39146}, - expr: &litMatcher{ - pos: position{line: 1086, col: 47, offset: 39147}, - val: "^", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1086, col: 51, offset: 39151}, - expr: &litMatcher{ - pos: position{line: 1086, col: 52, offset: 39152}, - val: "~", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1086, col: 56, offset: 39156}, - expr: &ruleRefExpr{ - pos: position{line: 1086, col: 57, offset: 39157}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 1086, col: 65, offset: 39165}, - expr: &ruleRefExpr{ - pos: position{line: 1086, col: 66, offset: 39166}, - name: "Parenthesis", - }, - }, - &anyMatcher{ - line: 1086, col: 78, offset: 39178, - }, + name: "SingleQuoteMonospaceTextFallbackCharacter", + pos: position{line: 1076, col: 1, offset: 39316}, + expr: &choiceExpr{ + pos: position{line: 1077, col: 5, offset: 39366}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 1077, col: 5, offset: 39366}, + val: "[^\\r\\n`]", + chars: []rune{'\r', '\n', '`'}, + ignoreCase: false, + inverted: true, + }, + &actionExpr{ + pos: position{line: 1078, col: 7, offset: 39468}, + run: (*parser).callonSingleQuoteMonospaceTextFallbackCharacter3, + expr: &seqExpr{ + pos: position{line: 1078, col: 7, offset: 39468}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1078, col: 7, offset: 39468}, + val: "`", + ignoreCase: false, + want: "\"`\"", + }, + &ruleRefExpr{ + pos: position{line: 1078, col: 11, offset: 39472}, + name: "Alphanums", }, }, }, @@ -8276,111 +7443,117 @@ var g = &grammar{ }, { name: "EscapedMonospaceText", - pos: position{line: 1090, col: 1, offset: 39259}, + pos: position{line: 1082, col: 1, offset: 39641}, expr: &choiceExpr{ - pos: position{line: 1091, col: 5, offset: 39288}, + pos: position{line: 1083, col: 5, offset: 39670}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1091, col: 5, offset: 39288}, + pos: position{line: 1083, col: 5, offset: 39670}, run: (*parser).callonEscapedMonospaceText2, expr: &seqExpr{ - pos: position{line: 1091, col: 5, offset: 39288}, + pos: position{line: 1083, col: 5, offset: 39670}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1091, col: 5, offset: 39288}, + pos: position{line: 1083, col: 5, offset: 39670}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1091, col: 18, offset: 39301}, + pos: position{line: 1083, col: 18, offset: 39683}, name: "TwoOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1091, col: 40, offset: 39323}, + pos: position{line: 1083, col: 40, offset: 39705}, val: "``", ignoreCase: false, + want: "\"``\"", }, &labeledExpr{ - pos: position{line: 1091, col: 45, offset: 39328}, + pos: position{line: 1083, col: 45, offset: 39710}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1091, col: 55, offset: 39338}, + pos: position{line: 1083, col: 55, offset: 39720}, name: "DoubleQuoteMonospaceTextElements", }, }, &litMatcher{ - pos: position{line: 1091, col: 89, offset: 39372}, + pos: position{line: 1083, col: 89, offset: 39754}, val: "``", ignoreCase: false, + want: "\"``\"", }, }, }, }, &actionExpr{ - pos: position{line: 1093, col: 9, offset: 39529}, + pos: position{line: 1085, col: 9, offset: 39911}, run: (*parser).callonEscapedMonospaceText10, expr: &seqExpr{ - pos: position{line: 1093, col: 9, offset: 39529}, + pos: position{line: 1085, col: 9, offset: 39911}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1093, col: 9, offset: 39529}, + pos: position{line: 1085, col: 9, offset: 39911}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1093, col: 22, offset: 39542}, + pos: position{line: 1085, col: 22, offset: 39924}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1093, col: 44, offset: 39564}, + pos: position{line: 1085, col: 44, offset: 39946}, val: "``", ignoreCase: false, + want: "\"``\"", }, &labeledExpr{ - pos: position{line: 1093, col: 49, offset: 39569}, + pos: position{line: 1085, col: 49, offset: 39951}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1093, col: 59, offset: 39579}, + pos: position{line: 1085, col: 59, offset: 39961}, name: "SingleQuoteMonospaceTextElements", }, }, &litMatcher{ - pos: position{line: 1093, col: 93, offset: 39613}, + pos: position{line: 1085, col: 93, offset: 39995}, val: "`", ignoreCase: false, + want: "\"`\"", }, }, }, }, &actionExpr{ - pos: position{line: 1096, col: 9, offset: 39813}, + pos: position{line: 1088, col: 9, offset: 40195}, run: (*parser).callonEscapedMonospaceText18, expr: &seqExpr{ - pos: position{line: 1096, col: 9, offset: 39813}, + pos: position{line: 1088, col: 9, offset: 40195}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1096, col: 9, offset: 39813}, + pos: position{line: 1088, col: 9, offset: 40195}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1096, col: 22, offset: 39826}, + pos: position{line: 1088, col: 22, offset: 40208}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1096, col: 44, offset: 39848}, + pos: position{line: 1088, col: 44, offset: 40230}, val: "`", ignoreCase: false, + want: "\"`\"", }, &labeledExpr{ - pos: position{line: 1096, col: 48, offset: 39852}, + pos: position{line: 1088, col: 48, offset: 40234}, label: "elements", expr: &ruleRefExpr{ - pos: position{line: 1096, col: 58, offset: 39862}, + pos: position{line: 1088, col: 58, offset: 40244}, name: "SingleQuoteMonospaceTextElements", }, }, &litMatcher{ - pos: position{line: 1096, col: 92, offset: 39896}, + pos: position{line: 1088, col: 92, offset: 40278}, val: "`", ignoreCase: false, + want: "\"`\"", }, }, }, @@ -8390,38 +7563,41 @@ var g = &grammar{ }, { name: "SubscriptText", - pos: position{line: 1100, col: 1, offset: 40046}, + pos: position{line: 1092, col: 1, offset: 40428}, expr: &actionExpr{ - pos: position{line: 1100, col: 18, offset: 40063}, + pos: position{line: 1092, col: 18, offset: 40445}, run: (*parser).callonSubscriptText1, expr: &seqExpr{ - pos: position{line: 1100, col: 18, offset: 40063}, + pos: position{line: 1092, col: 18, offset: 40445}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1100, col: 18, offset: 40063}, + pos: position{line: 1092, col: 18, offset: 40445}, expr: &litMatcher{ - pos: position{line: 1100, col: 19, offset: 40064}, + pos: position{line: 1092, col: 19, offset: 40446}, val: "\\", ignoreCase: false, + want: "\"\\\\\"", }, }, &litMatcher{ - pos: position{line: 1100, col: 23, offset: 40068}, + pos: position{line: 1092, col: 23, offset: 40450}, val: "~", ignoreCase: false, + want: "\"~\"", }, &labeledExpr{ - pos: position{line: 1100, col: 27, offset: 40072}, + pos: position{line: 1092, col: 27, offset: 40454}, label: "element", expr: &ruleRefExpr{ - pos: position{line: 1100, col: 36, offset: 40081}, + pos: position{line: 1092, col: 36, offset: 40463}, name: "SubscriptTextElement", }, }, &litMatcher{ - pos: position{line: 1100, col: 58, offset: 40103}, + pos: position{line: 1092, col: 58, offset: 40485}, val: "~", ignoreCase: false, + want: "\"~\"", }, }, }, @@ -8429,96 +7605,75 @@ var g = &grammar{ }, { name: "SubscriptTextElement", - pos: position{line: 1104, col: 1, offset: 40192}, + pos: position{line: 1096, col: 1, offset: 40574}, expr: &choiceExpr{ - pos: position{line: 1104, col: 25, offset: 40216}, + pos: position{line: 1096, col: 25, offset: 40598}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1104, col: 25, offset: 40216}, + pos: position{line: 1096, col: 25, offset: 40598}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 1104, col: 38, offset: 40229}, + pos: position{line: 1096, col: 38, offset: 40611}, name: "NonSubscriptText", }, }, }, - }, - { - name: "NonSubscriptText", - pos: position{line: 1106, col: 1, offset: 40248}, - expr: &actionExpr{ - pos: position{line: 1106, col: 21, offset: 40268}, - run: (*parser).callonNonSubscriptText1, - expr: &oneOrMoreExpr{ - pos: position{line: 1106, col: 21, offset: 40268}, - expr: &seqExpr{ - pos: position{line: 1106, col: 22, offset: 40269}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1106, col: 22, offset: 40269}, - expr: &ruleRefExpr{ - pos: position{line: 1106, col: 23, offset: 40270}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 1106, col: 31, offset: 40278}, - expr: &ruleRefExpr{ - pos: position{line: 1106, col: 32, offset: 40279}, - name: "WS", - }, - }, - ¬Expr{ - pos: position{line: 1106, col: 35, offset: 40282}, - expr: &litMatcher{ - pos: position{line: 1106, col: 36, offset: 40283}, - val: "~", - ignoreCase: false, - }, - }, - &anyMatcher{ - line: 1106, col: 40, offset: 40287, - }, - }, + }, + { + name: "NonSubscriptText", + pos: position{line: 1098, col: 1, offset: 40630}, + expr: &actionExpr{ + pos: position{line: 1098, col: 21, offset: 40650}, + run: (*parser).callonNonSubscriptText1, + expr: &oneOrMoreExpr{ + pos: position{line: 1098, col: 21, offset: 40650}, + expr: &charClassMatcher{ + pos: position{line: 1098, col: 21, offset: 40650}, + val: "[^\\r\\n ~]", + chars: []rune{'\r', '\n', ' ', '~'}, + ignoreCase: false, + inverted: true, }, }, }, }, { name: "EscapedSubscriptText", - pos: position{line: 1110, col: 1, offset: 40320}, + pos: position{line: 1102, col: 1, offset: 40727}, expr: &actionExpr{ - pos: position{line: 1110, col: 25, offset: 40344}, + pos: position{line: 1102, col: 25, offset: 40751}, run: (*parser).callonEscapedSubscriptText1, expr: &seqExpr{ - pos: position{line: 1110, col: 25, offset: 40344}, + pos: position{line: 1102, col: 25, offset: 40751}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1110, col: 25, offset: 40344}, + pos: position{line: 1102, col: 25, offset: 40751}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1110, col: 38, offset: 40357}, + pos: position{line: 1102, col: 38, offset: 40764}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1110, col: 60, offset: 40379}, + pos: position{line: 1102, col: 60, offset: 40786}, val: "~", ignoreCase: false, + want: "\"~\"", }, &labeledExpr{ - pos: position{line: 1110, col: 64, offset: 40383}, + pos: position{line: 1102, col: 64, offset: 40790}, label: "element", expr: &ruleRefExpr{ - pos: position{line: 1110, col: 73, offset: 40392}, + pos: position{line: 1102, col: 73, offset: 40799}, name: "SubscriptTextElement", }, }, &litMatcher{ - pos: position{line: 1110, col: 95, offset: 40414}, + pos: position{line: 1102, col: 95, offset: 40821}, val: "~", ignoreCase: false, + want: "\"~\"", }, }, }, @@ -8526,38 +7681,41 @@ var g = &grammar{ }, { name: "SuperscriptText", - pos: position{line: 1114, col: 1, offset: 40543}, + pos: position{line: 1106, col: 1, offset: 40950}, expr: &actionExpr{ - pos: position{line: 1114, col: 20, offset: 40562}, + pos: position{line: 1106, col: 20, offset: 40969}, run: (*parser).callonSuperscriptText1, expr: &seqExpr{ - pos: position{line: 1114, col: 20, offset: 40562}, + pos: position{line: 1106, col: 20, offset: 40969}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1114, col: 20, offset: 40562}, + pos: position{line: 1106, col: 20, offset: 40969}, expr: &litMatcher{ - pos: position{line: 1114, col: 21, offset: 40563}, + pos: position{line: 1106, col: 21, offset: 40970}, val: "\\", ignoreCase: false, + want: "\"\\\\\"", }, }, &litMatcher{ - pos: position{line: 1114, col: 25, offset: 40567}, + pos: position{line: 1106, col: 25, offset: 40974}, val: "^", ignoreCase: false, + want: "\"^\"", }, &labeledExpr{ - pos: position{line: 1114, col: 29, offset: 40571}, + pos: position{line: 1106, col: 29, offset: 40978}, label: "element", expr: &ruleRefExpr{ - pos: position{line: 1114, col: 38, offset: 40580}, + pos: position{line: 1106, col: 38, offset: 40987}, name: "SuperscriptTextElement", }, }, &litMatcher{ - pos: position{line: 1114, col: 62, offset: 40604}, + pos: position{line: 1106, col: 62, offset: 41011}, val: "^", ignoreCase: false, + want: "\"^\"", }, }, }, @@ -8565,16 +7723,16 @@ var g = &grammar{ }, { name: "SuperscriptTextElement", - pos: position{line: 1118, col: 1, offset: 40695}, + pos: position{line: 1110, col: 1, offset: 41102}, expr: &choiceExpr{ - pos: position{line: 1118, col: 27, offset: 40721}, + pos: position{line: 1110, col: 27, offset: 41128}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1118, col: 27, offset: 40721}, + pos: position{line: 1110, col: 27, offset: 41128}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 1118, col: 40, offset: 40734}, + pos: position{line: 1110, col: 40, offset: 41141}, name: "NonSuperscriptText", }, }, @@ -8582,79 +7740,58 @@ var g = &grammar{ }, { name: "NonSuperscriptText", - pos: position{line: 1120, col: 1, offset: 40755}, + pos: position{line: 1112, col: 1, offset: 41162}, expr: &actionExpr{ - pos: position{line: 1120, col: 23, offset: 40777}, + pos: position{line: 1112, col: 23, offset: 41184}, run: (*parser).callonNonSuperscriptText1, expr: &oneOrMoreExpr{ - pos: position{line: 1120, col: 23, offset: 40777}, - expr: &seqExpr{ - pos: position{line: 1120, col: 24, offset: 40778}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1120, col: 24, offset: 40778}, - expr: &ruleRefExpr{ - pos: position{line: 1120, col: 25, offset: 40779}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 1120, col: 33, offset: 40787}, - expr: &ruleRefExpr{ - pos: position{line: 1120, col: 34, offset: 40788}, - name: "WS", - }, - }, - ¬Expr{ - pos: position{line: 1120, col: 37, offset: 40791}, - expr: &litMatcher{ - pos: position{line: 1120, col: 38, offset: 40792}, - val: "^", - ignoreCase: false, - }, - }, - &anyMatcher{ - line: 1120, col: 42, offset: 40796, - }, - }, + pos: position{line: 1112, col: 23, offset: 41184}, + expr: &charClassMatcher{ + pos: position{line: 1112, col: 23, offset: 41184}, + val: "[^\\r\\n ^]", + chars: []rune{'\r', '\n', ' ', '^'}, + ignoreCase: false, + inverted: true, }, }, }, }, { name: "EscapedSuperscriptText", - pos: position{line: 1124, col: 1, offset: 40829}, + pos: position{line: 1116, col: 1, offset: 41261}, expr: &actionExpr{ - pos: position{line: 1124, col: 27, offset: 40855}, + pos: position{line: 1116, col: 27, offset: 41287}, run: (*parser).callonEscapedSuperscriptText1, expr: &seqExpr{ - pos: position{line: 1124, col: 27, offset: 40855}, + pos: position{line: 1116, col: 27, offset: 41287}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1124, col: 27, offset: 40855}, + pos: position{line: 1116, col: 27, offset: 41287}, label: "backslashes", expr: &ruleRefExpr{ - pos: position{line: 1124, col: 40, offset: 40868}, + pos: position{line: 1116, col: 40, offset: 41300}, name: "OneOrMoreBackslashes", }, }, &litMatcher{ - pos: position{line: 1124, col: 62, offset: 40890}, + pos: position{line: 1116, col: 62, offset: 41322}, val: "^", ignoreCase: false, + want: "\"^\"", }, &labeledExpr{ - pos: position{line: 1124, col: 66, offset: 40894}, + pos: position{line: 1116, col: 66, offset: 41326}, label: "element", expr: &ruleRefExpr{ - pos: position{line: 1124, col: 75, offset: 40903}, + pos: position{line: 1116, col: 75, offset: 41335}, name: "SuperscriptTextElement", }, }, &litMatcher{ - pos: position{line: 1124, col: 99, offset: 40927}, + pos: position{line: 1116, col: 99, offset: 41359}, val: "^", ignoreCase: false, + want: "\"^\"", }, }, }, @@ -8662,20 +7799,20 @@ var g = &grammar{ }, { name: "Passthrough", - pos: position{line: 1131, col: 1, offset: 41163}, + pos: position{line: 1123, col: 1, offset: 41595}, expr: &choiceExpr{ - pos: position{line: 1131, col: 16, offset: 41178}, + pos: position{line: 1123, col: 16, offset: 41610}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1131, col: 16, offset: 41178}, + pos: position{line: 1123, col: 16, offset: 41610}, name: "TriplePlusPassthrough", }, &ruleRefExpr{ - pos: position{line: 1131, col: 40, offset: 41202}, + pos: position{line: 1123, col: 40, offset: 41634}, name: "SinglePlusPassthrough", }, &ruleRefExpr{ - pos: position{line: 1131, col: 64, offset: 41226}, + pos: position{line: 1123, col: 64, offset: 41658}, name: "PassthroughMacro", }, }, @@ -8683,42 +7820,43 @@ var g = &grammar{ }, { name: "SinglePlusPassthroughPrefix", - pos: position{line: 1133, col: 1, offset: 41244}, + pos: position{line: 1125, col: 1, offset: 41676}, expr: &litMatcher{ - pos: position{line: 1133, col: 32, offset: 41275}, + pos: position{line: 1125, col: 32, offset: 41707}, val: "+", ignoreCase: false, + want: "\"+\"", }, }, { name: "SinglePlusPassthrough", - pos: position{line: 1135, col: 1, offset: 41280}, + pos: position{line: 1127, col: 1, offset: 41712}, expr: &actionExpr{ - pos: position{line: 1135, col: 26, offset: 41305}, + pos: position{line: 1127, col: 26, offset: 41737}, run: (*parser).callonSinglePlusPassthrough1, expr: &seqExpr{ - pos: position{line: 1135, col: 26, offset: 41305}, + pos: position{line: 1127, col: 26, offset: 41737}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1135, col: 26, offset: 41305}, + pos: position{line: 1127, col: 26, offset: 41737}, name: "SinglePlusPassthroughPrefix", }, &labeledExpr{ - pos: position{line: 1135, col: 54, offset: 41333}, + pos: position{line: 1127, col: 54, offset: 41765}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1135, col: 63, offset: 41342}, + pos: position{line: 1127, col: 63, offset: 41774}, name: "SinglePlusPassthroughContent", }, }, &ruleRefExpr{ - pos: position{line: 1135, col: 93, offset: 41372}, + pos: position{line: 1127, col: 93, offset: 41804}, name: "SinglePlusPassthroughPrefix", }, ¬Expr{ - pos: position{line: 1135, col: 121, offset: 41400}, + pos: position{line: 1127, col: 121, offset: 41832}, expr: &ruleRefExpr{ - pos: position{line: 1135, col: 122, offset: 41401}, + pos: position{line: 1127, col: 122, offset: 41833}, name: "Alphanum", }, }, @@ -8728,85 +7866,85 @@ var g = &grammar{ }, { name: "SinglePlusPassthroughContent", - pos: position{line: 1139, col: 1, offset: 41500}, + pos: position{line: 1131, col: 1, offset: 41932}, expr: &choiceExpr{ - pos: position{line: 1139, col: 33, offset: 41532}, + pos: position{line: 1131, col: 33, offset: 41964}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1139, col: 34, offset: 41533}, + pos: position{line: 1131, col: 34, offset: 41965}, run: (*parser).callonSinglePlusPassthroughContent2, expr: &seqExpr{ - pos: position{line: 1139, col: 34, offset: 41533}, + pos: position{line: 1131, col: 34, offset: 41965}, exprs: []interface{}{ &seqExpr{ - pos: position{line: 1139, col: 35, offset: 41534}, + pos: position{line: 1131, col: 35, offset: 41966}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1139, col: 35, offset: 41534}, + pos: position{line: 1131, col: 35, offset: 41966}, expr: &ruleRefExpr{ - pos: position{line: 1139, col: 36, offset: 41535}, + pos: position{line: 1131, col: 36, offset: 41967}, name: "SinglePlusPassthroughPrefix", }, }, ¬Expr{ - pos: position{line: 1139, col: 64, offset: 41563}, + pos: position{line: 1131, col: 64, offset: 41995}, expr: &ruleRefExpr{ - pos: position{line: 1139, col: 65, offset: 41564}, - name: "WS", + pos: position{line: 1131, col: 65, offset: 41996}, + name: "Space", }, }, ¬Expr{ - pos: position{line: 1139, col: 68, offset: 41567}, + pos: position{line: 1131, col: 71, offset: 42002}, expr: &ruleRefExpr{ - pos: position{line: 1139, col: 69, offset: 41568}, + pos: position{line: 1131, col: 72, offset: 42003}, name: "Newline", }, }, &anyMatcher{ - line: 1139, col: 77, offset: 41576, + line: 1131, col: 80, offset: 42011, }, }, }, &zeroOrMoreExpr{ - pos: position{line: 1139, col: 80, offset: 41579}, + pos: position{line: 1131, col: 83, offset: 42014}, expr: &seqExpr{ - pos: position{line: 1139, col: 81, offset: 41580}, + pos: position{line: 1131, col: 84, offset: 42015}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1139, col: 81, offset: 41580}, + pos: position{line: 1131, col: 84, offset: 42015}, expr: &seqExpr{ - pos: position{line: 1139, col: 83, offset: 41582}, + pos: position{line: 1131, col: 86, offset: 42017}, exprs: []interface{}{ &oneOrMoreExpr{ - pos: position{line: 1139, col: 83, offset: 41582}, + pos: position{line: 1131, col: 86, offset: 42017}, expr: &ruleRefExpr{ - pos: position{line: 1139, col: 83, offset: 41582}, - name: "WS", + pos: position{line: 1131, col: 86, offset: 42017}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1139, col: 87, offset: 41586}, + pos: position{line: 1131, col: 93, offset: 42024}, name: "SinglePlusPassthroughPrefix", }, }, }, }, ¬Expr{ - pos: position{line: 1139, col: 116, offset: 41615}, + pos: position{line: 1131, col: 122, offset: 42053}, expr: &ruleRefExpr{ - pos: position{line: 1139, col: 117, offset: 41616}, + pos: position{line: 1131, col: 123, offset: 42054}, name: "SinglePlusPassthroughPrefix", }, }, ¬Expr{ - pos: position{line: 1139, col: 145, offset: 41644}, + pos: position{line: 1131, col: 151, offset: 42082}, expr: &ruleRefExpr{ - pos: position{line: 1139, col: 146, offset: 41645}, + pos: position{line: 1131, col: 152, offset: 42083}, name: "Newline", }, }, &anyMatcher{ - line: 1139, col: 154, offset: 41653, + line: 1131, col: 160, offset: 42091, }, }, }, @@ -8815,34 +7953,34 @@ var g = &grammar{ }, }, &actionExpr{ - pos: position{line: 1141, col: 7, offset: 41795}, + pos: position{line: 1133, col: 7, offset: 42233}, run: (*parser).callonSinglePlusPassthroughContent24, expr: &seqExpr{ - pos: position{line: 1141, col: 8, offset: 41796}, + pos: position{line: 1133, col: 8, offset: 42234}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1141, col: 8, offset: 41796}, + pos: position{line: 1133, col: 8, offset: 42234}, expr: &ruleRefExpr{ - pos: position{line: 1141, col: 9, offset: 41797}, - name: "WS", + pos: position{line: 1133, col: 9, offset: 42235}, + name: "Space", }, }, ¬Expr{ - pos: position{line: 1141, col: 12, offset: 41800}, + pos: position{line: 1133, col: 15, offset: 42241}, expr: &ruleRefExpr{ - pos: position{line: 1141, col: 13, offset: 41801}, + pos: position{line: 1133, col: 16, offset: 42242}, name: "Newline", }, }, ¬Expr{ - pos: position{line: 1141, col: 21, offset: 41809}, + pos: position{line: 1133, col: 24, offset: 42250}, expr: &ruleRefExpr{ - pos: position{line: 1141, col: 22, offset: 41810}, + pos: position{line: 1133, col: 25, offset: 42251}, name: "SinglePlusPassthroughPrefix", }, }, &anyMatcher{ - line: 1141, col: 50, offset: 41838, + line: 1133, col: 53, offset: 42279, }, }, }, @@ -8852,42 +7990,43 @@ var g = &grammar{ }, { name: "TriplePlusPassthroughPrefix", - pos: position{line: 1145, col: 1, offset: 41920}, + pos: position{line: 1137, col: 1, offset: 42361}, expr: &litMatcher{ - pos: position{line: 1145, col: 32, offset: 41951}, + pos: position{line: 1137, col: 32, offset: 42392}, val: "+++", ignoreCase: false, + want: "\"+++\"", }, }, { name: "TriplePlusPassthrough", - pos: position{line: 1147, col: 1, offset: 41958}, + pos: position{line: 1139, col: 1, offset: 42399}, expr: &actionExpr{ - pos: position{line: 1147, col: 26, offset: 41983}, + pos: position{line: 1139, col: 26, offset: 42424}, run: (*parser).callonTriplePlusPassthrough1, expr: &seqExpr{ - pos: position{line: 1147, col: 26, offset: 41983}, + pos: position{line: 1139, col: 26, offset: 42424}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1147, col: 26, offset: 41983}, + pos: position{line: 1139, col: 26, offset: 42424}, name: "TriplePlusPassthroughPrefix", }, &labeledExpr{ - pos: position{line: 1147, col: 54, offset: 42011}, + pos: position{line: 1139, col: 54, offset: 42452}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1147, col: 63, offset: 42020}, + pos: position{line: 1139, col: 63, offset: 42461}, name: "TriplePlusPassthroughContent", }, }, &ruleRefExpr{ - pos: position{line: 1147, col: 93, offset: 42050}, + pos: position{line: 1139, col: 93, offset: 42491}, name: "TriplePlusPassthroughPrefix", }, ¬Expr{ - pos: position{line: 1147, col: 121, offset: 42078}, + pos: position{line: 1139, col: 121, offset: 42519}, expr: &ruleRefExpr{ - pos: position{line: 1147, col: 122, offset: 42079}, + pos: position{line: 1139, col: 122, offset: 42520}, name: "Alphanum", }, }, @@ -8897,63 +8036,63 @@ var g = &grammar{ }, { name: "TriplePlusPassthroughContent", - pos: position{line: 1151, col: 1, offset: 42178}, + pos: position{line: 1143, col: 1, offset: 42619}, expr: &choiceExpr{ - pos: position{line: 1151, col: 33, offset: 42210}, + pos: position{line: 1143, col: 33, offset: 42651}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1151, col: 34, offset: 42211}, + pos: position{line: 1143, col: 34, offset: 42652}, run: (*parser).callonTriplePlusPassthroughContent2, expr: &zeroOrMoreExpr{ - pos: position{line: 1151, col: 34, offset: 42211}, + pos: position{line: 1143, col: 34, offset: 42652}, expr: &seqExpr{ - pos: position{line: 1151, col: 35, offset: 42212}, + pos: position{line: 1143, col: 35, offset: 42653}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1151, col: 35, offset: 42212}, + pos: position{line: 1143, col: 35, offset: 42653}, expr: &ruleRefExpr{ - pos: position{line: 1151, col: 36, offset: 42213}, + pos: position{line: 1143, col: 36, offset: 42654}, name: "TriplePlusPassthroughPrefix", }, }, &anyMatcher{ - line: 1151, col: 64, offset: 42241, + line: 1143, col: 64, offset: 42682, }, }, }, }, }, &actionExpr{ - pos: position{line: 1153, col: 7, offset: 42406}, + pos: position{line: 1145, col: 7, offset: 42847}, run: (*parser).callonTriplePlusPassthroughContent8, expr: &zeroOrOneExpr{ - pos: position{line: 1153, col: 7, offset: 42406}, + pos: position{line: 1145, col: 7, offset: 42847}, expr: &seqExpr{ - pos: position{line: 1153, col: 8, offset: 42407}, + pos: position{line: 1145, col: 8, offset: 42848}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1153, col: 8, offset: 42407}, + pos: position{line: 1145, col: 8, offset: 42848}, expr: &ruleRefExpr{ - pos: position{line: 1153, col: 9, offset: 42408}, - name: "WS", + pos: position{line: 1145, col: 9, offset: 42849}, + name: "Space", }, }, ¬Expr{ - pos: position{line: 1153, col: 12, offset: 42411}, + pos: position{line: 1145, col: 15, offset: 42855}, expr: &ruleRefExpr{ - pos: position{line: 1153, col: 13, offset: 42412}, + pos: position{line: 1145, col: 16, offset: 42856}, name: "Newline", }, }, ¬Expr{ - pos: position{line: 1153, col: 21, offset: 42420}, + pos: position{line: 1145, col: 24, offset: 42864}, expr: &ruleRefExpr{ - pos: position{line: 1153, col: 22, offset: 42421}, + pos: position{line: 1145, col: 25, offset: 42865}, name: "TriplePlusPassthroughPrefix", }, }, &anyMatcher{ - line: 1153, col: 50, offset: 42449, + line: 1145, col: 53, offset: 42893, }, }, }, @@ -8964,65 +8103,68 @@ var g = &grammar{ }, { name: "PassthroughMacro", - pos: position{line: 1157, col: 1, offset: 42532}, + pos: position{line: 1149, col: 1, offset: 42976}, expr: &choiceExpr{ - pos: position{line: 1157, col: 21, offset: 42552}, + pos: position{line: 1149, col: 21, offset: 42996}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1157, col: 21, offset: 42552}, + pos: position{line: 1149, col: 21, offset: 42996}, run: (*parser).callonPassthroughMacro2, expr: &seqExpr{ - pos: position{line: 1157, col: 21, offset: 42552}, + pos: position{line: 1149, col: 21, offset: 42996}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1157, col: 21, offset: 42552}, + pos: position{line: 1149, col: 21, offset: 42996}, val: "pass:[", ignoreCase: false, + want: "\"pass:[\"", }, &labeledExpr{ - pos: position{line: 1157, col: 30, offset: 42561}, + pos: position{line: 1149, col: 30, offset: 43005}, label: "content", expr: &zeroOrMoreExpr{ - pos: position{line: 1157, col: 38, offset: 42569}, + pos: position{line: 1149, col: 38, offset: 43013}, expr: &ruleRefExpr{ - pos: position{line: 1157, col: 39, offset: 42570}, + pos: position{line: 1149, col: 39, offset: 43014}, name: "PassthroughMacroCharacter", }, }, }, &litMatcher{ - pos: position{line: 1157, col: 67, offset: 42598}, + pos: position{line: 1149, col: 67, offset: 43042}, val: "]", ignoreCase: false, + want: "\"]\"", }, }, }, }, &actionExpr{ - pos: position{line: 1159, col: 5, offset: 42688}, + pos: position{line: 1151, col: 5, offset: 43132}, run: (*parser).callonPassthroughMacro9, expr: &seqExpr{ - pos: position{line: 1159, col: 5, offset: 42688}, + pos: position{line: 1151, col: 5, offset: 43132}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1159, col: 5, offset: 42688}, + pos: position{line: 1151, col: 5, offset: 43132}, val: "pass:q[", ignoreCase: false, + want: "\"pass:q[\"", }, &labeledExpr{ - pos: position{line: 1159, col: 15, offset: 42698}, + pos: position{line: 1151, col: 15, offset: 43142}, label: "content", expr: &zeroOrMoreExpr{ - pos: position{line: 1159, col: 23, offset: 42706}, + pos: position{line: 1151, col: 23, offset: 43150}, expr: &choiceExpr{ - pos: position{line: 1159, col: 24, offset: 42707}, + pos: position{line: 1151, col: 24, offset: 43151}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1159, col: 24, offset: 42707}, + pos: position{line: 1151, col: 24, offset: 43151}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 1159, col: 37, offset: 42720}, + pos: position{line: 1151, col: 37, offset: 43164}, name: "PassthroughMacroCharacter", }, }, @@ -9030,9 +8172,10 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 1159, col: 65, offset: 42748}, + pos: position{line: 1151, col: 65, offset: 43192}, val: "]", ignoreCase: false, + want: "\"]\"", }, }, }, @@ -9042,53 +8185,31 @@ var g = &grammar{ }, { name: "PassthroughMacroCharacter", - pos: position{line: 1163, col: 1, offset: 42838}, - expr: &choiceExpr{ - pos: position{line: 1163, col: 31, offset: 42868}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1163, col: 31, offset: 42868}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 1163, col: 43, offset: 42880}, - name: "Spaces", - }, - &actionExpr{ - pos: position{line: 1163, col: 52, offset: 42889}, - run: (*parser).callonPassthroughMacroCharacter4, - expr: &seqExpr{ - pos: position{line: 1163, col: 53, offset: 42890}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1163, col: 53, offset: 42890}, - expr: &litMatcher{ - pos: position{line: 1163, col: 54, offset: 42891}, - val: "]", - ignoreCase: false, - }, - }, - &anyMatcher{ - line: 1163, col: 58, offset: 42895, - }, - }, - }, - }, + pos: position{line: 1155, col: 1, offset: 43282}, + expr: &actionExpr{ + pos: position{line: 1155, col: 30, offset: 43311}, + run: (*parser).callonPassthroughMacroCharacter1, + expr: &charClassMatcher{ + pos: position{line: 1155, col: 30, offset: 43311}, + val: "[^\\]]", + chars: []rune{']'}, + ignoreCase: false, + inverted: true, }, }, }, { name: "CrossReference", - pos: position{line: 1170, col: 1, offset: 43065}, + pos: position{line: 1162, col: 1, offset: 43484}, expr: &choiceExpr{ - pos: position{line: 1170, col: 19, offset: 43083}, + pos: position{line: 1162, col: 19, offset: 43502}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1170, col: 19, offset: 43083}, + pos: position{line: 1162, col: 19, offset: 43502}, name: "InternalCrossReference", }, &ruleRefExpr{ - pos: position{line: 1170, col: 44, offset: 43108}, + pos: position{line: 1162, col: 44, offset: 43527}, name: "ExternalCrossReference", }, }, @@ -9096,80 +8217,85 @@ var g = &grammar{ }, { name: "InternalCrossReference", - pos: position{line: 1172, col: 1, offset: 43133}, + pos: position{line: 1164, col: 1, offset: 43552}, expr: &choiceExpr{ - pos: position{line: 1172, col: 27, offset: 43159}, + pos: position{line: 1164, col: 27, offset: 43578}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1172, col: 27, offset: 43159}, + pos: position{line: 1164, col: 27, offset: 43578}, run: (*parser).callonInternalCrossReference2, expr: &seqExpr{ - pos: position{line: 1172, col: 27, offset: 43159}, + pos: position{line: 1164, col: 27, offset: 43578}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1172, col: 27, offset: 43159}, + pos: position{line: 1164, col: 27, offset: 43578}, val: "<<", ignoreCase: false, + want: "\"<<\"", }, &labeledExpr{ - pos: position{line: 1172, col: 32, offset: 43164}, + pos: position{line: 1164, col: 32, offset: 43583}, label: "id", expr: &ruleRefExpr{ - pos: position{line: 1172, col: 36, offset: 43168}, + pos: position{line: 1164, col: 36, offset: 43587}, name: "ID", }, }, &zeroOrMoreExpr{ - pos: position{line: 1172, col: 40, offset: 43172}, + pos: position{line: 1164, col: 40, offset: 43591}, expr: &ruleRefExpr{ - pos: position{line: 1172, col: 40, offset: 43172}, - name: "WS", + pos: position{line: 1164, col: 40, offset: 43591}, + name: "Space", }, }, &litMatcher{ - pos: position{line: 1172, col: 44, offset: 43176}, + pos: position{line: 1164, col: 47, offset: 43598}, val: ",", ignoreCase: false, + want: "\",\"", }, &labeledExpr{ - pos: position{line: 1172, col: 48, offset: 43180}, + pos: position{line: 1164, col: 51, offset: 43602}, label: "label", expr: &ruleRefExpr{ - pos: position{line: 1172, col: 55, offset: 43187}, + pos: position{line: 1164, col: 58, offset: 43609}, name: "CrossReferenceLabel", }, }, &litMatcher{ - pos: position{line: 1172, col: 76, offset: 43208}, + pos: position{line: 1164, col: 79, offset: 43630}, val: ">>", ignoreCase: false, + want: "\">>\"", }, }, }, }, &actionExpr{ - pos: position{line: 1174, col: 5, offset: 43291}, + pos: position{line: 1166, col: 5, offset: 43713}, run: (*parser).callonInternalCrossReference13, expr: &seqExpr{ - pos: position{line: 1174, col: 5, offset: 43291}, + pos: position{line: 1166, col: 5, offset: 43713}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1174, col: 5, offset: 43291}, + pos: position{line: 1166, col: 5, offset: 43713}, val: "<<", ignoreCase: false, + want: "\"<<\"", }, &labeledExpr{ - pos: position{line: 1174, col: 10, offset: 43296}, + pos: position{line: 1166, col: 10, offset: 43718}, label: "id", expr: &ruleRefExpr{ - pos: position{line: 1174, col: 14, offset: 43300}, + pos: position{line: 1166, col: 14, offset: 43722}, name: "ID", }, }, &litMatcher{ - pos: position{line: 1174, col: 18, offset: 43304}, + pos: position{line: 1166, col: 18, offset: 43726}, val: ">>", ignoreCase: false, + want: "\">>\"", }, }, }, @@ -9179,31 +8305,32 @@ var g = &grammar{ }, { name: "ExternalCrossReference", - pos: position{line: 1178, col: 1, offset: 43376}, + pos: position{line: 1170, col: 1, offset: 43798}, expr: &actionExpr{ - pos: position{line: 1178, col: 27, offset: 43402}, + pos: position{line: 1170, col: 27, offset: 43824}, run: (*parser).callonExternalCrossReference1, expr: &seqExpr{ - pos: position{line: 1178, col: 27, offset: 43402}, + pos: position{line: 1170, col: 27, offset: 43824}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1178, col: 27, offset: 43402}, + pos: position{line: 1170, col: 27, offset: 43824}, val: "xref:", ignoreCase: false, + want: "\"xref:\"", }, &labeledExpr{ - pos: position{line: 1178, col: 35, offset: 43410}, + pos: position{line: 1170, col: 35, offset: 43832}, label: "url", expr: &ruleRefExpr{ - pos: position{line: 1178, col: 40, offset: 43415}, + pos: position{line: 1170, col: 40, offset: 43837}, name: "FileLocation", }, }, &labeledExpr{ - pos: position{line: 1178, col: 54, offset: 43429}, + pos: position{line: 1170, col: 54, offset: 43851}, label: "inlineAttributes", expr: &ruleRefExpr{ - pos: position{line: 1178, col: 72, offset: 43447}, + pos: position{line: 1170, col: 72, offset: 43869}, name: "LinkAttributes", }, }, @@ -9213,56 +8340,24 @@ var g = &grammar{ }, { name: "CrossReferenceLabel", - pos: position{line: 1182, col: 1, offset: 43577}, - expr: &actionExpr{ - pos: position{line: 1182, col: 24, offset: 43600}, - run: (*parser).callonCrossReferenceLabel1, - expr: &oneOrMoreExpr{ - pos: position{line: 1182, col: 24, offset: 43600}, - expr: &choiceExpr{ - pos: position{line: 1182, col: 25, offset: 43601}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1182, col: 25, offset: 43601}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 1182, col: 37, offset: 43613}, - name: "Spaces", - }, - &seqExpr{ - pos: position{line: 1182, col: 47, offset: 43623}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1182, col: 47, offset: 43623}, - expr: &litMatcher{ - pos: position{line: 1182, col: 48, offset: 43624}, - val: ">>", - ignoreCase: false, - }, - }, - &anyMatcher{ - line: 1182, col: 54, offset: 43630, - }, - }, - }, - }, - }, - }, + pos: position{line: 1174, col: 1, offset: 43999}, + expr: &ruleRefExpr{ + pos: position{line: 1174, col: 24, offset: 44022}, + name: "ElementTitleContent", }, }, { name: "Link", - pos: position{line: 1189, col: 1, offset: 43772}, + pos: position{line: 1179, col: 1, offset: 44144}, expr: &choiceExpr{ - pos: position{line: 1189, col: 9, offset: 43780}, + pos: position{line: 1179, col: 9, offset: 44152}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1189, col: 9, offset: 43780}, + pos: position{line: 1179, col: 9, offset: 44152}, name: "RelativeLink", }, &ruleRefExpr{ - pos: position{line: 1189, col: 24, offset: 43795}, + pos: position{line: 1179, col: 24, offset: 44167}, name: "ExternalLink", }, }, @@ -9270,40 +8365,32 @@ var g = &grammar{ }, { name: "RelativeLink", - pos: position{line: 1192, col: 1, offset: 43876}, + pos: position{line: 1182, col: 1, offset: 44248}, expr: &actionExpr{ - pos: position{line: 1192, col: 17, offset: 43892}, + pos: position{line: 1182, col: 17, offset: 44264}, run: (*parser).callonRelativeLink1, expr: &seqExpr{ - pos: position{line: 1192, col: 17, offset: 43892}, + pos: position{line: 1182, col: 17, offset: 44264}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1192, col: 17, offset: 43892}, + pos: position{line: 1182, col: 17, offset: 44264}, val: "link:", ignoreCase: false, + want: "\"link:\"", }, &labeledExpr{ - pos: position{line: 1192, col: 25, offset: 43900}, + pos: position{line: 1182, col: 25, offset: 44272}, label: "url", - expr: &choiceExpr{ - pos: position{line: 1192, col: 30, offset: 43905}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1192, col: 30, offset: 43905}, - name: "Location", - }, - &ruleRefExpr{ - pos: position{line: 1192, col: 41, offset: 43916}, - name: "FileLocation", - }, - }, + expr: &ruleRefExpr{ + pos: position{line: 1182, col: 30, offset: 44277}, + name: "Location", }, }, &labeledExpr{ - pos: position{line: 1192, col: 55, offset: 43930}, + pos: position{line: 1182, col: 40, offset: 44287}, label: "inlineAttributes", expr: &ruleRefExpr{ - pos: position{line: 1192, col: 73, offset: 43948}, + pos: position{line: 1182, col: 58, offset: 44305}, name: "LinkAttributes", }, }, @@ -9313,28 +8400,28 @@ var g = &grammar{ }, { name: "ExternalLink", - pos: position{line: 1196, col: 1, offset: 44066}, + pos: position{line: 1186, col: 1, offset: 44423}, expr: &actionExpr{ - pos: position{line: 1196, col: 17, offset: 44082}, + pos: position{line: 1186, col: 17, offset: 44439}, run: (*parser).callonExternalLink1, expr: &seqExpr{ - pos: position{line: 1196, col: 17, offset: 44082}, + pos: position{line: 1186, col: 17, offset: 44439}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1196, col: 17, offset: 44082}, + pos: position{line: 1186, col: 17, offset: 44439}, label: "url", expr: &ruleRefExpr{ - pos: position{line: 1196, col: 22, offset: 44087}, - name: "Location", + pos: position{line: 1186, col: 22, offset: 44444}, + name: "LocationWithScheme", }, }, &labeledExpr{ - pos: position{line: 1196, col: 32, offset: 44097}, + pos: position{line: 1186, col: 42, offset: 44464}, label: "inlineAttributes", expr: &zeroOrOneExpr{ - pos: position{line: 1196, col: 49, offset: 44114}, + pos: position{line: 1186, col: 59, offset: 44481}, expr: &ruleRefExpr{ - pos: position{line: 1196, col: 50, offset: 44115}, + pos: position{line: 1186, col: 60, offset: 44482}, name: "LinkAttributes", }, }, @@ -9345,479 +8432,274 @@ var g = &grammar{ }, { name: "LinkAttributes", - pos: position{line: 1200, col: 1, offset: 44208}, - expr: &choiceExpr{ - pos: position{line: 1200, col: 19, offset: 44226}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1200, col: 19, offset: 44226}, - name: "TextOnlyLinkAttributes", - }, - &ruleRefExpr{ - pos: position{line: 1200, col: 44, offset: 44251}, - name: "TextAndMoreLinkAttributes", - }, - }, - }, - }, - { - name: "TextOnlyLinkAttributes", - pos: position{line: 1202, col: 1, offset: 44278}, + pos: position{line: 1190, col: 1, offset: 44575}, expr: &actionExpr{ - pos: position{line: 1202, col: 27, offset: 44304}, - run: (*parser).callonTextOnlyLinkAttributes1, + pos: position{line: 1190, col: 19, offset: 44593}, + run: (*parser).callonLinkAttributes1, expr: &seqExpr{ - pos: position{line: 1202, col: 27, offset: 44304}, + pos: position{line: 1190, col: 19, offset: 44593}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1202, col: 27, offset: 44304}, + pos: position{line: 1190, col: 19, offset: 44593}, val: "[", ignoreCase: false, + want: "\"[\"", }, &labeledExpr{ - pos: position{line: 1202, col: 31, offset: 44308}, - label: "text", - expr: &zeroOrOneExpr{ - pos: position{line: 1202, col: 36, offset: 44313}, - expr: &choiceExpr{ - pos: position{line: 1204, col: 5, offset: 44356}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1204, col: 5, offset: 44356}, - run: (*parser).callonTextOnlyLinkAttributes7, - expr: &seqExpr{ - pos: position{line: 1204, col: 5, offset: 44356}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1204, col: 5, offset: 44356}, - val: "\"", - ignoreCase: false, - }, - &labeledExpr{ - pos: position{line: 1204, col: 10, offset: 44361}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 1204, col: 19, offset: 44370}, - expr: &seqExpr{ - pos: position{line: 1204, col: 20, offset: 44371}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1204, col: 20, offset: 44371}, - expr: &litMatcher{ - pos: position{line: 1204, col: 21, offset: 44372}, - val: "\"", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1204, col: 26, offset: 44377}, - expr: &litMatcher{ - pos: position{line: 1204, col: 27, offset: 44378}, - val: "]", - ignoreCase: false, - }, - }, - &choiceExpr{ - pos: position{line: 1204, col: 32, offset: 44383}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1204, col: 32, offset: 44383}, - name: "SimpleWord", - }, - &ruleRefExpr{ - pos: position{line: 1204, col: 45, offset: 44396}, - name: "Spaces", - }, - &ruleRefExpr{ - pos: position{line: 1204, col: 54, offset: 44405}, - name: "QuotedText", - }, - &ruleRefExpr{ - pos: position{line: 1204, col: 67, offset: 44418}, - name: "AnyChar", - }, - }, - }, - }, - }, - }, - }, - &litMatcher{ - pos: position{line: 1204, col: 78, offset: 44429}, - val: "\"", - ignoreCase: false, - }, - &zeroOrMoreExpr{ - pos: position{line: 1204, col: 83, offset: 44434}, - expr: &ruleRefExpr{ - pos: position{line: 1204, col: 83, offset: 44434}, - name: "Spaces", - }, - }, - &andExpr{ - pos: position{line: 1204, col: 91, offset: 44442}, - expr: ¬Expr{ - pos: position{line: 1204, col: 93, offset: 44444}, - expr: &litMatcher{ - pos: position{line: 1204, col: 94, offset: 44445}, - val: "=", - ignoreCase: false, - }, - }, - }, - }, - }, - }, - &actionExpr{ - pos: position{line: 1208, col: 5, offset: 44570}, - run: (*parser).callonTextOnlyLinkAttributes28, - expr: &seqExpr{ - pos: position{line: 1208, col: 5, offset: 44570}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1208, col: 5, offset: 44570}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 1208, col: 14, offset: 44579}, - expr: &seqExpr{ - pos: position{line: 1208, col: 15, offset: 44580}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1208, col: 15, offset: 44580}, - expr: &litMatcher{ - pos: position{line: 1208, col: 16, offset: 44581}, - val: "=", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1208, col: 20, offset: 44585}, - expr: &litMatcher{ - pos: position{line: 1208, col: 21, offset: 44586}, - val: "]", - ignoreCase: false, - }, - }, - &choiceExpr{ - pos: position{line: 1208, col: 26, offset: 44591}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1208, col: 26, offset: 44591}, - name: "SimpleWord", - }, - &ruleRefExpr{ - pos: position{line: 1208, col: 39, offset: 44604}, - name: "Spaces", - }, - &ruleRefExpr{ - pos: position{line: 1208, col: 48, offset: 44613}, - name: "QuotedText", - }, - &ruleRefExpr{ - pos: position{line: 1208, col: 61, offset: 44626}, - name: "AnyChar", - }, - }, - }, - }, - }, - }, - }, - &andExpr{ - pos: position{line: 1208, col: 72, offset: 44637}, - expr: ¬Expr{ - pos: position{line: 1208, col: 74, offset: 44639}, - expr: &litMatcher{ - pos: position{line: 1208, col: 75, offset: 44640}, - val: "=", - ignoreCase: false, - }, - }, - }, - }, - }, - }, - }, + pos: position{line: 1190, col: 23, offset: 44597}, + label: "firstAttr", + expr: &zeroOrMoreExpr{ + pos: position{line: 1190, col: 33, offset: 44607}, + expr: &ruleRefExpr{ + pos: position{line: 1190, col: 34, offset: 44608}, + name: "FirstLinkAttributeElement", + }, + }, + }, + &zeroOrMoreExpr{ + pos: position{line: 1191, col: 5, offset: 44640}, + expr: &ruleRefExpr{ + pos: position{line: 1191, col: 5, offset: 44640}, + name: "Space", + }, + }, + &labeledExpr{ + pos: position{line: 1191, col: 12, offset: 44647}, + label: "otherattrs", + expr: &zeroOrMoreExpr{ + pos: position{line: 1191, col: 23, offset: 44658}, + expr: &ruleRefExpr{ + pos: position{line: 1191, col: 24, offset: 44659}, + name: "GenericAttribute", }, }, }, &litMatcher{ - pos: position{line: 1210, col: 9, offset: 44720}, + pos: position{line: 1191, col: 43, offset: 44678}, val: "]", ignoreCase: false, + want: "\"]\"", }, }, }, }, }, { - name: "TextAndMoreLinkAttributes", - pos: position{line: 1214, col: 1, offset: 44786}, + name: "FirstLinkAttributeElement", + pos: position{line: 1195, col: 1, offset: 44795}, expr: &actionExpr{ - pos: position{line: 1214, col: 30, offset: 44815}, - run: (*parser).callonTextAndMoreLinkAttributes1, - expr: &seqExpr{ - pos: position{line: 1214, col: 30, offset: 44815}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1214, col: 30, offset: 44815}, - val: "[", - ignoreCase: false, - }, - &labeledExpr{ - pos: position{line: 1214, col: 34, offset: 44819}, - label: "text", - expr: &zeroOrOneExpr{ - pos: position{line: 1214, col: 39, offset: 44824}, - expr: &choiceExpr{ - pos: position{line: 1216, col: 5, offset: 44867}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1216, col: 5, offset: 44867}, - run: (*parser).callonTextAndMoreLinkAttributes7, - expr: &seqExpr{ - pos: position{line: 1216, col: 5, offset: 44867}, - exprs: []interface{}{ - &litMatcher{ - pos: position{line: 1216, col: 5, offset: 44867}, - val: "\"", - ignoreCase: false, - }, - &labeledExpr{ - pos: position{line: 1216, col: 10, offset: 44872}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 1216, col: 19, offset: 44881}, - expr: &seqExpr{ - pos: position{line: 1216, col: 20, offset: 44882}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1216, col: 20, offset: 44882}, - expr: &litMatcher{ - pos: position{line: 1216, col: 21, offset: 44883}, - val: "\"", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1216, col: 26, offset: 44888}, - expr: &litMatcher{ - pos: position{line: 1216, col: 27, offset: 44889}, - val: "]", - ignoreCase: false, - }, - }, - &choiceExpr{ - pos: position{line: 1216, col: 32, offset: 44894}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1216, col: 32, offset: 44894}, - name: "SimpleWord", - }, - &ruleRefExpr{ - pos: position{line: 1216, col: 45, offset: 44907}, - name: "Spaces", - }, - &ruleRefExpr{ - pos: position{line: 1216, col: 54, offset: 44916}, - name: "QuotedText", - }, - &ruleRefExpr{ - pos: position{line: 1216, col: 67, offset: 44929}, - name: "AnyChar", - }, - }, - }, - }, - }, + pos: position{line: 1195, col: 30, offset: 44824}, + run: (*parser).callonFirstLinkAttributeElement1, + expr: &labeledExpr{ + pos: position{line: 1195, col: 30, offset: 44824}, + label: "element", + expr: &choiceExpr{ + pos: position{line: 1197, col: 5, offset: 44875}, + alternatives: []interface{}{ + &actionExpr{ + pos: position{line: 1197, col: 6, offset: 44876}, + run: (*parser).callonFirstLinkAttributeElement4, + expr: &seqExpr{ + pos: position{line: 1197, col: 6, offset: 44876}, + exprs: []interface{}{ + &litMatcher{ + pos: position{line: 1197, col: 6, offset: 44876}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + &labeledExpr{ + pos: position{line: 1197, col: 11, offset: 44881}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 1197, col: 20, offset: 44890}, + expr: &choiceExpr{ + pos: position{line: 1197, col: 21, offset: 44891}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1197, col: 21, offset: 44891}, + name: "QuotedText", }, - }, - &litMatcher{ - pos: position{line: 1216, col: 78, offset: 44940}, - val: "\"", - ignoreCase: false, - }, - &andExpr{ - pos: position{line: 1216, col: 83, offset: 44945}, - expr: ¬Expr{ - pos: position{line: 1216, col: 85, offset: 44947}, - expr: &litMatcher{ - pos: position{line: 1216, col: 86, offset: 44948}, - val: "=", - ignoreCase: false, - }, + &ruleRefExpr{ + pos: position{line: 1197, col: 34, offset: 44904}, + name: "QuotedAttributeChar", }, }, }, }, }, - &actionExpr{ - pos: position{line: 1220, col: 5, offset: 45073}, - run: (*parser).callonTextAndMoreLinkAttributes26, - expr: &seqExpr{ - pos: position{line: 1220, col: 5, offset: 45073}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1220, col: 5, offset: 45073}, - label: "elements", - expr: &oneOrMoreExpr{ - pos: position{line: 1220, col: 14, offset: 45082}, - expr: &seqExpr{ - pos: position{line: 1220, col: 15, offset: 45083}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1220, col: 15, offset: 45083}, - expr: &litMatcher{ - pos: position{line: 1220, col: 16, offset: 45084}, - val: ",", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1220, col: 20, offset: 45088}, - expr: &litMatcher{ - pos: position{line: 1220, col: 21, offset: 45089}, - val: "=", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1220, col: 25, offset: 45093}, - expr: &litMatcher{ - pos: position{line: 1220, col: 26, offset: 45094}, - val: "]", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1220, col: 30, offset: 45098}, - expr: &litMatcher{ - pos: position{line: 1220, col: 31, offset: 45099}, - val: "\"", - ignoreCase: false, - }, - }, - &choiceExpr{ - pos: position{line: 1220, col: 37, offset: 45105}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1220, col: 37, offset: 45105}, - name: "SimpleWord", - }, - &ruleRefExpr{ - pos: position{line: 1220, col: 50, offset: 45118}, - name: "Spaces", - }, - &ruleRefExpr{ - pos: position{line: 1220, col: 59, offset: 45127}, - name: "QuotedText", - }, - &ruleRefExpr{ - pos: position{line: 1220, col: 72, offset: 45140}, - name: "AnyChar", - }, - }, - }, - }, - }, + &litMatcher{ + pos: position{line: 1197, col: 56, offset: 44926}, + val: "\"", + ignoreCase: false, + want: "\"\\\"\"", + }, + &andExpr{ + pos: position{line: 1197, col: 61, offset: 44931}, + expr: ¬Expr{ + pos: position{line: 1197, col: 63, offset: 44933}, + expr: &litMatcher{ + pos: position{line: 1197, col: 64, offset: 44934}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, + }, + &zeroOrOneExpr{ + pos: position{line: 1197, col: 69, offset: 44939}, + expr: &litMatcher{ + pos: position{line: 1197, col: 69, offset: 44939}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1201, col: 6, offset: 45066}, + run: (*parser).callonFirstLinkAttributeElement18, + expr: &seqExpr{ + pos: position{line: 1201, col: 6, offset: 45066}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1201, col: 6, offset: 45066}, + label: "elements", + expr: &oneOrMoreExpr{ + pos: position{line: 1201, col: 15, offset: 45075}, + expr: &choiceExpr{ + pos: position{line: 1201, col: 16, offset: 45076}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1201, col: 16, offset: 45076}, + name: "QuotedText", }, - }, - &andExpr{ - pos: position{line: 1220, col: 83, offset: 45151}, - expr: ¬Expr{ - pos: position{line: 1220, col: 85, offset: 45153}, - expr: &litMatcher{ - pos: position{line: 1220, col: 86, offset: 45154}, - val: "=", - ignoreCase: false, - }, + &ruleRefExpr{ + pos: position{line: 1201, col: 29, offset: 45089}, + name: "UnquotedAttributeChar", }, }, }, }, }, + &andExpr{ + pos: position{line: 1201, col: 53, offset: 45113}, + expr: ¬Expr{ + pos: position{line: 1201, col: 55, offset: 45115}, + expr: &litMatcher{ + pos: position{line: 1201, col: 56, offset: 45116}, + val: "=", + ignoreCase: false, + want: "\"=\"", + }, + }, + }, + &zeroOrOneExpr{ + pos: position{line: 1201, col: 61, offset: 45121}, + expr: &litMatcher{ + pos: position{line: 1201, col: 61, offset: 45121}, + val: ",", + ignoreCase: false, + want: "\",\"", + }, + }, }, }, }, }, - &zeroOrOneExpr{ - pos: position{line: 1222, col: 9, offset: 45234}, - expr: &litMatcher{ - pos: position{line: 1222, col: 9, offset: 45234}, - val: ",", - ignoreCase: false, - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 1222, col: 14, offset: 45239}, - expr: &ruleRefExpr{ - pos: position{line: 1222, col: 14, offset: 45239}, - name: "WS", - }, - }, - &labeledExpr{ - pos: position{line: 1222, col: 18, offset: 45243}, - label: "otherattrs", - expr: &zeroOrMoreExpr{ - pos: position{line: 1222, col: 29, offset: 45254}, - expr: &ruleRefExpr{ - pos: position{line: 1222, col: 30, offset: 45255}, - name: "GenericAttribute", - }, - }, - }, - &litMatcher{ - pos: position{line: 1222, col: 49, offset: 45274}, - val: "]", - ignoreCase: false, - }, }, }, }, }, + { + name: "AttributeChar", + pos: position{line: 1207, col: 1, offset: 45235}, + expr: &actionExpr{ + pos: position{line: 1207, col: 18, offset: 45252}, + run: (*parser).callonAttributeChar1, + expr: &charClassMatcher{ + pos: position{line: 1207, col: 18, offset: 45252}, + val: "[^\\r\\n\"=\\],]", + chars: []rune{'\r', '\n', '"', '=', ']', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, + { + name: "QuotedAttributeChar", + pos: position{line: 1211, col: 1, offset: 45338}, + expr: &actionExpr{ + pos: position{line: 1211, col: 24, offset: 45361}, + run: (*parser).callonQuotedAttributeChar1, + expr: &charClassMatcher{ + pos: position{line: 1211, col: 24, offset: 45361}, + val: "[^\\r\\n\"=\\]]", + chars: []rune{'\r', '\n', '"', '=', ']'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + { + name: "UnquotedAttributeChar", + pos: position{line: 1215, col: 1, offset: 45454}, + expr: &actionExpr{ + pos: position{line: 1215, col: 26, offset: 45479}, + run: (*parser).callonUnquotedAttributeChar1, + expr: &charClassMatcher{ + pos: position{line: 1215, col: 26, offset: 45479}, + val: "[^\\r\\n\"=\\],]", + chars: []rune{'\r', '\n', '"', '=', ']', ','}, + ignoreCase: false, + inverted: true, + }, + }, + }, { name: "InlineLinks", - pos: position{line: 1227, col: 1, offset: 45430}, + pos: position{line: 1220, col: 1, offset: 45636}, expr: &actionExpr{ - pos: position{line: 1228, col: 5, offset: 45450}, + pos: position{line: 1221, col: 5, offset: 45656}, run: (*parser).callonInlineLinks1, expr: &seqExpr{ - pos: position{line: 1228, col: 5, offset: 45450}, + pos: position{line: 1221, col: 5, offset: 45656}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1228, col: 5, offset: 45450}, + pos: position{line: 1221, col: 5, offset: 45656}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1228, col: 14, offset: 45459}, + pos: position{line: 1221, col: 14, offset: 45665}, expr: &choiceExpr{ - pos: position{line: 1228, col: 15, offset: 45460}, + pos: position{line: 1221, col: 15, offset: 45666}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1228, col: 15, offset: 45460}, - name: "SimpleWord", + pos: position{line: 1221, col: 15, offset: 45666}, + name: "Word", }, - &ruleRefExpr{ - pos: position{line: 1229, col: 11, offset: 45481}, - name: "Spaces", + &oneOrMoreExpr{ + pos: position{line: 1222, col: 11, offset: 45681}, + expr: &ruleRefExpr{ + pos: position{line: 1222, col: 11, offset: 45681}, + name: "Space", + }, }, &ruleRefExpr{ - pos: position{line: 1230, col: 11, offset: 45499}, + pos: position{line: 1223, col: 11, offset: 45699}, name: "ResolvedLink", }, &ruleRefExpr{ - pos: position{line: 1231, col: 11, offset: 45523}, + pos: position{line: 1224, col: 11, offset: 45723}, name: "Parenthesis", }, &ruleRefExpr{ - pos: position{line: 1232, col: 11, offset: 45545}, - name: "AnyChars", - }, - &ruleRefExpr{ - pos: position{line: 1233, col: 11, offset: 45564}, + pos: position{line: 1225, col: 11, offset: 45745}, name: "AnyChar", }, &ruleRefExpr{ - pos: position{line: 1234, col: 11, offset: 45582}, + pos: position{line: 1226, col: 11, offset: 45763}, name: "Newline", }, }, @@ -9825,7 +8707,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 1234, col: 21, offset: 45592}, + pos: position{line: 1226, col: 21, offset: 45773}, name: "EOF", }, }, @@ -9834,16 +8716,16 @@ var g = &grammar{ }, { name: "ResolvedLink", - pos: position{line: 1238, col: 1, offset: 45662}, + pos: position{line: 1230, col: 1, offset: 45843}, expr: &choiceExpr{ - pos: position{line: 1238, col: 17, offset: 45678}, + pos: position{line: 1230, col: 17, offset: 45859}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1238, col: 17, offset: 45678}, + pos: position{line: 1230, col: 17, offset: 45859}, name: "ResolvedRelativeLink", }, &ruleRefExpr{ - pos: position{line: 1238, col: 40, offset: 45701}, + pos: position{line: 1230, col: 40, offset: 45882}, name: "ResolvedExternalLink", }, }, @@ -9851,40 +8733,41 @@ var g = &grammar{ }, { name: "ResolvedRelativeLink", - pos: position{line: 1241, col: 1, offset: 45837}, + pos: position{line: 1233, col: 1, offset: 46018}, expr: &actionExpr{ - pos: position{line: 1241, col: 25, offset: 45861}, + pos: position{line: 1233, col: 25, offset: 46042}, run: (*parser).callonResolvedRelativeLink1, expr: &seqExpr{ - pos: position{line: 1241, col: 25, offset: 45861}, + pos: position{line: 1233, col: 25, offset: 46042}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1241, col: 25, offset: 45861}, + pos: position{line: 1233, col: 25, offset: 46042}, val: "link:", ignoreCase: false, + want: "\"link:\"", }, &labeledExpr{ - pos: position{line: 1241, col: 33, offset: 45869}, + pos: position{line: 1233, col: 33, offset: 46050}, label: "url", expr: &choiceExpr{ - pos: position{line: 1241, col: 38, offset: 45874}, + pos: position{line: 1233, col: 38, offset: 46055}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1241, col: 38, offset: 45874}, + pos: position{line: 1233, col: 38, offset: 46055}, name: "ResolvedLocation", }, &ruleRefExpr{ - pos: position{line: 1241, col: 57, offset: 45893}, + pos: position{line: 1233, col: 57, offset: 46074}, name: "ResolvedFileLocation", }, }, }, }, &labeledExpr{ - pos: position{line: 1241, col: 79, offset: 45915}, + pos: position{line: 1233, col: 79, offset: 46096}, label: "inlineAttributes", expr: &ruleRefExpr{ - pos: position{line: 1241, col: 97, offset: 45933}, + pos: position{line: 1233, col: 97, offset: 46114}, name: "LinkAttributes", }, }, @@ -9894,28 +8777,28 @@ var g = &grammar{ }, { name: "ResolvedExternalLink", - pos: position{line: 1245, col: 1, offset: 46051}, + pos: position{line: 1237, col: 1, offset: 46232}, expr: &actionExpr{ - pos: position{line: 1245, col: 25, offset: 46075}, + pos: position{line: 1237, col: 25, offset: 46256}, run: (*parser).callonResolvedExternalLink1, expr: &seqExpr{ - pos: position{line: 1245, col: 25, offset: 46075}, + pos: position{line: 1237, col: 25, offset: 46256}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1245, col: 25, offset: 46075}, + pos: position{line: 1237, col: 25, offset: 46256}, label: "url", expr: &ruleRefExpr{ - pos: position{line: 1245, col: 30, offset: 46080}, + pos: position{line: 1237, col: 30, offset: 46261}, name: "ResolvedLocation", }, }, &labeledExpr{ - pos: position{line: 1245, col: 48, offset: 46098}, + pos: position{line: 1237, col: 48, offset: 46279}, label: "inlineAttributes", expr: &zeroOrOneExpr{ - pos: position{line: 1245, col: 65, offset: 46115}, + pos: position{line: 1237, col: 65, offset: 46296}, expr: &ruleRefExpr{ - pos: position{line: 1245, col: 66, offset: 46116}, + pos: position{line: 1237, col: 66, offset: 46297}, name: "LinkAttributes", }, }, @@ -9924,111 +8807,57 @@ var g = &grammar{ }, }, }, - { - name: "QuotedLink", - pos: position{line: 1249, col: 1, offset: 46209}, - expr: &choiceExpr{ - pos: position{line: 1249, col: 15, offset: 46223}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1249, col: 15, offset: 46223}, - name: "RelativeLink", - }, - &ruleRefExpr{ - pos: position{line: 1249, col: 30, offset: 46238}, - name: "ExternalQuotedLink", - }, - }, - }, - }, - { - name: "ExternalQuotedLink", - pos: position{line: 1251, col: 1, offset: 46258}, - expr: &actionExpr{ - pos: position{line: 1251, col: 23, offset: 46280}, - run: (*parser).callonExternalQuotedLink1, - expr: &seqExpr{ - pos: position{line: 1251, col: 23, offset: 46280}, - exprs: []interface{}{ - &labeledExpr{ - pos: position{line: 1251, col: 23, offset: 46280}, - label: "url", - expr: &ruleRefExpr{ - pos: position{line: 1251, col: 28, offset: 46285}, - name: "Location", - }, - }, - &labeledExpr{ - pos: position{line: 1251, col: 38, offset: 46295}, - label: "inlineAttributes", - expr: &ruleRefExpr{ - pos: position{line: 1251, col: 56, offset: 46313}, - name: "LinkAttributes", - }, - }, - }, - }, - }, - }, { name: "ImageBlock", - pos: position{line: 1258, col: 1, offset: 46648}, + pos: position{line: 1244, col: 1, offset: 46492}, expr: &actionExpr{ - pos: position{line: 1258, col: 15, offset: 46662}, + pos: position{line: 1244, col: 15, offset: 46506}, run: (*parser).callonImageBlock1, expr: &seqExpr{ - pos: position{line: 1258, col: 15, offset: 46662}, + pos: position{line: 1244, col: 15, offset: 46506}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1258, col: 15, offset: 46662}, + pos: position{line: 1244, col: 15, offset: 46506}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1258, col: 26, offset: 46673}, + pos: position{line: 1244, col: 26, offset: 46517}, expr: &ruleRefExpr{ - pos: position{line: 1258, col: 27, offset: 46674}, + pos: position{line: 1244, col: 27, offset: 46518}, name: "ElementAttributes", }, }, }, &litMatcher{ - pos: position{line: 1258, col: 47, offset: 46694}, + pos: position{line: 1244, col: 47, offset: 46538}, val: "image::", ignoreCase: false, + want: "\"image::\"", }, &labeledExpr{ - pos: position{line: 1258, col: 57, offset: 46704}, + pos: position{line: 1244, col: 57, offset: 46548}, label: "path", - expr: &choiceExpr{ - pos: position{line: 1258, col: 63, offset: 46710}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1258, col: 63, offset: 46710}, - name: "Location", - }, - &ruleRefExpr{ - pos: position{line: 1258, col: 74, offset: 46721}, - name: "FileLocation", - }, - }, + expr: &ruleRefExpr{ + pos: position{line: 1244, col: 63, offset: 46554}, + name: "Location", }, }, &labeledExpr{ - pos: position{line: 1258, col: 88, offset: 46735}, + pos: position{line: 1244, col: 73, offset: 46564}, label: "inlineAttributes", expr: &ruleRefExpr{ - pos: position{line: 1258, col: 106, offset: 46753}, + pos: position{line: 1244, col: 91, offset: 46582}, name: "ImageAttributes", }, }, &zeroOrMoreExpr{ - pos: position{line: 1258, col: 123, offset: 46770}, + pos: position{line: 1244, col: 108, offset: 46599}, expr: &ruleRefExpr{ - pos: position{line: 1258, col: 123, offset: 46770}, - name: "WS", + pos: position{line: 1244, col: 108, offset: 46599}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1258, col: 127, offset: 46774}, + pos: position{line: 1244, col: 115, offset: 46606}, name: "EOL", }, }, @@ -10037,48 +8866,41 @@ var g = &grammar{ }, { name: "InlineImage", - pos: position{line: 1262, col: 1, offset: 46893}, + pos: position{line: 1248, col: 1, offset: 46725}, expr: &actionExpr{ - pos: position{line: 1262, col: 16, offset: 46908}, + pos: position{line: 1248, col: 16, offset: 46740}, run: (*parser).callonInlineImage1, expr: &seqExpr{ - pos: position{line: 1262, col: 16, offset: 46908}, + pos: position{line: 1248, col: 16, offset: 46740}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1262, col: 16, offset: 46908}, + pos: position{line: 1248, col: 16, offset: 46740}, val: "image:", ignoreCase: false, + want: "\"image:\"", }, ¬Expr{ - pos: position{line: 1262, col: 25, offset: 46917}, + pos: position{line: 1248, col: 25, offset: 46749}, expr: &litMatcher{ - pos: position{line: 1262, col: 26, offset: 46918}, + pos: position{line: 1248, col: 26, offset: 46750}, val: ":", ignoreCase: false, + want: "\":\"", }, }, &labeledExpr{ - pos: position{line: 1262, col: 30, offset: 46922}, + pos: position{line: 1248, col: 30, offset: 46754}, label: "path", - expr: &choiceExpr{ - pos: position{line: 1262, col: 36, offset: 46928}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1262, col: 36, offset: 46928}, - name: "Location", - }, - &ruleRefExpr{ - pos: position{line: 1262, col: 47, offset: 46939}, - name: "FileLocation", - }, - }, + expr: &ruleRefExpr{ + pos: position{line: 1248, col: 36, offset: 46760}, + name: "Location", }, }, &labeledExpr{ - pos: position{line: 1262, col: 61, offset: 46953}, + pos: position{line: 1248, col: 46, offset: 46770}, label: "inlineAttributes", expr: &ruleRefExpr{ - pos: position{line: 1262, col: 79, offset: 46971}, + pos: position{line: 1248, col: 64, offset: 46788}, name: "ImageAttributes", }, }, @@ -10088,97 +8910,102 @@ var g = &grammar{ }, { name: "ImageAttributes", - pos: position{line: 1266, col: 1, offset: 47092}, + pos: position{line: 1252, col: 1, offset: 46909}, expr: &actionExpr{ - pos: position{line: 1266, col: 20, offset: 47111}, + pos: position{line: 1252, col: 20, offset: 46928}, run: (*parser).callonImageAttributes1, expr: &seqExpr{ - pos: position{line: 1266, col: 20, offset: 47111}, + pos: position{line: 1252, col: 20, offset: 46928}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1266, col: 20, offset: 47111}, + pos: position{line: 1252, col: 20, offset: 46928}, val: "[", ignoreCase: false, + want: "\"[\"", }, &labeledExpr{ - pos: position{line: 1266, col: 24, offset: 47115}, + pos: position{line: 1252, col: 24, offset: 46932}, label: "alt", expr: &zeroOrOneExpr{ - pos: position{line: 1266, col: 28, offset: 47119}, + pos: position{line: 1252, col: 28, offset: 46936}, expr: &ruleRefExpr{ - pos: position{line: 1266, col: 29, offset: 47120}, + pos: position{line: 1252, col: 29, offset: 46937}, name: "StandaloneAttributeValue", }, }, }, &zeroOrOneExpr{ - pos: position{line: 1266, col: 56, offset: 47147}, + pos: position{line: 1252, col: 56, offset: 46964}, expr: &litMatcher{ - pos: position{line: 1266, col: 56, offset: 47147}, + pos: position{line: 1252, col: 56, offset: 46964}, val: ",", ignoreCase: false, + want: "\",\"", }, }, &labeledExpr{ - pos: position{line: 1266, col: 61, offset: 47152}, + pos: position{line: 1252, col: 61, offset: 46969}, label: "width", expr: &zeroOrOneExpr{ - pos: position{line: 1266, col: 67, offset: 47158}, + pos: position{line: 1252, col: 67, offset: 46975}, expr: &ruleRefExpr{ - pos: position{line: 1266, col: 68, offset: 47159}, + pos: position{line: 1252, col: 68, offset: 46976}, name: "StandaloneAttributeValue", }, }, }, &zeroOrOneExpr{ - pos: position{line: 1266, col: 95, offset: 47186}, + pos: position{line: 1252, col: 95, offset: 47003}, expr: &litMatcher{ - pos: position{line: 1266, col: 95, offset: 47186}, + pos: position{line: 1252, col: 95, offset: 47003}, val: ",", ignoreCase: false, + want: "\",\"", }, }, &labeledExpr{ - pos: position{line: 1266, col: 100, offset: 47191}, + pos: position{line: 1252, col: 100, offset: 47008}, label: "height", expr: &zeroOrOneExpr{ - pos: position{line: 1266, col: 107, offset: 47198}, + pos: position{line: 1252, col: 107, offset: 47015}, expr: &ruleRefExpr{ - pos: position{line: 1266, col: 108, offset: 47199}, + pos: position{line: 1252, col: 108, offset: 47016}, name: "StandaloneAttributeValue", }, }, }, &zeroOrOneExpr{ - pos: position{line: 1266, col: 135, offset: 47226}, + pos: position{line: 1252, col: 135, offset: 47043}, expr: &litMatcher{ - pos: position{line: 1266, col: 135, offset: 47226}, + pos: position{line: 1252, col: 135, offset: 47043}, val: ",", ignoreCase: false, + want: "\",\"", }, }, &zeroOrMoreExpr{ - pos: position{line: 1266, col: 140, offset: 47231}, + pos: position{line: 1252, col: 140, offset: 47048}, expr: &ruleRefExpr{ - pos: position{line: 1266, col: 140, offset: 47231}, - name: "WS", + pos: position{line: 1252, col: 140, offset: 47048}, + name: "Space", }, }, &labeledExpr{ - pos: position{line: 1266, col: 144, offset: 47235}, + pos: position{line: 1252, col: 147, offset: 47055}, label: "otherattrs", expr: &zeroOrMoreExpr{ - pos: position{line: 1266, col: 155, offset: 47246}, + pos: position{line: 1252, col: 158, offset: 47066}, expr: &ruleRefExpr{ - pos: position{line: 1266, col: 156, offset: 47247}, + pos: position{line: 1252, col: 159, offset: 47067}, name: "GenericAttribute", }, }, }, &litMatcher{ - pos: position{line: 1266, col: 175, offset: 47266}, + pos: position{line: 1252, col: 178, offset: 47086}, val: "]", ignoreCase: false, + want: "\"]\"", }, }, }, @@ -10186,76 +9013,81 @@ var g = &grammar{ }, { name: "InlineFootnote", - pos: position{line: 1273, col: 1, offset: 47556}, + pos: position{line: 1259, col: 1, offset: 47376}, expr: &choiceExpr{ - pos: position{line: 1273, col: 19, offset: 47574}, + pos: position{line: 1259, col: 19, offset: 47394}, alternatives: []interface{}{ &actionExpr{ - pos: position{line: 1273, col: 19, offset: 47574}, + pos: position{line: 1259, col: 19, offset: 47394}, run: (*parser).callonInlineFootnote2, expr: &seqExpr{ - pos: position{line: 1273, col: 19, offset: 47574}, + pos: position{line: 1259, col: 19, offset: 47394}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1273, col: 19, offset: 47574}, + pos: position{line: 1259, col: 19, offset: 47394}, val: "footnote:[", ignoreCase: false, + want: "\"footnote:[\"", }, &labeledExpr{ - pos: position{line: 1273, col: 32, offset: 47587}, + pos: position{line: 1259, col: 32, offset: 47407}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1273, col: 41, offset: 47596}, + pos: position{line: 1259, col: 41, offset: 47416}, name: "FootnoteContent", }, }, &litMatcher{ - pos: position{line: 1273, col: 58, offset: 47613}, + pos: position{line: 1259, col: 58, offset: 47433}, val: "]", ignoreCase: false, + want: "\"]\"", }, }, }, }, &actionExpr{ - pos: position{line: 1275, col: 5, offset: 47681}, + pos: position{line: 1261, col: 5, offset: 47501}, run: (*parser).callonInlineFootnote8, expr: &seqExpr{ - pos: position{line: 1275, col: 5, offset: 47681}, + pos: position{line: 1261, col: 5, offset: 47501}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1275, col: 5, offset: 47681}, + pos: position{line: 1261, col: 5, offset: 47501}, val: "footnote:", ignoreCase: false, + want: "\"footnote:\"", }, &labeledExpr{ - pos: position{line: 1275, col: 17, offset: 47693}, + pos: position{line: 1261, col: 17, offset: 47513}, label: "ref", expr: &ruleRefExpr{ - pos: position{line: 1275, col: 22, offset: 47698}, + pos: position{line: 1261, col: 22, offset: 47518}, name: "FootnoteRef", }, }, &litMatcher{ - pos: position{line: 1275, col: 35, offset: 47711}, + pos: position{line: 1261, col: 35, offset: 47531}, val: "[", ignoreCase: false, + want: "\"[\"", }, &labeledExpr{ - pos: position{line: 1275, col: 39, offset: 47715}, + pos: position{line: 1261, col: 39, offset: 47535}, label: "content", expr: &zeroOrOneExpr{ - pos: position{line: 1275, col: 47, offset: 47723}, + pos: position{line: 1261, col: 47, offset: 47543}, expr: &ruleRefExpr{ - pos: position{line: 1275, col: 48, offset: 47724}, + pos: position{line: 1261, col: 48, offset: 47544}, name: "FootnoteContent", }, }, }, &litMatcher{ - pos: position{line: 1275, col: 66, offset: 47742}, + pos: position{line: 1261, col: 66, offset: 47562}, val: "]", ignoreCase: false, + want: "\"]\"", }, }, }, @@ -10265,70 +9097,39 @@ var g = &grammar{ }, { name: "FootnoteRef", - pos: position{line: 1279, col: 1, offset: 47803}, - expr: &actionExpr{ - pos: position{line: 1279, col: 16, offset: 47818}, - run: (*parser).callonFootnoteRef1, - expr: &ruleRefExpr{ - pos: position{line: 1279, col: 16, offset: 47818}, - name: "Alphanums", - }, + pos: position{line: 1265, col: 1, offset: 47623}, + expr: &ruleRefExpr{ + pos: position{line: 1265, col: 16, offset: 47638}, + name: "Alphanums", }, }, { name: "FootnoteContent", - pos: position{line: 1283, col: 1, offset: 47865}, + pos: position{line: 1267, col: 1, offset: 47649}, expr: &actionExpr{ - pos: position{line: 1283, col: 20, offset: 47884}, + pos: position{line: 1267, col: 20, offset: 47668}, run: (*parser).callonFootnoteContent1, expr: &labeledExpr{ - pos: position{line: 1283, col: 20, offset: 47884}, + pos: position{line: 1267, col: 20, offset: 47668}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1283, col: 29, offset: 47893}, + pos: position{line: 1267, col: 29, offset: 47677}, expr: &seqExpr{ - pos: position{line: 1283, col: 30, offset: 47894}, + pos: position{line: 1267, col: 30, offset: 47678}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1283, col: 30, offset: 47894}, + pos: position{line: 1267, col: 30, offset: 47678}, expr: &litMatcher{ - pos: position{line: 1283, col: 31, offset: 47895}, + pos: position{line: 1267, col: 31, offset: 47679}, val: "]", ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1283, col: 35, offset: 47899}, - expr: &ruleRefExpr{ - pos: position{line: 1283, col: 36, offset: 47900}, - name: "EOL", - }, - }, - &zeroOrMoreExpr{ - pos: position{line: 1283, col: 40, offset: 47904}, - expr: &ruleRefExpr{ - pos: position{line: 1283, col: 40, offset: 47904}, - name: "WS", - }, - }, - ¬Expr{ - pos: position{line: 1283, col: 44, offset: 47908}, - expr: &ruleRefExpr{ - pos: position{line: 1283, col: 45, offset: 47909}, - name: "InlineElementID", + want: "\"]\"", }, }, &ruleRefExpr{ - pos: position{line: 1283, col: 61, offset: 47925}, + pos: position{line: 1267, col: 35, offset: 47683}, name: "InlineElement", }, - &zeroOrMoreExpr{ - pos: position{line: 1283, col: 75, offset: 47939}, - expr: &ruleRefExpr{ - pos: position{line: 1283, col: 75, offset: 47939}, - name: "WS", - }, - }, }, }, }, @@ -10337,60 +9138,60 @@ var g = &grammar{ }, { name: "DelimitedBlock", - pos: position{line: 1290, col: 1, offset: 48253}, + pos: position{line: 1274, col: 1, offset: 48007}, expr: &actionExpr{ - pos: position{line: 1290, col: 19, offset: 48271}, + pos: position{line: 1274, col: 19, offset: 48025}, run: (*parser).callonDelimitedBlock1, expr: &seqExpr{ - pos: position{line: 1290, col: 19, offset: 48271}, + pos: position{line: 1274, col: 19, offset: 48025}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1290, col: 19, offset: 48271}, + pos: position{line: 1274, col: 19, offset: 48025}, expr: &ruleRefExpr{ - pos: position{line: 1290, col: 20, offset: 48272}, + pos: position{line: 1274, col: 20, offset: 48026}, name: "Alphanum", }, }, &labeledExpr{ - pos: position{line: 1291, col: 5, offset: 48301}, + pos: position{line: 1275, col: 5, offset: 48114}, label: "block", expr: &choiceExpr{ - pos: position{line: 1291, col: 12, offset: 48308}, + pos: position{line: 1275, col: 12, offset: 48121}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1291, col: 12, offset: 48308}, + pos: position{line: 1275, col: 12, offset: 48121}, name: "FencedBlock", }, &ruleRefExpr{ - pos: position{line: 1292, col: 11, offset: 48331}, + pos: position{line: 1276, col: 11, offset: 48144}, name: "ListingBlock", }, &ruleRefExpr{ - pos: position{line: 1293, col: 11, offset: 48355}, + pos: position{line: 1277, col: 11, offset: 48168}, name: "ExampleBlock", }, &ruleRefExpr{ - pos: position{line: 1294, col: 11, offset: 48379}, + pos: position{line: 1278, col: 11, offset: 48192}, name: "VerseBlock", }, &ruleRefExpr{ - pos: position{line: 1295, col: 11, offset: 48401}, + pos: position{line: 1279, col: 11, offset: 48214}, name: "QuoteBlock", }, &ruleRefExpr{ - pos: position{line: 1296, col: 11, offset: 48423}, + pos: position{line: 1280, col: 11, offset: 48236}, name: "SidebarBlock", }, &ruleRefExpr{ - pos: position{line: 1297, col: 11, offset: 48446}, + pos: position{line: 1281, col: 11, offset: 48259}, name: "SingleLineComment", }, &ruleRefExpr{ - pos: position{line: 1298, col: 11, offset: 48474}, + pos: position{line: 1282, col: 11, offset: 48287}, name: "Table", }, &ruleRefExpr{ - pos: position{line: 1299, col: 11, offset: 48490}, + pos: position{line: 1283, col: 11, offset: 48303}, name: "CommentBlock", }, }, @@ -10402,36 +9203,48 @@ var g = &grammar{ }, { name: "BlockDelimiter", - pos: position{line: 1303, col: 1, offset: 48531}, + pos: position{line: 1287, col: 1, offset: 48344}, expr: &choiceExpr{ - pos: position{line: 1303, col: 19, offset: 48549}, + pos: position{line: 1287, col: 19, offset: 48362}, alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1303, col: 19, offset: 48549}, - name: "LiteralBlockDelimiter", + &seqExpr{ + pos: position{line: 1287, col: 19, offset: 48362}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1287, col: 19, offset: 48362}, + expr: &ruleRefExpr{ + pos: position{line: 1287, col: 21, offset: 48364}, + name: "Alphanum", + }, + }, + &ruleRefExpr{ + pos: position{line: 1287, col: 31, offset: 48374}, + name: "LiteralBlockDelimiter", + }, + }, }, &ruleRefExpr{ - pos: position{line: 1304, col: 19, offset: 48620}, + pos: position{line: 1288, col: 19, offset: 48445}, name: "FencedBlockDelimiter", }, &ruleRefExpr{ - pos: position{line: 1305, col: 19, offset: 48660}, + pos: position{line: 1289, col: 19, offset: 48485}, name: "ListingBlockDelimiter", }, &ruleRefExpr{ - pos: position{line: 1306, col: 19, offset: 48701}, + pos: position{line: 1290, col: 19, offset: 48526}, name: "ExampleBlockDelimiter", }, &ruleRefExpr{ - pos: position{line: 1307, col: 19, offset: 48742}, + pos: position{line: 1291, col: 19, offset: 48567}, name: "CommentBlockDelimiter", }, &ruleRefExpr{ - pos: position{line: 1308, col: 19, offset: 48783}, + pos: position{line: 1292, col: 19, offset: 48608}, name: "QuoteBlockDelimiter", }, &ruleRefExpr{ - pos: position{line: 1309, col: 19, offset: 48821}, + pos: position{line: 1293, col: 19, offset: 48646}, name: "SidebarBlockDelimiter", }, }, @@ -10439,16 +9252,16 @@ var g = &grammar{ }, { name: "VerbatimContent", - pos: position{line: 1311, col: 1, offset: 48844}, + pos: position{line: 1295, col: 1, offset: 48669}, expr: &choiceExpr{ - pos: position{line: 1311, col: 20, offset: 48863}, + pos: position{line: 1295, col: 20, offset: 48688}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1311, col: 20, offset: 48863}, + pos: position{line: 1295, col: 20, offset: 48688}, name: "FileInclusion", }, &ruleRefExpr{ - pos: position{line: 1311, col: 36, offset: 48879}, + pos: position{line: 1295, col: 36, offset: 48704}, name: "VerbatimLine", }, }, @@ -10456,24 +9269,25 @@ var g = &grammar{ }, { name: "FencedBlockDelimiter", - pos: position{line: 1316, col: 1, offset: 49088}, + pos: position{line: 1300, col: 1, offset: 48913}, expr: &seqExpr{ - pos: position{line: 1316, col: 25, offset: 49112}, + pos: position{line: 1300, col: 25, offset: 48937}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1316, col: 25, offset: 49112}, + pos: position{line: 1300, col: 25, offset: 48937}, val: "```", ignoreCase: false, + want: "\"```\"", }, &zeroOrMoreExpr{ - pos: position{line: 1316, col: 31, offset: 49118}, + pos: position{line: 1300, col: 31, offset: 48943}, expr: &ruleRefExpr{ - pos: position{line: 1316, col: 31, offset: 49118}, - name: "WS", + pos: position{line: 1300, col: 31, offset: 48943}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1316, col: 35, offset: 49122}, + pos: position{line: 1300, col: 38, offset: 48950}, name: "EOL", }, }, @@ -10481,24 +9295,25 @@ var g = &grammar{ }, { name: "FencedBlockStartDelimiter", - pos: position{line: 1318, col: 1, offset: 49182}, + pos: position{line: 1302, col: 1, offset: 49010}, expr: &seqExpr{ - pos: position{line: 1318, col: 30, offset: 49211}, + pos: position{line: 1302, col: 30, offset: 49039}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1318, col: 30, offset: 49211}, + pos: position{line: 1302, col: 30, offset: 49039}, val: "```", ignoreCase: false, + want: "\"```\"", }, &zeroOrMoreExpr{ - pos: position{line: 1318, col: 36, offset: 49217}, + pos: position{line: 1302, col: 36, offset: 49045}, expr: &ruleRefExpr{ - pos: position{line: 1318, col: 36, offset: 49217}, - name: "WS", + pos: position{line: 1302, col: 36, offset: 49045}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1318, col: 40, offset: 49221}, + pos: position{line: 1302, col: 43, offset: 49052}, name: "EOL", }, }, @@ -10506,33 +9321,34 @@ var g = &grammar{ }, { name: "FencedBlockEndDelimiter", - pos: position{line: 1320, col: 1, offset: 49226}, + pos: position{line: 1304, col: 1, offset: 49057}, expr: &choiceExpr{ - pos: position{line: 1320, col: 28, offset: 49253}, + pos: position{line: 1304, col: 28, offset: 49084}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1320, col: 29, offset: 49254}, + pos: position{line: 1304, col: 29, offset: 49085}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1320, col: 29, offset: 49254}, + pos: position{line: 1304, col: 29, offset: 49085}, val: "```", ignoreCase: false, + want: "\"```\"", }, &zeroOrMoreExpr{ - pos: position{line: 1320, col: 35, offset: 49260}, + pos: position{line: 1304, col: 35, offset: 49091}, expr: &ruleRefExpr{ - pos: position{line: 1320, col: 35, offset: 49260}, - name: "WS", + pos: position{line: 1304, col: 35, offset: 49091}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1320, col: 39, offset: 49264}, + pos: position{line: 1304, col: 42, offset: 49098}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 1320, col: 46, offset: 49271}, + pos: position{line: 1304, col: 49, offset: 49105}, name: "EOF", }, }, @@ -10540,38 +9356,38 @@ var g = &grammar{ }, { name: "FencedBlock", - pos: position{line: 1322, col: 1, offset: 49276}, + pos: position{line: 1306, col: 1, offset: 49110}, expr: &actionExpr{ - pos: position{line: 1322, col: 16, offset: 49291}, + pos: position{line: 1306, col: 16, offset: 49125}, run: (*parser).callonFencedBlock1, expr: &seqExpr{ - pos: position{line: 1322, col: 16, offset: 49291}, + pos: position{line: 1306, col: 16, offset: 49125}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1322, col: 16, offset: 49291}, + pos: position{line: 1306, col: 16, offset: 49125}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1322, col: 27, offset: 49302}, + pos: position{line: 1306, col: 27, offset: 49136}, expr: &ruleRefExpr{ - pos: position{line: 1322, col: 28, offset: 49303}, + pos: position{line: 1306, col: 28, offset: 49137}, name: "ElementAttributes", }, }, }, &ruleRefExpr{ - pos: position{line: 1322, col: 48, offset: 49323}, + pos: position{line: 1306, col: 48, offset: 49157}, name: "FencedBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 1322, col: 74, offset: 49349}, + pos: position{line: 1306, col: 74, offset: 49183}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1322, col: 83, offset: 49358}, + pos: position{line: 1306, col: 83, offset: 49192}, name: "FencedBlockVerbatimContent", }, }, &ruleRefExpr{ - pos: position{line: 1322, col: 111, offset: 49386}, + pos: position{line: 1306, col: 111, offset: 49220}, name: "FencedBlockEndDelimiter", }, }, @@ -10580,27 +9396,27 @@ var g = &grammar{ }, { name: "FencedBlockVerbatimContent", - pos: position{line: 1326, col: 1, offset: 49501}, + pos: position{line: 1310, col: 1, offset: 49335}, expr: &zeroOrMoreExpr{ - pos: position{line: 1326, col: 31, offset: 49531}, + pos: position{line: 1310, col: 31, offset: 49365}, expr: &actionExpr{ - pos: position{line: 1326, col: 32, offset: 49532}, + pos: position{line: 1310, col: 32, offset: 49366}, run: (*parser).callonFencedBlockVerbatimContent2, expr: &seqExpr{ - pos: position{line: 1326, col: 32, offset: 49532}, + pos: position{line: 1310, col: 32, offset: 49366}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1326, col: 32, offset: 49532}, + pos: position{line: 1310, col: 32, offset: 49366}, expr: &ruleRefExpr{ - pos: position{line: 1326, col: 33, offset: 49533}, + pos: position{line: 1310, col: 33, offset: 49367}, name: "FencedBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 1326, col: 57, offset: 49557}, + pos: position{line: 1310, col: 57, offset: 49391}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1326, col: 66, offset: 49566}, + pos: position{line: 1310, col: 66, offset: 49400}, name: "VerbatimContent", }, }, @@ -10611,24 +9427,25 @@ var g = &grammar{ }, { name: "ListingBlockDelimiter", - pos: position{line: 1333, col: 1, offset: 49903}, + pos: position{line: 1317, col: 1, offset: 49737}, expr: &seqExpr{ - pos: position{line: 1333, col: 26, offset: 49928}, + pos: position{line: 1317, col: 26, offset: 49762}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1333, col: 26, offset: 49928}, + pos: position{line: 1317, col: 26, offset: 49762}, val: "----", ignoreCase: false, + want: "\"----\"", }, &zeroOrMoreExpr{ - pos: position{line: 1333, col: 33, offset: 49935}, + pos: position{line: 1317, col: 33, offset: 49769}, expr: &ruleRefExpr{ - pos: position{line: 1333, col: 33, offset: 49935}, - name: "WS", + pos: position{line: 1317, col: 33, offset: 49769}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1333, col: 37, offset: 49939}, + pos: position{line: 1317, col: 40, offset: 49776}, name: "EOL", }, }, @@ -10636,24 +9453,25 @@ var g = &grammar{ }, { name: "ListingBlockStartDelimiter", - pos: position{line: 1335, col: 1, offset: 49944}, + pos: position{line: 1319, col: 1, offset: 49781}, expr: &seqExpr{ - pos: position{line: 1335, col: 31, offset: 49974}, + pos: position{line: 1319, col: 31, offset: 49811}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1335, col: 31, offset: 49974}, + pos: position{line: 1319, col: 31, offset: 49811}, val: "----", ignoreCase: false, + want: "\"----\"", }, &zeroOrMoreExpr{ - pos: position{line: 1335, col: 38, offset: 49981}, + pos: position{line: 1319, col: 38, offset: 49818}, expr: &ruleRefExpr{ - pos: position{line: 1335, col: 38, offset: 49981}, - name: "WS", + pos: position{line: 1319, col: 38, offset: 49818}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1335, col: 42, offset: 49985}, + pos: position{line: 1319, col: 45, offset: 49825}, name: "EOL", }, }, @@ -10661,33 +9479,34 @@ var g = &grammar{ }, { name: "ListingBlockEndDelimiter", - pos: position{line: 1337, col: 1, offset: 49990}, + pos: position{line: 1321, col: 1, offset: 49830}, expr: &choiceExpr{ - pos: position{line: 1337, col: 29, offset: 50018}, + pos: position{line: 1321, col: 29, offset: 49858}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1337, col: 30, offset: 50019}, + pos: position{line: 1321, col: 30, offset: 49859}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1337, col: 30, offset: 50019}, + pos: position{line: 1321, col: 30, offset: 49859}, val: "----", ignoreCase: false, + want: "\"----\"", }, &zeroOrMoreExpr{ - pos: position{line: 1337, col: 37, offset: 50026}, + pos: position{line: 1321, col: 37, offset: 49866}, expr: &ruleRefExpr{ - pos: position{line: 1337, col: 37, offset: 50026}, - name: "WS", + pos: position{line: 1321, col: 37, offset: 49866}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1337, col: 41, offset: 50030}, + pos: position{line: 1321, col: 44, offset: 49873}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 1337, col: 48, offset: 50037}, + pos: position{line: 1321, col: 51, offset: 49880}, name: "EOF", }, }, @@ -10695,38 +9514,38 @@ var g = &grammar{ }, { name: "ListingBlock", - pos: position{line: 1339, col: 1, offset: 50042}, + pos: position{line: 1323, col: 1, offset: 49885}, expr: &actionExpr{ - pos: position{line: 1339, col: 17, offset: 50058}, + pos: position{line: 1323, col: 17, offset: 49901}, run: (*parser).callonListingBlock1, expr: &seqExpr{ - pos: position{line: 1339, col: 17, offset: 50058}, + pos: position{line: 1323, col: 17, offset: 49901}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1339, col: 17, offset: 50058}, + pos: position{line: 1323, col: 17, offset: 49901}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1339, col: 28, offset: 50069}, + pos: position{line: 1323, col: 28, offset: 49912}, expr: &ruleRefExpr{ - pos: position{line: 1339, col: 29, offset: 50070}, + pos: position{line: 1323, col: 29, offset: 49913}, name: "ElementAttributes", }, }, }, &ruleRefExpr{ - pos: position{line: 1339, col: 49, offset: 50090}, + pos: position{line: 1323, col: 49, offset: 49933}, name: "ListingBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 1339, col: 76, offset: 50117}, + pos: position{line: 1323, col: 76, offset: 49960}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1339, col: 85, offset: 50126}, + pos: position{line: 1323, col: 85, offset: 49969}, name: "ListingBlockVerbatimContent", }, }, &ruleRefExpr{ - pos: position{line: 1339, col: 114, offset: 50155}, + pos: position{line: 1323, col: 114, offset: 49998}, name: "ListingBlockEndDelimiter", }, }, @@ -10735,27 +9554,27 @@ var g = &grammar{ }, { name: "ListingBlockVerbatimContent", - pos: position{line: 1343, col: 1, offset: 50272}, + pos: position{line: 1327, col: 1, offset: 50115}, expr: &zeroOrMoreExpr{ - pos: position{line: 1343, col: 32, offset: 50303}, + pos: position{line: 1327, col: 32, offset: 50146}, expr: &actionExpr{ - pos: position{line: 1343, col: 33, offset: 50304}, + pos: position{line: 1327, col: 33, offset: 50147}, run: (*parser).callonListingBlockVerbatimContent2, expr: &seqExpr{ - pos: position{line: 1343, col: 33, offset: 50304}, + pos: position{line: 1327, col: 33, offset: 50147}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1343, col: 33, offset: 50304}, + pos: position{line: 1327, col: 33, offset: 50147}, expr: &ruleRefExpr{ - pos: position{line: 1343, col: 34, offset: 50305}, + pos: position{line: 1327, col: 34, offset: 50148}, name: "ListingBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 1343, col: 59, offset: 50330}, + pos: position{line: 1327, col: 59, offset: 50173}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1343, col: 68, offset: 50339}, + pos: position{line: 1327, col: 68, offset: 50182}, name: "VerbatimContent", }, }, @@ -10766,24 +9585,25 @@ var g = &grammar{ }, { name: "ExampleBlockDelimiter", - pos: position{line: 1350, col: 1, offset: 50676}, + pos: position{line: 1334, col: 1, offset: 50519}, expr: &seqExpr{ - pos: position{line: 1350, col: 26, offset: 50701}, + pos: position{line: 1334, col: 26, offset: 50544}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1350, col: 26, offset: 50701}, + pos: position{line: 1334, col: 26, offset: 50544}, val: "====", ignoreCase: false, + want: "\"====\"", }, &zeroOrMoreExpr{ - pos: position{line: 1350, col: 33, offset: 50708}, + pos: position{line: 1334, col: 33, offset: 50551}, expr: &ruleRefExpr{ - pos: position{line: 1350, col: 33, offset: 50708}, - name: "WS", + pos: position{line: 1334, col: 33, offset: 50551}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1350, col: 37, offset: 50712}, + pos: position{line: 1334, col: 40, offset: 50558}, name: "EOL", }, }, @@ -10791,24 +9611,25 @@ var g = &grammar{ }, { name: "ExampleBlockStartDelimiter", - pos: position{line: 1352, col: 1, offset: 50717}, + pos: position{line: 1336, col: 1, offset: 50563}, expr: &seqExpr{ - pos: position{line: 1352, col: 31, offset: 50747}, + pos: position{line: 1336, col: 31, offset: 50593}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1352, col: 31, offset: 50747}, + pos: position{line: 1336, col: 31, offset: 50593}, val: "====", ignoreCase: false, + want: "\"====\"", }, &zeroOrMoreExpr{ - pos: position{line: 1352, col: 38, offset: 50754}, + pos: position{line: 1336, col: 38, offset: 50600}, expr: &ruleRefExpr{ - pos: position{line: 1352, col: 38, offset: 50754}, - name: "WS", + pos: position{line: 1336, col: 38, offset: 50600}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1352, col: 42, offset: 50758}, + pos: position{line: 1336, col: 45, offset: 50607}, name: "EOL", }, }, @@ -10816,33 +9637,34 @@ var g = &grammar{ }, { name: "ExampleBlockEndDelimiter", - pos: position{line: 1354, col: 1, offset: 50763}, + pos: position{line: 1338, col: 1, offset: 50612}, expr: &choiceExpr{ - pos: position{line: 1354, col: 29, offset: 50791}, + pos: position{line: 1338, col: 29, offset: 50640}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1354, col: 30, offset: 50792}, + pos: position{line: 1338, col: 30, offset: 50641}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1354, col: 30, offset: 50792}, + pos: position{line: 1338, col: 30, offset: 50641}, val: "====", ignoreCase: false, + want: "\"====\"", }, &zeroOrMoreExpr{ - pos: position{line: 1354, col: 37, offset: 50799}, + pos: position{line: 1338, col: 37, offset: 50648}, expr: &ruleRefExpr{ - pos: position{line: 1354, col: 37, offset: 50799}, - name: "WS", + pos: position{line: 1338, col: 37, offset: 50648}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1354, col: 41, offset: 50803}, + pos: position{line: 1338, col: 44, offset: 50655}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 1354, col: 48, offset: 50810}, + pos: position{line: 1338, col: 51, offset: 50662}, name: "EOF", }, }, @@ -10850,38 +9672,38 @@ var g = &grammar{ }, { name: "ExampleBlock", - pos: position{line: 1356, col: 1, offset: 50815}, + pos: position{line: 1340, col: 1, offset: 50667}, expr: &actionExpr{ - pos: position{line: 1356, col: 17, offset: 50831}, + pos: position{line: 1340, col: 17, offset: 50683}, run: (*parser).callonExampleBlock1, expr: &seqExpr{ - pos: position{line: 1356, col: 17, offset: 50831}, + pos: position{line: 1340, col: 17, offset: 50683}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1356, col: 17, offset: 50831}, + pos: position{line: 1340, col: 17, offset: 50683}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1356, col: 28, offset: 50842}, + pos: position{line: 1340, col: 28, offset: 50694}, expr: &ruleRefExpr{ - pos: position{line: 1356, col: 29, offset: 50843}, + pos: position{line: 1340, col: 29, offset: 50695}, name: "ElementAttributes", }, }, }, &ruleRefExpr{ - pos: position{line: 1356, col: 49, offset: 50863}, + pos: position{line: 1340, col: 49, offset: 50715}, name: "ExampleBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 1356, col: 76, offset: 50890}, + pos: position{line: 1340, col: 76, offset: 50742}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1356, col: 85, offset: 50899}, + pos: position{line: 1340, col: 85, offset: 50751}, name: "ExampleBlockVerbatimContent", }, }, &ruleRefExpr{ - pos: position{line: 1356, col: 114, offset: 50928}, + pos: position{line: 1340, col: 114, offset: 50780}, name: "ExampleBlockEndDelimiter", }, }, @@ -10890,27 +9712,27 @@ var g = &grammar{ }, { name: "ExampleBlockVerbatimContent", - pos: position{line: 1360, col: 1, offset: 51045}, + pos: position{line: 1344, col: 1, offset: 50897}, expr: &zeroOrMoreExpr{ - pos: position{line: 1360, col: 32, offset: 51076}, + pos: position{line: 1344, col: 32, offset: 50928}, expr: &actionExpr{ - pos: position{line: 1360, col: 33, offset: 51077}, + pos: position{line: 1344, col: 33, offset: 50929}, run: (*parser).callonExampleBlockVerbatimContent2, expr: &seqExpr{ - pos: position{line: 1360, col: 33, offset: 51077}, + pos: position{line: 1344, col: 33, offset: 50929}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1360, col: 33, offset: 51077}, + pos: position{line: 1344, col: 33, offset: 50929}, expr: &ruleRefExpr{ - pos: position{line: 1360, col: 34, offset: 51078}, + pos: position{line: 1344, col: 34, offset: 50930}, name: "ExampleBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 1360, col: 59, offset: 51103}, + pos: position{line: 1344, col: 59, offset: 50955}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1360, col: 68, offset: 51112}, + pos: position{line: 1344, col: 68, offset: 50964}, name: "VerbatimContent", }, }, @@ -10921,24 +9743,25 @@ var g = &grammar{ }, { name: "QuoteBlockDelimiter", - pos: position{line: 1367, col: 1, offset: 51447}, + pos: position{line: 1351, col: 1, offset: 51299}, expr: &seqExpr{ - pos: position{line: 1367, col: 24, offset: 51470}, + pos: position{line: 1351, col: 24, offset: 51322}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1367, col: 24, offset: 51470}, + pos: position{line: 1351, col: 24, offset: 51322}, val: "____", ignoreCase: false, + want: "\"____\"", }, &zeroOrMoreExpr{ - pos: position{line: 1367, col: 31, offset: 51477}, + pos: position{line: 1351, col: 31, offset: 51329}, expr: &ruleRefExpr{ - pos: position{line: 1367, col: 31, offset: 51477}, - name: "WS", + pos: position{line: 1351, col: 31, offset: 51329}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1367, col: 35, offset: 51481}, + pos: position{line: 1351, col: 38, offset: 51336}, name: "EOL", }, }, @@ -10946,24 +9769,25 @@ var g = &grammar{ }, { name: "QuoteBlockStartDelimiter", - pos: position{line: 1369, col: 1, offset: 51511}, + pos: position{line: 1353, col: 1, offset: 51366}, expr: &seqExpr{ - pos: position{line: 1369, col: 29, offset: 51539}, + pos: position{line: 1353, col: 29, offset: 51394}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1369, col: 29, offset: 51539}, + pos: position{line: 1353, col: 29, offset: 51394}, val: "____", ignoreCase: false, + want: "\"____\"", }, &zeroOrMoreExpr{ - pos: position{line: 1369, col: 36, offset: 51546}, + pos: position{line: 1353, col: 36, offset: 51401}, expr: &ruleRefExpr{ - pos: position{line: 1369, col: 36, offset: 51546}, - name: "WS", + pos: position{line: 1353, col: 36, offset: 51401}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1369, col: 40, offset: 51550}, + pos: position{line: 1353, col: 43, offset: 51408}, name: "EOL", }, }, @@ -10971,33 +9795,34 @@ var g = &grammar{ }, { name: "QuoteBlockEndDelimiter", - pos: position{line: 1371, col: 1, offset: 51580}, + pos: position{line: 1355, col: 1, offset: 51438}, expr: &choiceExpr{ - pos: position{line: 1371, col: 27, offset: 51606}, + pos: position{line: 1355, col: 27, offset: 51464}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1371, col: 28, offset: 51607}, + pos: position{line: 1355, col: 28, offset: 51465}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1371, col: 28, offset: 51607}, + pos: position{line: 1355, col: 28, offset: 51465}, val: "____", ignoreCase: false, + want: "\"____\"", }, &zeroOrMoreExpr{ - pos: position{line: 1371, col: 35, offset: 51614}, + pos: position{line: 1355, col: 35, offset: 51472}, expr: &ruleRefExpr{ - pos: position{line: 1371, col: 35, offset: 51614}, - name: "WS", + pos: position{line: 1355, col: 35, offset: 51472}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1371, col: 39, offset: 51618}, + pos: position{line: 1355, col: 42, offset: 51479}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 1371, col: 46, offset: 51625}, + pos: position{line: 1355, col: 49, offset: 51486}, name: "EOF", }, }, @@ -11005,38 +9830,38 @@ var g = &grammar{ }, { name: "QuoteBlock", - pos: position{line: 1373, col: 1, offset: 51655}, + pos: position{line: 1357, col: 1, offset: 51516}, expr: &actionExpr{ - pos: position{line: 1373, col: 15, offset: 51669}, + pos: position{line: 1357, col: 15, offset: 51530}, run: (*parser).callonQuoteBlock1, expr: &seqExpr{ - pos: position{line: 1373, col: 15, offset: 51669}, + pos: position{line: 1357, col: 15, offset: 51530}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1373, col: 15, offset: 51669}, + pos: position{line: 1357, col: 15, offset: 51530}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1373, col: 26, offset: 51680}, + pos: position{line: 1357, col: 26, offset: 51541}, expr: &ruleRefExpr{ - pos: position{line: 1373, col: 27, offset: 51681}, + pos: position{line: 1357, col: 27, offset: 51542}, name: "ElementAttributes", }, }, }, &ruleRefExpr{ - pos: position{line: 1373, col: 47, offset: 51701}, + pos: position{line: 1357, col: 47, offset: 51562}, name: "QuoteBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 1373, col: 72, offset: 51726}, + pos: position{line: 1357, col: 72, offset: 51587}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1373, col: 81, offset: 51735}, + pos: position{line: 1357, col: 81, offset: 51596}, name: "QuoteBlockVerbatimElement", }, }, &ruleRefExpr{ - pos: position{line: 1373, col: 108, offset: 51762}, + pos: position{line: 1357, col: 108, offset: 51623}, name: "QuoteBlockEndDelimiter", }, }, @@ -11045,27 +9870,27 @@ var g = &grammar{ }, { name: "QuoteBlockVerbatimElement", - pos: position{line: 1377, col: 1, offset: 51875}, + pos: position{line: 1361, col: 1, offset: 51736}, expr: &zeroOrMoreExpr{ - pos: position{line: 1377, col: 30, offset: 51904}, + pos: position{line: 1361, col: 30, offset: 51765}, expr: &actionExpr{ - pos: position{line: 1377, col: 31, offset: 51905}, + pos: position{line: 1361, col: 31, offset: 51766}, run: (*parser).callonQuoteBlockVerbatimElement2, expr: &seqExpr{ - pos: position{line: 1377, col: 31, offset: 51905}, + pos: position{line: 1361, col: 31, offset: 51766}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1377, col: 31, offset: 51905}, + pos: position{line: 1361, col: 31, offset: 51766}, expr: &ruleRefExpr{ - pos: position{line: 1377, col: 32, offset: 51906}, + pos: position{line: 1361, col: 32, offset: 51767}, name: "QuoteBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 1377, col: 55, offset: 51929}, + pos: position{line: 1361, col: 55, offset: 51790}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1377, col: 64, offset: 51938}, + pos: position{line: 1361, col: 64, offset: 51799}, name: "VerbatimContent", }, }, @@ -11076,39 +9901,39 @@ var g = &grammar{ }, { name: "VerseBlock", - pos: position{line: 1386, col: 1, offset: 52322}, + pos: position{line: 1370, col: 1, offset: 52183}, expr: &actionExpr{ - pos: position{line: 1386, col: 15, offset: 52336}, + pos: position{line: 1370, col: 15, offset: 52197}, run: (*parser).callonVerseBlock1, expr: &seqExpr{ - pos: position{line: 1386, col: 15, offset: 52336}, + pos: position{line: 1370, col: 15, offset: 52197}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1386, col: 15, offset: 52336}, + pos: position{line: 1370, col: 15, offset: 52197}, label: "attributes", expr: &ruleRefExpr{ - pos: position{line: 1386, col: 27, offset: 52348}, + pos: position{line: 1370, col: 27, offset: 52209}, name: "ElementAttributes", }, }, &andCodeExpr{ - pos: position{line: 1387, col: 5, offset: 52372}, + pos: position{line: 1371, col: 5, offset: 52233}, run: (*parser).callonVerseBlock5, }, &ruleRefExpr{ - pos: position{line: 1391, col: 5, offset: 52558}, + pos: position{line: 1375, col: 5, offset: 52419}, name: "QuoteBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 1391, col: 30, offset: 52583}, + pos: position{line: 1375, col: 30, offset: 52444}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1391, col: 39, offset: 52592}, + pos: position{line: 1375, col: 39, offset: 52453}, name: "VerseBlockVerbatimContent", }, }, &ruleRefExpr{ - pos: position{line: 1391, col: 66, offset: 52619}, + pos: position{line: 1375, col: 66, offset: 52480}, name: "QuoteBlockEndDelimiter", }, }, @@ -11117,27 +9942,27 @@ var g = &grammar{ }, { name: "VerseBlockVerbatimContent", - pos: position{line: 1395, col: 1, offset: 52740}, + pos: position{line: 1379, col: 1, offset: 52601}, expr: &zeroOrMoreExpr{ - pos: position{line: 1395, col: 30, offset: 52769}, + pos: position{line: 1379, col: 30, offset: 52630}, expr: &actionExpr{ - pos: position{line: 1395, col: 31, offset: 52770}, + pos: position{line: 1379, col: 31, offset: 52631}, run: (*parser).callonVerseBlockVerbatimContent2, expr: &seqExpr{ - pos: position{line: 1395, col: 31, offset: 52770}, + pos: position{line: 1379, col: 31, offset: 52631}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1395, col: 31, offset: 52770}, + pos: position{line: 1379, col: 31, offset: 52631}, expr: &ruleRefExpr{ - pos: position{line: 1395, col: 32, offset: 52771}, + pos: position{line: 1379, col: 32, offset: 52632}, name: "QuoteBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 1395, col: 55, offset: 52794}, + pos: position{line: 1379, col: 55, offset: 52655}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1395, col: 64, offset: 52803}, + pos: position{line: 1379, col: 64, offset: 52664}, name: "VerbatimContent", }, }, @@ -11148,24 +9973,25 @@ var g = &grammar{ }, { name: "SidebarBlockDelimiter", - pos: position{line: 1402, col: 1, offset: 53140}, + pos: position{line: 1386, col: 1, offset: 53001}, expr: &seqExpr{ - pos: position{line: 1402, col: 26, offset: 53165}, + pos: position{line: 1386, col: 26, offset: 53026}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1402, col: 26, offset: 53165}, + pos: position{line: 1386, col: 26, offset: 53026}, val: "****", ignoreCase: false, + want: "\"****\"", }, &zeroOrMoreExpr{ - pos: position{line: 1402, col: 33, offset: 53172}, + pos: position{line: 1386, col: 33, offset: 53033}, expr: &ruleRefExpr{ - pos: position{line: 1402, col: 33, offset: 53172}, - name: "WS", + pos: position{line: 1386, col: 33, offset: 53033}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1402, col: 37, offset: 53176}, + pos: position{line: 1386, col: 40, offset: 53040}, name: "EOL", }, }, @@ -11173,24 +9999,25 @@ var g = &grammar{ }, { name: "SidebarBlockStartDelimiter", - pos: position{line: 1404, col: 1, offset: 53181}, + pos: position{line: 1388, col: 1, offset: 53045}, expr: &seqExpr{ - pos: position{line: 1404, col: 31, offset: 53211}, + pos: position{line: 1388, col: 31, offset: 53075}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1404, col: 31, offset: 53211}, + pos: position{line: 1388, col: 31, offset: 53075}, val: "****", ignoreCase: false, + want: "\"****\"", }, &zeroOrMoreExpr{ - pos: position{line: 1404, col: 38, offset: 53218}, + pos: position{line: 1388, col: 38, offset: 53082}, expr: &ruleRefExpr{ - pos: position{line: 1404, col: 38, offset: 53218}, - name: "WS", + pos: position{line: 1388, col: 38, offset: 53082}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1404, col: 42, offset: 53222}, + pos: position{line: 1388, col: 45, offset: 53089}, name: "EOL", }, }, @@ -11198,33 +10025,34 @@ var g = &grammar{ }, { name: "SidebarBlockEndDelimiter", - pos: position{line: 1406, col: 1, offset: 53227}, + pos: position{line: 1390, col: 1, offset: 53094}, expr: &choiceExpr{ - pos: position{line: 1406, col: 29, offset: 53255}, + pos: position{line: 1390, col: 29, offset: 53122}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1406, col: 30, offset: 53256}, + pos: position{line: 1390, col: 30, offset: 53123}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1406, col: 30, offset: 53256}, + pos: position{line: 1390, col: 30, offset: 53123}, val: "****", ignoreCase: false, + want: "\"****\"", }, &zeroOrMoreExpr{ - pos: position{line: 1406, col: 37, offset: 53263}, + pos: position{line: 1390, col: 37, offset: 53130}, expr: &ruleRefExpr{ - pos: position{line: 1406, col: 37, offset: 53263}, - name: "WS", + pos: position{line: 1390, col: 37, offset: 53130}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1406, col: 41, offset: 53267}, + pos: position{line: 1390, col: 44, offset: 53137}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 1406, col: 48, offset: 53274}, + pos: position{line: 1390, col: 51, offset: 53144}, name: "EOF", }, }, @@ -11232,38 +10060,38 @@ var g = &grammar{ }, { name: "SidebarBlock", - pos: position{line: 1408, col: 1, offset: 53279}, + pos: position{line: 1392, col: 1, offset: 53149}, expr: &actionExpr{ - pos: position{line: 1408, col: 17, offset: 53295}, + pos: position{line: 1392, col: 17, offset: 53165}, run: (*parser).callonSidebarBlock1, expr: &seqExpr{ - pos: position{line: 1408, col: 17, offset: 53295}, + pos: position{line: 1392, col: 17, offset: 53165}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1408, col: 17, offset: 53295}, + pos: position{line: 1392, col: 17, offset: 53165}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1408, col: 28, offset: 53306}, + pos: position{line: 1392, col: 28, offset: 53176}, expr: &ruleRefExpr{ - pos: position{line: 1408, col: 29, offset: 53307}, + pos: position{line: 1392, col: 29, offset: 53177}, name: "ElementAttributes", }, }, }, &ruleRefExpr{ - pos: position{line: 1408, col: 49, offset: 53327}, + pos: position{line: 1392, col: 49, offset: 53197}, name: "SidebarBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 1408, col: 76, offset: 53354}, + pos: position{line: 1392, col: 76, offset: 53224}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1408, col: 85, offset: 53363}, + pos: position{line: 1392, col: 85, offset: 53233}, name: "SidebarBlockVerbatimContent", }, }, &ruleRefExpr{ - pos: position{line: 1408, col: 114, offset: 53392}, + pos: position{line: 1392, col: 114, offset: 53262}, name: "SidebarBlockEndDelimiter", }, }, @@ -11272,27 +10100,27 @@ var g = &grammar{ }, { name: "SidebarBlockVerbatimContent", - pos: position{line: 1412, col: 1, offset: 53509}, + pos: position{line: 1396, col: 1, offset: 53379}, expr: &zeroOrMoreExpr{ - pos: position{line: 1412, col: 32, offset: 53540}, + pos: position{line: 1396, col: 32, offset: 53410}, expr: &actionExpr{ - pos: position{line: 1412, col: 33, offset: 53541}, + pos: position{line: 1396, col: 33, offset: 53411}, run: (*parser).callonSidebarBlockVerbatimContent2, expr: &seqExpr{ - pos: position{line: 1412, col: 33, offset: 53541}, + pos: position{line: 1396, col: 33, offset: 53411}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1412, col: 33, offset: 53541}, + pos: position{line: 1396, col: 33, offset: 53411}, expr: &ruleRefExpr{ - pos: position{line: 1412, col: 34, offset: 53542}, + pos: position{line: 1396, col: 34, offset: 53412}, name: "SidebarBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 1412, col: 59, offset: 53567}, + pos: position{line: 1396, col: 59, offset: 53437}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1412, col: 68, offset: 53576}, + pos: position{line: 1396, col: 68, offset: 53446}, name: "VerbatimContent", }, }, @@ -11303,75 +10131,87 @@ var g = &grammar{ }, { name: "NormalBlockContent", - pos: position{line: 1420, col: 1, offset: 53922}, + pos: position{line: 1404, col: 1, offset: 53792}, expr: &zeroOrMoreExpr{ - pos: position{line: 1420, col: 23, offset: 53944}, + pos: position{line: 1404, col: 23, offset: 53814}, expr: &ruleRefExpr{ - pos: position{line: 1420, col: 23, offset: 53944}, + pos: position{line: 1404, col: 23, offset: 53814}, name: "NormalBlockElement", }, }, }, { name: "NormalBlockElement", - pos: position{line: 1422, col: 1, offset: 53965}, + pos: position{line: 1406, col: 1, offset: 53835}, expr: &actionExpr{ - pos: position{line: 1423, col: 5, offset: 53992}, + pos: position{line: 1407, col: 5, offset: 53862}, run: (*parser).callonNormalBlockElement1, expr: &seqExpr{ - pos: position{line: 1423, col: 5, offset: 53992}, + pos: position{line: 1407, col: 5, offset: 53862}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1423, col: 5, offset: 53992}, + pos: position{line: 1407, col: 5, offset: 53862}, expr: &ruleRefExpr{ - pos: position{line: 1423, col: 6, offset: 53993}, + pos: position{line: 1407, col: 6, offset: 53863}, name: "EOF", }, }, &labeledExpr{ - pos: position{line: 1423, col: 10, offset: 53997}, + pos: position{line: 1407, col: 10, offset: 53867}, label: "element", expr: &choiceExpr{ - pos: position{line: 1423, col: 19, offset: 54006}, + pos: position{line: 1407, col: 19, offset: 53876}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1423, col: 19, offset: 54006}, + pos: position{line: 1407, col: 19, offset: 53876}, name: "BlankLine", }, &ruleRefExpr{ - pos: position{line: 1424, col: 15, offset: 54031}, + pos: position{line: 1408, col: 15, offset: 53901}, name: "FileInclusion", }, &ruleRefExpr{ - pos: position{line: 1425, col: 15, offset: 54059}, + pos: position{line: 1409, col: 15, offset: 53929}, name: "ImageBlock", }, &ruleRefExpr{ - pos: position{line: 1426, col: 15, offset: 54085}, - name: "ListItem", + pos: position{line: 1410, col: 15, offset: 53955}, + name: "OrderedListItem", + }, + &ruleRefExpr{ + pos: position{line: 1411, col: 15, offset: 53986}, + name: "UnorderedListItem", + }, + &ruleRefExpr{ + pos: position{line: 1412, col: 15, offset: 54019}, + name: "LabeledListItem", + }, + &ruleRefExpr{ + pos: position{line: 1413, col: 15, offset: 54050}, + name: "ContinuedListItemElement", }, &ruleRefExpr{ - pos: position{line: 1427, col: 15, offset: 54108}, + pos: position{line: 1414, col: 15, offset: 54089}, name: "DelimitedBlock", }, &ruleRefExpr{ - pos: position{line: 1428, col: 15, offset: 54137}, + pos: position{line: 1415, col: 15, offset: 54118}, name: "LiteralBlock", }, &ruleRefExpr{ - pos: position{line: 1429, col: 15, offset: 54165}, + pos: position{line: 1416, col: 15, offset: 54146}, name: "DocumentAttributeDeclaration", }, &ruleRefExpr{ - pos: position{line: 1430, col: 15, offset: 54209}, + pos: position{line: 1417, col: 15, offset: 54190}, name: "DocumentAttributeReset", }, &ruleRefExpr{ - pos: position{line: 1431, col: 15, offset: 54247}, + pos: position{line: 1418, col: 15, offset: 54228}, name: "TableOfContentsPlaceHolder", }, &ruleRefExpr{ - pos: position{line: 1432, col: 15, offset: 54288}, + pos: position{line: 1419, col: 15, offset: 54269}, name: "Paragraph", }, }, @@ -11383,43 +10223,43 @@ var g = &grammar{ }, { name: "VerseBlockContent", - pos: position{line: 1436, col: 1, offset: 54337}, + pos: position{line: 1423, col: 1, offset: 54318}, expr: &zeroOrMoreExpr{ - pos: position{line: 1436, col: 22, offset: 54358}, + pos: position{line: 1423, col: 22, offset: 54339}, expr: &ruleRefExpr{ - pos: position{line: 1436, col: 22, offset: 54358}, + pos: position{line: 1423, col: 22, offset: 54339}, name: "VerseBlockElement", }, }, }, { name: "VerseBlockElement", - pos: position{line: 1438, col: 1, offset: 54378}, + pos: position{line: 1425, col: 1, offset: 54359}, expr: &actionExpr{ - pos: position{line: 1438, col: 22, offset: 54399}, + pos: position{line: 1425, col: 22, offset: 54380}, run: (*parser).callonVerseBlockElement1, expr: &seqExpr{ - pos: position{line: 1438, col: 22, offset: 54399}, + pos: position{line: 1425, col: 22, offset: 54380}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1438, col: 22, offset: 54399}, + pos: position{line: 1425, col: 22, offset: 54380}, expr: &ruleRefExpr{ - pos: position{line: 1438, col: 23, offset: 54400}, + pos: position{line: 1425, col: 23, offset: 54381}, name: "EOF", }, }, &labeledExpr{ - pos: position{line: 1438, col: 27, offset: 54404}, + pos: position{line: 1425, col: 27, offset: 54385}, label: "element", expr: &choiceExpr{ - pos: position{line: 1438, col: 36, offset: 54413}, + pos: position{line: 1425, col: 36, offset: 54394}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1438, col: 36, offset: 54413}, + pos: position{line: 1425, col: 36, offset: 54394}, name: "BlankLine", }, &ruleRefExpr{ - pos: position{line: 1438, col: 48, offset: 54425}, + pos: position{line: 1425, col: 48, offset: 54406}, name: "VerseBlockParagraph", }, }, @@ -11431,17 +10271,17 @@ var g = &grammar{ }, { name: "VerseBlockParagraph", - pos: position{line: 1442, col: 1, offset: 54475}, + pos: position{line: 1429, col: 1, offset: 54456}, expr: &actionExpr{ - pos: position{line: 1442, col: 24, offset: 54498}, + pos: position{line: 1429, col: 24, offset: 54479}, run: (*parser).callonVerseBlockParagraph1, expr: &labeledExpr{ - pos: position{line: 1442, col: 24, offset: 54498}, + pos: position{line: 1429, col: 24, offset: 54479}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 1442, col: 30, offset: 54504}, + pos: position{line: 1429, col: 30, offset: 54485}, expr: &ruleRefExpr{ - pos: position{line: 1442, col: 31, offset: 54505}, + pos: position{line: 1429, col: 31, offset: 54486}, name: "VerseBlockParagraphLine", }, }, @@ -11450,26 +10290,26 @@ var g = &grammar{ }, { name: "VerseBlockParagraphLine", - pos: position{line: 1446, col: 1, offset: 54595}, + pos: position{line: 1433, col: 1, offset: 54576}, expr: &actionExpr{ - pos: position{line: 1446, col: 28, offset: 54622}, + pos: position{line: 1433, col: 28, offset: 54603}, run: (*parser).callonVerseBlockParagraphLine1, expr: &seqExpr{ - pos: position{line: 1446, col: 28, offset: 54622}, + pos: position{line: 1433, col: 28, offset: 54603}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1446, col: 28, offset: 54622}, + pos: position{line: 1433, col: 28, offset: 54603}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1446, col: 37, offset: 54631}, + pos: position{line: 1433, col: 37, offset: 54612}, expr: &ruleRefExpr{ - pos: position{line: 1446, col: 38, offset: 54632}, + pos: position{line: 1433, col: 38, offset: 54613}, name: "InlineElement", }, }, }, &ruleRefExpr{ - pos: position{line: 1446, col: 54, offset: 54648}, + pos: position{line: 1433, col: 54, offset: 54629}, name: "EOL", }, }, @@ -11478,59 +10318,59 @@ var g = &grammar{ }, { name: "Table", - pos: position{line: 1453, col: 1, offset: 54890}, + pos: position{line: 1440, col: 1, offset: 54871}, expr: &actionExpr{ - pos: position{line: 1453, col: 10, offset: 54899}, + pos: position{line: 1440, col: 10, offset: 54880}, run: (*parser).callonTable1, expr: &seqExpr{ - pos: position{line: 1453, col: 10, offset: 54899}, + pos: position{line: 1440, col: 10, offset: 54880}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1453, col: 10, offset: 54899}, + pos: position{line: 1440, col: 10, offset: 54880}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1453, col: 21, offset: 54910}, + pos: position{line: 1440, col: 21, offset: 54891}, expr: &ruleRefExpr{ - pos: position{line: 1453, col: 22, offset: 54911}, + pos: position{line: 1440, col: 22, offset: 54892}, name: "ElementAttributes", }, }, }, &ruleRefExpr{ - pos: position{line: 1453, col: 42, offset: 54931}, + pos: position{line: 1440, col: 42, offset: 54912}, name: "TableDelimiter", }, &labeledExpr{ - pos: position{line: 1454, col: 5, offset: 54950}, + pos: position{line: 1441, col: 5, offset: 54931}, label: "header", expr: &zeroOrOneExpr{ - pos: position{line: 1454, col: 12, offset: 54957}, + pos: position{line: 1441, col: 12, offset: 54938}, expr: &ruleRefExpr{ - pos: position{line: 1454, col: 13, offset: 54958}, + pos: position{line: 1441, col: 13, offset: 54939}, name: "TableLineHeader", }, }, }, &labeledExpr{ - pos: position{line: 1455, col: 5, offset: 54980}, + pos: position{line: 1442, col: 5, offset: 54961}, label: "lines", expr: &zeroOrMoreExpr{ - pos: position{line: 1455, col: 11, offset: 54986}, + pos: position{line: 1442, col: 11, offset: 54967}, expr: &ruleRefExpr{ - pos: position{line: 1455, col: 12, offset: 54987}, + pos: position{line: 1442, col: 12, offset: 54968}, name: "TableLine", }, }, }, &choiceExpr{ - pos: position{line: 1456, col: 6, offset: 55004}, + pos: position{line: 1443, col: 6, offset: 54985}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1456, col: 6, offset: 55004}, + pos: position{line: 1443, col: 6, offset: 54985}, name: "TableDelimiter", }, &ruleRefExpr{ - pos: position{line: 1456, col: 23, offset: 55021}, + pos: position{line: 1443, col: 23, offset: 55002}, name: "EOF", }, }, @@ -11541,20 +10381,21 @@ var g = &grammar{ }, { name: "TableCellSeparator", - pos: position{line: 1460, col: 1, offset: 55136}, + pos: position{line: 1447, col: 1, offset: 55117}, expr: &seqExpr{ - pos: position{line: 1460, col: 23, offset: 55158}, + pos: position{line: 1447, col: 23, offset: 55139}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1460, col: 23, offset: 55158}, + pos: position{line: 1447, col: 23, offset: 55139}, val: "|", ignoreCase: false, + want: "\"|\"", }, &zeroOrMoreExpr{ - pos: position{line: 1460, col: 27, offset: 55162}, + pos: position{line: 1447, col: 27, offset: 55143}, expr: &ruleRefExpr{ - pos: position{line: 1460, col: 27, offset: 55162}, - name: "WS", + pos: position{line: 1447, col: 27, offset: 55143}, + name: "Space", }, }, }, @@ -11562,24 +10403,25 @@ var g = &grammar{ }, { name: "TableDelimiter", - pos: position{line: 1462, col: 1, offset: 55167}, + pos: position{line: 1449, col: 1, offset: 55151}, expr: &seqExpr{ - pos: position{line: 1462, col: 19, offset: 55185}, + pos: position{line: 1449, col: 19, offset: 55169}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1462, col: 19, offset: 55185}, + pos: position{line: 1449, col: 19, offset: 55169}, val: "|===", ignoreCase: false, + want: "\"|===\"", }, &zeroOrMoreExpr{ - pos: position{line: 1462, col: 26, offset: 55192}, + pos: position{line: 1449, col: 26, offset: 55176}, expr: &ruleRefExpr{ - pos: position{line: 1462, col: 26, offset: 55192}, - name: "WS", + pos: position{line: 1449, col: 26, offset: 55176}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1462, col: 30, offset: 55196}, + pos: position{line: 1449, col: 33, offset: 55183}, name: "EOL", }, }, @@ -11587,37 +10429,37 @@ var g = &grammar{ }, { name: "TableLineHeader", - pos: position{line: 1465, col: 1, offset: 55264}, + pos: position{line: 1452, col: 1, offset: 55251}, expr: &actionExpr{ - pos: position{line: 1465, col: 20, offset: 55283}, + pos: position{line: 1452, col: 20, offset: 55270}, run: (*parser).callonTableLineHeader1, expr: &seqExpr{ - pos: position{line: 1465, col: 20, offset: 55283}, + pos: position{line: 1452, col: 20, offset: 55270}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1465, col: 20, offset: 55283}, + pos: position{line: 1452, col: 20, offset: 55270}, expr: &ruleRefExpr{ - pos: position{line: 1465, col: 21, offset: 55284}, + pos: position{line: 1452, col: 21, offset: 55271}, name: "TableDelimiter", }, }, &labeledExpr{ - pos: position{line: 1465, col: 36, offset: 55299}, + pos: position{line: 1452, col: 36, offset: 55286}, label: "cells", expr: &oneOrMoreExpr{ - pos: position{line: 1465, col: 42, offset: 55305}, + pos: position{line: 1452, col: 42, offset: 55292}, expr: &ruleRefExpr{ - pos: position{line: 1465, col: 43, offset: 55306}, + pos: position{line: 1452, col: 43, offset: 55293}, name: "TableCell", }, }, }, &ruleRefExpr{ - pos: position{line: 1465, col: 55, offset: 55318}, + pos: position{line: 1452, col: 55, offset: 55305}, name: "EOL", }, &ruleRefExpr{ - pos: position{line: 1465, col: 59, offset: 55322}, + pos: position{line: 1452, col: 59, offset: 55309}, name: "BlankLine", }, }, @@ -11626,39 +10468,39 @@ var g = &grammar{ }, { name: "TableLine", - pos: position{line: 1469, col: 1, offset: 55390}, + pos: position{line: 1456, col: 1, offset: 55377}, expr: &actionExpr{ - pos: position{line: 1469, col: 14, offset: 55403}, + pos: position{line: 1456, col: 14, offset: 55390}, run: (*parser).callonTableLine1, expr: &seqExpr{ - pos: position{line: 1469, col: 14, offset: 55403}, + pos: position{line: 1456, col: 14, offset: 55390}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1469, col: 14, offset: 55403}, + pos: position{line: 1456, col: 14, offset: 55390}, expr: &ruleRefExpr{ - pos: position{line: 1469, col: 15, offset: 55404}, + pos: position{line: 1456, col: 15, offset: 55391}, name: "TableDelimiter", }, }, &labeledExpr{ - pos: position{line: 1469, col: 30, offset: 55419}, + pos: position{line: 1456, col: 30, offset: 55406}, label: "cells", expr: &oneOrMoreExpr{ - pos: position{line: 1469, col: 36, offset: 55425}, + pos: position{line: 1456, col: 36, offset: 55412}, expr: &ruleRefExpr{ - pos: position{line: 1469, col: 37, offset: 55426}, + pos: position{line: 1456, col: 37, offset: 55413}, name: "TableCell", }, }, }, &ruleRefExpr{ - pos: position{line: 1469, col: 49, offset: 55438}, + pos: position{line: 1456, col: 49, offset: 55425}, name: "EOL", }, &zeroOrMoreExpr{ - pos: position{line: 1469, col: 53, offset: 55442}, + pos: position{line: 1456, col: 53, offset: 55429}, expr: &ruleRefExpr{ - pos: position{line: 1469, col: 53, offset: 55442}, + pos: position{line: 1456, col: 53, offset: 55429}, name: "BlankLine", }, }, @@ -11668,55 +10510,55 @@ var g = &grammar{ }, { name: "TableCell", - pos: position{line: 1473, col: 1, offset: 55511}, + pos: position{line: 1460, col: 1, offset: 55498}, expr: &actionExpr{ - pos: position{line: 1473, col: 14, offset: 55524}, + pos: position{line: 1460, col: 14, offset: 55511}, run: (*parser).callonTableCell1, expr: &seqExpr{ - pos: position{line: 1473, col: 14, offset: 55524}, + pos: position{line: 1460, col: 14, offset: 55511}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1473, col: 14, offset: 55524}, + pos: position{line: 1460, col: 14, offset: 55511}, name: "TableCellSeparator", }, &labeledExpr{ - pos: position{line: 1473, col: 33, offset: 55543}, + pos: position{line: 1460, col: 33, offset: 55530}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1473, col: 42, offset: 55552}, + pos: position{line: 1460, col: 42, offset: 55539}, expr: &seqExpr{ - pos: position{line: 1473, col: 43, offset: 55553}, + pos: position{line: 1460, col: 43, offset: 55540}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1473, col: 43, offset: 55553}, + pos: position{line: 1460, col: 43, offset: 55540}, expr: &ruleRefExpr{ - pos: position{line: 1473, col: 44, offset: 55554}, + pos: position{line: 1460, col: 44, offset: 55541}, name: "TableCellSeparator", }, }, ¬Expr{ - pos: position{line: 1473, col: 63, offset: 55573}, + pos: position{line: 1460, col: 63, offset: 55560}, expr: &ruleRefExpr{ - pos: position{line: 1473, col: 64, offset: 55574}, + pos: position{line: 1460, col: 64, offset: 55561}, name: "EOL", }, }, &zeroOrMoreExpr{ - pos: position{line: 1473, col: 68, offset: 55578}, + pos: position{line: 1460, col: 68, offset: 55565}, expr: &ruleRefExpr{ - pos: position{line: 1473, col: 68, offset: 55578}, - name: "WS", + pos: position{line: 1460, col: 68, offset: 55565}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1473, col: 72, offset: 55582}, + pos: position{line: 1460, col: 75, offset: 55572}, name: "InlineElement", }, &zeroOrMoreExpr{ - pos: position{line: 1473, col: 86, offset: 55596}, + pos: position{line: 1460, col: 89, offset: 55586}, expr: &ruleRefExpr{ - pos: position{line: 1473, col: 86, offset: 55596}, - name: "WS", + pos: position{line: 1460, col: 89, offset: 55586}, + name: "Space", }, }, }, @@ -11729,24 +10571,25 @@ var g = &grammar{ }, { name: "CommentBlockDelimiter", - pos: position{line: 1480, col: 1, offset: 55842}, + pos: position{line: 1467, col: 1, offset: 55835}, expr: &seqExpr{ - pos: position{line: 1480, col: 26, offset: 55867}, + pos: position{line: 1467, col: 26, offset: 55860}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1480, col: 26, offset: 55867}, + pos: position{line: 1467, col: 26, offset: 55860}, val: "////", ignoreCase: false, + want: "\"////\"", }, &zeroOrMoreExpr{ - pos: position{line: 1480, col: 33, offset: 55874}, + pos: position{line: 1467, col: 33, offset: 55867}, expr: &ruleRefExpr{ - pos: position{line: 1480, col: 33, offset: 55874}, - name: "WS", + pos: position{line: 1467, col: 33, offset: 55867}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1480, col: 37, offset: 55878}, + pos: position{line: 1467, col: 40, offset: 55874}, name: "EOL", }, }, @@ -11754,24 +10597,25 @@ var g = &grammar{ }, { name: "CommentBlockStartDelimiter", - pos: position{line: 1482, col: 1, offset: 55883}, + pos: position{line: 1469, col: 1, offset: 55879}, expr: &seqExpr{ - pos: position{line: 1482, col: 31, offset: 55913}, + pos: position{line: 1469, col: 31, offset: 55909}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1482, col: 31, offset: 55913}, + pos: position{line: 1469, col: 31, offset: 55909}, val: "////", ignoreCase: false, + want: "\"////\"", }, &zeroOrMoreExpr{ - pos: position{line: 1482, col: 38, offset: 55920}, + pos: position{line: 1469, col: 38, offset: 55916}, expr: &ruleRefExpr{ - pos: position{line: 1482, col: 38, offset: 55920}, - name: "WS", + pos: position{line: 1469, col: 38, offset: 55916}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1482, col: 42, offset: 55924}, + pos: position{line: 1469, col: 45, offset: 55923}, name: "EOL", }, }, @@ -11779,33 +10623,34 @@ var g = &grammar{ }, { name: "CommentBlockEndDelimiter", - pos: position{line: 1484, col: 1, offset: 55929}, + pos: position{line: 1471, col: 1, offset: 55928}, expr: &choiceExpr{ - pos: position{line: 1484, col: 29, offset: 55957}, + pos: position{line: 1471, col: 29, offset: 55956}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1484, col: 30, offset: 55958}, + pos: position{line: 1471, col: 30, offset: 55957}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1484, col: 30, offset: 55958}, + pos: position{line: 1471, col: 30, offset: 55957}, val: "////", ignoreCase: false, + want: "\"////\"", }, &zeroOrMoreExpr{ - pos: position{line: 1484, col: 37, offset: 55965}, + pos: position{line: 1471, col: 37, offset: 55964}, expr: &ruleRefExpr{ - pos: position{line: 1484, col: 37, offset: 55965}, - name: "WS", + pos: position{line: 1471, col: 37, offset: 55964}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1484, col: 41, offset: 55969}, + pos: position{line: 1471, col: 44, offset: 55971}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 1484, col: 48, offset: 55976}, + pos: position{line: 1471, col: 51, offset: 55978}, name: "EOF", }, }, @@ -11813,27 +10658,27 @@ var g = &grammar{ }, { name: "CommentBlock", - pos: position{line: 1486, col: 1, offset: 55981}, + pos: position{line: 1473, col: 1, offset: 55983}, expr: &actionExpr{ - pos: position{line: 1486, col: 17, offset: 55997}, + pos: position{line: 1473, col: 17, offset: 55999}, run: (*parser).callonCommentBlock1, expr: &seqExpr{ - pos: position{line: 1486, col: 17, offset: 55997}, + pos: position{line: 1473, col: 17, offset: 55999}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1486, col: 17, offset: 55997}, + pos: position{line: 1473, col: 17, offset: 55999}, name: "CommentBlockStartDelimiter", }, &labeledExpr{ - pos: position{line: 1486, col: 44, offset: 56024}, + pos: position{line: 1473, col: 44, offset: 56026}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1486, col: 53, offset: 56033}, + pos: position{line: 1473, col: 53, offset: 56035}, name: "CommentBlockVerbatimContent", }, }, &ruleRefExpr{ - pos: position{line: 1486, col: 83, offset: 56063}, + pos: position{line: 1473, col: 83, offset: 56065}, name: "CommentBlockEndDelimiter", }, }, @@ -11842,27 +10687,27 @@ var g = &grammar{ }, { name: "CommentBlockVerbatimContent", - pos: position{line: 1490, col: 1, offset: 56173}, + pos: position{line: 1477, col: 1, offset: 56175}, expr: &zeroOrMoreExpr{ - pos: position{line: 1490, col: 32, offset: 56204}, + pos: position{line: 1477, col: 32, offset: 56206}, expr: &actionExpr{ - pos: position{line: 1490, col: 33, offset: 56205}, + pos: position{line: 1477, col: 33, offset: 56207}, run: (*parser).callonCommentBlockVerbatimContent2, expr: &seqExpr{ - pos: position{line: 1490, col: 33, offset: 56205}, + pos: position{line: 1477, col: 33, offset: 56207}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1490, col: 33, offset: 56205}, + pos: position{line: 1477, col: 33, offset: 56207}, expr: &ruleRefExpr{ - pos: position{line: 1490, col: 34, offset: 56206}, + pos: position{line: 1477, col: 34, offset: 56208}, name: "CommentBlockEndDelimiter", }, }, &labeledExpr{ - pos: position{line: 1490, col: 59, offset: 56231}, + pos: position{line: 1477, col: 59, offset: 56233}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1490, col: 68, offset: 56240}, + pos: position{line: 1477, col: 68, offset: 56242}, name: "VerbatimContent", }, }, @@ -11873,42 +10718,43 @@ var g = &grammar{ }, { name: "SingleLineComment", - pos: position{line: 1494, col: 1, offset: 56381}, + pos: position{line: 1481, col: 1, offset: 56383}, expr: &actionExpr{ - pos: position{line: 1494, col: 22, offset: 56402}, + pos: position{line: 1481, col: 22, offset: 56404}, run: (*parser).callonSingleLineComment1, expr: &seqExpr{ - pos: position{line: 1494, col: 22, offset: 56402}, + pos: position{line: 1481, col: 22, offset: 56404}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1494, col: 22, offset: 56402}, + pos: position{line: 1481, col: 22, offset: 56404}, expr: &ruleRefExpr{ - pos: position{line: 1494, col: 23, offset: 56403}, + pos: position{line: 1481, col: 23, offset: 56405}, name: "CommentBlockDelimiter", }, }, &zeroOrMoreExpr{ - pos: position{line: 1494, col: 45, offset: 56425}, + pos: position{line: 1481, col: 45, offset: 56427}, expr: &ruleRefExpr{ - pos: position{line: 1494, col: 45, offset: 56425}, - name: "WS", + pos: position{line: 1481, col: 45, offset: 56427}, + name: "Space", }, }, &litMatcher{ - pos: position{line: 1494, col: 49, offset: 56429}, + pos: position{line: 1481, col: 52, offset: 56434}, val: "//", ignoreCase: false, + want: "\"//\"", }, &labeledExpr{ - pos: position{line: 1494, col: 54, offset: 56434}, + pos: position{line: 1481, col: 57, offset: 56439}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1494, col: 63, offset: 56443}, + pos: position{line: 1481, col: 66, offset: 56448}, name: "SingleLineCommentContent", }, }, &ruleRefExpr{ - pos: position{line: 1494, col: 89, offset: 56469}, + pos: position{line: 1481, col: 92, offset: 56474}, name: "EOL", }, }, @@ -11917,59 +10763,38 @@ var g = &grammar{ }, { name: "SingleLineCommentContent", - pos: position{line: 1498, col: 1, offset: 56534}, + pos: position{line: 1485, col: 1, offset: 56539}, expr: &actionExpr{ - pos: position{line: 1498, col: 29, offset: 56562}, + pos: position{line: 1485, col: 29, offset: 56567}, run: (*parser).callonSingleLineCommentContent1, expr: &zeroOrMoreExpr{ - pos: position{line: 1498, col: 29, offset: 56562}, - expr: &choiceExpr{ - pos: position{line: 1498, col: 30, offset: 56563}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1498, col: 30, offset: 56563}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 1498, col: 42, offset: 56575}, - name: "Spaces", - }, - &seqExpr{ - pos: position{line: 1498, col: 52, offset: 56585}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1498, col: 52, offset: 56585}, - expr: &ruleRefExpr{ - pos: position{line: 1498, col: 53, offset: 56586}, - name: "EOL", - }, - }, - &anyMatcher{ - line: 1498, col: 58, offset: 56591, - }, - }, - }, - }, + pos: position{line: 1485, col: 29, offset: 56567}, + expr: &charClassMatcher{ + pos: position{line: 1485, col: 29, offset: 56567}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, { name: "LiteralBlock", - pos: position{line: 1506, col: 1, offset: 56900}, + pos: position{line: 1493, col: 1, offset: 56880}, expr: &choiceExpr{ - pos: position{line: 1506, col: 17, offset: 56916}, + pos: position{line: 1493, col: 17, offset: 56896}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1506, col: 17, offset: 56916}, + pos: position{line: 1493, col: 17, offset: 56896}, name: "ParagraphWithLiteralAttribute", }, &ruleRefExpr{ - pos: position{line: 1506, col: 49, offset: 56948}, + pos: position{line: 1493, col: 49, offset: 56928}, name: "ParagraphWithHeadingSpaces", }, &ruleRefExpr{ - pos: position{line: 1506, col: 78, offset: 56977}, + pos: position{line: 1493, col: 78, offset: 56957}, name: "ParagraphWithLiteralBlockDelimiter", }, }, @@ -11977,38 +10802,39 @@ var g = &grammar{ }, { name: "LiteralBlockDelimiter", - pos: position{line: 1508, col: 1, offset: 57013}, + pos: position{line: 1495, col: 1, offset: 56993}, expr: &litMatcher{ - pos: position{line: 1508, col: 26, offset: 57038}, + pos: position{line: 1495, col: 26, offset: 57018}, val: "....", ignoreCase: false, + want: "\"....\"", }, }, { name: "ParagraphWithHeadingSpaces", - pos: position{line: 1511, col: 1, offset: 57110}, + pos: position{line: 1498, col: 1, offset: 57090}, expr: &actionExpr{ - pos: position{line: 1511, col: 31, offset: 57140}, + pos: position{line: 1498, col: 31, offset: 57120}, run: (*parser).callonParagraphWithHeadingSpaces1, expr: &seqExpr{ - pos: position{line: 1511, col: 31, offset: 57140}, + pos: position{line: 1498, col: 31, offset: 57120}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1511, col: 31, offset: 57140}, + pos: position{line: 1498, col: 31, offset: 57120}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1511, col: 42, offset: 57151}, + pos: position{line: 1498, col: 42, offset: 57131}, expr: &ruleRefExpr{ - pos: position{line: 1511, col: 43, offset: 57152}, + pos: position{line: 1498, col: 43, offset: 57132}, name: "ElementAttributes", }, }, }, &labeledExpr{ - pos: position{line: 1511, col: 63, offset: 57172}, + pos: position{line: 1498, col: 63, offset: 57152}, label: "lines", expr: &ruleRefExpr{ - pos: position{line: 1511, col: 70, offset: 57179}, + pos: position{line: 1498, col: 70, offset: 57159}, name: "ParagraphWithHeadingSpacesLines", }, }, @@ -12018,59 +10844,37 @@ var g = &grammar{ }, { name: "ParagraphWithHeadingSpacesLines", - pos: position{line: 1516, col: 1, offset: 57409}, + pos: position{line: 1503, col: 1, offset: 57389}, expr: &actionExpr{ - pos: position{line: 1517, col: 5, offset: 57449}, + pos: position{line: 1504, col: 5, offset: 57429}, run: (*parser).callonParagraphWithHeadingSpacesLines1, expr: &seqExpr{ - pos: position{line: 1517, col: 5, offset: 57449}, + pos: position{line: 1504, col: 5, offset: 57429}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1517, col: 5, offset: 57449}, + pos: position{line: 1504, col: 5, offset: 57429}, label: "firstLine", expr: &actionExpr{ - pos: position{line: 1517, col: 16, offset: 57460}, + pos: position{line: 1504, col: 16, offset: 57440}, run: (*parser).callonParagraphWithHeadingSpacesLines4, expr: &seqExpr{ - pos: position{line: 1517, col: 16, offset: 57460}, + pos: position{line: 1504, col: 16, offset: 57440}, exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1517, col: 16, offset: 57460}, - name: "WS", + &oneOrMoreExpr{ + pos: position{line: 1504, col: 16, offset: 57440}, + expr: &ruleRefExpr{ + pos: position{line: 1504, col: 16, offset: 57440}, + name: "Space", + }, }, &oneOrMoreExpr{ - pos: position{line: 1517, col: 19, offset: 57463}, - expr: &choiceExpr{ - pos: position{line: 1517, col: 20, offset: 57464}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1517, col: 20, offset: 57464}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 1517, col: 32, offset: 57476}, - name: "Spaces", - }, - &actionExpr{ - pos: position{line: 1517, col: 41, offset: 57485}, - run: (*parser).callonParagraphWithHeadingSpacesLines11, - expr: &seqExpr{ - pos: position{line: 1517, col: 42, offset: 57486}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1517, col: 42, offset: 57486}, - expr: &ruleRefExpr{ - pos: position{line: 1517, col: 43, offset: 57487}, - name: "EOL", - }, - }, - &anyMatcher{ - line: 1517, col: 48, offset: 57492, - }, - }, - }, - }, - }, + pos: position{line: 1504, col: 23, offset: 57447}, + expr: &charClassMatcher{ + pos: position{line: 1504, col: 23, offset: 57447}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, @@ -12078,68 +10882,47 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 1521, col: 8, offset: 57583}, + pos: position{line: 1506, col: 8, offset: 57500}, name: "EOL", }, &labeledExpr{ - pos: position{line: 1522, col: 5, offset: 57646}, + pos: position{line: 1507, col: 5, offset: 57563}, label: "otherLines", expr: &zeroOrMoreExpr{ - pos: position{line: 1522, col: 16, offset: 57657}, + pos: position{line: 1507, col: 16, offset: 57574}, expr: &actionExpr{ - pos: position{line: 1523, col: 9, offset: 57667}, - run: (*parser).callonParagraphWithHeadingSpacesLines19, + pos: position{line: 1508, col: 9, offset: 57584}, + run: (*parser).callonParagraphWithHeadingSpacesLines13, expr: &seqExpr{ - pos: position{line: 1523, col: 9, offset: 57667}, + pos: position{line: 1508, col: 9, offset: 57584}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1523, col: 9, offset: 57667}, + pos: position{line: 1508, col: 9, offset: 57584}, expr: &ruleRefExpr{ - pos: position{line: 1523, col: 10, offset: 57668}, + pos: position{line: 1508, col: 10, offset: 57585}, name: "BlankLine", }, }, &labeledExpr{ - pos: position{line: 1524, col: 9, offset: 57687}, + pos: position{line: 1509, col: 9, offset: 57604}, label: "otherLine", expr: &actionExpr{ - pos: position{line: 1524, col: 20, offset: 57698}, - run: (*parser).callonParagraphWithHeadingSpacesLines24, + pos: position{line: 1509, col: 20, offset: 57615}, + run: (*parser).callonParagraphWithHeadingSpacesLines18, expr: &oneOrMoreExpr{ - pos: position{line: 1524, col: 20, offset: 57698}, - expr: &choiceExpr{ - pos: position{line: 1524, col: 21, offset: 57699}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1524, col: 21, offset: 57699}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 1524, col: 33, offset: 57711}, - name: "Spaces", - }, - &seqExpr{ - pos: position{line: 1524, col: 43, offset: 57721}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1524, col: 43, offset: 57721}, - expr: &ruleRefExpr{ - pos: position{line: 1524, col: 44, offset: 57722}, - name: "EOL", - }, - }, - &anyMatcher{ - line: 1524, col: 49, offset: 57727, - }, - }, - }, - }, + pos: position{line: 1509, col: 20, offset: 57615}, + expr: &charClassMatcher{ + pos: position{line: 1509, col: 20, offset: 57615}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, &ruleRefExpr{ - pos: position{line: 1526, col: 12, offset: 57784}, + pos: position{line: 1511, col: 12, offset: 57676}, name: "EOL", }, }, @@ -12153,72 +10936,72 @@ var g = &grammar{ }, { name: "ParagraphWithLiteralBlockDelimiter", - pos: position{line: 1533, col: 1, offset: 58014}, + pos: position{line: 1518, col: 1, offset: 57906}, expr: &actionExpr{ - pos: position{line: 1533, col: 39, offset: 58052}, + pos: position{line: 1518, col: 39, offset: 57944}, run: (*parser).callonParagraphWithLiteralBlockDelimiter1, expr: &seqExpr{ - pos: position{line: 1533, col: 39, offset: 58052}, + pos: position{line: 1518, col: 39, offset: 57944}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1533, col: 39, offset: 58052}, + pos: position{line: 1518, col: 39, offset: 57944}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1533, col: 50, offset: 58063}, + pos: position{line: 1518, col: 50, offset: 57955}, expr: &ruleRefExpr{ - pos: position{line: 1533, col: 51, offset: 58064}, + pos: position{line: 1518, col: 51, offset: 57956}, name: "ElementAttributes", }, }, }, &ruleRefExpr{ - pos: position{line: 1534, col: 9, offset: 58092}, + pos: position{line: 1519, col: 9, offset: 57984}, name: "LiteralBlockDelimiter", }, &zeroOrMoreExpr{ - pos: position{line: 1534, col: 31, offset: 58114}, + pos: position{line: 1519, col: 31, offset: 58006}, expr: &ruleRefExpr{ - pos: position{line: 1534, col: 31, offset: 58114}, - name: "WS", + pos: position{line: 1519, col: 31, offset: 58006}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1534, col: 35, offset: 58118}, + pos: position{line: 1519, col: 38, offset: 58013}, name: "Newline", }, &labeledExpr{ - pos: position{line: 1534, col: 43, offset: 58126}, + pos: position{line: 1519, col: 46, offset: 58021}, label: "lines", expr: &ruleRefExpr{ - pos: position{line: 1534, col: 50, offset: 58133}, + pos: position{line: 1519, col: 53, offset: 58028}, name: "ParagraphWithLiteralBlockDelimiterLines", }, }, &choiceExpr{ - pos: position{line: 1534, col: 92, offset: 58175}, + pos: position{line: 1519, col: 95, offset: 58070}, alternatives: []interface{}{ &seqExpr{ - pos: position{line: 1534, col: 93, offset: 58176}, + pos: position{line: 1519, col: 96, offset: 58071}, exprs: []interface{}{ &ruleRefExpr{ - pos: position{line: 1534, col: 93, offset: 58176}, + pos: position{line: 1519, col: 96, offset: 58071}, name: "LiteralBlockDelimiter", }, &zeroOrMoreExpr{ - pos: position{line: 1534, col: 115, offset: 58198}, + pos: position{line: 1519, col: 118, offset: 58093}, expr: &ruleRefExpr{ - pos: position{line: 1534, col: 115, offset: 58198}, - name: "WS", + pos: position{line: 1519, col: 118, offset: 58093}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1534, col: 119, offset: 58202}, + pos: position{line: 1519, col: 125, offset: 58100}, name: "EOL", }, }, }, &ruleRefExpr{ - pos: position{line: 1534, col: 126, offset: 58209}, + pos: position{line: 1519, col: 132, offset: 58107}, name: "EOF", }, }, @@ -12229,17 +11012,17 @@ var g = &grammar{ }, { name: "ParagraphWithLiteralBlockDelimiterLines", - pos: position{line: 1539, col: 1, offset: 58368}, + pos: position{line: 1524, col: 1, offset: 58266}, expr: &actionExpr{ - pos: position{line: 1539, col: 44, offset: 58411}, + pos: position{line: 1524, col: 44, offset: 58309}, run: (*parser).callonParagraphWithLiteralBlockDelimiterLines1, expr: &labeledExpr{ - pos: position{line: 1539, col: 44, offset: 58411}, + pos: position{line: 1524, col: 44, offset: 58309}, label: "lines", expr: &zeroOrMoreExpr{ - pos: position{line: 1539, col: 50, offset: 58417}, + pos: position{line: 1524, col: 50, offset: 58315}, expr: &ruleRefExpr{ - pos: position{line: 1539, col: 51, offset: 58418}, + pos: position{line: 1524, col: 51, offset: 58316}, name: "ParagraphWithLiteralBlockDelimiterLine", }, }, @@ -12248,53 +11031,37 @@ var g = &grammar{ }, { name: "ParagraphWithLiteralBlockDelimiterLine", - pos: position{line: 1543, col: 1, offset: 58502}, + pos: position{line: 1528, col: 1, offset: 58400}, expr: &actionExpr{ - pos: position{line: 1544, col: 5, offset: 58557}, + pos: position{line: 1529, col: 5, offset: 58455}, run: (*parser).callonParagraphWithLiteralBlockDelimiterLine1, expr: &seqExpr{ - pos: position{line: 1544, col: 5, offset: 58557}, + pos: position{line: 1529, col: 5, offset: 58455}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1544, col: 5, offset: 58557}, + pos: position{line: 1529, col: 5, offset: 58455}, label: "line", expr: &actionExpr{ - pos: position{line: 1544, col: 11, offset: 58563}, + pos: position{line: 1529, col: 11, offset: 58461}, run: (*parser).callonParagraphWithLiteralBlockDelimiterLine4, - expr: &zeroOrMoreExpr{ - pos: position{line: 1544, col: 11, offset: 58563}, - expr: &choiceExpr{ - pos: position{line: 1544, col: 12, offset: 58564}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1544, col: 12, offset: 58564}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 1544, col: 24, offset: 58576}, - name: "Spaces", + expr: &seqExpr{ + pos: position{line: 1529, col: 11, offset: 58461}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1529, col: 11, offset: 58461}, + expr: &ruleRefExpr{ + pos: position{line: 1529, col: 12, offset: 58462}, + name: "LiteralBlockDelimiter", }, - &seqExpr{ - pos: position{line: 1544, col: 34, offset: 58586}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1544, col: 34, offset: 58586}, - expr: &ruleRefExpr{ - pos: position{line: 1544, col: 35, offset: 58587}, - name: "LiteralBlockDelimiter", - }, - }, - ¬Expr{ - pos: position{line: 1544, col: 57, offset: 58609}, - expr: &ruleRefExpr{ - pos: position{line: 1544, col: 58, offset: 58610}, - name: "EOL", - }, - }, - &anyMatcher{ - line: 1544, col: 62, offset: 58614, - }, - }, + }, + &zeroOrMoreExpr{ + pos: position{line: 1529, col: 34, offset: 58484}, + expr: &charClassMatcher{ + pos: position{line: 1529, col: 34, offset: 58484}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, @@ -12302,7 +11069,7 @@ var g = &grammar{ }, }, &ruleRefExpr{ - pos: position{line: 1546, col: 8, offset: 58663}, + pos: position{line: 1531, col: 8, offset: 58537}, name: "EOL", }, }, @@ -12311,33 +11078,33 @@ var g = &grammar{ }, { name: "ParagraphWithLiteralAttribute", - pos: position{line: 1551, col: 1, offset: 58789}, + pos: position{line: 1536, col: 1, offset: 58663}, expr: &actionExpr{ - pos: position{line: 1552, col: 5, offset: 58827}, + pos: position{line: 1537, col: 5, offset: 58701}, run: (*parser).callonParagraphWithLiteralAttribute1, expr: &seqExpr{ - pos: position{line: 1552, col: 5, offset: 58827}, + pos: position{line: 1537, col: 5, offset: 58701}, exprs: []interface{}{ &labeledExpr{ - pos: position{line: 1552, col: 5, offset: 58827}, + pos: position{line: 1537, col: 5, offset: 58701}, label: "attributes", expr: &zeroOrOneExpr{ - pos: position{line: 1552, col: 16, offset: 58838}, + pos: position{line: 1537, col: 16, offset: 58712}, expr: &ruleRefExpr{ - pos: position{line: 1552, col: 17, offset: 58839}, + pos: position{line: 1537, col: 17, offset: 58713}, name: "ElementAttributes", }, }, }, &andCodeExpr{ - pos: position{line: 1553, col: 5, offset: 58863}, + pos: position{line: 1538, col: 5, offset: 58737}, run: (*parser).callonParagraphWithLiteralAttribute6, }, &labeledExpr{ - pos: position{line: 1560, col: 5, offset: 59077}, + pos: position{line: 1545, col: 5, offset: 58951}, label: "lines", expr: &ruleRefExpr{ - pos: position{line: 1560, col: 12, offset: 59084}, + pos: position{line: 1545, col: 12, offset: 58958}, name: "ParagraphWithLiteralAttributeLines", }, }, @@ -12347,30 +11114,31 @@ var g = &grammar{ }, { name: "LiteralKind", - pos: position{line: 1564, col: 1, offset: 59234}, + pos: position{line: 1549, col: 1, offset: 59108}, expr: &actionExpr{ - pos: position{line: 1564, col: 16, offset: 59249}, + pos: position{line: 1549, col: 16, offset: 59123}, run: (*parser).callonLiteralKind1, expr: &litMatcher{ - pos: position{line: 1564, col: 16, offset: 59249}, + pos: position{line: 1549, col: 16, offset: 59123}, val: "literal", ignoreCase: false, + want: "\"literal\"", }, }, }, { name: "ParagraphWithLiteralAttributeLines", - pos: position{line: 1569, col: 1, offset: 59332}, + pos: position{line: 1554, col: 1, offset: 59206}, expr: &actionExpr{ - pos: position{line: 1569, col: 39, offset: 59370}, + pos: position{line: 1554, col: 39, offset: 59244}, run: (*parser).callonParagraphWithLiteralAttributeLines1, expr: &labeledExpr{ - pos: position{line: 1569, col: 39, offset: 59370}, + pos: position{line: 1554, col: 39, offset: 59244}, label: "lines", expr: &oneOrMoreExpr{ - pos: position{line: 1569, col: 45, offset: 59376}, + pos: position{line: 1554, col: 45, offset: 59250}, expr: &ruleRefExpr{ - pos: position{line: 1569, col: 46, offset: 59377}, + pos: position{line: 1554, col: 46, offset: 59251}, name: "ParagraphWithLiteralAttributeLine", }, }, @@ -12379,66 +11147,40 @@ var g = &grammar{ }, { name: "ParagraphWithLiteralAttributeLine", - pos: position{line: 1573, col: 1, offset: 59457}, + pos: position{line: 1558, col: 1, offset: 59331}, expr: &actionExpr{ - pos: position{line: 1573, col: 38, offset: 59494}, + pos: position{line: 1558, col: 38, offset: 59368}, run: (*parser).callonParagraphWithLiteralAttributeLine1, expr: &seqExpr{ - pos: position{line: 1573, col: 38, offset: 59494}, + pos: position{line: 1558, col: 38, offset: 59368}, exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1558, col: 38, offset: 59368}, + expr: &ruleRefExpr{ + pos: position{line: 1558, col: 39, offset: 59369}, + name: "BlankLine", + }, + }, &labeledExpr{ - pos: position{line: 1573, col: 38, offset: 59494}, - label: "line", + pos: position{line: 1558, col: 49, offset: 59379}, + label: "content", expr: &actionExpr{ - pos: position{line: 1573, col: 44, offset: 59500}, - run: (*parser).callonParagraphWithLiteralAttributeLine4, - expr: &seqExpr{ - pos: position{line: 1573, col: 44, offset: 59500}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1573, col: 44, offset: 59500}, - expr: &ruleRefExpr{ - pos: position{line: 1573, col: 46, offset: 59502}, - name: "BlankLine", - }, - }, - &oneOrMoreExpr{ - pos: position{line: 1573, col: 57, offset: 59513}, - expr: &choiceExpr{ - pos: position{line: 1573, col: 58, offset: 59514}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1573, col: 58, offset: 59514}, - name: "Alphanums", - }, - &ruleRefExpr{ - pos: position{line: 1573, col: 70, offset: 59526}, - name: "Spaces", - }, - &seqExpr{ - pos: position{line: 1573, col: 80, offset: 59536}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1573, col: 80, offset: 59536}, - expr: &ruleRefExpr{ - pos: position{line: 1573, col: 81, offset: 59537}, - name: "EOL", - }, - }, - &anyMatcher{ - line: 1573, col: 86, offset: 59542, - }, - }, - }, - }, - }, - }, + pos: position{line: 1558, col: 58, offset: 59388}, + run: (*parser).callonParagraphWithLiteralAttributeLine6, + expr: &oneOrMoreExpr{ + pos: position{line: 1558, col: 58, offset: 59388}, + expr: &charClassMatcher{ + pos: position{line: 1558, col: 58, offset: 59388}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, }, &ruleRefExpr{ - pos: position{line: 1575, col: 4, offset: 59583}, + pos: position{line: 1560, col: 4, offset: 59433}, name: "EOL", }, }, @@ -12447,30 +11189,32 @@ var g = &grammar{ }, { name: "IndexTerm", - pos: position{line: 1582, col: 1, offset: 59757}, + pos: position{line: 1567, col: 1, offset: 59619}, expr: &actionExpr{ - pos: position{line: 1582, col: 14, offset: 59770}, + pos: position{line: 1567, col: 14, offset: 59632}, run: (*parser).callonIndexTerm1, expr: &seqExpr{ - pos: position{line: 1582, col: 14, offset: 59770}, + pos: position{line: 1567, col: 14, offset: 59632}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1582, col: 14, offset: 59770}, + pos: position{line: 1567, col: 14, offset: 59632}, val: "((", ignoreCase: false, + want: "\"((\"", }, &labeledExpr{ - pos: position{line: 1582, col: 19, offset: 59775}, + pos: position{line: 1567, col: 19, offset: 59637}, label: "term", expr: &ruleRefExpr{ - pos: position{line: 1582, col: 25, offset: 59781}, + pos: position{line: 1567, col: 25, offset: 59643}, name: "IndexTermContent", }, }, &litMatcher{ - pos: position{line: 1582, col: 43, offset: 59799}, + pos: position{line: 1567, col: 43, offset: 59661}, val: "))", ignoreCase: false, + want: "\"))\"", }, }, }, @@ -12478,54 +11222,48 @@ var g = &grammar{ }, { name: "IndexTermContent", - pos: position{line: 1586, col: 1, offset: 59864}, + pos: position{line: 1571, col: 1, offset: 59726}, expr: &actionExpr{ - pos: position{line: 1586, col: 21, offset: 59884}, + pos: position{line: 1571, col: 21, offset: 59746}, run: (*parser).callonIndexTermContent1, expr: &labeledExpr{ - pos: position{line: 1586, col: 21, offset: 59884}, + pos: position{line: 1571, col: 21, offset: 59746}, label: "elements", expr: &oneOrMoreExpr{ - pos: position{line: 1586, col: 30, offset: 59893}, + pos: position{line: 1571, col: 30, offset: 59755}, expr: &choiceExpr{ - pos: position{line: 1586, col: 31, offset: 59894}, + pos: position{line: 1571, col: 31, offset: 59756}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1586, col: 31, offset: 59894}, - name: "SimpleWord", + pos: position{line: 1571, col: 31, offset: 59756}, + name: "Word", }, &ruleRefExpr{ - pos: position{line: 1586, col: 44, offset: 59907}, + pos: position{line: 1571, col: 38, offset: 59763}, name: "QuotedText", }, &ruleRefExpr{ - pos: position{line: 1586, col: 57, offset: 59920}, - name: "WS", - }, - &ruleRefExpr{ - pos: position{line: 1586, col: 62, offset: 59925}, - name: "AnyChars", + pos: position{line: 1571, col: 51, offset: 59776}, + name: "Space", }, &actionExpr{ - pos: position{line: 1586, col: 73, offset: 59936}, - run: (*parser).callonIndexTermContent9, - expr: &oneOrMoreExpr{ - pos: position{line: 1586, col: 73, offset: 59936}, - expr: &seqExpr{ - pos: position{line: 1586, col: 74, offset: 59937}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1586, col: 74, offset: 59937}, - expr: &litMatcher{ - pos: position{line: 1586, col: 75, offset: 59938}, - val: "))", - ignoreCase: false, - }, - }, - &anyMatcher{ - line: 1586, col: 80, offset: 59943, + pos: position{line: 1571, col: 59, offset: 59784}, + run: (*parser).callonIndexTermContent8, + expr: &seqExpr{ + pos: position{line: 1571, col: 60, offset: 59785}, + exprs: []interface{}{ + ¬Expr{ + pos: position{line: 1571, col: 60, offset: 59785}, + expr: &litMatcher{ + pos: position{line: 1571, col: 61, offset: 59786}, + val: "))", + ignoreCase: false, + want: "\"))\"", }, }, + &anyMatcher{ + line: 1571, col: 66, offset: 59791, + }, }, }, }, @@ -12537,61 +11275,63 @@ var g = &grammar{ }, { name: "ConcealedIndexTerm", - pos: position{line: 1592, col: 1, offset: 60050}, + pos: position{line: 1577, col: 1, offset: 59897}, expr: &actionExpr{ - pos: position{line: 1592, col: 23, offset: 60072}, + pos: position{line: 1577, col: 23, offset: 59919}, run: (*parser).callonConcealedIndexTerm1, expr: &seqExpr{ - pos: position{line: 1592, col: 23, offset: 60072}, + pos: position{line: 1577, col: 23, offset: 59919}, exprs: []interface{}{ &litMatcher{ - pos: position{line: 1592, col: 23, offset: 60072}, + pos: position{line: 1577, col: 23, offset: 59919}, val: "(((", ignoreCase: false, + want: "\"(((\"", }, &labeledExpr{ - pos: position{line: 1592, col: 29, offset: 60078}, + pos: position{line: 1577, col: 29, offset: 59925}, label: "term1", expr: &ruleRefExpr{ - pos: position{line: 1592, col: 36, offset: 60085}, + pos: position{line: 1577, col: 36, offset: 59932}, name: "ConcealedIndexTermContent", }, }, &labeledExpr{ - pos: position{line: 1593, col: 5, offset: 60117}, + pos: position{line: 1578, col: 5, offset: 59964}, label: "term2", expr: &zeroOrOneExpr{ - pos: position{line: 1593, col: 11, offset: 60123}, + pos: position{line: 1578, col: 11, offset: 59970}, expr: &actionExpr{ - pos: position{line: 1593, col: 12, offset: 60124}, + pos: position{line: 1578, col: 12, offset: 59971}, run: (*parser).callonConcealedIndexTerm8, expr: &seqExpr{ - pos: position{line: 1593, col: 12, offset: 60124}, + pos: position{line: 1578, col: 12, offset: 59971}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 1593, col: 12, offset: 60124}, + pos: position{line: 1578, col: 12, offset: 59971}, expr: &ruleRefExpr{ - pos: position{line: 1593, col: 12, offset: 60124}, - name: "WS", + pos: position{line: 1578, col: 12, offset: 59971}, + name: "Space", }, }, &litMatcher{ - pos: position{line: 1593, col: 16, offset: 60128}, + pos: position{line: 1578, col: 19, offset: 59978}, val: ",", ignoreCase: false, + want: "\",\"", }, &zeroOrMoreExpr{ - pos: position{line: 1593, col: 20, offset: 60132}, + pos: position{line: 1578, col: 23, offset: 59982}, expr: &ruleRefExpr{ - pos: position{line: 1593, col: 20, offset: 60132}, - name: "WS", + pos: position{line: 1578, col: 23, offset: 59982}, + name: "Space", }, }, &labeledExpr{ - pos: position{line: 1593, col: 24, offset: 60136}, + pos: position{line: 1578, col: 30, offset: 59989}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1593, col: 33, offset: 60145}, + pos: position{line: 1578, col: 39, offset: 59998}, name: "ConcealedIndexTermContent", }, }, @@ -12601,40 +11341,41 @@ var g = &grammar{ }, }, &labeledExpr{ - pos: position{line: 1594, col: 5, offset: 60203}, + pos: position{line: 1579, col: 5, offset: 60056}, label: "term3", expr: &zeroOrOneExpr{ - pos: position{line: 1594, col: 11, offset: 60209}, + pos: position{line: 1579, col: 11, offset: 60062}, expr: &actionExpr{ - pos: position{line: 1594, col: 12, offset: 60210}, + pos: position{line: 1579, col: 12, offset: 60063}, run: (*parser).callonConcealedIndexTerm19, expr: &seqExpr{ - pos: position{line: 1594, col: 12, offset: 60210}, + pos: position{line: 1579, col: 12, offset: 60063}, exprs: []interface{}{ &zeroOrMoreExpr{ - pos: position{line: 1594, col: 12, offset: 60210}, + pos: position{line: 1579, col: 12, offset: 60063}, expr: &ruleRefExpr{ - pos: position{line: 1594, col: 12, offset: 60210}, - name: "WS", + pos: position{line: 1579, col: 12, offset: 60063}, + name: "Space", }, }, &litMatcher{ - pos: position{line: 1594, col: 16, offset: 60214}, + pos: position{line: 1579, col: 19, offset: 60070}, val: ",", ignoreCase: false, + want: "\",\"", }, &zeroOrMoreExpr{ - pos: position{line: 1594, col: 20, offset: 60218}, + pos: position{line: 1579, col: 23, offset: 60074}, expr: &ruleRefExpr{ - pos: position{line: 1594, col: 20, offset: 60218}, - name: "WS", + pos: position{line: 1579, col: 23, offset: 60074}, + name: "Space", }, }, &labeledExpr{ - pos: position{line: 1594, col: 24, offset: 60222}, + pos: position{line: 1579, col: 30, offset: 60081}, label: "content", expr: &ruleRefExpr{ - pos: position{line: 1594, col: 33, offset: 60231}, + pos: position{line: 1579, col: 39, offset: 60090}, name: "ConcealedIndexTermContent", }, }, @@ -12644,9 +11385,10 @@ var g = &grammar{ }, }, &litMatcher{ - pos: position{line: 1595, col: 5, offset: 60289}, + pos: position{line: 1580, col: 5, offset: 60148}, val: ")))", ignoreCase: false, + want: "\")))\"", }, }, }, @@ -12654,22 +11396,22 @@ var g = &grammar{ }, { name: "ConcealedIndexTermContent", - pos: position{line: 1599, col: 1, offset: 60368}, + pos: position{line: 1584, col: 1, offset: 60227}, expr: &actionExpr{ - pos: position{line: 1599, col: 30, offset: 60397}, + pos: position{line: 1584, col: 30, offset: 60256}, run: (*parser).callonConcealedIndexTermContent1, expr: &oneOrMoreExpr{ - pos: position{line: 1599, col: 30, offset: 60397}, + pos: position{line: 1584, col: 30, offset: 60256}, expr: &choiceExpr{ - pos: position{line: 1599, col: 31, offset: 60398}, + pos: position{line: 1584, col: 31, offset: 60257}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1599, col: 31, offset: 60398}, + pos: position{line: 1584, col: 31, offset: 60257}, name: "Alphanum", }, &ruleRefExpr{ - pos: position{line: 1599, col: 42, offset: 60409}, - name: "WS", + pos: position{line: 1584, col: 42, offset: 60268}, + name: "Space", }, }, }, @@ -12678,29 +11420,29 @@ var g = &grammar{ }, { name: "BlankLine", - pos: position{line: 1605, col: 1, offset: 60554}, + pos: position{line: 1591, col: 1, offset: 60417}, expr: &actionExpr{ - pos: position{line: 1605, col: 14, offset: 60567}, + pos: position{line: 1591, col: 14, offset: 60430}, run: (*parser).callonBlankLine1, expr: &seqExpr{ - pos: position{line: 1605, col: 14, offset: 60567}, + pos: position{line: 1591, col: 14, offset: 60430}, exprs: []interface{}{ ¬Expr{ - pos: position{line: 1605, col: 14, offset: 60567}, + pos: position{line: 1591, col: 14, offset: 60430}, expr: &ruleRefExpr{ - pos: position{line: 1605, col: 15, offset: 60568}, + pos: position{line: 1591, col: 15, offset: 60431}, name: "EOF", }, }, &zeroOrMoreExpr{ - pos: position{line: 1605, col: 19, offset: 60572}, + pos: position{line: 1591, col: 19, offset: 60435}, expr: &ruleRefExpr{ - pos: position{line: 1605, col: 19, offset: 60572}, - name: "WS", + pos: position{line: 1591, col: 19, offset: 60435}, + name: "Space", }, }, &ruleRefExpr{ - pos: position{line: 1605, col: 23, offset: 60576}, + pos: position{line: 1591, col: 26, offset: 60442}, name: "EOL", }, }, @@ -12709,9 +11451,9 @@ var g = &grammar{ }, { name: "Alphanum", - pos: position{line: 1612, col: 1, offset: 60723}, + pos: position{line: 1598, col: 1, offset: 60589}, expr: &charClassMatcher{ - pos: position{line: 1612, col: 13, offset: 60735}, + pos: position{line: 1598, col: 13, offset: 60601}, val: "[\\pL0-9]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, @@ -12721,53 +11463,59 @@ var g = &grammar{ }, { name: "Parenthesis", - pos: position{line: 1614, col: 1, offset: 60745}, + pos: position{line: 1600, col: 1, offset: 60611}, expr: &choiceExpr{ - pos: position{line: 1614, col: 16, offset: 60760}, + pos: position{line: 1600, col: 16, offset: 60626}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1614, col: 16, offset: 60760}, + pos: position{line: 1600, col: 16, offset: 60626}, val: "(", ignoreCase: false, + want: "\"(\"", }, &litMatcher{ - pos: position{line: 1614, col: 22, offset: 60766}, + pos: position{line: 1600, col: 22, offset: 60632}, val: ")", ignoreCase: false, + want: "\")\"", }, &litMatcher{ - pos: position{line: 1614, col: 28, offset: 60772}, + pos: position{line: 1600, col: 28, offset: 60638}, val: "[", ignoreCase: false, + want: "\"[\"", }, &litMatcher{ - pos: position{line: 1614, col: 34, offset: 60778}, + pos: position{line: 1600, col: 34, offset: 60644}, val: "]", ignoreCase: false, + want: "\"]\"", }, &litMatcher{ - pos: position{line: 1614, col: 40, offset: 60784}, + pos: position{line: 1600, col: 40, offset: 60650}, val: "{", ignoreCase: false, + want: "\"{\"", }, &litMatcher{ - pos: position{line: 1614, col: 46, offset: 60790}, + pos: position{line: 1600, col: 46, offset: 60656}, val: "}", ignoreCase: false, + want: "\"}\"", }, }, }, }, { name: "Alphanums", - pos: position{line: 1616, col: 1, offset: 60796}, + pos: position{line: 1602, col: 1, offset: 60662}, expr: &actionExpr{ - pos: position{line: 1616, col: 14, offset: 60809}, + pos: position{line: 1602, col: 14, offset: 60675}, run: (*parser).callonAlphanums1, expr: &oneOrMoreExpr{ - pos: position{line: 1616, col: 14, offset: 60809}, + pos: position{line: 1602, col: 14, offset: 60675}, expr: &charClassMatcher{ - pos: position{line: 1616, col: 14, offset: 60809}, + pos: position{line: 1602, col: 14, offset: 60675}, val: "[\\pL0-9]", ranges: []rune{'0', '9'}, classes: []*unicode.RangeTable{rangeTable("L")}, @@ -12778,99 +11526,91 @@ var g = &grammar{ }, }, { - name: "AlphanumsAndSpaces", - pos: position{line: 1620, col: 1, offset: 60855}, - expr: &actionExpr{ - pos: position{line: 1620, col: 23, offset: 60877}, - run: (*parser).callonAlphanumsAndSpaces1, - expr: &oneOrMoreExpr{ - pos: position{line: 1620, col: 23, offset: 60877}, - expr: &charClassMatcher{ - pos: position{line: 1620, col: 23, offset: 60877}, - val: "[\\pL0-9 ]", - chars: []rune{' '}, - ranges: []rune{'0', '9'}, - classes: []*unicode.RangeTable{rangeTable("L")}, - ignoreCase: false, - inverted: false, - }, - }, - }, - }, - { - name: "PunctuationMark", - pos: position{line: 1624, col: 1, offset: 60924}, + name: "Word", + pos: position{line: 1606, col: 1, offset: 60721}, expr: &choiceExpr{ - pos: position{line: 1624, col: 20, offset: 60943}, + pos: position{line: 1610, col: 5, offset: 61049}, alternatives: []interface{}{ - &litMatcher{ - pos: position{line: 1624, col: 20, offset: 60943}, - val: ".", - ignoreCase: false, - }, - &litMatcher{ - pos: position{line: 1624, col: 26, offset: 60949}, - val: "?", - ignoreCase: false, - }, - &litMatcher{ - pos: position{line: 1624, col: 32, offset: 60955}, - val: "!", - ignoreCase: false, - }, - &litMatcher{ - pos: position{line: 1624, col: 38, offset: 60961}, - val: ",", - ignoreCase: false, - }, - &litMatcher{ - pos: position{line: 1624, col: 44, offset: 60967}, - val: ";", - ignoreCase: false, - }, - &litMatcher{ - pos: position{line: 1624, col: 50, offset: 60973}, - val: ":", - ignoreCase: false, - }, - }, - }, - }, - { - name: "SimpleWord", - pos: position{line: 1626, col: 1, offset: 60978}, - expr: &actionExpr{ - pos: position{line: 1626, col: 15, offset: 60992}, - run: (*parser).callonSimpleWord1, - expr: &seqExpr{ - pos: position{line: 1626, col: 15, offset: 60992}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1626, col: 15, offset: 60992}, - name: "Alphanums", - }, - &andExpr{ - pos: position{line: 1626, col: 25, offset: 61002}, - expr: &choiceExpr{ - pos: position{line: 1626, col: 27, offset: 61004}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1626, col: 27, offset: 61004}, - name: "WS", - }, - &litMatcher{ - pos: position{line: 1626, col: 32, offset: 61009}, - val: ",", + &actionExpr{ + pos: position{line: 1610, col: 5, offset: 61049}, + run: (*parser).callonWord2, + expr: &seqExpr{ + pos: position{line: 1610, col: 5, offset: 61049}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1610, col: 5, offset: 61049}, + expr: &charClassMatcher{ + pos: position{line: 1610, col: 5, offset: 61049}, + val: "[\\pL0-9]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, + inverted: false, + }, + }, + &andExpr{ + pos: position{line: 1610, col: 15, offset: 61059}, + expr: &choiceExpr{ + pos: position{line: 1610, col: 17, offset: 61061}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 1610, col: 17, offset: 61061}, + val: "[\\r\\n ,\\]]", + chars: []rune{'\r', '\n', ' ', ',', ']'}, + ignoreCase: false, + inverted: false, + }, + &ruleRefExpr{ + pos: position{line: 1610, col: 30, offset: 61074}, + name: "EOF", + }, + }, }, - &litMatcher{ - pos: position{line: 1626, col: 38, offset: 61015}, - val: "]", + }, + }, + }, + }, + &actionExpr{ + pos: position{line: 1612, col: 9, offset: 61144}, + run: (*parser).callonWord10, + expr: &seqExpr{ + pos: position{line: 1612, col: 9, offset: 61144}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1612, col: 9, offset: 61144}, + expr: &charClassMatcher{ + pos: position{line: 1612, col: 9, offset: 61144}, + val: "[\\pL0-9]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, ignoreCase: false, + inverted: false, }, - &ruleRefExpr{ - pos: position{line: 1626, col: 44, offset: 61021}, - name: "EOL", + }, + &oneOrMoreExpr{ + pos: position{line: 1612, col: 19, offset: 61154}, + expr: &seqExpr{ + pos: position{line: 1612, col: 20, offset: 61155}, + exprs: []interface{}{ + &charClassMatcher{ + pos: position{line: 1612, col: 20, offset: 61155}, + val: "[=*_`]", + chars: []rune{'=', '*', '_', '`'}, + ignoreCase: false, + inverted: false, + }, + &oneOrMoreExpr{ + pos: position{line: 1612, col: 27, offset: 61162}, + expr: &charClassMatcher{ + pos: position{line: 1612, col: 27, offset: 61162}, + val: "[\\pL0-9]", + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, + }, + }, + }, }, }, }, @@ -12880,118 +11620,44 @@ var g = &grammar{ }, }, { - name: "AnyChars", - pos: position{line: 1630, col: 1, offset: 61228}, + name: "InlineWord", + pos: position{line: 1616, col: 1, offset: 61238}, expr: &choiceExpr{ - pos: position{line: 1630, col: 13, offset: 61240}, + pos: position{line: 1617, col: 5, offset: 61319}, alternatives: []interface{}{ - &oneOrMoreExpr{ - pos: position{line: 1630, col: 13, offset: 61240}, - expr: &choiceExpr{ - pos: position{line: 1632, col: 5, offset: 61397}, - alternatives: []interface{}{ - &actionExpr{ - pos: position{line: 1632, col: 5, offset: 61397}, - run: (*parser).callonAnyChars4, - expr: &seqExpr{ - pos: position{line: 1632, col: 6, offset: 61398}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1632, col: 6, offset: 61398}, - expr: &choiceExpr{ - pos: position{line: 1632, col: 8, offset: 61400}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1632, col: 8, offset: 61400}, - name: "Alphanum", - }, - &litMatcher{ - pos: position{line: 1632, col: 19, offset: 61411}, - val: ",", - ignoreCase: false, - }, - &litMatcher{ - pos: position{line: 1632, col: 25, offset: 61417}, - val: ";", - ignoreCase: false, - }, - &litMatcher{ - pos: position{line: 1632, col: 31, offset: 61423}, - val: "}", - ignoreCase: false, - }, - }, - }, - }, - &ruleRefExpr{ - pos: position{line: 1632, col: 36, offset: 61428}, - name: "ConstrainedQuotedTextMarker", - }, - }, + &actionExpr{ + pos: position{line: 1617, col: 5, offset: 61319}, + run: (*parser).callonInlineWord2, + expr: &seqExpr{ + pos: position{line: 1617, col: 5, offset: 61319}, + exprs: []interface{}{ + &oneOrMoreExpr{ + pos: position{line: 1617, col: 5, offset: 61319}, + expr: &charClassMatcher{ + pos: position{line: 1617, col: 5, offset: 61319}, + val: "[\\pL0-9,.?!;]", + chars: []rune{',', '.', '?', '!', ';'}, + ranges: []rune{'0', '9'}, + classes: []*unicode.RangeTable{rangeTable("L")}, + ignoreCase: false, + inverted: false, }, }, - &actionExpr{ - pos: position{line: 1636, col: 8, offset: 61576}, - run: (*parser).callonAnyChars13, - expr: &seqExpr{ - pos: position{line: 1636, col: 9, offset: 61577}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1636, col: 9, offset: 61577}, - name: "Alphanums", + &andExpr{ + pos: position{line: 1617, col: 20, offset: 61334}, + expr: &choiceExpr{ + pos: position{line: 1617, col: 22, offset: 61336}, + alternatives: []interface{}{ + &charClassMatcher{ + pos: position{line: 1617, col: 22, offset: 61336}, + val: "[\\r\\n ]", + chars: []rune{'\r', '\n', ' '}, + ignoreCase: false, + inverted: false, }, - &zeroOrOneExpr{ - pos: position{line: 1636, col: 19, offset: 61587}, - expr: &seqExpr{ - pos: position{line: 1636, col: 20, offset: 61588}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1636, col: 20, offset: 61588}, - expr: &ruleRefExpr{ - pos: position{line: 1636, col: 21, offset: 61589}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 1636, col: 29, offset: 61597}, - expr: &ruleRefExpr{ - pos: position{line: 1636, col: 30, offset: 61598}, - name: "WS", - }, - }, - ¬Expr{ - pos: position{line: 1636, col: 33, offset: 61601}, - expr: &ruleRefExpr{ - pos: position{line: 1636, col: 34, offset: 61602}, - name: "Parenthesis", - }, - }, - ¬Expr{ - pos: position{line: 1636, col: 46, offset: 61614}, - expr: &ruleRefExpr{ - pos: position{line: 1636, col: 47, offset: 61615}, - name: "UnconstrainedQuotedTextPrefix", - }, - }, - ¬Expr{ - pos: position{line: 1636, col: 77, offset: 61645}, - expr: &ruleRefExpr{ - pos: position{line: 1636, col: 78, offset: 61646}, - name: "LabeledListItemSeparator", - }, - }, - ¬Expr{ - pos: position{line: 1636, col: 103, offset: 61671}, - expr: &ruleRefExpr{ - pos: position{line: 1636, col: 104, offset: 61672}, - name: "PunctuationMark", - }, - }, - &anyMatcher{ - line: 1636, col: 120, offset: 61688, - }, - }, - }, + &ruleRefExpr{ + pos: position{line: 1617, col: 32, offset: 61346}, + name: "EOF", }, }, }, @@ -12999,71 +11665,48 @@ var g = &grammar{ }, }, }, - &actionExpr{ - pos: position{line: 1639, col: 7, offset: 61746}, - run: (*parser).callonAnyChars31, - expr: &ruleRefExpr{ - pos: position{line: 1639, col: 7, offset: 61746}, - name: "PunctuationMark", - }, + &ruleRefExpr{ + pos: position{line: 1619, col: 9, offset: 61416}, + name: "Word", }, }, }, }, { name: "AnyChar", - pos: position{line: 1644, col: 1, offset: 62036}, + pos: position{line: 1622, col: 1, offset: 61516}, expr: &actionExpr{ - pos: position{line: 1644, col: 12, offset: 62047}, + pos: position{line: 1622, col: 12, offset: 61527}, run: (*parser).callonAnyChar1, - expr: &seqExpr{ - pos: position{line: 1644, col: 12, offset: 62047}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1644, col: 12, offset: 62047}, - expr: &ruleRefExpr{ - pos: position{line: 1644, col: 13, offset: 62048}, - name: "EOF", - }, - }, - &anyMatcher{ - line: 1644, col: 17, offset: 62052, - }, - }, - }, - }, - }, - { - name: "Spaces", - pos: position{line: 1648, col: 1, offset: 62204}, - expr: &oneOrMoreExpr{ - pos: position{line: 1648, col: 11, offset: 62214}, - expr: &ruleRefExpr{ - pos: position{line: 1648, col: 11, offset: 62214}, - name: "WS", + expr: &charClassMatcher{ + pos: position{line: 1622, col: 12, offset: 61527}, + val: "[^\\r\\n]", + chars: []rune{'\r', '\n'}, + ignoreCase: false, + inverted: true, }, }, }, { name: "FileLocation", - pos: position{line: 1650, col: 1, offset: 62220}, + pos: position{line: 1626, col: 1, offset: 61592}, expr: &actionExpr{ - pos: position{line: 1650, col: 17, offset: 62236}, + pos: position{line: 1626, col: 17, offset: 61608}, run: (*parser).callonFileLocation1, expr: &labeledExpr{ - pos: position{line: 1650, col: 17, offset: 62236}, - label: "elements", + pos: position{line: 1626, col: 17, offset: 61608}, + label: "path", expr: &oneOrMoreExpr{ - pos: position{line: 1650, col: 26, offset: 62245}, + pos: position{line: 1626, col: 22, offset: 61613}, expr: &choiceExpr{ - pos: position{line: 1650, col: 27, offset: 62246}, + pos: position{line: 1626, col: 23, offset: 61614}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1650, col: 27, offset: 62246}, + pos: position{line: 1626, col: 23, offset: 61614}, name: "FILENAME", }, &ruleRefExpr{ - pos: position{line: 1650, col: 38, offset: 62257}, + pos: position{line: 1626, col: 34, offset: 61625}, name: "DocumentAttributeSubstitution", }, }, @@ -13074,44 +11717,21 @@ var g = &grammar{ }, { name: "ResolvedFileLocation", - pos: position{line: 1654, col: 1, offset: 62349}, + pos: position{line: 1630, col: 1, offset: 61717}, expr: &actionExpr{ - pos: position{line: 1654, col: 25, offset: 62373}, + pos: position{line: 1630, col: 25, offset: 61741}, run: (*parser).callonResolvedFileLocation1, expr: &labeledExpr{ - pos: position{line: 1654, col: 25, offset: 62373}, - label: "elements", + pos: position{line: 1630, col: 25, offset: 61741}, + label: "path", expr: &oneOrMoreExpr{ - pos: position{line: 1654, col: 34, offset: 62382}, - expr: &seqExpr{ - pos: position{line: 1654, col: 35, offset: 62383}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1654, col: 35, offset: 62383}, - expr: &ruleRefExpr{ - pos: position{line: 1654, col: 36, offset: 62384}, - name: "EOL", - }, - }, - ¬Expr{ - pos: position{line: 1654, col: 40, offset: 62388}, - expr: &ruleRefExpr{ - pos: position{line: 1654, col: 41, offset: 62389}, - name: "WS", - }, - }, - ¬Expr{ - pos: position{line: 1654, col: 44, offset: 62392}, - expr: &litMatcher{ - pos: position{line: 1654, col: 45, offset: 62393}, - val: "[", - ignoreCase: false, - }, - }, - &anyMatcher{ - line: 1654, col: 49, offset: 62397, - }, - }, + pos: position{line: 1630, col: 30, offset: 61746}, + expr: &charClassMatcher{ + pos: position{line: 1630, col: 31, offset: 61747}, + val: "[^\\r\\n []", + chars: []rune{'\r', '\n', ' ', '['}, + ignoreCase: false, + inverted: true, }, }, }, @@ -13119,31 +11739,38 @@ var g = &grammar{ }, { name: "Location", - pos: position{line: 1658, col: 1, offset: 62461}, + pos: position{line: 1634, col: 1, offset: 61819}, expr: &actionExpr{ - pos: position{line: 1658, col: 13, offset: 62473}, + pos: position{line: 1634, col: 13, offset: 61831}, run: (*parser).callonLocation1, - expr: &labeledExpr{ - pos: position{line: 1658, col: 13, offset: 62473}, - label: "elements", - expr: &seqExpr{ - pos: position{line: 1658, col: 23, offset: 62483}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1658, col: 23, offset: 62483}, - name: "URL_SCHEME", + expr: &seqExpr{ + pos: position{line: 1634, col: 13, offset: 61831}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1634, col: 13, offset: 61831}, + label: "scheme", + expr: &zeroOrOneExpr{ + pos: position{line: 1634, col: 20, offset: 61838}, + expr: &ruleRefExpr{ + pos: position{line: 1634, col: 21, offset: 61839}, + name: "URL_SCHEME", + }, }, - &oneOrMoreExpr{ - pos: position{line: 1658, col: 34, offset: 62494}, + }, + &labeledExpr{ + pos: position{line: 1634, col: 34, offset: 61852}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 1634, col: 39, offset: 61857}, expr: &choiceExpr{ - pos: position{line: 1658, col: 35, offset: 62495}, + pos: position{line: 1634, col: 40, offset: 61858}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1658, col: 35, offset: 62495}, + pos: position{line: 1634, col: 40, offset: 61858}, name: "FILENAME", }, &ruleRefExpr{ - pos: position{line: 1658, col: 46, offset: 62506}, + pos: position{line: 1634, col: 51, offset: 61869}, name: "DocumentAttributeSubstitution", }, }, @@ -13155,53 +11782,40 @@ var g = &grammar{ }, }, { - name: "FILENAME", - pos: position{line: 1662, col: 1, offset: 62599}, - expr: &oneOrMoreExpr{ - pos: position{line: 1662, col: 13, offset: 62611}, - expr: &choiceExpr{ - pos: position{line: 1662, col: 14, offset: 62612}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 1662, col: 14, offset: 62612}, - val: "[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~:/?#@!$&;=()*+,_%]", - chars: []rune{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '~', ':', '/', '?', '#', '@', '!', '$', '&', ';', '=', '(', ')', '*', '+', ',', '_', '%'}, - ignoreCase: false, - inverted: false, - }, - &litMatcher{ - pos: position{line: 1662, col: 99, offset: 62697}, - val: "-", - ignoreCase: false, - }, - &litMatcher{ - pos: position{line: 1662, col: 105, offset: 62703}, - val: ".", - ignoreCase: false, - }, - }, - }, - }, - }, - { - name: "ResolvedLocation", - pos: position{line: 1664, col: 1, offset: 62824}, + name: "LocationWithScheme", + pos: position{line: 1638, col: 1, offset: 61965}, expr: &actionExpr{ - pos: position{line: 1664, col: 21, offset: 62844}, - run: (*parser).callonResolvedLocation1, - expr: &labeledExpr{ - pos: position{line: 1664, col: 21, offset: 62844}, - label: "elements", - expr: &seqExpr{ - pos: position{line: 1664, col: 31, offset: 62854}, - exprs: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1664, col: 31, offset: 62854}, + pos: position{line: 1638, col: 23, offset: 61987}, + run: (*parser).callonLocationWithScheme1, + expr: &seqExpr{ + pos: position{line: 1638, col: 23, offset: 61987}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1638, col: 23, offset: 61987}, + label: "scheme", + expr: &ruleRefExpr{ + pos: position{line: 1638, col: 31, offset: 61995}, name: "URL_SCHEME", }, - &ruleRefExpr{ - pos: position{line: 1664, col: 42, offset: 62865}, - name: "RESOLVED_FILENAME", + }, + &labeledExpr{ + pos: position{line: 1638, col: 43, offset: 62007}, + label: "path", + expr: &oneOrMoreExpr{ + pos: position{line: 1638, col: 48, offset: 62012}, + expr: &choiceExpr{ + pos: position{line: 1638, col: 49, offset: 62013}, + alternatives: []interface{}{ + &ruleRefExpr{ + pos: position{line: 1638, col: 49, offset: 62013}, + name: "FILENAME", + }, + &ruleRefExpr{ + pos: position{line: 1638, col: 60, offset: 62024}, + name: "DocumentAttributeSubstitution", + }, + }, + }, }, }, }, @@ -13209,216 +11823,145 @@ var g = &grammar{ }, }, { - name: "RESOLVED_FILENAME", - pos: position{line: 1668, col: 1, offset: 62944}, + name: "FILENAME", + pos: position{line: 1642, col: 1, offset: 62120}, expr: &oneOrMoreExpr{ - pos: position{line: 1668, col: 22, offset: 62965}, - expr: &choiceExpr{ - pos: position{line: 1668, col: 23, offset: 62966}, - alternatives: []interface{}{ - &charClassMatcher{ - pos: position{line: 1668, col: 23, offset: 62966}, - val: "[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~:/?#@!$&;=()*+_,%{}]", - chars: []rune{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '~', ':', '/', '?', '#', '@', '!', '$', '&', ';', '=', '(', ')', '*', '+', '_', ',', '%', '{', '}'}, - ignoreCase: false, - inverted: false, - }, - &litMatcher{ - pos: position{line: 1668, col: 110, offset: 63053}, - val: "-", - ignoreCase: false, - }, - &litMatcher{ - pos: position{line: 1668, col: 116, offset: 63059}, - val: ".", - ignoreCase: false, - }, - }, + pos: position{line: 1642, col: 13, offset: 62132}, + expr: &charClassMatcher{ + pos: position{line: 1642, col: 14, offset: 62133}, + val: "[^\\r\\n{}[\\] ]", + chars: []rune{'\r', '\n', '{', '}', '[', ']', ' '}, + ignoreCase: false, + inverted: true, }, }, }, { - name: "URL", - pos: position{line: 1670, col: 1, offset: 63108}, + name: "ResolvedLocation", + pos: position{line: 1644, col: 1, offset: 62267}, expr: &actionExpr{ - pos: position{line: 1670, col: 8, offset: 63115}, - run: (*parser).callonURL1, - expr: &oneOrMoreExpr{ - pos: position{line: 1670, col: 8, offset: 63115}, - expr: &choiceExpr{ - pos: position{line: 1670, col: 9, offset: 63116}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1670, col: 9, offset: 63116}, - name: "Alphanums", + pos: position{line: 1644, col: 21, offset: 62287}, + run: (*parser).callonResolvedLocation1, + expr: &seqExpr{ + pos: position{line: 1644, col: 21, offset: 62287}, + exprs: []interface{}{ + &labeledExpr{ + pos: position{line: 1644, col: 21, offset: 62287}, + label: "scheme", + expr: &ruleRefExpr{ + pos: position{line: 1644, col: 29, offset: 62295}, + name: "URL_SCHEME", }, - &seqExpr{ - pos: position{line: 1670, col: 22, offset: 63129}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1670, col: 22, offset: 63129}, - expr: &ruleRefExpr{ - pos: position{line: 1670, col: 23, offset: 63130}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 1670, col: 31, offset: 63138}, - expr: &ruleRefExpr{ - pos: position{line: 1670, col: 32, offset: 63139}, - name: "WS", - }, - }, - ¬Expr{ - pos: position{line: 1670, col: 35, offset: 63142}, - expr: &litMatcher{ - pos: position{line: 1670, col: 36, offset: 63143}, - val: "[", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1670, col: 40, offset: 63147}, - expr: &litMatcher{ - pos: position{line: 1670, col: 41, offset: 63148}, - val: "]", - ignoreCase: false, - }, - }, - &anyMatcher{ - line: 1670, col: 46, offset: 63153, - }, - }, + }, + &labeledExpr{ + pos: position{line: 1644, col: 41, offset: 62307}, + label: "path", + expr: &ruleRefExpr{ + pos: position{line: 1644, col: 47, offset: 62313}, + name: "RESOLVED_FILENAME", }, }, }, }, }, }, + { + name: "RESOLVED_FILENAME", + pos: position{line: 1649, col: 1, offset: 62561}, + expr: &oneOrMoreExpr{ + pos: position{line: 1649, col: 22, offset: 62582}, + expr: &charClassMatcher{ + pos: position{line: 1649, col: 23, offset: 62583}, + val: "[^\\r\\n[\\] ]", + chars: []rune{'\r', '\n', '[', ']', ' '}, + ignoreCase: false, + inverted: true, + }, + }, + }, + { + name: "URL", + pos: position{line: 1651, col: 1, offset: 62715}, + expr: &actionExpr{ + pos: position{line: 1651, col: 9, offset: 62723}, + run: (*parser).callonURL1, + expr: &oneOrMoreExpr{ + pos: position{line: 1651, col: 9, offset: 62723}, + expr: &charClassMatcher{ + pos: position{line: 1651, col: 9, offset: 62723}, + val: "[^\\r\\n[\\]]", + chars: []rune{'\r', '\n', '[', ']'}, + ignoreCase: false, + inverted: true, + }, + }, + }, + }, { name: "URL_SCHEME", - pos: position{line: 1674, col: 1, offset: 63194}, + pos: position{line: 1655, col: 1, offset: 62771}, expr: &choiceExpr{ - pos: position{line: 1674, col: 15, offset: 63208}, + pos: position{line: 1655, col: 15, offset: 62785}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1674, col: 15, offset: 63208}, + pos: position{line: 1655, col: 15, offset: 62785}, val: "http://", ignoreCase: false, + want: "\"http://\"", }, &litMatcher{ - pos: position{line: 1674, col: 27, offset: 63220}, + pos: position{line: 1655, col: 27, offset: 62797}, val: "https://", ignoreCase: false, + want: "\"https://\"", }, &litMatcher{ - pos: position{line: 1674, col: 40, offset: 63233}, + pos: position{line: 1655, col: 40, offset: 62810}, val: "ftp://", ignoreCase: false, + want: "\"ftp://\"", }, &litMatcher{ - pos: position{line: 1674, col: 51, offset: 63244}, + pos: position{line: 1655, col: 51, offset: 62821}, val: "irc://", ignoreCase: false, + want: "\"irc://\"", }, &litMatcher{ - pos: position{line: 1674, col: 62, offset: 63255}, + pos: position{line: 1655, col: 62, offset: 62832}, val: "mailto:", ignoreCase: false, + want: "\"mailto:\"", }, }, }, }, { name: "ID", - pos: position{line: 1676, col: 1, offset: 63266}, + pos: position{line: 1657, col: 1, offset: 62843}, expr: &actionExpr{ - pos: position{line: 1676, col: 7, offset: 63272}, + pos: position{line: 1657, col: 7, offset: 62849}, run: (*parser).callonID1, expr: &oneOrMoreExpr{ - pos: position{line: 1676, col: 7, offset: 63272}, - expr: &choiceExpr{ - pos: position{line: 1676, col: 8, offset: 63273}, - alternatives: []interface{}{ - &ruleRefExpr{ - pos: position{line: 1676, col: 8, offset: 63273}, - name: "Alphanums", - }, - &seqExpr{ - pos: position{line: 1676, col: 21, offset: 63286}, - exprs: []interface{}{ - ¬Expr{ - pos: position{line: 1676, col: 21, offset: 63286}, - expr: &ruleRefExpr{ - pos: position{line: 1676, col: 22, offset: 63287}, - name: "Newline", - }, - }, - ¬Expr{ - pos: position{line: 1676, col: 30, offset: 63295}, - expr: &ruleRefExpr{ - pos: position{line: 1676, col: 31, offset: 63296}, - name: "WS", - }, - }, - ¬Expr{ - pos: position{line: 1676, col: 34, offset: 63299}, - expr: &litMatcher{ - pos: position{line: 1676, col: 35, offset: 63300}, - val: "[", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1676, col: 39, offset: 63304}, - expr: &litMatcher{ - pos: position{line: 1676, col: 40, offset: 63305}, - val: "]", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1676, col: 44, offset: 63309}, - expr: &litMatcher{ - pos: position{line: 1676, col: 45, offset: 63310}, - val: "<<", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1676, col: 50, offset: 63315}, - expr: &litMatcher{ - pos: position{line: 1676, col: 51, offset: 63316}, - val: ">>", - ignoreCase: false, - }, - }, - ¬Expr{ - pos: position{line: 1676, col: 56, offset: 63321}, - expr: &litMatcher{ - pos: position{line: 1676, col: 57, offset: 63322}, - val: ",", - ignoreCase: false, - }, - }, - &anyMatcher{ - line: 1676, col: 62, offset: 63327, - }, - }, - }, - }, + pos: position{line: 1657, col: 7, offset: 62849}, + expr: &charClassMatcher{ + pos: position{line: 1657, col: 7, offset: 62849}, + val: "[^[\\]<>,]", + chars: []rune{'[', ']', '<', '>', ','}, + ignoreCase: false, + inverted: true, }, }, }, }, { name: "DIGIT", - pos: position{line: 1680, col: 1, offset: 63368}, + pos: position{line: 1661, col: 1, offset: 62974}, expr: &actionExpr{ - pos: position{line: 1680, col: 10, offset: 63377}, + pos: position{line: 1661, col: 10, offset: 62983}, run: (*parser).callonDIGIT1, expr: &charClassMatcher{ - pos: position{line: 1680, col: 10, offset: 63377}, + pos: position{line: 1661, col: 10, offset: 62983}, val: "[0-9]", ranges: []rune{'0', '9'}, ignoreCase: false, @@ -13428,25 +11971,26 @@ var g = &grammar{ }, { name: "NUMBER", - pos: position{line: 1684, col: 1, offset: 63419}, + pos: position{line: 1665, col: 1, offset: 63025}, expr: &actionExpr{ - pos: position{line: 1684, col: 11, offset: 63429}, + pos: position{line: 1665, col: 11, offset: 63035}, run: (*parser).callonNUMBER1, expr: &seqExpr{ - pos: position{line: 1684, col: 11, offset: 63429}, + pos: position{line: 1665, col: 11, offset: 63035}, exprs: []interface{}{ &zeroOrOneExpr{ - pos: position{line: 1684, col: 11, offset: 63429}, + pos: position{line: 1665, col: 11, offset: 63035}, expr: &litMatcher{ - pos: position{line: 1684, col: 11, offset: 63429}, + pos: position{line: 1665, col: 11, offset: 63035}, val: "-", ignoreCase: false, + want: "\"-\"", }, }, &oneOrMoreExpr{ - pos: position{line: 1684, col: 16, offset: 63434}, + pos: position{line: 1665, col: 16, offset: 63040}, expr: &ruleRefExpr{ - pos: position{line: 1684, col: 16, offset: 63434}, + pos: position{line: 1665, col: 16, offset: 63040}, name: "DIGIT", }, }, @@ -13455,23 +11999,25 @@ var g = &grammar{ }, }, { - name: "WS", - pos: position{line: 1688, col: 1, offset: 63486}, + name: "Space", + pos: position{line: 1669, col: 1, offset: 63092}, expr: &choiceExpr{ - pos: position{line: 1688, col: 7, offset: 63492}, + pos: position{line: 1669, col: 10, offset: 63101}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1688, col: 7, offset: 63492}, + pos: position{line: 1669, col: 10, offset: 63101}, val: " ", ignoreCase: false, + want: "\" \"", }, &actionExpr{ - pos: position{line: 1688, col: 13, offset: 63498}, - run: (*parser).callonWS3, + pos: position{line: 1669, col: 16, offset: 63107}, + run: (*parser).callonSpace3, expr: &litMatcher{ - pos: position{line: 1688, col: 13, offset: 63498}, + pos: position{line: 1669, col: 16, offset: 63107}, val: "\t", ignoreCase: false, + want: "\"\\t\"", }, }, }, @@ -13479,50 +12025,53 @@ var g = &grammar{ }, { name: "Newline", - pos: position{line: 1692, col: 1, offset: 63539}, + pos: position{line: 1673, col: 1, offset: 63148}, expr: &choiceExpr{ - pos: position{line: 1692, col: 12, offset: 63550}, + pos: position{line: 1673, col: 12, offset: 63159}, alternatives: []interface{}{ &litMatcher{ - pos: position{line: 1692, col: 12, offset: 63550}, + pos: position{line: 1673, col: 12, offset: 63159}, val: "\r\n", ignoreCase: false, + want: "\"\\r\\n\"", }, &litMatcher{ - pos: position{line: 1692, col: 21, offset: 63559}, + pos: position{line: 1673, col: 21, offset: 63168}, val: "\r", ignoreCase: false, + want: "\"\\r\"", }, &litMatcher{ - pos: position{line: 1692, col: 28, offset: 63566}, + pos: position{line: 1673, col: 28, offset: 63175}, val: "\n", ignoreCase: false, + want: "\"\\n\"", }, }, }, }, { name: "EOF", - pos: position{line: 1694, col: 1, offset: 63572}, + pos: position{line: 1675, col: 1, offset: 63181}, expr: ¬Expr{ - pos: position{line: 1694, col: 8, offset: 63579}, + pos: position{line: 1675, col: 8, offset: 63188}, expr: &anyMatcher{ - line: 1694, col: 9, offset: 63580, + line: 1675, col: 9, offset: 63189, }, }, }, { name: "EOL", - pos: position{line: 1696, col: 1, offset: 63583}, + pos: position{line: 1677, col: 1, offset: 63192}, expr: &choiceExpr{ - pos: position{line: 1696, col: 8, offset: 63590}, + pos: position{line: 1677, col: 8, offset: 63199}, alternatives: []interface{}{ &ruleRefExpr{ - pos: position{line: 1696, col: 8, offset: 63590}, + pos: position{line: 1677, col: 8, offset: 63199}, name: "Newline", }, &ruleRefExpr{ - pos: position{line: 1696, col: 18, offset: 63600}, + pos: position{line: 1677, col: 18, offset: 63209}, name: "EOF", }, }, @@ -13576,16 +12125,6 @@ func (p *parser) callonAsciidocDocumentBlocks1() (interface{}, error) { return p.cur.onAsciidocDocumentBlocks1(stack["header"], stack["others"]) } -func (c *current) onDocumentBlock1(block interface{}) (interface{}, error) { - return block, nil -} - -func (p *parser) callonDocumentBlock1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onDocumentBlock1(stack["block"]) -} - func (c *current) onDocumentBlockWithinDelimitedBlock1(block interface{}) (interface{}, error) { return block, nil } @@ -13738,14 +12277,14 @@ func (p *parser) callonDocumentRevisionNumber2() (interface{}, error) { return p.cur.onDocumentRevisionNumber2() } -func (c *current) onDocumentRevisionNumber18() (interface{}, error) { +func (c *current) onDocumentRevisionNumber8() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonDocumentRevisionNumber18() (interface{}, error) { +func (p *parser) callonDocumentRevisionNumber8() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDocumentRevisionNumber18() + return p.cur.onDocumentRevisionNumber8() } func (c *current) onDocumentRevisionDate1() (interface{}, error) { @@ -13769,7 +12308,9 @@ func (p *parser) callonDocumentRevisionRemark1() (interface{}, error) { } func (c *current) onDocumentAttributeDeclaration9(value interface{}) (interface{}, error) { + return value, nil + } func (p *parser) callonDocumentAttributeDeclaration9() (interface{}, error) { @@ -13889,24 +12430,25 @@ func (p *parser) callonInlineElementID1() (interface{}, error) { return p.cur.onInlineElementID1(stack["id"]) } -func (c *current) onElementTitle5() (interface{}, error) { - return string(c.text), nil +func (c *current) onElementTitle1(title interface{}) (interface{}, error) { + return types.NewElementTitle(title.(string)) } -func (p *parser) callonElementTitle5() (interface{}, error) { +func (p *parser) callonElementTitle1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onElementTitle5() + return p.cur.onElementTitle1(stack["title"]) } -func (c *current) onElementTitle1(title interface{}) (interface{}, error) { - return types.NewElementTitle(title.(string)) +func (c *current) onElementTitleContent1() (interface{}, error) { + // "<" and ">" characters are not allowed as they are used as cross-reference markers + return string(c.text), nil } -func (p *parser) callonElementTitle1() (interface{}, error) { +func (p *parser) callonElementTitleContent1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onElementTitle1(stack["title"]) + return p.cur.onElementTitleContent1() } func (c *current) onElementRole5() (interface{}, error) { @@ -14552,16 +13094,16 @@ func (p *parser) callonListParagraph5() (interface{}, error) { return p.cur.onListParagraph5(stack["lines"]) } -func (c *current) onListParagraphLine24(elements, linebreak interface{}) (interface{}, error) { - // absorbs heading and trailing spaces - return types.NewInlineElements(append(elements.([]interface{}), linebreak)) +func (c *current) onListParagraphLine22(elements interface{}) (interface{}, error) { + + return types.NewInlineElements(elements.([]interface{})) } -func (p *parser) callonListParagraphLine24() (interface{}, error) { +func (p *parser) callonListParagraphLine22() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onListParagraphLine24(stack["elements"], stack["linebreak"]) + return p.cur.onListParagraphLine22(stack["elements"]) } func (c *current) onListParagraphLine1(line interface{}) (interface{}, error) { @@ -14576,24 +13118,24 @@ func (p *parser) callonListParagraphLine1() (interface{}, error) { return p.cur.onListParagraphLine1(stack["line"]) } -func (c *current) onContinuedListItemElement1(blanklines, element interface{}) (interface{}, error) { - return types.NewContinuedListItemElement(-len(blanklines.([]interface{})), element) // offset is negative +func (c *current) onContinuedListItemElement1(element interface{}) (interface{}, error) { + return types.NewContinuedListItemElement(element) // offset is negative } func (p *parser) callonContinuedListItemElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemElement1(stack["blanklines"], stack["element"]) + return p.cur.onContinuedListItemElement1(stack["element"]) } -func (c *current) onContinuedListItemBlock1(block interface{}) (interface{}, error) { - return block, nil +func (c *current) onContinuedListItemContent1(content interface{}) (interface{}, error) { + return content, nil } -func (p *parser) callonContinuedListItemBlock1() (interface{}, error) { +func (p *parser) callonContinuedListItemContent1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onContinuedListItemBlock1(stack["block"]) + return p.cur.onContinuedListItemContent1(stack["content"]) } func (c *current) onOrderedListItem1(attributes, prefix, content interface{}) (interface{}, error) { @@ -14875,28 +13417,28 @@ func (p *parser) callonLabeledListItem1() (interface{}, error) { return p.cur.onLabeledListItem1(stack["attributes"], stack["term"], stack["separator"], stack["description"]) } -func (c *current) onSimpleLabeledListItemTerm3() (interface{}, error) { +func (c *current) onVerbatimLabeledListItemTerm3() (interface{}, error) { return types.NewStringElement(strings.TrimSpace(string(c.text))) } -func (p *parser) callonSimpleLabeledListItemTerm3() (interface{}, error) { +func (p *parser) callonVerbatimLabeledListItemTerm3() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSimpleLabeledListItemTerm3() + return p.cur.onVerbatimLabeledListItemTerm3() } -func (c *current) onSimpleLabeledListItemTerm1(content interface{}) (interface{}, error) { +func (c *current) onVerbatimLabeledListItemTerm1(content interface{}) (interface{}, error) { return types.NewInlineElements(content) } -func (p *parser) callonSimpleLabeledListItemTerm1() (interface{}, error) { +func (p *parser) callonVerbatimLabeledListItemTerm1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSimpleLabeledListItemTerm1(stack["content"]) + return p.cur.onVerbatimLabeledListItemTerm1(stack["content"]) } func (c *current) onLabeledListItemTerm1(elements interface{}) (interface{}, error) { - // absorbs heading and trailing spaces + // rule as an extra entrypoint return types.NewInlineElements(elements.([]interface{})) } @@ -15066,6 +13608,27 @@ func (p *parser) callonSimpleParagraph1() (interface{}, error) { return p.cur.onSimpleParagraph1(stack["attributes"], stack["firstLine"], stack["otherLines"]) } +func (c *current) onFirstParagraphLine1(elements interface{}) (interface{}, error) { + + return types.NewInlineElements(elements.([]interface{})) +} + +func (p *parser) callonFirstParagraphLine1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onFirstParagraphLine1(stack["elements"]) +} + +func (c *current) onOtherParagraphLine1(elements interface{}) (interface{}, error) { + return elements, nil +} + +func (p *parser) callonOtherParagraphLine1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onOtherParagraphLine1(stack["elements"]) +} + func (c *current) onContinuedParagraph2(attributes, t, lines interface{}) (interface{}, error) { return types.NewAdmonitionParagraph(lines.([]interface{}), t.(types.AdmonitionKind), attributes) @@ -15099,27 +13662,6 @@ func (p *parser) callonContinuedParagraphLines1() (interface{}, error) { return p.cur.onContinuedParagraphLines1(stack["firstLine"], stack["otherLines"]) } -func (c *current) onFirstParagraphLine1(elements, linebreak interface{}) (interface{}, error) { - - return types.NewInlineElements(append(elements.([]interface{}), linebreak)) -} - -func (p *parser) callonFirstParagraphLine1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onFirstParagraphLine1(stack["elements"], stack["linebreak"]) -} - -func (c *current) onOtherParagraphLine1(elements interface{}) (interface{}, error) { - return elements, nil -} - -func (p *parser) callonOtherParagraphLine1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onOtherParagraphLine1(stack["elements"]) -} - func (c *current) onVerseParagraph7(attributes interface{}) (bool, error) { if attrs, ok := attributes.(types.ElementAttributes); ok { kind, ok := attrs[types.AttrKind] @@ -15174,27 +13716,27 @@ func (p *parser) callonVerseParagraph14() (interface{}, error) { return p.cur.onVerseParagraph14(stack["attributes"], stack["lines"]) } -func (c *current) onInlineElements9(comment interface{}) (interface{}, error) { +func (c *current) onInlineElements7(comment interface{}) (interface{}, error) { return types.NewInlineElements([]interface{}{comment}) } -func (p *parser) callonInlineElements9() (interface{}, error) { +func (p *parser) callonInlineElements7() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElements9(stack["comment"]) + return p.cur.onInlineElements7(stack["comment"]) } -func (c *current) onInlineElements12(elements, linebreak interface{}) (interface{}, error) { +func (c *current) onInlineElements10(elements interface{}) (interface{}, error) { - return types.NewInlineElements(append(elements.([]interface{}), linebreak)) + return types.NewInlineElements(elements.([]interface{})) } -func (p *parser) callonInlineElements12() (interface{}, error) { +func (p *parser) callonInlineElements10() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onInlineElements12(stack["elements"], stack["linebreak"]) + return p.cur.onInlineElements10(stack["elements"]) } func (c *current) onInlineElements1(elements interface{}) (interface{}, error) { @@ -15218,57 +13760,6 @@ func (p *parser) callonInlineElement1() (interface{}, error) { return p.cur.onInlineElement1(stack["element"]) } -func (c *current) onInlineElementWithoutSubtitution1(element interface{}) (interface{}, error) { - return element, nil -} - -func (p *parser) callonInlineElementWithoutSubtitution1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onInlineElementWithoutSubtitution1(stack["element"]) -} - -func (c *current) onVerbatimParagraph8(line interface{}) (interface{}, error) { - return line, nil -} - -func (p *parser) callonVerbatimParagraph8() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onVerbatimParagraph8(stack["line"]) -} - -func (c *current) onVerbatimParagraph1(attributes, lines interface{}) (interface{}, error) { - return types.NewParagraph(lines.([]interface{}), attributes) -} - -func (p *parser) callonVerbatimParagraph1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onVerbatimParagraph1(stack["attributes"], stack["lines"]) -} - -func (c *current) onVerbatimParagraphLine1(elements, linebreak interface{}) (interface{}, error) { - - return types.NewInlineElements(append(elements.([]interface{}), linebreak)) -} - -func (p *parser) callonVerbatimParagraphLine1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onVerbatimParagraphLine1(stack["elements"], stack["linebreak"]) -} - -func (c *current) onVerbatimParagraphLineElement1() (interface{}, error) { - return string(c.text), nil -} - -func (p *parser) callonVerbatimParagraphLineElement1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onVerbatimParagraphLineElement1() -} - func (c *current) onLineBreak1() (interface{}, error) { return types.NewLineBreak() } @@ -15332,26 +13823,26 @@ func (p *parser) callonDoubleQuoteBoldText1() (interface{}, error) { return p.cur.onDoubleQuoteBoldText1(stack["elements"]) } -func (c *current) onDoubleQuoteBoldTextElement1(element interface{}) (interface{}, error) { - // word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop - return element, nil +func (c *current) onDoubleQuoteBoldTextStringElement1() (interface{}, error) { + + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDoubleQuoteBoldTextElement1() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextStringElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteBoldTextElement1(stack["element"]) + return p.cur.onDoubleQuoteBoldTextStringElement1() } -func (c *current) onNonDoubleQuoteBoldText1() (interface{}, error) { - +func (c *current) onDoubleQuoteBoldTextFallbackCharacter3() (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) callonNonDoubleQuoteBoldText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteBoldTextFallbackCharacter3() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNonDoubleQuoteBoldText1() + return p.cur.onDoubleQuoteBoldTextFallbackCharacter3() } func (c *current) onSingleQuoteBoldText2(elements interface{}) (interface{}, error) { @@ -15365,37 +13856,37 @@ func (p *parser) callonSingleQuoteBoldText2() (interface{}, error) { return p.cur.onSingleQuoteBoldText2(stack["elements"]) } -func (c *current) onSingleQuoteBoldText12(elements interface{}) (interface{}, error) { +func (c *current) onSingleQuoteBoldText16(elements interface{}) (interface{}, error) { // unbalanced `**` vs `*` punctuation. return types.NewQuotedText(types.Bold, elements.([]interface{})) // include the second heading `*` as a regular StringElement in the bold content } -func (p *parser) callonSingleQuoteBoldText12() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldText16() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldText12(stack["elements"]) + return p.cur.onSingleQuoteBoldText16(stack["elements"]) } -func (c *current) onSingleQuoteBoldTextElement1(element interface{}) (interface{}, error) { - // word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop - return element, nil +func (c *current) onSingleQuoteBoldTextStringElement1() (interface{}, error) { + // anything except EOL, space, bold and subscript/superscript delimiters and brackets. Excludes curly brackets to match with DocumentAttributeSubstitution elements + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSingleQuoteBoldTextElement1() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextStringElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteBoldTextElement1(stack["element"]) + return p.cur.onSingleQuoteBoldTextStringElement1() } -func (c *current) onNonSingleQuoteBoldText1() (interface{}, error) { - +func (c *current) onSingleQuoteBoldTextFallbackCharacter3() (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) callonNonSingleQuoteBoldText1() (interface{}, error) { +func (p *parser) callonSingleQuoteBoldTextFallbackCharacter3() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNonSingleQuoteBoldText1() + return p.cur.onSingleQuoteBoldTextFallbackCharacter3() } func (c *current) onEscapedBoldText2(backslashes, elements interface{}) (interface{}, error) { @@ -15445,26 +13936,26 @@ func (p *parser) callonDoubleQuoteItalicText1() (interface{}, error) { return p.cur.onDoubleQuoteItalicText1(stack["elements"]) } -func (c *current) onDoubleQuoteItalicTextElement1(element interface{}) (interface{}, error) { - // word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop - return element, nil +func (c *current) onDoubleQuoteItalicTextStringElement1() (interface{}, error) { + + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDoubleQuoteItalicTextElement1() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextStringElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteItalicTextElement1(stack["element"]) + return p.cur.onDoubleQuoteItalicTextStringElement1() } -func (c *current) onNonDoubleQuoteItalicText1() (interface{}, error) { - +func (c *current) onDoubleQuoteItalicTextFallbackCharacter3() (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) callonNonDoubleQuoteItalicText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteItalicTextFallbackCharacter3() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNonDoubleQuoteItalicText1() + return p.cur.onDoubleQuoteItalicTextFallbackCharacter3() } func (c *current) onSingleQuoteItalicText2(elements interface{}) (interface{}, error) { @@ -15478,37 +13969,37 @@ func (p *parser) callonSingleQuoteItalicText2() (interface{}, error) { return p.cur.onSingleQuoteItalicText2(stack["elements"]) } -func (c *current) onSingleQuoteItalicText12(elements interface{}) (interface{}, error) { +func (c *current) onSingleQuoteItalicText13(elements interface{}) (interface{}, error) { // unbalanced `__` vs `_` punctuation. return types.NewQuotedText(types.Italic, elements.([]interface{})) // include the second heading `_` as a regular StringElement in the italic content } -func (p *parser) callonSingleQuoteItalicText12() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicText13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicText12(stack["elements"]) + return p.cur.onSingleQuoteItalicText13(stack["elements"]) } -func (c *current) onSingleQuoteItalicTextElement1(element interface{}) (interface{}, error) { - // word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop - return element, nil +func (c *current) onSingleQuoteItalicTextStringElement1() (interface{}, error) { + // anything except EOL, space, bold and subscript/superscript delimiters and brackets. Excludes curly brackets to match with DocumentAttributeSubstitution elements + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSingleQuoteItalicTextElement1() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextStringElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteItalicTextElement1(stack["element"]) + return p.cur.onSingleQuoteItalicTextStringElement1() } -func (c *current) onNonSingleQuoteItalicText1() (interface{}, error) { - +func (c *current) onSingleQuoteItalicTextFallbackCharacter3() (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) callonNonSingleQuoteItalicText1() (interface{}, error) { +func (p *parser) callonSingleQuoteItalicTextFallbackCharacter3() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNonSingleQuoteItalicText1() + return p.cur.onSingleQuoteItalicTextFallbackCharacter3() } func (c *current) onEscapedItalicText2(backslashes, elements interface{}) (interface{}, error) { @@ -15558,26 +14049,26 @@ func (p *parser) callonDoubleQuoteMonospaceText1() (interface{}, error) { return p.cur.onDoubleQuoteMonospaceText1(stack["elements"]) } -func (c *current) onDoubleQuoteMonospaceTextElement1(element interface{}) (interface{}, error) { - // word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop - return element, nil +func (c *current) onDoubleQuoteMonospaceTextStringElement1() (interface{}, error) { + + return types.NewStringElement(string(c.text)) } -func (p *parser) callonDoubleQuoteMonospaceTextElement1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextStringElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onDoubleQuoteMonospaceTextElement1(stack["element"]) + return p.cur.onDoubleQuoteMonospaceTextStringElement1() } -func (c *current) onNonDoubleQuoteMonospaceText1() (interface{}, error) { - +func (c *current) onDoubleQuoteMonospaceTextFallbackCharacter3() (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) callonNonDoubleQuoteMonospaceText1() (interface{}, error) { +func (p *parser) callonDoubleQuoteMonospaceTextFallbackCharacter3() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNonDoubleQuoteMonospaceText1() + return p.cur.onDoubleQuoteMonospaceTextFallbackCharacter3() } func (c *current) onSingleQuoteMonospaceText2(elements interface{}) (interface{}, error) { @@ -15591,37 +14082,37 @@ func (p *parser) callonSingleQuoteMonospaceText2() (interface{}, error) { return p.cur.onSingleQuoteMonospaceText2(stack["elements"]) } -func (c *current) onSingleQuoteMonospaceText12(elements interface{}) (interface{}, error) { +func (c *current) onSingleQuoteMonospaceText13(elements interface{}) (interface{}, error) { // unbalanced "``" vs "`" punctuation. return types.NewQuotedText(types.Monospace, elements.([]interface{})) // include the second heading "`" as a regular StringElement in the monospace content } -func (p *parser) callonSingleQuoteMonospaceText12() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceText13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceText12(stack["elements"]) + return p.cur.onSingleQuoteMonospaceText13(stack["elements"]) } -func (c *current) onSingleQuoteMonospaceTextElement1(element interface{}) (interface{}, error) { - // word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop - return element, nil +func (c *current) onSingleQuoteMonospaceTextStringElement1() (interface{}, error) { + // anything except EOL, space, monospace and subscript/superscript delimiters. Excludes curly brackets to match with DocumentAttributeSubstitution elements + return types.NewStringElement(string(c.text)) } -func (p *parser) callonSingleQuoteMonospaceTextElement1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextStringElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onSingleQuoteMonospaceTextElement1(stack["element"]) + return p.cur.onSingleQuoteMonospaceTextStringElement1() } -func (c *current) onNonSingleQuoteMonospaceText1() (interface{}, error) { - // break at multiline +func (c *current) onSingleQuoteMonospaceTextFallbackCharacter3() (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) callonNonSingleQuoteMonospaceText1() (interface{}, error) { +func (p *parser) callonSingleQuoteMonospaceTextFallbackCharacter3() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onNonSingleQuoteMonospaceText1() + return p.cur.onSingleQuoteMonospaceTextFallbackCharacter3() } func (c *current) onEscapedMonospaceText2(backslashes, elements interface{}) (interface{}, error) { @@ -15672,7 +14163,7 @@ func (p *parser) callonSubscriptText1() (interface{}, error) { } func (c *current) onNonSubscriptText1() (interface{}, error) { - + // anything except spaces, EOL or '~' return c.text, nil } @@ -15705,7 +14196,7 @@ func (p *parser) callonSuperscriptText1() (interface{}, error) { } func (c *current) onNonSuperscriptText1() (interface{}, error) { - + // anything except spaces, EOL or '^' return c.text, nil } @@ -15810,14 +14301,14 @@ func (p *parser) callonPassthroughMacro9() (interface{}, error) { return p.cur.onPassthroughMacro9(stack["content"]) } -func (c *current) onPassthroughMacroCharacter4() (interface{}, error) { +func (c *current) onPassthroughMacroCharacter1() (interface{}, error) { return types.NewStringElement(string(c.text)) } -func (p *parser) callonPassthroughMacroCharacter4() (interface{}, error) { +func (p *parser) callonPassthroughMacroCharacter1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onPassthroughMacroCharacter4() + return p.cur.onPassthroughMacroCharacter1() } func (c *current) onInternalCrossReference2(id, label interface{}) (interface{}, error) { @@ -15850,16 +14341,6 @@ func (p *parser) callonExternalCrossReference1() (interface{}, error) { return p.cur.onExternalCrossReference1(stack["url"], stack["inlineAttributes"]) } -func (c *current) onCrossReferenceLabel1() (interface{}, error) { - return string(c.text), nil -} - -func (p *parser) callonCrossReferenceLabel1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onCrossReferenceLabel1() -} - func (c *current) onRelativeLink1(url, inlineAttributes interface{}) (interface{}, error) { return types.NewInlineLink(url.(types.Location), inlineAttributes.(types.ElementAttributes)) } @@ -15880,68 +14361,79 @@ func (p *parser) callonExternalLink1() (interface{}, error) { return p.cur.onExternalLink1(stack["url"], stack["inlineAttributes"]) } -func (c *current) onTextOnlyLinkAttributes7(elements interface{}) (interface{}, error) { +func (c *current) onLinkAttributes1(firstAttr, otherattrs interface{}) (interface{}, error) { + return types.NewInlineLinkAttributes(append(firstAttr.([]interface{}), otherattrs.([]interface{})...)) +} + +func (p *parser) callonLinkAttributes1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLinkAttributes1(stack["firstAttr"], stack["otherattrs"]) +} + +func (c *current) onFirstLinkAttributeElement4(elements interface{}) (interface{}, error) { return types.NewInlineElements(elements.([]interface{})) } -func (p *parser) callonTextOnlyLinkAttributes7() (interface{}, error) { +func (p *parser) callonFirstLinkAttributeElement4() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTextOnlyLinkAttributes7(stack["elements"]) + return p.cur.onFirstLinkAttributeElement4(stack["elements"]) } -func (c *current) onTextOnlyLinkAttributes28(elements interface{}) (interface{}, error) { +func (c *current) onFirstLinkAttributeElement18(elements interface{}) (interface{}, error) { return types.NewInlineElements(elements.([]interface{})) } -func (p *parser) callonTextOnlyLinkAttributes28() (interface{}, error) { +func (p *parser) callonFirstLinkAttributeElement18() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTextOnlyLinkAttributes28(stack["elements"]) + return p.cur.onFirstLinkAttributeElement18(stack["elements"]) } -func (c *current) onTextOnlyLinkAttributes1(text interface{}) (interface{}, error) { - return types.NewInlineLinkAttributes(text, nil) +func (c *current) onFirstLinkAttributeElement1(element interface{}) (interface{}, error) { + return element, nil } -func (p *parser) callonTextOnlyLinkAttributes1() (interface{}, error) { +func (p *parser) callonFirstLinkAttributeElement1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTextOnlyLinkAttributes1(stack["text"]) + return p.cur.onFirstLinkAttributeElement1(stack["element"]) } -func (c *current) onTextAndMoreLinkAttributes7(elements interface{}) (interface{}, error) { - return types.NewInlineElements(elements.([]interface{})) - +func (c *current) onAttributeChar1() (interface{}, error) { + // excludes comma + return types.NewStringElement(string(c.text)) } -func (p *parser) callonTextAndMoreLinkAttributes7() (interface{}, error) { +func (p *parser) callonAttributeChar1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTextAndMoreLinkAttributes7(stack["elements"]) + return p.cur.onAttributeChar1() } -func (c *current) onTextAndMoreLinkAttributes26(elements interface{}) (interface{}, error) { - return types.NewInlineElements(elements.([]interface{})) - +func (c *current) onQuotedAttributeChar1() (interface{}, error) { + // does not exclude comma + return types.NewStringElement(string(c.text)) } -func (p *parser) callonTextAndMoreLinkAttributes26() (interface{}, error) { +func (p *parser) callonQuotedAttributeChar1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTextAndMoreLinkAttributes26(stack["elements"]) + return p.cur.onQuotedAttributeChar1() } -func (c *current) onTextAndMoreLinkAttributes1(text, otherattrs interface{}) (interface{}, error) { - return types.NewInlineLinkAttributes(text, otherattrs.([]interface{})) +func (c *current) onUnquotedAttributeChar1() (interface{}, error) { + // excludes comma + return types.NewStringElement(string(c.text)) } -func (p *parser) callonTextAndMoreLinkAttributes1() (interface{}, error) { +func (p *parser) callonUnquotedAttributeChar1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onTextAndMoreLinkAttributes1(stack["text"], stack["otherattrs"]) + return p.cur.onUnquotedAttributeChar1() } func (c *current) onInlineLinks1(elements interface{}) (interface{}, error) { @@ -15974,17 +14466,6 @@ func (p *parser) callonResolvedExternalLink1() (interface{}, error) { return p.cur.onResolvedExternalLink1(stack["url"], stack["inlineAttributes"]) } -func (c *current) onExternalQuotedLink1(url, inlineAttributes interface{}) (interface{}, error) { - // here attributes are required, so we can safely use the `_` and `*` characters in the URL without messing with the bold or italic markers. - return types.NewInlineLink(url.(types.Location), inlineAttributes) -} - -func (p *parser) callonExternalQuotedLink1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onExternalQuotedLink1(stack["url"], stack["inlineAttributes"]) -} - func (c *current) onImageBlock1(attributes, path, inlineAttributes interface{}) (interface{}, error) { return types.NewImageBlock(path.(types.Location), inlineAttributes.(types.ElementAttributes), attributes) } @@ -16035,17 +14516,6 @@ func (p *parser) callonInlineFootnote8() (interface{}, error) { return p.cur.onInlineFootnote8(stack["ref"], stack["content"]) } -func (c *current) onFootnoteRef1() (interface{}, error) { - - return string(c.text), nil -} - -func (p *parser) callonFootnoteRef1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onFootnoteRef1() -} - func (c *current) onFootnoteContent1(elements interface{}) (interface{}, error) { // footnote content may span multiple lines return types.NewInlineElements(elements.([]interface{})) @@ -16340,17 +14810,6 @@ func (p *parser) callonParagraphWithHeadingSpaces1() (interface{}, error) { return p.cur.onParagraphWithHeadingSpaces1(stack["attributes"], stack["lines"]) } -func (c *current) onParagraphWithHeadingSpacesLines11() (interface{}, error) { - return string(c.text), nil - -} - -func (p *parser) callonParagraphWithHeadingSpacesLines11() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onParagraphWithHeadingSpacesLines11() -} - func (c *current) onParagraphWithHeadingSpacesLines4() (interface{}, error) { return string(c.text), nil @@ -16362,26 +14821,26 @@ func (p *parser) callonParagraphWithHeadingSpacesLines4() (interface{}, error) { return p.cur.onParagraphWithHeadingSpacesLines4() } -func (c *current) onParagraphWithHeadingSpacesLines24() (interface{}, error) { +func (c *current) onParagraphWithHeadingSpacesLines18() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonParagraphWithHeadingSpacesLines24() (interface{}, error) { +func (p *parser) callonParagraphWithHeadingSpacesLines18() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onParagraphWithHeadingSpacesLines24() + return p.cur.onParagraphWithHeadingSpacesLines18() } -func (c *current) onParagraphWithHeadingSpacesLines19(otherLine interface{}) (interface{}, error) { +func (c *current) onParagraphWithHeadingSpacesLines13(otherLine interface{}) (interface{}, error) { return otherLine, nil // do not include the trailing 'EOL' } -func (p *parser) callonParagraphWithHeadingSpacesLines19() (interface{}, error) { +func (p *parser) callonParagraphWithHeadingSpacesLines13() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onParagraphWithHeadingSpacesLines19(stack["otherLine"]) + return p.cur.onParagraphWithHeadingSpacesLines13(stack["otherLine"]) } func (c *current) onParagraphWithHeadingSpacesLines1(firstLine, otherLines interface{}) (interface{}, error) { @@ -16484,24 +14943,24 @@ func (p *parser) callonParagraphWithLiteralAttributeLines1() (interface{}, error return p.cur.onParagraphWithLiteralAttributeLines1(stack["lines"]) } -func (c *current) onParagraphWithLiteralAttributeLine4() (interface{}, error) { +func (c *current) onParagraphWithLiteralAttributeLine6() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonParagraphWithLiteralAttributeLine4() (interface{}, error) { +func (p *parser) callonParagraphWithLiteralAttributeLine6() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onParagraphWithLiteralAttributeLine4() + return p.cur.onParagraphWithLiteralAttributeLine6() } -func (c *current) onParagraphWithLiteralAttributeLine1(line interface{}) (interface{}, error) { - return line, nil // do not include the trailing 'EOL' +func (c *current) onParagraphWithLiteralAttributeLine1(content interface{}) (interface{}, error) { + return content.(string), nil // do not include the trailing 'EOL' } func (p *parser) callonParagraphWithLiteralAttributeLine1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onParagraphWithLiteralAttributeLine1(stack["line"]) + return p.cur.onParagraphWithLiteralAttributeLine1(stack["content"]) } func (c *current) onIndexTerm1(term interface{}) (interface{}, error) { @@ -16514,14 +14973,14 @@ func (p *parser) callonIndexTerm1() (interface{}, error) { return p.cur.onIndexTerm1(stack["term"]) } -func (c *current) onIndexTermContent9() (interface{}, error) { +func (c *current) onIndexTermContent8() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonIndexTermContent9() (interface{}, error) { +func (p *parser) callonIndexTermContent8() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onIndexTermContent9() + return p.cur.onIndexTermContent8() } func (c *current) onIndexTermContent1(elements interface{}) (interface{}, error) { @@ -16595,62 +15054,44 @@ func (p *parser) callonAlphanums1() (interface{}, error) { return p.cur.onAlphanums1() } -func (c *current) onAlphanumsAndSpaces1() (interface{}, error) { - return string(c.text), nil -} - -func (p *parser) callonAlphanumsAndSpaces1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onAlphanumsAndSpaces1() -} +func (c *current) onWord2() (interface{}, error) { -func (c *current) onSimpleWord1() (interface{}, error) { - // very straightforward content: alphanums followed by spaces but not the "+" signs because it needs a heading space to become a LineBreak element return types.NewStringElement(string(c.text)) -} - -func (p *parser) callonSimpleWord1() (interface{}, error) { - stack := p.vstack[len(p.vstack)-1] - _ = stack - return p.cur.onSimpleWord1() -} - -func (c *current) onAnyChars4() (interface{}, error) { - return string(c.text), nil } -func (p *parser) callonAnyChars4() (interface{}, error) { +func (p *parser) callonWord2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAnyChars4() + return p.cur.onWord2() } -func (c *current) onAnyChars13() (interface{}, error) { - return string(c.text), nil +func (c *current) onWord10() (interface{}, error) { + + return types.NewStringElement(string(c.text)) } -func (p *parser) callonAnyChars13() (interface{}, error) { +func (p *parser) callonWord10() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAnyChars13() + return p.cur.onWord10() } -func (c *current) onAnyChars31() (interface{}, error) { - // punctuation marks are treated separately, so any following macro (image, footnote, etc.) is not included in this rule +func (c *current) onInlineWord2() (interface{}, error) { + return types.NewStringElement(string(c.text)) + } -func (p *parser) callonAnyChars31() (interface{}, error) { +func (p *parser) callonInlineWord2() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onAnyChars31() + return p.cur.onInlineWord2() } func (c *current) onAnyChar1() (interface{}, error) { - // this is a fall-back rule in case all preceeding rules failed to match the current content. + return types.NewStringElement(string(c.text)) } @@ -16660,44 +15101,54 @@ func (p *parser) callonAnyChar1() (interface{}, error) { return p.cur.onAnyChar1() } -func (c *current) onFileLocation1(elements interface{}) (interface{}, error) { - return types.NewLocation(elements.([]interface{})) +func (c *current) onFileLocation1(path interface{}) (interface{}, error) { + return types.NewLocation("", path.([]interface{})) } func (p *parser) callonFileLocation1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onFileLocation1(stack["elements"]) + return p.cur.onFileLocation1(stack["path"]) } -func (c *current) onResolvedFileLocation1(elements interface{}) (interface{}, error) { - return types.NewLocation(elements.([]interface{})) +func (c *current) onResolvedFileLocation1(path interface{}) (interface{}, error) { + return types.NewLocation("", path.([]interface{})) } func (p *parser) callonResolvedFileLocation1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onResolvedFileLocation1(stack["elements"]) + return p.cur.onResolvedFileLocation1(stack["path"]) } -func (c *current) onLocation1(elements interface{}) (interface{}, error) { - return types.NewLocation(elements.([]interface{})) +func (c *current) onLocation1(scheme, path interface{}) (interface{}, error) { + return types.NewLocation(scheme, path.([]interface{})) } func (p *parser) callonLocation1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onLocation1(stack["elements"]) + return p.cur.onLocation1(stack["scheme"], stack["path"]) +} + +func (c *current) onLocationWithScheme1(scheme, path interface{}) (interface{}, error) { + return types.NewLocation(scheme, path.([]interface{})) +} + +func (p *parser) callonLocationWithScheme1() (interface{}, error) { + stack := p.vstack[len(p.vstack)-1] + _ = stack + return p.cur.onLocationWithScheme1(stack["scheme"], stack["path"]) } -func (c *current) onResolvedLocation1(elements interface{}) (interface{}, error) { - return types.NewLocation(elements.([]interface{})) +func (c *current) onResolvedLocation1(scheme, path interface{}) (interface{}, error) { + return types.NewLocation(scheme, path.([]interface{})) } func (p *parser) callonResolvedLocation1() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onResolvedLocation1(stack["elements"]) + return p.cur.onResolvedLocation1(stack["scheme"], stack["path"]) } func (c *current) onURL1() (interface{}, error) { @@ -16711,6 +15162,7 @@ func (p *parser) callonURL1() (interface{}, error) { } func (c *current) onID1() (interface{}, error) { + // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil } @@ -16740,14 +15192,14 @@ func (p *parser) callonNUMBER1() (interface{}, error) { return p.cur.onNUMBER1() } -func (c *current) onWS3() (interface{}, error) { +func (c *current) onSpace3() (interface{}, error) { return string(c.text), nil } -func (p *parser) callonWS3() (interface{}, error) { +func (p *parser) callonSpace3() (interface{}, error) { stack := p.vstack[len(p.vstack)-1] _ = stack - return p.cur.onWS3() + return p.cur.onSpace3() } var ( @@ -16980,6 +15432,7 @@ type litMatcher struct { pos position val string ignoreCase bool + want string } type charClassMatcher struct { @@ -17572,11 +16025,6 @@ func (p *parser) parseLabeledExpr(lab *labeledExpr) (interface{}, bool) { } func (p *parser) parseLitMatcher(lit *litMatcher) (interface{}, bool) { - ignoreCase := "" - if lit.ignoreCase { - ignoreCase = "i" - } - val := string(strconv.AppendQuote([]byte{}, lit.val)) + ignoreCase // wrap 'lit.val' with double quotes start := p.pt for _, want := range lit.val { cur := p.pt.rn @@ -17584,13 +16032,13 @@ func (p *parser) parseLitMatcher(lit *litMatcher) (interface{}, bool) { cur = unicode.ToLower(cur) } if cur != want { - p.failAt(false, start.position, val) + p.failAt(false, start.position, lit.want) p.restore(start) return nil, false } p.read() } - p.failAt(true, start.position, val) + p.failAt(true, start.position, lit.want) return p.sliceFrom(start), true } diff --git a/pkg/parser/parser.peg b/pkg/parser/parser.peg index c7f6d4fd..1311a686 100644 --- a/pkg/parser/parser.peg +++ b/pkg/parser/parser.peg @@ -39,33 +39,37 @@ AsciidocDocumentBlocks <- header:(DocumentHeader?) others:(DocumentBlock*) { return []interface{}{}, nil } -DocumentBlock <- !EOF - block:(SimpleParagraph - / Section +DocumentBlock <- + LabeledListItem // mjst appear before simple paragraph + / SimpleParagraph + / BlankLine // must be before LiteralBlock + / Section / DelimitedBlock / FileInclusion / VerseParagraph // must be before ImageBlock / ImageBlock - / ListItem - / BlankLine // must be before LiteralBlock + / OrderedListItem + / UnorderedListItem + / ContinuedListItemElement / LiteralBlock / DocumentAttributeDeclaration / DocumentAttributeReset / TableOfContentsPlaceHolder / UserMacroBlock - / Paragraph) { - return block, nil -} + / Paragraph AsciidocDocumentBlocksWithinDelimitedBlock <- blocks:(DocumentBlockWithinDelimitedBlock)* DocumentBlockWithinDelimitedBlock <- !EOF block:(DelimitedBlock + / BlankLine // must be before LiteralBlock / FileInclusion / VerseParagraph / ImageBlock - / ListItem - / BlankLine // must be before LiteralBlock + / OrderedListItem + / UnorderedListItem + / LabeledListItem + / ContinuedListItemElement / LiteralBlock / DocumentAttributeDeclaration / DocumentAttributeReset @@ -91,7 +95,7 @@ YamlFrontMatter <- YamlFrontMatterToken content:(YamlFrontMatterContent)? YamlFr return types.NewYamlFrontMatter(content.(string)) } -YamlFrontMatterToken <- "---" WS* EOL +YamlFrontMatterToken <- "---" Space* EOL YamlFrontMatterContent <- ((!YamlFrontMatterToken .)+)* { return string(c.text), nil @@ -100,7 +104,7 @@ YamlFrontMatterContent <- ((!YamlFrontMatterToken .)+)* { // ------------------------------------------ // Document Header and Metadata // ------------------------------------------ -DocumentHeader <- "=" WS+ title:(TitleElements) id:(InlineElementID*) EOL +DocumentHeader <- "=" Space+ title:(TitleElements) id:(InlineElementID*) EOL (SingleLineComment / CommentBlock)* authors:(DocumentAuthors?) (SingleLineComment / CommentBlock)* @@ -110,24 +114,24 @@ DocumentHeader <- "=" WS+ title:(TitleElements) id:(InlineElementID*) EOL DocumentAuthors <- DocumentAuthorsInlineForm / DocumentAuthorsAttributeForm -DocumentAuthorsInlineForm <- WS* !":" authors:(DocumentAuthor+) EOL { +DocumentAuthorsInlineForm <- Space* !":" authors:(DocumentAuthor+) EOL { return types.NewDocumentAuthors(authors.([]interface{})) } -DocumentAuthorsAttributeForm <- WS* ":author:" author:(DocumentAuthor) EOL { +DocumentAuthorsAttributeForm <- Space* ":author:" author:(DocumentAuthor) EOL { return []types.DocumentAuthor{author.(types.DocumentAuthor)}, nil } -DocumentAuthor <- WS* fullname:(DocumentAuthorName) email:(DocumentAuthorEmail)? WS* ";"? WS* { +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 <- (Alphanums / (!"<" !";" !Newline .))+ { +DocumentAuthorName <- [^<;\r\n]+ { return string(c.text), nil } -DocumentAuthorEmail <- "<" email:((Alphanums / (!">" !EOL .))+ { +DocumentAuthorEmail <- "<" email:(([^>\r\n]+) { return string(c.text), nil }) ">" { return email, nil @@ -135,7 +139,7 @@ DocumentAuthorEmail <- "<" email:((Alphanums / (!">" !EOL .))+ { // see http://asciidoctor.org/docs/user-manual/#revision-number-date-and-remark // Eg: "v1.0, October 2, 2013: First incarnation" -DocumentRevision <- WS* !":" revision:( +DocumentRevision <- Space* !":" revision:( (revnumber:(DocumentRevisionNumber) ","? revdate:(DocumentRevisionDate)? ":"? revremark:(DocumentRevisionRemark)? { return types.NewDocumentRevision(revnumber, revdate, revremark) }) / (revdate:(DocumentRevisionDate) ":"? revremark:(DocumentRevisionRemark)? { @@ -145,41 +149,44 @@ DocumentRevision <- WS* !":" revision:( } // DocumentRevisionNumber MUST start with a `v` or MAY start with a `v` but MUST end with a `,` -DocumentRevisionNumber <- "v"i DIGIT (Alphanums / Spaces / (!EOL !"," !":" .))+ { +DocumentRevisionNumber <- "v"i DIGIT [^:,\r\n]+ { return string(c.text), nil -} / "v"i? DIGIT (Alphanums / Spaces / (!EOL !"," !":" .))+ WS* &"," { +} / "v"i? DIGIT [^:,\r\n]+ Space* &"," { return string(c.text), nil } -DocumentRevisionDate <- (Alphanums / Spaces / (!EOL !":" .))+ { +DocumentRevisionDate <- [^:\r\n]+ { return string(c.text), nil } -DocumentRevisionRemark <- (Alphanums / Spaces / (!EOL .))+ { +DocumentRevisionRemark <- [^\r\r\n]+ { return string(c.text), nil } // ------------------------------------------ // Document Attributes // ------------------------------------------ -DocumentAttributeDeclaration <- ":" name:(DocumentAttributeName) ":" value:((WS+ value:(DocumentAttributeValue)) { return value, nil })? WS* EOL { +DocumentAttributeDeclaration <- ":" name:(DocumentAttributeName) ":" + value:((Space+ value:(DocumentAttributeValue)) { + return value, nil + })? Space* EOL { return types.NewDocumentAttributeDeclaration(name.(string), value) } // 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 ("-"). -DocumentAttributeName <- ([A-Z] / [a-z] / [0-9] / "_") ([A-Z] / [a-z] / [0-9] / "-")* { +DocumentAttributeName <- [\pL0-9_] ([\pL0-9-])* { return string(c.text), nil } -DocumentAttributeValue <- (!Newline .)+ { +DocumentAttributeValue <- [^\r\n]+ { return string(c.text), nil } -DocumentAttributeReset <- ":!" name:(DocumentAttributeName) ":" WS* EOL { +DocumentAttributeReset <- ":!" name:(DocumentAttributeName) ":" Space* EOL { return types.NewDocumentAttributeReset(name.(string)) -} / ":" name:(DocumentAttributeName) "!:" WS* EOL { +} / ":" name:(DocumentAttributeName) "!:" Space* EOL { return types.NewDocumentAttributeReset(name.(string)) } @@ -211,38 +218,40 @@ ElementAttribute <- &("[" / "." / "#") // skip if the content does not start wit // identify all attributes that masquerade a block element into something else. MasqueradeAttribute <- QuoteAttributes / VerseAttributes -ElementID <- "[[" id:(ID) "]]" WS* EOL { +ElementID <- "[[" id:(ID) "]]" Space* EOL { return types.NewElementID(id.(string)) -} / "[#" id:(ID) "]" WS* EOL { +} / "[#" id:(ID) "]" Space* EOL { return types.NewElementID(id.(string)) } -InlineElementID <- "[[" id:(ID) "]]" WS* { // no EOL here since there can be multiple InlineElementID on the same line +InlineElementID <- "[[" id:(ID) "]]" Space* { // no EOL here since there can be multiple InlineElementID on the same line return types.NewInlineElementID(id.(string)) } // a title attached to an element, such as a ImageBlock // a title starts with a single "." followed by the value, without space in-between -ElementTitle <- "." title:(Alphanums (Alphanums / Spaces / (!Newline .))* { - return string(c.text), nil -}) EOL { +ElementTitle <- "." title:(ElementTitleContent) EOL { return types.NewElementTitle(title.(string)) } +ElementTitleContent <- [\pL0-9][^\r\n<>]* { // "<" and ">" characters are not allowed as they are used as cross-reference markers + return string(c.text), nil +} + // a role attached to an element, such as a ImageBlock // a role starts is wrapped in "[. ]" -ElementRole <- "[." role:(Alphanums (Alphanums / Spaces / (!Newline !"]" .))* { +ElementRole <- "[." role:([\pL0-9] [^\]\r\n]* { return string(c.text), nil -}) "]" WS* EOL { +}) "]" Space* EOL { return types.NewElementRole(role.(string)) } -LiteralAttribute <- "[literal]" WS* Newline { +LiteralAttribute <- "[literal]" Space* Newline { return types.NewLiteralAttribute() } // expression for the whole admonition marker, but only retains the actual kind -AdmonitionMarkerAttribute <- "[" k:(AdmonitionKind) "]" WS* EOL { +AdmonitionMarkerAttribute <- "[" k:(AdmonitionKind) "]" Space* EOL { return types.NewAdmonitionAttribute(k.(types.AdmonitionKind)) } @@ -250,52 +259,50 @@ AdmonitionMarkerAttribute <- "[" k:(AdmonitionKind) "]" WS* EOL { SourceAttributes <- "[source" language:("," attr:(StandaloneAttributeValue)? { return attr, nil })? others:("," attr:(GenericAttribute)? { return attr, nil })* - "]" WS* EOL { + "]" Space* EOL { return types.NewSourceAttributes(language, others.([]interface{})...) } // one or more attributes. eg: [foo, key1=value1, key2 = value2 , ] -AttributeGroup <- "[" attributes:(GenericAttribute)* "]" WS* EOL { +AttributeGroup <- "[" attributes:(GenericAttribute)* "]" Space* EOL { return types.NewAttributeGroup(attributes.([]interface{})) } GenericAttribute <- GenericAttributeWithValue / GenericAttributeWithoutValue -GenericAttributeWithValue <- key:(AttributeKey) "=" value:(AttributeValue)? ","? WS* { // value is (optionally) set +GenericAttributeWithValue <- key:(AttributeKey) "=" value:(AttributeValue)? ","? Space* { // value is (optionally) set return types.NewGenericAttribute(key.(string), value) } -GenericAttributeWithoutValue <- key:(AttributeKey) ","? WS* { // value is not set +GenericAttributeWithoutValue <- key:(AttributeKey) ","? Space* { // value is not set return types.NewGenericAttribute(key.(string), nil) } -AttributeKey <- !"quote" !"verse" !"literal" !Spaces key:(Alphanums / OtherAttributeChar)+ WS* { +AttributeKey <- !"quote" !"verse" !"literal" !(Space+) key:([^\r\n=,\]]+) Space* { return string(c.text), nil } -AttributeValue <- value:(Alphanums / Spaces / OtherAttributeChar)+ { +AttributeValue <- value:([^\r\n=,\]]+) { return string(c.text), nil } -StandaloneAttributeValue <- value:(Alphanums / Spaces / OtherAttributeChar)+ !"=" { // standalone attribute value cannot be followed by a `=`, otherwise it causes troubles for standalone values (eg: in images) +StandaloneAttributeValue <- value:([^\r\n=,\]]+) !"=" { // standalone attribute value cannot be followed by a `=`, otherwise it causes troubles for standalone values (eg: in images) return string(c.text), nil } -OtherAttributeChar <- (!Newline !"=" !"," !"]" .) - -HorizontalLayout <- "[horizontal]" WS* EOL { +HorizontalLayout <- "[horizontal]" Space* EOL { return types.ElementAttributes{"layout": "horizontal"}, nil } -QuoteAttributes <- "[quote" WS* ","? author:(QuoteAttribute)? ","? title:(QuoteAttribute)? "]" WS* EOL { +QuoteAttributes <- "[quote" Space* ","? author:(QuoteAttribute)? ","? title:(QuoteAttribute)? "]" Space* EOL { return types.NewQuoteAttributes("quote", author, title) } -VerseAttributes <- "[verse" WS* ","? author:(QuoteAttribute)? ","? title:(QuoteAttribute)? "]" WS* EOL { +VerseAttributes <- "[verse" Space* ","? author:(QuoteAttribute)? ","? title:(QuoteAttribute)? "]" Space* EOL { return types.NewQuoteAttributes("verse", author.(string), title.(string)) } -QuoteAttribute <- (Alphanums / Spaces / (!"," !"]" !EOL .))* { +QuoteAttribute <- ([^\r\n,\]]*) { return string(c.text), nil } @@ -315,7 +322,7 @@ Section <- attributes:(ElementAttributes)? // use a predicate to make sure that only `=` (level 0) to `======` (level 5) are allowed return level.(int) <= 5, nil } - WS+ title:(TitleElements) id:(InlineElementID*) EOL { + Space+ title:(TitleElements) id:(InlineElementID*) EOL { return types.NewSection(level.(int), title.([]interface{}), id.([]interface{}), attributes) } @@ -323,8 +330,9 @@ TitleElements <- elements:(!Newline !InlineElementID TitleElement)+ { // absorbs return types.NewInlineElements(elements.([]interface{})) } -TitleElement <- element:(SimpleWord - / Spaces +TitleElement <- element:(Word + / LineBreak // must be before spaces + / Space+ / CrossReference / Passthrough / InlineImage @@ -332,10 +340,7 @@ TitleElement <- element:(SimpleWord / InlineFootnote / QuotedText / DocumentAttributeSubstitution - / LineBreak - / Parenthesis - / AnyChars - / AnyChar ) { + / AnyChar) { return element, nil } @@ -355,11 +360,11 @@ InlineUserMacro <- name:(UserMacroName) ":" value:(UserMacroValue) attrs:(UserMa return types.NewInlineUserMacro(name.(string), value.(string), attrs.(types.ElementAttributes), string(c.text)) } -UserMacroName <- ([a-zA-Z0-9] / "_" / "-")+ { +UserMacroName <- ([\pL0-9_-]+) { return string(c.text), nil } -UserMacroValue <- (Alphanums / (!WS !":" !"[" !EOL .))* { +UserMacroValue <- [^:[ \r\n]* { return string(c.text), nil } @@ -372,7 +377,7 @@ UserMacroAttributes <- "[" attrs:(GenericAttribute)* "]" { // ------------------------------------------ FileInclusion <- incl:("include::" path:(FileLocation) inlineAttributes:(FileIncludeAttributes) { return types.NewFileInclusion(path.(types.Location), inlineAttributes.(types.ElementAttributes), string(c.text)) - }) WS* EOL { + }) Space* EOL { return incl.(types.FileInclusion), nil } @@ -390,7 +395,7 @@ LineRangesAttributeValue <- value:(MultipleLineRanges // TODO: just have Multipl / MultiLineQuotedRange / SingleLineQuotedRange / SingleLineRange - / UndefinedLineRange) WS* (&"," / &"]") { + / UndefinedLineRange) Space* (&"," / &"]") { return value, nil } @@ -424,7 +429,7 @@ SingleLineQuotedRange <- "\"" singleline:(NUMBER) "\"" { // eg: lines=12 return types.NewLineRange(singleline.(int), singleline.(int)) } -UndefinedLineRange <- (!"]" !"," !WS .)* { +UndefinedLineRange <- [^\], ]* { return string(c.text), nil } @@ -432,7 +437,7 @@ TagRangesAttribute <- ("tags=" / "tag=") tags:(TagRangesAttributeValue) ","? { / return types.NewTagRangesAttribute(tags.([]interface{})) } -TagRangesAttributeValue <- value:(MultipleTagRanges) WS* (&"," / &"]") { +TagRangesAttributeValue <- value:(MultipleTagRanges) Space* (&"," / &"]") { return value, nil } @@ -462,7 +467,7 @@ TagWildcard <- stars:(("*")+ { // Entrypoint to parse a file to include. May contain nested file inclusion macros VerbatimFileContent <- (FileInclusion / VerbatimLine)* -VerbatimLine <- !EOF content:((AlphanumsAndSpaces / !EOL .)* { +VerbatimLine <- !EOF content:([^\r\n]* { return string(c.text), nil }) EOL { return types.NewVerbatimLine(content.(string)) @@ -486,10 +491,6 @@ IncludedFileEndTag <- "end::" tag:(Alphanums {return string(c.text), nil}) "[]" // ------------------------------------------ // Lists // ------------------------------------------ -ListItems <- ListItem+ - -ListItem <- OrderedListItem / UnorderedListItem / LabeledListItem / ContinuedListItemElement - ListParagraph <- comment:(SingleLineComment) { return comment, nil } / lines:(ListParagraphLine)+ { @@ -504,26 +505,28 @@ ListParagraphLine <- !EOF !ListItemContinuation !ElementAttribute !BlockDelimiter - !(SimpleLabeledListItemTerm LabeledListItemSeparator) - line:( - elements:(InlineElement)+ linebreak:(LineBreak)? { // absorbs heading and trailing spaces - return types.NewInlineElements(append(elements.([]interface{}), linebreak)) + !LabeledListItemPrefix + line:(elements:(InlineElement)+ { + return types.NewInlineElements(elements.([]interface{})) }) EOL { - return line, nil - } + return line, nil + } -ListItemContinuation <- "+" WS* EOL +ListItemContinuation <- "+" Space* Newline // there should be something after, so `EOL` is not valid here -ContinuedListItemElement <- blanklines:(BlankLine*) ListItemContinuation element:ContinuedListItemBlock { - return types.NewContinuedListItemElement(-len(blanklines.([]interface{})), element) // offset is negative +ContinuedListItemElement <- ListItemContinuation element:ContinuedListItemContent { + return types.NewContinuedListItemElement(element) // offset is negative } -ContinuedListItemBlock <- !EOF - block:(DelimitedBlock +ContinuedListItemContent <- !EOF + content:(DelimitedBlock / FileInclusion / VerseParagraph // must be before ImageBlock / ImageBlock - / ListItem + / OrderedListItem + / UnorderedListItem + / LabeledListItem + // / ContinuedListItemElement / BlankLine // must be before LiteralBlock / LiteralBlock / DocumentAttributeDeclaration @@ -531,7 +534,7 @@ ContinuedListItemBlock <- !EOF / TableOfContentsPlaceHolder / UserMacroBlock / ContinuedParagraph) { - return block, nil + return content, nil } // ------------------------------------------ @@ -542,7 +545,7 @@ OrderedListItem <- attributes:(ElementAttributes)? prefix:(OrderedListItemPrefix } OrderedListItemPrefix <- - WS* prefix:( + Space* prefix:( // implicit numbering: "." to "....." depth:((".")+ { // `.` is 1, etc. @@ -577,7 +580,7 @@ OrderedListItemPrefix <- return types.NewOrderedListItemPrefix(types.LowerRoman, 1) } / ([A-Z])+ ")" { // numbering style: "I)" return types.NewOrderedListItemPrefix(types.UpperRoman, 1) - }) WS+ { + }) Space+ { return prefix, nil } @@ -593,7 +596,7 @@ UnorderedListItem <- attributes:(ElementAttributes)? prefix:(UnorderedListItemPr } UnorderedListItemPrefix <- - WS* prefix:(( + Space* prefix:(( // implicit numbering: "*" to "*****" depth:(("*")+ { // `*` is 1, etc. @@ -618,7 +621,7 @@ UnorderedListItemPrefix <- } }) / depth:(("-") { return types.NewUnorderedListItemPrefix(types.Dash, 1) - })) WS+ { + })) Space+ { return prefix, nil } @@ -626,7 +629,7 @@ UnorderedListItemCheckStyle <- &"[" style:( "[ ]" { return types.Unchecked, nil } / "[*]" { return types.Checked, nil } / "[x]" { return types.Checked, nil } - ) WS+ { + ) Space+ { return style, nil } @@ -637,22 +640,25 @@ UnorderedListItemContent <- elements:(ListParagraph+) { // Another list or a lit // ------------------------------------------ // Labeled List Items // ------------------------------------------ -LabeledListItem <- attributes:(ElementAttributes)? term:(SimpleLabeledListItemTerm) separator:(LabeledListItemSeparator) description:(LabeledListItemDescription)? { +LabeledListItem <- attributes:(ElementAttributes)? term:(VerbatimLabeledListItemTerm) separator:(LabeledListItemSeparator) description:(LabeledListItemDescription)? { return types.NewLabeledListItem(len(separator.(string)) - 1, term.([]interface{}), description, attributes) } -SimpleLabeledListItemTerm <- content:((Alphanums / Spaces / (!Newline !LabeledListItemSeparator .))+ { +LabeledListItemPrefix <- VerbatimLabeledListItemTerm LabeledListItemSeparator + +VerbatimLabeledListItemTerm <- content:([^:\r\n]+ { return types.NewStringElement(strings.TrimSpace(string(c.text))) }) { return types.NewInlineElements(content) } -LabeledListItemTerm <- elements:(!Newline !LabeledListItemSeparator LabeledListItemTermElement)+ { // absorbs heading and trailing spaces +LabeledListItemTerm <- elements:(!Newline !"::" LabeledListItemTermElement)+ { // rule as an extra entrypoint return types.NewInlineElements(elements.([]interface{})) } -LabeledListItemTermElement <- element:(SimpleWord - / Spaces +LabeledListItemTermElement <- element:(Word + / LineBreak // must appear before spaces + / Space+ / CrossReference / ConcealedIndexTerm / IndexTerm @@ -662,9 +668,6 @@ LabeledListItemTermElement <- element:(SimpleWord / InlineFootnote / QuotedText / DocumentAttributeSubstitution - / LineBreak - / Parenthesis - / AnyChars / AnyChar ) { return element, nil } @@ -677,7 +680,7 @@ LabeledListItemSeparator <- // use a predicate to make sure that only `::` to `::::` are allowed return len(separator.(string)) >= 2 && len(separator.(string)) <= 4, nil } - ((WS / Newline)+ / EOL) { + ((Space / Newline)+ / EOL) { return separator, nil } @@ -711,7 +714,7 @@ Paragraph <- return types.NewAdmonitionParagraph(lines.([]interface{}), t.(types.AdmonitionKind), attributes) } / // other kind of paragraph (verse, regular, etc.) - attributes:(ElementAttributes)? lines:(InlineElements)+ { + attributes:(ElementAttributes)? !BlockDelimiter lines:(InlineElements)+ { return types.NewParagraph(lines.([]interface{}), attributes) } @@ -730,6 +733,15 @@ SimpleParagraph <- attributes:(ElementAttributes)? return types.NewParagraph(append([]interface{}{firstLine}, otherLines.([]interface{})...), attributes) } +FirstParagraphLine <- + elements:(Word InlineElement*) EOL { + return types.NewInlineElements(elements.([]interface{})) +} + +OtherParagraphLine <- elements:(InlineElements) { + return elements, nil +} + // same as Paragraph, but without allowing for ListItemContinuation (`+`) ContinuedParagraph <- // admonition paragraph @@ -745,15 +757,6 @@ ContinuedParagraphLines <- firstLine:(FirstParagraphLine) otherLines:(!ListItemC return append([]interface{}{firstLine}, otherLines.([]interface{})...), nil } -FirstParagraphLine <- !(SimpleLabeledListItemTerm LabeledListItemSeparator) - elements:(SimpleWord InlineElement*) linebreak:(LineBreak)? EOL { - return types.NewInlineElements(append(elements.([]interface{}), linebreak)) -} - -OtherParagraphLine <- elements:(InlineElements) { - return elements, nil -} - VerseParagraph <- // admonition paragraph attributes:(ElementAttributes)? @@ -780,68 +783,39 @@ VerseParagraph <- return types.NewParagraph(lines.([]interface{}), attributes) } -InlineElements <- !EOF !BlankLine +InlineElements <- !BlankLine elements:(comment:(SingleLineComment) { return types.NewInlineElements([]interface{}{comment}) - } / !BlockDelimiter elements:(InlineElement)+ linebreak:(LineBreak)? EOL { - return types.NewInlineElements(append(elements.([]interface{}), linebreak)) + } / elements:(InlineElement)+ EOL { + return types.NewInlineElements(elements.([]interface{})) }) { return elements, nil } -InlineElement <- !EOL !LineBreak - element:(SimpleWord - / QuotedText - / Spaces - / InlineImage - / Link - / Passthrough - / InlineFootnote - / CrossReference - / InlineUserMacro - / DocumentAttributeSubstitution - / InlineElementID - / ConcealedIndexTerm - / IndexTerm - / Parenthesis - / AnyChars - / AnyChar ) { - return element, nil -} - -InlineElementWithoutSubtitution <- !EOL !LineBreak - element:(SimpleWord - / QuotedText - / Spaces - / InlineImage - / Link - / Passthrough - / CrossReference - / InlineElementID - / Parenthesis - / AnyChars - / AnyChar ) { +InlineElement <- + element:(InlineWord // more permissive than words + / LineBreak // must be before spaces + / Space+ + / !EOL ( + QuotedText + / InlineImage + / Link + / Passthrough + / InlineFootnote + / CrossReference + / InlineUserMacro + / DocumentAttributeSubstitution + / InlineElementID + / ConcealedIndexTerm + / IndexTerm + / AnyChar)) { return element, nil } -VerbatimParagraph <- attributes:(ElementAttributes)? lines:(!EOF line:(VerbatimParagraphLine) { - return line, nil -})+ { - return types.NewParagraph(lines.([]interface{}), attributes) -} - -VerbatimParagraphLine <- !BlockDelimiter !BlankLine elements:(VerbatimParagraphLineElement)* linebreak:(LineBreak)? EOL { - return types.NewInlineElements(append(elements.([]interface{}), linebreak)) -} - -VerbatimParagraphLineElement <- (!EOL !LineBreak .)+ { - return string(c.text), nil -} - // ---------------------------------------------------------------------------- // Explicit line breaks // ---------------------------------------------------------------------------- -LineBreak <- WS "+" WS* &EOL { +LineBreak <- Space "+" Space* &EOL { return types.NewLineBreak() } @@ -854,7 +828,7 @@ ConstrainedQuotedTextMarker <- "*" !"*" / "_" !"_" / "`" !"`" UnconstrainedQuotedTextPrefix <- "**" / "__" / "``" / "^" / "~" -ConstrainedQuotedText <- !WS text:(SingleQuoteBoldText +ConstrainedQuotedText <- text:(SingleQuoteBoldText / SingleQuoteItalicText / SingleQuoteMonospaceText / SubscriptText @@ -895,55 +869,61 @@ DoubleQuoteBoldText <- !`\\` "**" elements:(DoubleQuoteBoldTextElements) "**" { return types.NewQuotedText(types.Bold, elements.([]interface{})) } -DoubleQuoteBoldTextElements <- DoubleQuoteBoldTextElement (!("**") (WS / DoubleQuoteBoldTextElement))* // may start and end with spaces +DoubleQuoteBoldTextElements <- DoubleQuoteBoldTextElement (!("**") (Space / DoubleQuoteBoldTextElement))* // may start and end with spaces -DoubleQuoteBoldTextElement <- !Newline element:(SimpleWord +DoubleQuoteBoldTextElement <- Word / SingleQuoteBoldText / ItalicText / MonospaceText / SubscriptText / SuperscriptText / InlineImage - / QuotedLink + / Link / Passthrough / DocumentAttributeSubstitution - / NonDoubleQuoteBoldText - / Parenthesis - / AnyChars - / AnyChar ) { // word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop - return element, nil + / DoubleQuoteBoldTextStringElement + / DoubleQuoteBoldTextFallbackCharacter + + +DoubleQuoteBoldTextStringElement <- (!"**" [^\r\n ^~{}])+ { + return types.NewStringElement(string(c.text)) } -NonDoubleQuoteBoldText <- (.) (!"**" !WS !"^" !"~" !Newline !Parenthesis .)* { +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) "*" { // single punctuation cannot be followed by a character (needs '**' to emphazise a portion of a word) +SingleQuoteBoldText <- (!`\` "*" !"*") elements:(SingleQuoteBoldTextElements) "*" &(!Alphanum) { // single punctuation cannot be followed by a character (needs '**' to emphazise a portion of a word) return types.NewQuotedText(types.Bold, elements.([]interface{})) } / !`\\` "*" elements:("*" SingleQuoteBoldTextElements) "*" { // unbalanced `**` vs `*` punctuation. return types.NewQuotedText(types.Bold, elements.([]interface{})) // include the second heading `*` as a regular StringElement in the bold content } -SingleQuoteBoldTextElements <- !WS SingleQuoteBoldTextElement (!("*" !Alphanum) WS* SingleQuoteBoldTextElement)* +SingleQuoteBoldTextElements <- !Space SingleQuoteBoldTextElement+ -SingleQuoteBoldTextElement <- !Newline element:(SimpleWord +SingleQuoteBoldTextElement <- Word / DoubleQuoteBoldText + / Space+ ('*' !'*')? / ItalicText / MonospaceText / SubscriptText / SuperscriptText / InlineImage - / QuotedLink + / Link / Passthrough / DocumentAttributeSubstitution - / NonSingleQuoteBoldText - / Parenthesis - / AnyChars - / AnyChar ) { // word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop - return element, nil + / SingleQuoteBoldTextStringElement + / SingleQuoteBoldTextFallbackCharacter + +SingleQuoteBoldTextStringElement <- [^\r\n{} *^~]+ { // anything except EOL, space, bold and subscript/superscript delimiters and brackets. Excludes curly brackets to match with DocumentAttributeSubstitution elements + return types.NewStringElement(string(c.text)) } -NonSingleQuoteBoldText <- (.) (!"*" !WS !"^" !"~" !Newline !Parenthesis .)* { +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)) } @@ -967,53 +947,59 @@ DoubleQuoteItalicText <- !`\\` "__" elements:(DoubleQuoteItalicTextElements) "__ return types.NewQuotedText(types.Italic, elements.([]interface{})) } -DoubleQuoteItalicTextElements <- DoubleQuoteItalicTextElement (!("__") (WS / DoubleQuoteItalicTextElement))* // may start and end with spaces +DoubleQuoteItalicTextElements <- DoubleQuoteItalicTextElement (!("__") (Space / DoubleQuoteItalicTextElement))* // may start and end with spaces -DoubleQuoteItalicTextElement <- !Newline element:(SimpleWord +DoubleQuoteItalicTextElement <- Word / SingleQuoteItalicText / BoldText / MonospaceText / SubscriptText / SuperscriptText / InlineImage - / QuotedLink + / Link / Passthrough - / NonDoubleQuoteItalicText - / Parenthesis - / AnyChars - / AnyChar ) { // word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop - return element, nil + / DoubleQuoteItalicTextStringElement + / DoubleQuoteItalicTextFallbackCharacter + +DoubleQuoteItalicTextStringElement <- (!"__" [^\r\n ^~{}])+ { + return types.NewStringElement(string(c.text)) } -NonDoubleQuoteItalicText <- (.) (!"__" !"^" !"~" !Newline !Parenthesis .)* { +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) +SingleQuoteItalicText <- (!`\` "_" !"_") elements:(SingleQuoteItalicTextElements) "_" { // single punctuation cannot be followed by a character (needs '__' to emphazise a portion of a word) return types.NewQuotedText(types.Italic, elements.([]interface{})) } / !`\\` "_" elements:("_" SingleQuoteItalicTextElements) "_" { // unbalanced `__` vs `_` punctuation. return types.NewQuotedText(types.Italic, elements.([]interface{})) // include the second heading `_` as a regular StringElement in the italic content } -SingleQuoteItalicTextElements <- !WS SingleQuoteItalicTextElement (!("_" !Alphanum) WS* SingleQuoteItalicTextElement)* +SingleQuoteItalicTextElements <- !Space SingleQuoteItalicTextElement+ -SingleQuoteItalicTextElement <- !Newline element:(SimpleWord +SingleQuoteItalicTextElement <- Word / DoubleQuoteItalicText + / Space+ ('_' !'_')? / BoldText / MonospaceText / SubscriptText / SuperscriptText / InlineImage - / QuotedLink + / Link / Passthrough - / NonSingleQuoteItalicText - / Parenthesis - / AnyChars - / AnyChar ) { // word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop - return element, nil + / DocumentAttributeSubstitution + / SingleQuoteItalicTextStringElement + / SingleQuoteItalicTextFallbackCharacter + +SingleQuoteItalicTextStringElement <- [^\r\n{} _^~]+ { // anything except EOL, space, bold and subscript/superscript delimiters and brackets. Excludes curly brackets to match with DocumentAttributeSubstitution elements + return types.NewStringElement(string(c.text)) } -NonSingleQuoteItalicText <- (.) (!"_" !WS !"^" !"~" !Newline !Parenthesis .)* { +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)) } @@ -1036,54 +1022,60 @@ DoubleQuoteMonospaceText <- !`\\` "``" elements:(DoubleQuoteMonospaceTextElement return types.NewQuotedText(types.Monospace, elements.([]interface{})) } -DoubleQuoteMonospaceTextElements <- DoubleQuoteMonospaceTextElement (!("``") (WS / DoubleQuoteMonospaceTextElement))* // may start and end with spaces +DoubleQuoteMonospaceTextElements <- DoubleQuoteMonospaceTextElement (!("``") (Space / DoubleQuoteMonospaceTextElement))* // may start and end with spaces -DoubleQuoteMonospaceTextElement <- !Newline element:(SimpleWord +DoubleQuoteMonospaceTextElement <- Word / SingleQuoteMonospaceText / BoldText / ItalicText / SubscriptText / SuperscriptText / InlineImage - / QuotedLink + / Link / Passthrough - / NonDoubleQuoteMonospaceText - / Parenthesis - / AnyChars - / AnyChar ) { // word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop - return element, nil + / DoubleQuoteMonospaceTextStringElement + / DoubleQuoteMonospaceTextFallbackCharacter + +DoubleQuoteMonospaceTextStringElement <- (!"``" [^\r\n ^~{}])+ { + return types.NewStringElement(string(c.text)) } -NonDoubleQuoteMonospaceText <- (.) (!"``" !WS !"^" !"~" !Newline !Parenthesis .)* { +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) +SingleQuoteMonospaceText <- (!`\` "`" !"`") elements:(SingleQuoteMonospaceTextElements) "`" { // single punctuation cannot be followed by a character (needs "``" to emphazise a portion of a word) return types.NewQuotedText(types.Monospace, elements.([]interface{})) } / !`\\` "`" elements:("`" SingleQuoteMonospaceTextElements) "`" { // unbalanced "``" vs "`" punctuation. return types.NewQuotedText(types.Monospace, elements.([]interface{})) // include the second heading "`" as a regular StringElement in the monospace content } -SingleQuoteMonospaceTextElements <- !WS SingleQuoteMonospaceTextElement (!("`" !Alphanum) WS* SingleQuoteMonospaceTextElement)* +SingleQuoteMonospaceTextElements <- !Space SingleQuoteMonospaceTextElement+ -SingleQuoteMonospaceTextElement <- element:(SimpleWord - / Newline // allows multiline +SingleQuoteMonospaceTextElement <- Word / DoubleQuoteMonospaceText + / Space+ ('`' !'`')? // allow for content such as "`some `nested monospace`". Also, do not allow for double backticks after spaces. + / Newline // allows multiline / BoldText / ItalicText / SubscriptText / SuperscriptText / InlineImage - / QuotedLink + / Link / Passthrough - / NonSingleQuoteMonospaceText - / Parenthesis - / AnyChars - / AnyChar ) { // word with quote punctuation is only accepted if nothing matched before, so we have a chance to stop - return element, nil + / DocumentAttributeSubstitution + / SingleQuoteMonospaceTextStringElement + / SingleQuoteMonospaceTextFallbackCharacter + +SingleQuoteMonospaceTextStringElement <- [^\r\n {}`^~]+ { // anything except EOL, space, monospace and subscript/superscript delimiters. Excludes curly brackets to match with DocumentAttributeSubstitution elements + return types.NewStringElement(string(c.text)) } -NonSingleQuoteMonospaceText <- (.) (!WS !"`" !"^" !"~" !Newline !Parenthesis .)* { // break at multiline +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)) } @@ -1103,7 +1095,7 @@ SubscriptText <- !`\` "~" element:(SubscriptTextElement) "~" { // wraps a single SubscriptTextElement <- QuotedText / NonSubscriptText -NonSubscriptText <- (!Newline !WS !"~" .)+ { +NonSubscriptText <- [^\r\n ~]+ { // anything except spaces, EOL or '~' return c.text, nil } @@ -1117,7 +1109,7 @@ SuperscriptText <- !`\` "^" element:(SuperscriptTextElement) "^" { // wraps a si SuperscriptTextElement <- QuotedText / NonSuperscriptText -NonSuperscriptText <- (!Newline !WS !"^" .)+ { +NonSuperscriptText <- [^\r\n ^]+ { // anything except spaces, EOL or '^' return c.text, nil } @@ -1136,9 +1128,9 @@ SinglePlusPassthrough <- SinglePlusPassthroughPrefix content:(SinglePlusPassthro return types.NewPassthrough(types.SinglePlusPassthrough, []interface{}{content}) } -SinglePlusPassthroughContent <- ((!SinglePlusPassthroughPrefix !WS !Newline .) (!(WS+ SinglePlusPassthroughPrefix) !SinglePlusPassthroughPrefix !Newline .)* { // no space in the first or last position of the content, but allowed elsewhere +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)) -}) / ((!WS !Newline !SinglePlusPassthroughPrefix .) { // a single character +}) / ((!Space !Newline !SinglePlusPassthroughPrefix .) { // a single character return types.NewStringElement(string(c.text)) }) @@ -1150,7 +1142,7 @@ TriplePlusPassthrough <- TriplePlusPassthroughPrefix content:(TriplePlusPassthro 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)) -}) / ((!WS !Newline !TriplePlusPassthroughPrefix .)? { // a single character +}) / ((!Space !Newline !TriplePlusPassthroughPrefix .)? { // a single character return types.NewStringElement(string(c.text)) }) @@ -1160,16 +1152,16 @@ PassthroughMacro <- "pass:[" content:(PassthroughMacroCharacter)* "]" { return types.NewPassthrough(types.PassthroughMacro, content.([]interface{})) } -PassthroughMacroCharacter <- (Alphanums / Spaces / (!"]" .){ +PassthroughMacroCharacter <- [^\]] { return types.NewStringElement(string(c.text)) -}) +} // ------------------------------------------ // Cross References // ------------------------------------------ CrossReference <- InternalCrossReference / ExternalCrossReference -InternalCrossReference <- "<<" id:(ID) WS* "," label:(CrossReferenceLabel) ">>" { +InternalCrossReference <- "<<" id:(ID) Space* "," label:(CrossReferenceLabel) ">>" { return types.NewInternalCrossReference(id.(string), label.(string)) } / "<<" id:(ID) ">>" { return types.NewInternalCrossReference(id.(string), nil) @@ -1179,9 +1171,7 @@ ExternalCrossReference <- "xref:" url:(FileLocation) inlineAttributes:(LinkAttri return types.NewExternalCrossReference(url.(types.Location), inlineAttributes.(types.ElementAttributes)) } -CrossReferenceLabel <- (Alphanums / Spaces / (!">>" .))+ { - return string(c.text), nil -} +CrossReferenceLabel <- ElementTitleContent // ------------------------------------------ // Links @@ -1189,47 +1179,49 @@ CrossReferenceLabel <- (Alphanums / Spaces / (!">>" .))+ { Link <- RelativeLink / ExternalLink // url preceeding with `link:` MUST be followed by square brackets -RelativeLink <- "link:" url:(Location / FileLocation) inlineAttributes:(LinkAttributes) { +RelativeLink <- "link:" url:(Location) inlineAttributes:(LinkAttributes) { return types.NewInlineLink(url.(types.Location), inlineAttributes.(types.ElementAttributes)) } -ExternalLink <- url:(Location) inlineAttributes:(LinkAttributes)? { +ExternalLink <- url:(LocationWithScheme) inlineAttributes:(LinkAttributes)? { return types.NewInlineLink(url.(types.Location), inlineAttributes) } -LinkAttributes <- TextOnlyLinkAttributes / TextAndMoreLinkAttributes - -TextOnlyLinkAttributes <- "[" text:( - // surrounded with double quotes - "\"" elements:(!"\"" !"]" (SimpleWord / Spaces / QuotedText / AnyChar))+ "\"" Spaces* &(!"=") { - return types.NewInlineElements(elements.([]interface{})) - } / - // not surrounded with double quotes - elements:(!"=" !"]" (SimpleWord / Spaces / QuotedText / AnyChar))+ &(!"=") { - return types.NewInlineElements(elements.([]interface{})) - })? "]" { - return types.NewInlineLinkAttributes(text, nil) +LinkAttributes <- "[" firstAttr:(FirstLinkAttributeElement)* + Space* otherattrs:(GenericAttribute)* "]" { + return types.NewInlineLinkAttributes(append(firstAttr.([]interface{}), otherattrs.([]interface{})...)) } -TextAndMoreLinkAttributes <- "[" text:( +FirstLinkAttributeElement <- element:( // surrounded with double quotes - "\"" elements:(!"\"" !"]" (SimpleWord / Spaces / QuotedText / AnyChar))+ "\"" &(!"=") { + ("\"" elements:(QuotedText / QuotedAttributeChar)+ "\"" &(!"=") ","? { return types.NewInlineElements(elements.([]interface{})) - } / + }) / // not surrounded with double quotes - elements:(!"," !"=" !"]" !"\"" (SimpleWord / Spaces / QuotedText / AnyChar))+ &(!"=") { + (elements:(QuotedText / UnquotedAttributeChar)+ &(!"=") ","? { return types.NewInlineElements(elements.([]interface{})) - })? ","? WS* otherattrs:(GenericAttribute)* "]" { - return types.NewInlineLinkAttributes(text, otherattrs.([]interface{})) -} + })) { + return element, nil +} + +AttributeChar <- [^\r\n"=\],] { // excludes comma + return types.NewStringElement(string(c.text)) +} + +QuotedAttributeChar <- [^\r\n"=\]] { // does not exclude comma + return types.NewStringElement(string(c.text)) +} + +UnquotedAttributeChar <- [^\r\n"=\],] { // excludes comma + return types.NewStringElement(string(c.text)) +} // rule used after document attribute substitution, to discover links InlineLinks <- - elements:(SimpleWord - / Spaces + elements:(Word + / Space+ / ResolvedLink / Parenthesis - / AnyChars / AnyChar / Newline)+ EOF { return types.NewInlineElements(elements.([]interface{})) @@ -1246,24 +1238,18 @@ ResolvedExternalLink <- url:(ResolvedLocation) inlineAttributes:(LinkAttributes) return types.NewInlineLink(url.(types.Location), inlineAttributes) } -QuotedLink <- RelativeLink / ExternalQuotedLink - -ExternalQuotedLink <- url:(Location) inlineAttributes:(LinkAttributes) { // here attributes are required, so we can safely use the `_` and `*` characters in the URL without messing with the bold or italic markers. - return types.NewInlineLink(url.(types.Location), inlineAttributes) -} - // ------------------------------------------ // Images // ------------------------------------------ -ImageBlock <- attributes:(ElementAttributes)? "image::" path:(Location / FileLocation) inlineAttributes:(ImageAttributes) WS* EOL { +ImageBlock <- attributes:(ElementAttributes)? "image::" path:(Location) inlineAttributes:(ImageAttributes) Space* EOL { return types.NewImageBlock(path.(types.Location), inlineAttributes.(types.ElementAttributes), attributes) } -InlineImage <- "image:" !":" path:(Location / FileLocation) inlineAttributes:(ImageAttributes) { +InlineImage <- "image:" !":" path:(Location) inlineAttributes:(ImageAttributes) { return types.NewInlineImage(path.(types.Location), inlineAttributes.(types.ElementAttributes)) } -ImageAttributes <- "[" alt:(StandaloneAttributeValue)? ","? width:(StandaloneAttributeValue)? ","? height:(StandaloneAttributeValue)? ","? WS* otherattrs:(GenericAttribute)* "]" { +ImageAttributes <- "[" alt:(StandaloneAttributeValue)? ","? width:(StandaloneAttributeValue)? ","? height:(StandaloneAttributeValue)? ","? Space* otherattrs:(GenericAttribute)* "]" { return types.NewImageAttributes(alt, width, height, otherattrs.([]interface{})) } @@ -1276,18 +1262,16 @@ InlineFootnote <- "footnote:[" content:(FootnoteContent) "]" { return types.NewFootnote(ref.(string), content) } -FootnoteRef <- Alphanums { - return string(c.text), nil -} +FootnoteRef <- Alphanums -FootnoteContent <- elements:(!"]" !EOL WS* !InlineElementID InlineElement WS*)+ { // footnote content may span multiple lines +FootnoteContent <- elements:(!"]" InlineElement)+ { // footnote content may span multiple lines return types.NewInlineElements(elements.([]interface{})) } // ------------------------------------------------------------------------------------ // Delimited Blocks // ------------------------------------------------------------------------------------ -DelimitedBlock <- !Alphanum // quick escape +DelimitedBlock <- !Alphanum // delimited blocks, even without attributes, never start with an alphanum block:(FencedBlock / ListingBlock / ExampleBlock @@ -1300,7 +1284,7 @@ DelimitedBlock <- !Alphanum // quick escape return block, nil } -BlockDelimiter <- LiteralBlockDelimiter //TODO: use "start" delimiters +BlockDelimiter <- !(Alphanum) LiteralBlockDelimiter //TODO: use "start" delimiters / FencedBlockDelimiter / ListingBlockDelimiter / ExampleBlockDelimiter @@ -1313,11 +1297,11 @@ VerbatimContent <- FileInclusion / VerbatimLine // ------------------------------------------------------------------------------------- // Fenced Blocks // ------------------------------------------------------------------------------------- -FencedBlockDelimiter <- "```" WS* EOL // Deprecated: use 'FencedBlockStartDelimiter' instead +FencedBlockDelimiter <- "```" Space* EOL // Deprecated: use 'FencedBlockStartDelimiter' instead -FencedBlockStartDelimiter <- "```" WS* EOL +FencedBlockStartDelimiter <- "```" Space* EOL -FencedBlockEndDelimiter <- ("```" WS* EOL) / EOF +FencedBlockEndDelimiter <- ("```" Space* EOL) / EOF FencedBlock <- attributes:(ElementAttributes)? FencedBlockStartDelimiter content:(FencedBlockVerbatimContent) FencedBlockEndDelimiter { return types.NewDelimitedBlock(types.Fenced, content.([]interface{}), attributes) @@ -1330,11 +1314,11 @@ FencedBlockVerbatimContent <- (!FencedBlockEndDelimiter content:(VerbatimContent // ------------------------------------------------------------------------------------- // Listing blocks // ------------------------------------------------------------------------------------- -ListingBlockDelimiter <- "----" WS* EOL +ListingBlockDelimiter <- "----" Space* EOL -ListingBlockStartDelimiter <- "----" WS* EOL +ListingBlockStartDelimiter <- "----" Space* EOL -ListingBlockEndDelimiter <- ("----" WS* EOL) / EOF +ListingBlockEndDelimiter <- ("----" Space* EOL) / EOF ListingBlock <- attributes:(ElementAttributes)? ListingBlockStartDelimiter content:(ListingBlockVerbatimContent) ListingBlockEndDelimiter { return types.NewDelimitedBlock(types.Listing, content.([]interface{}), attributes) @@ -1347,11 +1331,11 @@ ListingBlockVerbatimContent <- (!ListingBlockEndDelimiter content:(VerbatimConte // ------------------------------------------------------------------------------------- // Example blocks // ------------------------------------------------------------------------------------- -ExampleBlockDelimiter <- "====" WS* EOL +ExampleBlockDelimiter <- "====" Space* EOL -ExampleBlockStartDelimiter <- "====" WS* EOL +ExampleBlockStartDelimiter <- "====" Space* EOL -ExampleBlockEndDelimiter <- ("====" WS* EOL) / EOF +ExampleBlockEndDelimiter <- ("====" Space* EOL) / EOF ExampleBlock <- attributes:(ElementAttributes)? ExampleBlockStartDelimiter content:(ExampleBlockVerbatimContent) ExampleBlockEndDelimiter { return types.NewDelimitedBlock(types.Example, content.([]interface{}), attributes) @@ -1364,11 +1348,11 @@ ExampleBlockVerbatimContent <- (!ExampleBlockEndDelimiter content:(VerbatimConte // ------------------------------------------------------------------------------------- // Quote blocks // ------------------------------------------------------------------------------------- -QuoteBlockDelimiter <- "____" WS* EOL // same for verse blocks +QuoteBlockDelimiter <- "____" Space* EOL // same for verse blocks -QuoteBlockStartDelimiter <- "____" WS* EOL // same for verse blocks +QuoteBlockStartDelimiter <- "____" Space* EOL // same for verse blocks -QuoteBlockEndDelimiter <- ("____" WS* EOL) / EOF // same for verse blocks +QuoteBlockEndDelimiter <- ("____" Space* EOL) / EOF // same for verse blocks QuoteBlock <- attributes:(ElementAttributes)? QuoteBlockStartDelimiter content:(QuoteBlockVerbatimElement) QuoteBlockEndDelimiter { return types.NewDelimitedBlock(types.Quote, content.([]interface{}), attributes) @@ -1399,11 +1383,11 @@ VerseBlockVerbatimContent <- (!QuoteBlockEndDelimiter content:(VerbatimContent) // ------------------------------------------------------------------------------------- // Sidebar blocks // ------------------------------------------------------------------------------------- -SidebarBlockDelimiter <- "****" WS* EOL +SidebarBlockDelimiter <- "****" Space* EOL -SidebarBlockStartDelimiter <- "****" WS* EOL +SidebarBlockStartDelimiter <- "****" Space* EOL -SidebarBlockEndDelimiter <- ("****" WS* EOL) / EOF +SidebarBlockEndDelimiter <- ("****" Space* EOL) / EOF SidebarBlock <- attributes:(ElementAttributes)? SidebarBlockStartDelimiter content:(SidebarBlockVerbatimContent) SidebarBlockEndDelimiter { return types.NewDelimitedBlock(types.Sidebar, content.([]interface{}), attributes) @@ -1423,7 +1407,10 @@ NormalBlockElement <- !EOF element:(BlankLine / FileInclusion / ImageBlock - / ListItem + / OrderedListItem + / UnorderedListItem + / LabeledListItem + / ContinuedListItemElement / DelimitedBlock / LiteralBlock / DocumentAttributeDeclaration @@ -1457,9 +1444,9 @@ Table <- attributes:(ElementAttributes)? TableDelimiter return types.NewTable(header, lines.([]interface{}), attributes) } -TableCellSeparator <- "|" WS* +TableCellSeparator <- "|" Space* -TableDelimiter <- "|===" WS* EOL +TableDelimiter <- "|===" Space* EOL // table line header is a line followed by a blankline TableLineHeader <- !TableDelimiter cells:(TableCell)+ EOL BlankLine { @@ -1470,18 +1457,18 @@ TableLine <- !TableDelimiter cells:(TableCell)+ EOL BlankLine* { return types.NewTableLine(cells.([]interface{})) } -TableCell <- TableCellSeparator elements:(!TableCellSeparator !EOL WS* InlineElement WS*)+ { +TableCell <- TableCellSeparator elements:(!TableCellSeparator !EOL Space* InlineElement Space*)+ { return types.NewInlineElements(elements) } // ------------------------------------------------------------------------------------- // Comments // ------------------------------------------------------------------------------------- -CommentBlockDelimiter <- "////" WS* EOL +CommentBlockDelimiter <- "////" Space* EOL -CommentBlockStartDelimiter <- "////" WS* EOL +CommentBlockStartDelimiter <- "////" Space* EOL -CommentBlockEndDelimiter <- ("////" WS* EOL) / EOF +CommentBlockEndDelimiter <- ("////" Space* EOL) / EOF CommentBlock <- CommentBlockStartDelimiter content:(CommentBlockVerbatimContent) CommentBlockEndDelimiter { return types.NewDelimitedBlock(types.Comment, content.([]interface{}), nil) @@ -1491,11 +1478,11 @@ CommentBlockVerbatimContent <- (!CommentBlockEndDelimiter content:(VerbatimConte return content, nil })* -SingleLineComment <- !CommentBlockDelimiter WS* "//" content:(SingleLineCommentContent) EOL { +SingleLineComment <- !CommentBlockDelimiter Space* "//" content:(SingleLineCommentContent) EOL { return types.NewSingleLineComment(content.(string)) } -SingleLineCommentContent <- (Alphanums / Spaces / (!EOL .))* { +SingleLineCommentContent <- [^\r\n]* { return string(c.text), nil } @@ -1514,14 +1501,12 @@ ParagraphWithHeadingSpaces <- attributes:(ElementAttributes)? lines:(ParagraphWi // first line MUST start with one (or more) space. Stop when reaching a blank line ParagraphWithHeadingSpacesLines <- - firstLine:(WS (Alphanums / Spaces / (!EOL .){ - return string(c.text), nil - })+ { + firstLine:(Space+ [^\r\n]+ { return string(c.text), nil }) EOL // do not include the trailing 'EOL' on the first line otherLines:( !BlankLine - otherLine:((Alphanums / Spaces / (!EOL .))+ { + otherLine:([^\r\n]+ { return string(c.text), nil }) EOL { return otherLine, nil // do not include the trailing 'EOL' @@ -1531,7 +1516,7 @@ ParagraphWithHeadingSpacesLines <- // paragraph with the literal block delimiter (`....`) ParagraphWithLiteralBlockDelimiter <- attributes:(ElementAttributes)? - LiteralBlockDelimiter WS* Newline lines:(ParagraphWithLiteralBlockDelimiterLines) ((LiteralBlockDelimiter WS* EOL) / EOF) { + LiteralBlockDelimiter Space* Newline lines:(ParagraphWithLiteralBlockDelimiterLines) ((LiteralBlockDelimiter Space* EOL) / EOF) { return types.NewLiteralBlock(types.LiteralBlockWithDelimiter, lines.([]interface{}), attributes) } @@ -1541,7 +1526,7 @@ ParagraphWithLiteralBlockDelimiterLines <- lines:(ParagraphWithLiteralBlockDelim } ParagraphWithLiteralBlockDelimiterLine <- - line:((Alphanums / Spaces / (!LiteralBlockDelimiter !EOL .))* { + line:(!LiteralBlockDelimiter [^\r\n]* { return string(c.text), nil }) EOL { return line, nil // do not include the trailing 'EOL' @@ -1570,10 +1555,10 @@ ParagraphWithLiteralAttributeLines <- lines:(ParagraphWithLiteralAttributeLine)+ return lines.([]interface{}), nil } -ParagraphWithLiteralAttributeLine <- line:(!(BlankLine) (Alphanums / Spaces / (!EOL .))+ { +ParagraphWithLiteralAttributeLine <- !BlankLine content:([^\r\n]+ { return string(c.text), nil }) EOL { - return line, nil // do not include the trailing 'EOL' + return content.(string), nil // do not include the trailing 'EOL' } // ------------------------------------------ @@ -1583,26 +1568,27 @@ IndexTerm <- "((" term:(IndexTermContent) "))" { return types.NewIndexTerm(term.([]interface{})) } -IndexTermContent <- elements:(SimpleWord / QuotedText / WS / AnyChars / (!"))" .)+ { +IndexTermContent <- elements:(Word / QuotedText / Space / (!"))" .) { return string(c.text), nil })+ { return types.NewInlineElements(elements.([]interface{})) } ConcealedIndexTerm <- "(((" term1:(ConcealedIndexTermContent) - term2:(WS* "," WS* content:(ConcealedIndexTermContent) { return content, nil })? - term3:(WS* "," WS* content:(ConcealedIndexTermContent) { return content, nil })? + term2:(Space* "," Space* content:(ConcealedIndexTermContent) { return content, nil })? + term3:(Space* "," Space* content:(ConcealedIndexTermContent) { return content, nil })? ")))" { return types.NewConcealedIndexTerm(term1, term2, term3) } -ConcealedIndexTermContent <- (Alphanum / WS)+ { +ConcealedIndexTermContent <- (Alphanum / Space)+ { return string(c.text), nil } + // ------------------------------------------ // BlankLine // ------------------------------------------ -BlankLine <- !EOF WS* EOL { +BlankLine <- !EOF Space* EOL { return types.NewBlankLine() } @@ -1617,63 +1603,58 @@ Alphanums <- [\pL0-9]+ { return string(c.text), nil } -AlphanumsAndSpaces <- [\pL0-9 ]+ { - return string(c.text), nil -} - -PunctuationMark <- "." / "?" / "!" / "," / ";" / ":" - -SimpleWord <- Alphanums &(WS / "," / "]" / EOL) { // very straightforward content: alphanums followed by spaces but not the "+" signs because it needs a heading space to become a LineBreak element - return types.NewStringElement(string(c.text)) -} - -AnyChars <- ( - // allow cases where something else than a letter, number, colon, semi-colon or closing curly bracket appears directly before a quoted text marker - (!(Alphanum / "," / ";" / "}") ConstrainedQuotedTextMarker) { - 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]+)+ { + return types.NewStringElement(string(c.text)) } - // allow alphanums directly followed by a non excluded character - / ((Alphanums (!Newline !WS !Parenthesis !UnconstrainedQuotedTextPrefix !LabeledListItemSeparator !PunctuationMark .)?) { - return string(c.text), nil - }))+ - / PunctuationMark { // punctuation marks are treated separately, so any following macro (image, footnote, etc.) is not included in this rule + +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 <- !EOF . { // 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)) } -Spaces <- WS+ +FileLocation <- path:(FILENAME / DocumentAttributeSubstitution)+ { + return types.NewLocation("", path.([]interface{})) +} -FileLocation <- elements:(FILENAME / DocumentAttributeSubstitution)+ { - return types.NewLocation(elements.([]interface{})) +ResolvedFileLocation <- path:([^\r\n [])+ { + return types.NewLocation("", path.([]interface{})) } -ResolvedFileLocation <- elements:(!EOL !WS !"[" .)+ { - return types.NewLocation(elements.([]interface{})) +Location <- scheme:(URL_SCHEME)? path:(FILENAME / DocumentAttributeSubstitution)+ { + return types.NewLocation(scheme, path.([]interface{})) } -Location <- elements:(URL_SCHEME (FILENAME / DocumentAttributeSubstitution)+) { - return types.NewLocation(elements.([]interface{})) +LocationWithScheme <- scheme:(URL_SCHEME) path:(FILENAME / DocumentAttributeSubstitution)+ { + return types.NewLocation(scheme, path.([]interface{})) } -FILENAME <- ([ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~:/?#@!$&;=()*+,_%] / "-" / ".")+ // not supported for now: "[" "]". Excluded: "{" and "}" as they may be used for document attribute substitutions +FILENAME <- ([^\r\n{}[\] ])+ // not supported for now: EOL, space, "[", "]", "{" and "}" as they may be used for document attribute substitutions -ResolvedLocation <- elements:(URL_SCHEME RESOLVED_FILENAME) { - return types.NewLocation(elements.([]interface{})) +ResolvedLocation <- scheme:(URL_SCHEME) path:(RESOLVED_FILENAME) { + return types.NewLocation(scheme, path.([]interface{})) } -RESOLVED_FILENAME <- ([ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~:/?#@!$&;=()*+_,%{}] / "-" / ".")+ // here, `{` and `}` are valid characters +//RESOLVED_FILENAME <- ([ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789~:/?#@!$&;=()*+_,%{}] / "-" / ".")+ // here, `{` and `}` are valid characters +RESOLVED_FILENAME <- ([^\r\n[\] ])+ // not supported for now: EOL, space, "[", "]", "{" and "}" as they may be used for document attribute substitutions -URL <- (Alphanums / (!Newline !WS !"[" !"]" .))+ { +URL <- [^\r\n[\]]+ { return string(c.text), nil } URL_SCHEME <- "http://" / "https://" / "ftp://" / "irc://" / "mailto:" -ID <- (Alphanums / (!Newline !WS !"[" !"]" !"<<" !">>" !"," .))+ { +ID <- [^[\]<>,]+ { // previously: (Alphanums / (!Newline !Space !"[" !"]" !"<<" !">>" !"," .))+ return string(c.text), nil } @@ -1685,7 +1666,7 @@ NUMBER <- "-"? DIGIT+ { return strconv.Atoi(string(c.text)) } -WS <- " " / "\t" { +Space <- " " / "\t" { return string(c.text), nil } diff --git a/pkg/parser/passthrough_test.go b/pkg/parser/passthrough_test.go index c3114147..9c829452 100644 --- a/pkg/parser/passthrough_test.go +++ b/pkg/parser/passthrough_test.go @@ -186,7 +186,9 @@ var _ = Describe("passthroughs - draft", func() { }, }, } - Expect(ParseDocumentBlock(source)).To(Equal(expected)) + result, err := ParseDocumentBlock(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(Equal(expected)) }) It("singleplus passthrough with embedded image", func() { diff --git a/pkg/parser/q_a_list_test.go b/pkg/parser/q_a_list_test.go index 882f80ac..bb94206b 100644 --- a/pkg/parser/q_a_list_test.go +++ b/pkg/parser/q_a_list_test.go @@ -13,7 +13,7 @@ var _ = Describe("q and a lists", func() { It("q and a with title", func() { source := `.Q&A [qanda] -What is libsciidoc?:: +What is libasciidoc?:: An implementation of the AsciiDoc processor in Golang. What is the answer to the Ultimate Question?:: 42` @@ -33,7 +33,7 @@ What is the answer to the Ultimate Question?:: 42` Level: 1, Term: []interface{}{ types.StringElement{ - Content: "What is libsciidoc?", + Content: "What is libasciidoc?", }, }, Elements: []interface{}{ diff --git a/pkg/parser/quoted_text_test.go b/pkg/parser/quoted_text_test.go index 4e7e5832..4c8097a7 100644 --- a/pkg/parser/quoted_text_test.go +++ b/pkg/parser/quoted_text_test.go @@ -11,6 +11,7 @@ import ( var _ = Describe("quoted texts", func() { Context("draft document", func() { + Context("quoted text with single punctuation", func() { It("bold text with 1 word", func() { @@ -243,6 +244,72 @@ var _ = Describe("quoted texts", func() { Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) }) + It("bold delimiter text within bold text", func() { + source := "*bold*content*" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.QuotedText{ + Kind: types.Bold, + 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{ + Blocks: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.QuotedText{ + Kind: types.Italic, + 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{ + Blocks: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.QuotedText{ + Kind: types.Monospace, + 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{ @@ -404,7 +471,9 @@ var _ = Describe("quoted texts", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + result, err := ParseDraftDocument(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDraftDocument(expected)) }) It("italic text with 3 words in double quote", func() { @@ -1378,14 +1447,14 @@ var _ = Describe("quoted texts", func() { types.StringElement{Content: "a "}, types.InlineLink{ Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "b", }, }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "/", }, @@ -1399,7 +1468,9 @@ var _ = Describe("quoted texts", func() { }, }, } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + result, err := ParseDraftDocument(source) + Expect(err).NotTo(HaveOccurred()) + Expect(result).To(MatchDraftDocument(expected)) }) It("image in bold", func() { @@ -1417,7 +1488,7 @@ var _ = Describe("quoted texts", func() { types.InlineImage{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "foo.png", }, @@ -1504,14 +1575,14 @@ var _ = Describe("quoted texts", func() { types.StringElement{Content: "a "}, types.InlineLink{ Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "b", }, }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "/", }, @@ -1543,7 +1614,7 @@ var _ = Describe("quoted texts", func() { types.InlineImage{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "foo.png", }, @@ -1630,14 +1701,14 @@ var _ = Describe("quoted texts", func() { types.StringElement{Content: "a "}, types.InlineLink{ Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "b", }, }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "/", }, @@ -1669,7 +1740,7 @@ var _ = Describe("quoted texts", func() { types.InlineImage{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "foo.png", }, @@ -4133,14 +4204,14 @@ var _ = Describe("quoted texts", func() { types.StringElement{Content: "a "}, types.InlineLink{ Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "b", }, }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "/", }, @@ -4177,7 +4248,7 @@ var _ = Describe("quoted texts", func() { types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "foo.png", }, @@ -4273,14 +4344,14 @@ var _ = Describe("quoted texts", func() { types.StringElement{Content: "a "}, types.InlineLink{ Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "b", }, }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "/", }, @@ -4317,7 +4388,7 @@ var _ = Describe("quoted texts", func() { types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "foo.png", }, @@ -4413,14 +4484,14 @@ var _ = Describe("quoted texts", func() { types.StringElement{Content: "a "}, types.InlineLink{ Attributes: types.ElementAttributes{ - types.AttrInlineLinkText: []interface{}{ + "positional-1": []interface{}{ types.StringElement{ Content: "b", }, }, }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "/", }, @@ -4457,7 +4528,7 @@ var _ = Describe("quoted texts", func() { types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "foo.png", }, @@ -5622,7 +5693,7 @@ var _ = Describe("quoted texts - final document", func() { types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "foo.png", }, @@ -5659,7 +5730,7 @@ var _ = Describe("quoted texts - final document", func() { types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "foo.png", }, @@ -5696,7 +5767,7 @@ var _ = Describe("quoted texts - final document", func() { types.AttrImageAlt: "foo", }, Location: types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "foo.png", }, diff --git a/pkg/parser/section_test.go b/pkg/parser/section_test.go index f98d2618..2865db87 100644 --- a/pkg/parser/section_test.go +++ b/pkg/parser/section_test.go @@ -492,8 +492,9 @@ a paragraph` types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ - types.StringElement{Content: "https://foo.bar"}, + Scheme: "https://", + Path: []interface{}{ + types.StringElement{Content: "foo.bar"}, }, }, }, @@ -651,6 +652,42 @@ a short preamble } Expect(ParseDraftDocument(source)).To(MatchDraftDocument(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{ + Blocks: []interface{}{ + types.Section{ + Attributes: types.ElementAttributes{}, + Level: 0, + Title: []interface{}{ + types.StringElement{Content: "a title"}, + }, + Elements: []interface{}{}, + }, + types.BlankLine{}, + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a first paragraph"}, + }, + }, + }, + types.BlankLine{}, + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a second paragraph"}, + }, + }, + }, + }, + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) + }) Context("invalid sections", func() { diff --git a/pkg/parser/unordered_list_test.go b/pkg/parser/unordered_list_test.go index 835ea282..46363afb 100644 --- a/pkg/parser/unordered_list_test.go +++ b/pkg/parser/unordered_list_test.go @@ -8,131 +8,133 @@ import ( . "github.com/onsi/gomega" //nolint golint ) -var _ = Describe("unordered lists - draft", func() { +var _ = Describe("unordered lists", func() { - Context("valid content", func() { + Context("draft document", func() { + Context("valid content", func() { - It("unordered list with a basic single item", func() { - source := `* a list item` - expected := types.DraftDocument{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a list item"}, + It("unordered list with a basic single item", func() { + source := `* a list item` + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a list item"}, + }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("unordered list with ID, title, role and a single item", func() { - source := `.mytitle + It("unordered list with ID, title, role and a single item", func() { + source := `.mytitle [#listID] [.myrole] * a list item` - expected := types.DraftDocument{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{ - types.AttrTitle: "mytitle", - types.AttrID: "listID", - types.AttrCustomID: true, - types.AttrRole: "myrole", - }, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a list item"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{ + types.AttrTitle: "mytitle", + types.AttrID: "listID", + types.AttrCustomID: true, + types.AttrRole: "myrole", + }, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + 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 + } + 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{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{ - types.AttrTitle: "a title", - }, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a list item"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{ + types.AttrTitle: "a title", + }, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a list item"}, + }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("unordered list with 2 items with stars", func() { - source := `* a first item + It("unordered list with 2 items with stars", func() { + source := `* a first item * a second item with *bold content*` - expected := types.DraftDocument{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first item"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a first item"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second item with "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a second item with "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold content"}, + }, }, }, }, @@ -140,13 +142,12 @@ var _ = Describe("unordered lists - draft", func() { }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("unordered list based on article.adoc (with heading spaces)", func() { - source := `.Unordered list title + 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 @@ -155,179 +156,180 @@ var _ = Describe("unordered lists - draft", func() { *** nested nested list item B.1 *** nested nested list item B.2 * list item 2` - expected := types.DraftDocument{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{ - types.AttrTitle: "Unordered list title", - }, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "list item 1"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{ + types.AttrTitle: "Unordered list title", + }, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "list item 1"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested list item A"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "nested list item A"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item A.1"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "nested nested list item A.1"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item A.2"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "nested nested list item A.2"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested list item B"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "nested list item B"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item B.1"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "nested nested list item B.1"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item B.2"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "nested nested list item B.2"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "list item 2"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "list item 2"}, + }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + 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{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first item"}, + It("unordered list with 2 items with carets", func() { + source := "- a first item\n" + + "- a second item with *bold content*" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a first item"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second item with "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a second item with "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold content"}, + }, }, }, }, @@ -335,143 +337,143 @@ var _ = Describe("unordered lists - draft", func() { }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("unordered list with items with mixed styles", func() { - source := `- a parent item + 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{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a parent item"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a parent item"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a child item"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a child item"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "another parent item"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "another parent item"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "another child item"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "another child item"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "with a sub child item"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "with a sub child item"}, + }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + 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{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first item"}, + 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{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a first item"}, + }, }, }, }, }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second item with "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, + types.BlankLine{}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a second item with "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold content"}, + }, }, }, }, @@ -479,107 +481,106 @@ var _ = Describe("unordered lists - draft", func() { }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) - It("unordered list with 2 items on multiple lines", func() { - source := `* item 1 + } + 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{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, - { - types.StringElement{Content: " on 2 lines."}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1"}, + }, + { + types.StringElement{Content: " on 2 lines."}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, - { - types.StringElement{Content: "on 2 lines, too."}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + 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 + } + 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{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "an item in the first list"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "an item in the first list"}, + }, }, }, }, }, - }, - types.BlankLine{}, - types.BlankLine{}, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "an item in the second list"}, + types.BlankLine{}, + types.BlankLine{}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + 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 - }) + } + 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 + It("unordered list with items on 3 levels", func() { + source := `* item 1 ** item 1.1 ** item 1.2 *** item 1.2.1 @@ -587,507 +588,507 @@ on 2 lines, too.` ** item 1.4 * item 2 ** item 2.1` - expected := types.DraftDocument{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.1"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.2"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2.1"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.2.1"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.3"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.3"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.4"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.4"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 2"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2.1"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 2.1"}, + }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("max level of unordered items - case 1", func() { - source := `.Unordered, max nesting + 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{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{ - types.AttrTitle: "Unordered, max nesting", - }, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{ + types.AttrTitle: "Unordered, max nesting", + }, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 1", + }, }, }, }, }, }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", + types.UnorderedListItem{ + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 2", + }, }, }, }, }, }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", + types.UnorderedListItem{ + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 3", + }, }, }, }, }, }, - }, - types.UnorderedListItem{ - Level: 4, - BulletStyle: types.FourAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", + types.UnorderedListItem{ + Level: 4, + BulletStyle: types.FourAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 4", + }, }, }, }, }, }, - }, - types.UnorderedListItem{ - Level: 5, - BulletStyle: types.FiveAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", + types.UnorderedListItem{ + Level: 5, + BulletStyle: types.FiveAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 5", + }, }, }, }, }, }, - }, - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", + types.UnorderedListItem{ + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 1", + }, }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("max level of unordered items - case 2", func() { - source := `.Unordered, max nesting + 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{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{ - types.AttrTitle: "Unordered, max nesting", - }, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{ + types.AttrTitle: "Unordered, max nesting", + }, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 1", + }, }, }, }, }, }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", + types.UnorderedListItem{ + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 2", + }, }, }, }, }, }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", + types.UnorderedListItem{ + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 3", + }, }, }, }, }, }, - }, - types.UnorderedListItem{Level: 4, - BulletStyle: types.FourAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", + types.UnorderedListItem{Level: 4, + BulletStyle: types.FourAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 4", + }, }, }, }, }, }, - }, - types.UnorderedListItem{ - Level: 5, - BulletStyle: types.FiveAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", + types.UnorderedListItem{ + Level: 5, + BulletStyle: types.FiveAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 5", + }, }, - }, - }, - }, - }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", + }, + }, + }, + }, + types.UnorderedListItem{ + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 2", + }, }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) }) - }) - Context("invalid content", func() { - It("unordered list with items on 2 levels - bad numbering", func() { - source := `* item 1 + 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{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.1"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1.1"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.1.1"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.2"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 2"}, + }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("invalid list item", func() { - source := "*an invalid list item" - expected := types.DraftDocument{ - Blocks: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "*an invalid list item"}, + It("invalid list item", func() { + source := "*an invalid list item" + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "*an invalid list item"}, + }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) }) - }) - Context("list item continuation", func() { + Context("list item continuation", func() { - It("unordered list with item continuation - case 1", func() { - source := `* foo + It("unordered list with item continuation - case 1", func() { + source := `* foo + ---- a delimited block @@ -1098,71 +1099,71 @@ another delimited block ---- * bar ` - expected := types.DraftDocument{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "foo"}, + }, }, }, }, }, - }, - types.ContinuedListItemElement{ - Offset: 0, - Element: types.DelimitedBlock{ - Attributes: types.ElementAttributes{}, - Kind: types.Listing, - Elements: []interface{}{ - types.VerbatimLine{ - Content: "a delimited block", + types.ContinuedListItemElement{ + Offset: 0, + Element: types.DelimitedBlock{ + Attributes: types.ElementAttributes{}, + Kind: types.Listing, + Elements: []interface{}{ + types.VerbatimLine{ + Content: "a delimited block", + }, }, }, }, - }, - types.ContinuedListItemElement{ - Offset: 0, - Element: types.DelimitedBlock{ - Attributes: types.ElementAttributes{}, - Kind: types.Listing, - Elements: []interface{}{ - types.VerbatimLine{ - Content: "another delimited block", + types.ContinuedListItemElement{ + Offset: 0, + Element: types.DelimitedBlock{ + Attributes: types.ElementAttributes{}, + Kind: types.Listing, + Elements: []interface{}{ + types.VerbatimLine{ + Content: "another delimited block", + }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "bar"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "bar"}, + }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("unordered list with item continuation - case 2", func() { - source := `.Unordered, complex + It("unordered list with item continuation - case 2", func() { + source := `.Unordered, complex * level 1 ** level 2 *** level 3 @@ -1175,150 +1176,150 @@ The {plus} symbol is on a new line. ***** level 5 ` - expected := types.DraftDocument{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{ - types.AttrTitle: "Unordered, complex", - }, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{ + types.AttrTitle: "Unordered, complex", + }, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 1", + }, }, }, }, }, }, - }, - types.UnorderedListItem{ - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", + types.UnorderedListItem{ + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 2", + }, }, }, }, }, }, - }, - types.UnorderedListItem{ - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", - }, - }, - { - types.StringElement{ - Content: "This is a new line inside an unordered list using ", + types.UnorderedListItem{ + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 3", + }, }, - types.DocumentAttributeSubstitution{ - Name: "plus", + { + types.StringElement{ + Content: "This is a new line inside an unordered list using ", + }, + types.DocumentAttributeSubstitution{ + Name: "plus", + }, + types.StringElement{ + Content: " symbol.", + }, }, - types.StringElement{ - Content: " symbol.", + { + types.StringElement{ + Content: "We can even force content to start on a separate line...", + }, + types.LineBreak{}, }, - }, - { - types.StringElement{ - Content: "We can even force content to start on a separate line...", + { + types.StringElement{ + Content: "Amazing, isn't it?", + }, }, - types.LineBreak{}, }, - { - types.StringElement{ - Content: "Amazing, isn't it?", + }, + }, + }, + types.UnorderedListItem{ + Level: 4, + BulletStyle: types.FourAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 4", + }, }, }, }, }, }, - }, - types.UnorderedListItem{ - Level: 4, - BulletStyle: types.FourAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ + // the `+` continuation produces the second paragraph below + types.ContinuedListItemElement{ + Offset: 0, + Element: types.Paragraph{ Attributes: types.ElementAttributes{}, Lines: [][]interface{}{ { types.StringElement{ - Content: "level 4", + Content: "The ", + }, + types.DocumentAttributeSubstitution{ + Name: "plus", + }, + types.StringElement{ + Content: " symbol is on a new line.", }, }, }, }, }, - }, - // the `+` continuation produces the second paragraph below - types.ContinuedListItemElement{ - Offset: 0, - Element: types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "The ", - }, - types.DocumentAttributeSubstitution{ - Name: "plus", - }, - types.StringElement{ - Content: " symbol is on a new line.", - }, - }, - }, - }, - }, - types.BlankLine{}, - types.UnorderedListItem{ - Level: 5, - BulletStyle: types.FiveAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", + types.BlankLine{}, + types.UnorderedListItem{ + Level: 5, + BulletStyle: types.FiveAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 5", + }, }, }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("unordered list without item continuation", func() { - source := `* foo + It("unordered list without item continuation", func() { + source := `* foo ---- a delimited block ---- @@ -1326,240 +1327,244 @@ a delimited block ---- another delimited block ----` - expected := types.DraftDocument{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "foo"}, + }, }, }, }, }, - }, - types.DelimitedBlock{ - Attributes: types.ElementAttributes{}, - Kind: types.Listing, - Elements: []interface{}{ - types.VerbatimLine{ - Content: "a delimited block", + types.DelimitedBlock{ + Attributes: types.ElementAttributes{}, + Kind: types.Listing, + Elements: []interface{}{ + types.VerbatimLine{ + Content: "a delimited block", + }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "bar"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "bar"}, + }, }, }, }, }, - }, - types.DelimitedBlock{ - Attributes: types.ElementAttributes{}, - Kind: types.Listing, - Elements: []interface{}{ - types.VerbatimLine{ - Content: "another delimited block", + types.DelimitedBlock{ + Attributes: types.ElementAttributes{}, + Kind: types.Listing, + Elements: []interface{}{ + types.VerbatimLine{ + Content: "another delimited block", + }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) }) - }) - Context("attach to ancestor", func() { + Context("attach to ancestor", func() { - It("attach to grandparent item", func() { - source := `* grand parent list item + It("attach to grandparent item", func() { + source := `* grand parent list item ** parent list item *** child list item + paragraph attached to grand parent list item` - expected := types.DraftDocument{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "grand parent list item"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "grand parent list item"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "parent list item"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "child list item"}, + }, }, }, }, }, - }, - types.ContinuedListItemElement{ - Offset: -2, - Element: types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to grand parent list item"}, + types.BlankLine{}, + types.BlankLine{}, + types.ContinuedListItemElement{ + Offset: 0, + Element: types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "paragraph attached to grand parent list item"}, + }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) - }) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) - It("attach to parent item", func() { - source := `* grandparent list item + 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{ - Blocks: []interface{}{ - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, + expected := types.DraftDocument{ + Blocks: []interface{}{ + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "grandparent list item"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "parent list item"}, + }, }, }, }, }, - }, - types.UnorderedListItem{ - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, + types.UnorderedListItem{ + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "child list item"}, + }, }, }, }, }, - }, - types.ContinuedListItemElement{ - Offset: -1, - Element: types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to parent list item"}, + types.BlankLine{}, + types.ContinuedListItemElement{ + Offset: 0, + Element: types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "paragraph attached to parent list item"}, + }, }, }, }, }, - }, - } - Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + } + Expect(ParseDraftDocument(source)).To(MatchDraftDocument(expected)) + }) }) }) -}) -var _ = Describe("unordered lists - document", func() { + Context("final document", func() { - Context("valid content", func() { + Context("valid content", func() { - It("unordered list with a basic single item", func() { - source := `* a list item` - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a list item"}, + It("unordered list with a basic single item", func() { + source := `* a list item` + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a list item"}, + }, }, }, }, @@ -1567,40 +1572,40 @@ var _ = Describe("unordered lists - document", func() { }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("unordered list with ID, title, role and a single item", func() { - source := `.mytitle + It("unordered list with ID, title, role and a single item", func() { + source := `.mytitle [#listID] [.myrole] * a list item` - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{ - types.AttrID: "listID", - types.AttrCustomID: true, - types.AttrTitle: "mytitle", - types.AttrRole: "myrole", - }, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a list item"}, + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{ + types.AttrID: "listID", + types.AttrCustomID: true, + types.AttrTitle: "mytitle", + types.AttrRole: "myrole", + }, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a list item"}, + }, }, }, }, @@ -1608,34 +1613,34 @@ var _ = Describe("unordered lists - document", func() { }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - It("unordered list with a title and a single item", func() { - source := `.a title + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) + It("unordered list with a title and a single item", func() { + source := `.a title * a list item` - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{ - types.AttrTitle: "a title", - }, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a list item"}, + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{ + types.AttrTitle: "a title", + }, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a list item"}, + }, }, }, }, @@ -1643,53 +1648,53 @@ var _ = Describe("unordered lists - document", func() { }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("unordered list with 2 items with stars", func() { - source := `* a first item + It("unordered list with 2 items with stars", func() { + source := `* a first item * a second item with *bold content*` - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first item"}, + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a first item"}, + }, }, }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second item with "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a second item with "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold content"}, + }, }, }, }, @@ -1699,13 +1704,12 @@ var _ = Describe("unordered lists - document", func() { }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("unordered list based on article.adoc (with heading spaces)", func() { - source := `.Unordered list title + 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 @@ -1714,77 +1718,78 @@ var _ = Describe("unordered lists - document", func() { *** nested nested list item B.1 *** nested nested list item B.2 * list item 2` - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{ - types.AttrTitle: "Unordered list title", - }, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "list item 1"}, - }, - }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested list item A"}, + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{ + types.AttrTitle: "Unordered list title", + }, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "list item 1"}, + }, + }, + }, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "nested list item A"}, + }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item A.1"}, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "nested nested list item A.1"}, + }, }, }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item A.2"}, + { + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "nested nested list item A.2"}, + }, }, }, }, @@ -1793,51 +1798,51 @@ var _ = Describe("unordered lists - document", func() { }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested list item B"}, + { + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "nested list item B"}, + }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item B.1"}, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "nested nested list item B.1"}, + }, }, }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "nested nested list item B.2"}, + { + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "nested nested list item B.2"}, + }, }, }, }, @@ -1850,18 +1855,18 @@ var _ = Describe("unordered lists - document", func() { }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "list item 2"}, + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "list item 2"}, + }, }, }, }, @@ -1869,53 +1874,53 @@ var _ = Describe("unordered lists - document", func() { }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("unordered list with 2 items with carets", func() { - source := "- a first item\n" + - "- a second item with *bold content*" - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first item"}, + It("unordered list with 2 items with carets", func() { + source := "- a first item\n" + + "- a second item with *bold content*" + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a first item"}, + }, }, }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second item with "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a second item with "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold content"}, + }, }, }, }, @@ -1925,53 +1930,53 @@ var _ = Describe("unordered lists - document", func() { }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("unordered list with items with mixed styles", func() { - source := `- a parent item + 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.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a parent item"}, - }, - }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a child item"}, + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a parent item"}, + }, + }, + }, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a child item"}, + }, }, }, }, @@ -1980,52 +1985,52 @@ var _ = Describe("unordered lists - document", func() { }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.Dash, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "another parent item"}, - }, - }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "another child item"}, + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.Dash, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "another parent item"}, + }, + }, + }, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "another child item"}, + }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "with a sub child item"}, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "with a sub child item"}, + }, }, }, }, @@ -2041,55 +2046,55 @@ var _ = Describe("unordered lists - document", func() { }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + 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 - source := "* a first item\n" + - "\n" + - "* a second item with *bold content*" - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a first item"}, + 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.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a first item"}, + }, }, }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "a second item with "}, - types.QuotedText{ - Kind: types.Bold, - Elements: []interface{}{ - types.StringElement{Content: "bold content"}, + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "a second item with "}, + types.QuotedText{ + Kind: types.Bold, + Elements: []interface{}{ + types.StringElement{Content: "bold content"}, + }, }, }, }, @@ -2099,56 +2104,56 @@ var _ = Describe("unordered lists - document", func() { }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) - It("unordered list with 2 items on multiple lines", func() { - source := `* item 1 + } + Expect(ParseDocument(source)).To(MatchDocument(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.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, - { - types.StringElement{Content: " on 2 lines."}, + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1"}, + }, + { + types.StringElement{Content: " on 2 lines."}, + }, }, }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, - { - types.StringElement{Content: "on 2 lines, too."}, + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 2"}, + }, + { + types.StringElement{Content: "on 2 lines, too."}, + }, }, }, }, @@ -2156,51 +2161,51 @@ 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) - source := "* an item in the first list\n" + - "\n" + - "\n" + - "* an item in the second list" - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "an item in the first list"}, + } + 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) + source := "* an item in the first list\n" + + "\n" + + "\n" + + "* an item in the second list" + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "an item in the first list"}, + }, }, }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "an item in the second list"}, + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "an item in the second list"}, + }, }, }, }, @@ -2208,13 +2213,12 @@ on 2 lines, too.` }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) // parse the whole document to get 2 lists - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) // parse the whole document to get 2 lists + }) - It("unordered list with items on 3 levels", func() { - source := `* item 1 + It("unordered list with items on 3 levels", func() { + source := `* item 1 ** item 1.1 ** item 1.2 *** item 1.2.1 @@ -2222,75 +2226,76 @@ on 2 lines, too.` ** item 1.4 * item 2 ** item 2.1` - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, - }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1"}, + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1"}, + }, + }, + }, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.1"}, + }, }, }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2"}, + { + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.2"}, + }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2.1"}, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.2.1"}, + }, }, }, }, @@ -2299,34 +2304,34 @@ on 2 lines, too.` }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.3"}, + { + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.3"}, + }, }, }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.4"}, + { + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.4"}, + }, }, }, }, @@ -2335,35 +2340,35 @@ on 2 lines, too.` }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, - }, - }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2.1"}, + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 2"}, + }, + }, + }, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 2.1"}, + }, }, }, }, @@ -2375,117 +2380,117 @@ on 2 lines, too.` }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("max level of unordered items - case 1", func() { - source := `.Unordered, max nesting + 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.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{ - types.AttrTitle: "Unordered, max nesting", - }, - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{ + types.AttrTitle: "Unordered, max nesting", + }, + Items: []types.UnorderedListItem{ + { + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 1", + }, }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 2", + }, }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 3", + }, }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Level: 4, - BulletStyle: types.FourAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Level: 4, + BulletStyle: types.FourAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 4", + }, }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Level: 5, - BulletStyle: types.FiveAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Level: 5, + BulletStyle: types.FiveAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 5", + }, }, }, }, @@ -2507,19 +2512,19 @@ on 2 lines, too.` }, }, }, - }, - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", + { + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 1", + }, }, }, }, @@ -2528,117 +2533,117 @@ on 2 lines, too.` }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("max level of unordered items - case 2", func() { - source := `.Unordered, max nesting + 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.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{ - types.AttrTitle: "Unordered, max nesting", - }, - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{ + types.AttrTitle: "Unordered, max nesting", + }, + Items: []types.UnorderedListItem{ + { + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 1", + }, }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 2", + }, }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 3", + }, }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Level: 4, - BulletStyle: types.FourAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Level: 4, + BulletStyle: types.FourAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 4", + }, }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Level: 5, - BulletStyle: types.FiveAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Level: 5, + BulletStyle: types.FiveAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 5", + }, }, }, }, @@ -2656,19 +2661,19 @@ on 2 lines, too.` }, }, }, - }, - { - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", + { + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 2", + }, }, }, }, @@ -2681,32 +2686,32 @@ on 2 lines, too.` }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("unordered list item with predefined attribute", func() { - source := `* {amp}` - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Attributes: map[string]interface{}{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "&"}, + It("unordered list item with predefined attribute", func() { + source := `* {amp}` + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Attributes: map[string]interface{}{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "&"}, + }, }, }, }, @@ -2714,72 +2719,72 @@ on 2 lines, too.` }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) }) - }) - Context("invalid content", func() { - It("unordered list with items on 2 levels - bad numbering", func() { - source := `* item 1 + 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.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1"}, - }, - }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1"}, + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1"}, + }, + }, + }, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.1"}, + }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.1.1"}, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.1.1"}, + }, }, }, }, @@ -2788,18 +2793,18 @@ on 2 lines, too.` }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 1.2"}, + { + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 1.2"}, + }, }, }, }, @@ -2808,18 +2813,18 @@ on 2 lines, too.` }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "item 2"}, + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "item 2"}, + }, }, }, }, @@ -2827,36 +2832,35 @@ on 2 lines, too.` }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("invalid list item", func() { - source := "*an invalid list item" - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "*an invalid list item"}, + It("invalid list item", func() { + source := "*an invalid list item" + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "*an invalid list item"}, + }, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) }) - }) - Context("list item continuation", func() { + Context("list item continuation", func() { - It("unordered list with item continuation - case 1", func() { - source := `* foo + It("unordered list with item continuation - case 1", func() { + source := `* foo + ---- a delimited block @@ -2867,59 +2871,60 @@ another delimited block ---- * bar ` - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "foo"}, + }, }, }, - }, - types.DelimitedBlock{ - Attributes: types.ElementAttributes{}, - Kind: types.Listing, - Elements: []interface{}{ - types.VerbatimLine{ - Content: "a delimited block", + types.DelimitedBlock{ + Attributes: types.ElementAttributes{}, + Kind: types.Listing, + Elements: []interface{}{ + types.VerbatimLine{ + Content: "a delimited block", + }, }, }, - }, - types.DelimitedBlock{ - Attributes: types.ElementAttributes{}, - Kind: types.Listing, - Elements: []interface{}{ - types.VerbatimLine{ - Content: "another delimited block", + types.DelimitedBlock{ + Attributes: types.ElementAttributes{}, + Kind: types.Listing, + Elements: []interface{}{ + types.VerbatimLine{ + Content: "another delimited block", + }, }, }, }, }, - }, - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "bar"}, + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "bar"}, + }, }, }, }, @@ -2927,13 +2932,12 @@ another delimited block }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("unordered list with item continuation - case 2", func() { - source := `.Unordered, complex + It("unordered list with item continuation - case 2", func() { + source := `.Unordered, complex * level 1 ** level 2 *** level 3 @@ -2946,132 +2950,133 @@ The {plus} symbol is on a new line. ***** level 5 ` - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{ - types.AttrTitle: "Unordered, complex", - }, - Items: []types.UnorderedListItem{ - { - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 1", + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{ + types.AttrTitle: "Unordered, complex", + }, + Items: []types.UnorderedListItem{ + { + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 1", + }, }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 2", + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 2", + }, }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 3", + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 3", + }, }, - }, - { - types.StringElement{ - Content: "This is a new line inside an unordered list using + symbol.", + { + types.StringElement{ + Content: "This is a new line inside an unordered list using + symbol.", + }, }, - }, - { - types.StringElement{ - Content: "We can even force content to start on a separate line...", + { + types.StringElement{ + Content: "We can even force content to start on a separate line...", + }, + types.LineBreak{}, }, - types.LineBreak{}, - }, - { - types.StringElement{ - Content: "Amazing, isn't it?", + { + types.StringElement{ + Content: "Amazing, isn't it?", + }, }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Level: 4, - BulletStyle: types.FourAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 4", + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Level: 4, + BulletStyle: types.FourAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 4", + }, }, }, }, - }, - // the `+` continuation produces the second paragrap below - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "The + symbol is on a new line.", + // the `+` continuation produces the second paragrap below + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "The + symbol is on a new line.", + }, }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Level: 5, - BulletStyle: types.FiveAsterisks, - CheckStyle: types.NoCheck, - Attributes: types.ElementAttributes{}, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{ - Content: "level 5", + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Level: 5, + BulletStyle: types.FiveAsterisks, + CheckStyle: types.NoCheck, + Attributes: types.ElementAttributes{}, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{ + Content: "level 5", + }, }, }, }, @@ -3096,13 +3101,12 @@ The {plus} symbol is on a new line. }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("unordered list without item continuation", func() { - source := `* foo + It("unordered list without item continuation", func() { + source := `* foo ---- a delimited block ---- @@ -3110,140 +3114,141 @@ a delimited block ---- another delimited block ----` - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "foo"}, + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "foo"}, + }, }, }, }, }, }, }, - }, - types.DelimitedBlock{ - Attributes: types.ElementAttributes{}, - Kind: types.Listing, - Elements: []interface{}{ - types.VerbatimLine{ - Content: "a delimited block", + types.DelimitedBlock{ + Attributes: types.ElementAttributes{}, + Kind: types.Listing, + Elements: []interface{}{ + types.VerbatimLine{ + Content: "a delimited block", + }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "bar"}, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "bar"}, + }, }, }, }, }, }, }, - }, - types.DelimitedBlock{ - Attributes: types.ElementAttributes{}, - Kind: types.Listing, - Elements: []interface{}{ - types.VerbatimLine{ - Content: "another delimited block", + types.DelimitedBlock{ + Attributes: types.ElementAttributes{}, + Kind: types.Listing, + Elements: []interface{}{ + types.VerbatimLine{ + Content: "another delimited block", + }, }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) }) - }) - Context("attach to ancestor", func() { + Context("attach to ancestor", func() { - It("attach to grandparent item", func() { - source := `* grand parent list item + It("attach to grandparent item", func() { + source := `* grand parent list item ** parent list item *** child list item + paragraph attached to grand parent list item` - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "grand parent list item"}, - }, - }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "grand parent list item"}, + }, + }, + }, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "parent list item"}, + }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "child list item"}, + }, }, }, }, @@ -3254,12 +3259,12 @@ paragraph attached to grand parent list item` }, }, }, - }, - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to grand parent list item"}, + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "paragraph attached to grand parent list item"}, + }, }, }, }, @@ -3267,83 +3272,83 @@ paragraph attached to grand parent list item` }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) - }) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) - It("attach to parent item", func() { - source := `* grandparent list item + It("attach to parent item", func() { + source := `* grandparent list item ** parent list item *** child list item + paragraph attached to parent list item` - expected := types.Document{ - Attributes: types.DocumentAttributes{}, - ElementReferences: types.ElementReferences{}, - Footnotes: []types.Footnote{}, - Elements: []interface{}{ - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 1, - BulletStyle: types.OneAsterisk, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "grandparent list item"}, - }, - }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 2, - BulletStyle: types.TwoAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "parent list item"}, + expected := types.Document{ + Attributes: types.DocumentAttributes{}, + ElementReferences: types.ElementReferences{}, + Footnotes: []types.Footnote{}, + Elements: []interface{}{ + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 1, + BulletStyle: types.OneAsterisk, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "grandparent list item"}, + }, + }, + }, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 2, + BulletStyle: types.TwoAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "parent list item"}, + }, }, }, - }, - types.UnorderedList{ - Attributes: types.ElementAttributes{}, - Items: []types.UnorderedListItem{ - { - Attributes: types.ElementAttributes{}, - Level: 3, - BulletStyle: types.ThreeAsterisks, - CheckStyle: types.NoCheck, - Elements: []interface{}{ - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "child list item"}, + types.UnorderedList{ + Attributes: types.ElementAttributes{}, + Items: []types.UnorderedListItem{ + { + Attributes: types.ElementAttributes{}, + Level: 3, + BulletStyle: types.ThreeAsterisks, + CheckStyle: types.NoCheck, + Elements: []interface{}{ + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "child list item"}, + }, }, }, }, }, }, }, - }, - types.Paragraph{ - Attributes: types.ElementAttributes{}, - Lines: [][]interface{}{ - { - types.StringElement{Content: "paragraph attached to parent list item"}, + types.Paragraph{ + Attributes: types.ElementAttributes{}, + Lines: [][]interface{}{ + { + types.StringElement{Content: "paragraph attached to parent list item"}, + }, }, }, }, @@ -3355,9 +3360,9 @@ paragraph attached to parent list item` }, }, }, - }, - } - Expect(ParseDocument(source)).To(MatchDocument(expected)) + } + Expect(ParseDocument(source)).To(MatchDocument(expected)) + }) }) }) }) diff --git a/pkg/renderer/html5/comment_test.go b/pkg/renderer/html5/comment_test.go index ceaedbf6..44486b2c 100644 --- a/pkg/renderer/html5/comment_test.go +++ b/pkg/renderer/html5/comment_test.go @@ -50,10 +50,12 @@ with multiple lines It("comment block with paragraphs around", func() { source := `a first paragraph + //// a *comment* block with multiple lines //// + a second paragraph` expected := `

a first paragraph

diff --git a/pkg/renderer/html5/delimited_block_test.go b/pkg/renderer/html5/delimited_block_test.go index 9c9dabd8..14023533 100644 --- a/pkg/renderer/html5/delimited_block_test.go +++ b/pkg/renderer/html5/delimited_block_test.go @@ -831,6 +831,7 @@ some *verse* content .title for sidebar **** some *verse* content + ---- foo bar diff --git a/pkg/renderer/html5/image.go b/pkg/renderer/html5/image.go index c9e4b3aa..35ab1ea7 100644 --- a/pkg/renderer/html5/image.go +++ b/pkg/renderer/html5/image.go @@ -2,7 +2,7 @@ package html5 import ( "bytes" - "fmt" + "strconv" texttemplate "text/template" "github.com/bytesparadise/libasciidoc/pkg/renderer" @@ -35,7 +35,8 @@ func renderImageBlock(ctx renderer.Context, img types.ImageBlock) ([]byte, error result := bytes.NewBuffer(nil) title := "" if t := img.Attributes.GetAsString(types.AttrTitle); t != "" { - title = fmt.Sprintf("Figure %d. %s", ctx.GetAndIncrementImageCounter(), EscapeString(t)) + // title = fmt.Sprintf("Figure %d. %s", ctx.GetAndIncrementImageCounter(), EscapeString(t)) + title = "Figure " + strconv.Itoa(ctx.GetAndIncrementImageCounter()) + ". " + EscapeString(t) } err := blockImageTmpl.Execute(result, struct { ID string diff --git a/pkg/renderer/html5/inline_elements.go b/pkg/renderer/html5/inline_elements.go index 15c11092..4685976a 100644 --- a/pkg/renderer/html5/inline_elements.go +++ b/pkg/renderer/html5/inline_elements.go @@ -16,6 +16,7 @@ type linesRenderer struct { type renderLinesOption func(config *linesRenderer) +// TODO: is it used? func verbatim() renderLinesOption { return func(config *linesRenderer) { config.render = renderPlainText diff --git a/pkg/renderer/html5/labeled_list_test.go b/pkg/renderer/html5/labeled_list_test.go index 4a974f55..b1a0c51b 100644 --- a/pkg/renderer/html5/labeled_list_test.go +++ b/pkg/renderer/html5/labeled_list_test.go @@ -484,7 +484,7 @@ Item 3 description` It("q and a with title", func() { source := `.Q&A [qanda] -What is libsciidoc?:: +What is libasciidoc?:: An implementation of the AsciiDoc processor in Golang. What is the answer to the Ultimate Question?:: 42` @@ -492,7 +492,7 @@ What is the answer to the Ultimate Question?:: 42`
Q&A
  1. -

    What is libsciidoc?

    +

    What is libasciidoc?

    An implementation of the AsciiDoc processor in Golang.

  2. diff --git a/pkg/renderer/html5/link.go b/pkg/renderer/html5/link.go index a2fa445f..64c5bd3a 100644 --- a/pkg/renderer/html5/link.go +++ b/pkg/renderer/html5/link.go @@ -23,11 +23,21 @@ func renderLink(ctx renderer.Context, l types.InlineLink) ([]byte, error) { //no var text []byte class := "" var err error - if t, ok := l.Attributes[types.AttrInlineLinkText].([]interface{}); ok { - text, err = renderInlineElements(ctx, t) - if err != nil { - return nil, errors.Wrapf(err, "unable to render external link") + // TODO; support `mailto:` positional attributes + positionals := l.Attributes.Positionals() + if len(positionals) > 0 { + buf := bytes.NewBuffer(nil) + for i, arg := range positionals { + t, err := renderInlineElements(ctx, arg) + if err != nil { + return nil, errors.Wrapf(err, "unable to render external link") + } + buf.Write(t) + if i < len(positionals)-1 { + buf.WriteString(",") + } } + text = buf.Bytes() } else { class = "bare" text = []byte(location) diff --git a/pkg/renderer/html5/link_test.go b/pkg/renderer/html5/link_test.go index 8db2acd8..eb5024f9 100644 --- a/pkg/renderer/html5/link_test.go +++ b/pkg/renderer/html5/link_test.go @@ -28,7 +28,7 @@ var _ = Describe("links", func() { Expect(RenderHTML(source)).To(MatchHTML(expected)) }) - It("external link with text having comma", func() { + It("external link with unquoted text having comma", func() { source := "https://foo.com[A, B, and C]" expected := `

    A, B, and C

    @@ -36,6 +36,22 @@ var _ = Describe("links", func() { Expect(RenderHTML(source)).To(MatchHTML(expected)) }) + // It("email link with unquoted text having comma", func() { + // source := "mailto:foo@example.com[A, B, and C]" + // expected := `
    + //

    A

    + //
    ` + // Expect(RenderHTML(source)).To(MatchHTML(expected)) + // }) + + It("email link with quoted text having comma", func() { + source := `mailto:foo@example.com["A, B, and C"]` + expected := `` + Expect(RenderHTML(source)).To(MatchHTML(expected)) + }) + It("external link inside a multiline paragraph", func() { source := `a http://website.com and more text on the diff --git a/pkg/renderer/html5/table_of_contents_test.go b/pkg/renderer/html5/table_of_contents_test.go index 226e643d..9c88c339 100644 --- a/pkg/renderer/html5/table_of_contents_test.go +++ b/pkg/renderer/html5/table_of_contents_test.go @@ -225,9 +225,10 @@ var _ = Describe("table of contents initialization", func() { types.StringElement{Content: "Section A with link to "}, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://redhat.com", + Content: "redhat.com", }, }, }, diff --git a/pkg/types/element_attributes.go b/pkg/types/element_attributes.go index 6811c744..bbe77b19 100644 --- a/pkg/types/element_attributes.go +++ b/pkg/types/element_attributes.go @@ -3,6 +3,7 @@ package types import ( "fmt" "path/filepath" + "strconv" "strings" "github.com/pkg/errors" @@ -214,7 +215,9 @@ func (a ElementAttributes) NilSafeSet(key string, value interface{}) { // GetAsString returns the value of the key as a string, or empty string if the key did not exist func (a ElementAttributes) GetAsString(key string) string { - if v, ok := a[key]; ok { + if v, ok := a[key].(string); ok { + return v + } else if v, ok := a[key]; ok { return fmt.Sprintf("%v", v) } return "" @@ -251,6 +254,21 @@ func (a ElementAttributes) AddNonEmpty(key string, value interface{}) { a[key] = value } +// Positionals returns all positional attributes, ie, the values for the keys in the form of `positional-` +func (a ElementAttributes) Positionals() [][]interface{} { + result := make([][]interface{}, 0, len(a)) + i := 0 + for { + i++ + if arg, ok := a["positional-"+strconv.Itoa(i)].([]interface{}); ok { + result = append(result, arg) + continue + } + break + } + return result +} + // NewElementAttributes retrieves the ElementID, ElementTitle and ElementInlineLink from the given slice of attributes func NewElementAttributes(attributes []interface{}) ElementAttributes { attrs := ElementAttributes{} diff --git a/pkg/types/non_alphanumeric_replacement_test.go b/pkg/types/non_alphanumeric_replacement_test.go index 162a7428..e673f2e5 100644 --- a/pkg/types/non_alphanumeric_replacement_test.go +++ b/pkg/types/non_alphanumeric_replacement_test.go @@ -65,9 +65,10 @@ var _ = Describe("normalizing string", func() { types.InlineLink{ Attributes: types.ElementAttributes{}, Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, diff --git a/pkg/types/types.go b/pkg/types/types.go index 3ad425ff..986ff73b 100644 --- a/pkg/types/types.go +++ b/pkg/types/types.go @@ -615,10 +615,10 @@ type ContinuedListItemElement struct { } // NewContinuedListItemElement returns a wrapper for an element which should be attached to a list item (same level or an ancestor) -func NewContinuedListItemElement(offset int, element interface{}) (ContinuedListItemElement, error) { +func NewContinuedListItemElement(element interface{}) (ContinuedListItemElement, error) { // log.Debugf("initializing a new continued list element for element of type %T", element) return ContinuedListItemElement{ - Offset: offset, + Offset: 0, Element: element, }, nil } @@ -1117,9 +1117,7 @@ const ( // NewInlineElements initializes a new `InlineElements` from the given values func NewInlineElements(elements ...interface{}) ([]interface{}, error) { - result := Merge(elements...) - return result, nil - + return Merge(elements...), nil } // ------------------------------------------ @@ -1154,7 +1152,7 @@ type ExternalCrossReference struct { // NewExternalCrossReference initializes a new `InternalCrossReference` from the given ID func NewExternalCrossReference(location Location, attributes ElementAttributes) (ExternalCrossReference, error) { var label []interface{} - if l, ok := attributes[AttrInlineLinkText].([]interface{}); ok { + if l, ok := attributes["positional-1"].([]interface{}); ok { label = l } log.Debugf("initializing a new ExternalCrossReference with Location=%v and label='%s' (attrs=%v / %T)", location, label, attributes, attributes[AttrInlineLinkText]) @@ -1387,9 +1385,10 @@ func NewDelimitedBlock(kind BlockKind, elements []interface{}, attributes interf if attributes, ok := attributes.(ElementAttributes); ok { attrs.AddAll(attributes) } - if k := attrs.GetAsString(AttrKind); k != "" { // override default kind - // log.Debugf("overriding kind '%s' to '%s'", b.Kind, attributes[AttrKind]) - kind = BlockKind(k) + log.Debugf("attributes: %v -> '%s'", attrs, attrs.GetAsString(AttrKind)) + if k, found := attrs[AttrKind].(BlockKind); found { // override default kind + log.Debugf("overriding kind '%s' to '%s'", kind, k) + kind = k } return DelimitedBlock{ Attributes: attrs, @@ -1726,21 +1725,24 @@ func NewInlineLink(url Location, attrs interface{}) (InlineLink, error) { } // AttrInlineLinkText the link `text` attribute -const AttrInlineLinkText string = "text" +const AttrInlineLinkText string = "positional-1" -// NewInlineLinkAttributes returns a map of link attributes, some of which have implicit keys (`text`) -func NewInlineLinkAttributes(text interface{}, otherattrs []interface{}) (ElementAttributes, error) { +// NewInlineLinkAttributes returns a map of link attributes +func NewInlineLinkAttributes(attributes []interface{}) (ElementAttributes, error) { + log.Debugf("new inline link attributes: %v", attributes) result := ElementAttributes{} - if text, ok := text.([]interface{}); ok { - result[AttrInlineLinkText] = text - } - for _, otherAttr := range otherattrs { - if otherAttr, ok := otherAttr.(ElementAttributes); ok { - for k, v := range otherAttr { + for i, attr := range attributes { + log.Debugf("new inline link attribute: '%[1]v' (%[1]T)", attr) + switch attr := attr.(type) { + case ElementAttributes: + for k, v := range attr { result[k] = v } + case []interface{}: + result["positional-"+strconv.Itoa(i+1)] = attr } } + log.Debugf("new inline link attributes: %v", result) return result, nil } @@ -2026,15 +2028,21 @@ func NewIncludedFileEndTag(tag string) (IncludedFileEndTag, error) { // Location a Location contains characters and optionaly, document attributes type Location struct { - Elements []interface{} + Scheme string + Path []interface{} } // NewLocation return a new location with the given elements -func NewLocation(elements []interface{}) (Location, error) { - elements = Merge(elements) - // log.Debugf("new location: %+v", elements) +func NewLocation(scheme interface{}, path []interface{}) (Location, error) { + path = Merge(path) + // log.Debugf("new location: '%[1]s' (%[1]T) '%+[2]v", scheme, path) + s := "" + if scheme, ok := scheme.([]byte); ok { + s = string(scheme) + } return Location{ - Elements: elements, + Scheme: s, + Path: path, }, nil } @@ -2044,8 +2052,13 @@ func NewLocation(elements []interface{}) (Location, error) { // returns the resolved attribute func (l Location) String() string { // (attrs map[string]string) string { result := bytes.NewBuffer(nil) - for _, e := range l.Elements { - result.WriteString(fmt.Sprintf("%s", e)) + result.WriteString(l.Scheme) + for _, e := range l.Path { + if s, ok := e.(string); ok { + result.WriteString(s) // no need to use `fmt.Sprintf` for elements of type 'string' + } else { + result.WriteString(fmt.Sprintf("%s", e)) + } } return result.String() } @@ -2058,7 +2071,7 @@ const imagesdir = "imagesdir" // returns `true` if some document attribute substitution occurred func (l *Location) Resolve(attrs DocumentAttributesWithOverrides) Location { content := bytes.NewBuffer(nil) - for _, e := range l.Elements { + for _, e := range l.Path { switch e := e.(type) { case DocumentAttributeSubstitution: if value, found := attrs.GetAsString(e.Name); found { @@ -2069,11 +2082,15 @@ func (l *Location) Resolve(attrs DocumentAttributesWithOverrides) Location { content.WriteRune('}') } default: - content.WriteString(fmt.Sprintf("%s", e)) + if s, ok := e.(string); ok { + content.WriteString(s) // no need to use `fmt.Sprintf` for elements of type 'string' + } else { + content.WriteString(fmt.Sprintf("%s", e)) + } } } location := content.String() - if !strings.HasPrefix(location, "/") { + if l.Scheme == "" && !strings.HasPrefix(location, "/") { if u, err := url.Parse(location); err == nil { if !u.IsAbs() { if imagesdir, ok := attrs.GetAsString(imagesdir); ok { @@ -2083,7 +2100,8 @@ func (l *Location) Resolve(attrs DocumentAttributesWithOverrides) Location { } } return Location{ - Elements: []interface{}{ + Scheme: l.Scheme, + Path: []interface{}{ StringElement{ Content: location, }, diff --git a/pkg/types/types_test.go b/pkg/types/types_test.go index 2f176c3c..4f732167 100644 --- a/pkg/types/types_test.go +++ b/pkg/types/types_test.go @@ -486,14 +486,14 @@ var _ = Describe("location resolution", func() { }, Entry("includes/file.ext", types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "includes/file.ext", }, }, }, types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "./images/includes/file.ext", }, @@ -503,7 +503,7 @@ var _ = Describe("location resolution", func() { ), Entry("./{includedir}/file.ext", types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "./", }, @@ -516,7 +516,7 @@ var _ = Describe("location resolution", func() { }, }, types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "./images/./includes/file.ext", }, @@ -526,7 +526,7 @@ var _ = Describe("location resolution", func() { ), Entry("./{unknown}/file.ext", types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "./", }, @@ -539,7 +539,7 @@ var _ = Describe("location resolution", func() { }, }, types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "./images/./{unknown}/file.ext", }, @@ -549,16 +549,18 @@ var _ = Describe("location resolution", func() { ), Entry("https://foo.bar", types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.bar", + Content: "foo.bar", }, }, }, @@ -566,14 +568,14 @@ var _ = Describe("location resolution", func() { ), Entry("/foo/bar", types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "/foo/bar", }, }, }, types.Location{ - Elements: []interface{}{ + Path: []interface{}{ types.StringElement{ Content: "/foo/bar", }, @@ -750,9 +752,10 @@ var _ = Describe("element id resolution", func() { }, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.com", + Content: "foo.com", }, }, }, @@ -808,9 +811,10 @@ var _ = Describe("element id resolution", func() { }, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.com", + Content: "foo.com", }, }, }, @@ -874,9 +878,10 @@ var _ = Describe("element id resolution", func() { }, types.InlineLink{ Location: types.Location{ - Elements: []interface{}{ + Scheme: "https://", + Path: []interface{}{ types.StringElement{ - Content: "https://foo.com", + Content: "foo.com", }, }, }, diff --git a/test/bench/attributes.adoc b/test/bench/attributes.adoc new file mode 100644 index 00000000..a9e57481 --- /dev/null +++ b/test/bench/attributes.adoc @@ -0,0 +1,3 @@ +:idprefix: +:idseparator: - +:icons: font diff --git a/test/bench/kafka-streams.adoc b/test/bench/kafka-streams.adoc new file mode 100644 index 00000000..ba4129f2 --- /dev/null +++ b/test/bench/kafka-streams.adoc @@ -0,0 +1,1224 @@ +//// +This guide is maintained in the main Quarkus repository +and pull requests should be submitted there: +https://github.com/quarkusio/quarkus/tree/master/docs/src/main/asciidoc +//// += Quarkus - Using Apache Kafka Streams + +include::./attributes.adoc[] + +This guide demonstrates how your Quarkus application can utilize the Apache Kafka Streams API to implement stream processing applications based on Apache Kafka. + +== Prerequisites + +To complete this guide, you need: + +* less than 30 minutes +* an IDE +* JDK 1.8+ installed with `JAVA_HOME` configured appropriately +* Apache Maven {maven-version} +* Docker Compose to start an Apache Kafka development cluster +* GraalVM installed if you want to run in native mode. + +It is recommended, that you have read the {quickstarts-tree-url}/kafka-quickstart[Kafka quickstart] before. + +[NOTE] +==== +The Quarkus extension for Kafka Streams allows for very fast turnaround times during development by supporting the Quarkus Dev Mode (e.g. via `./mvnw compile quarkus:dev`). +After changing the code of your Kafka Streams topology, the application will automatically be reloaded when the next input message arrives. + +A recommended development set-up is to have some producer which creates test messages on the processed topic(s) in fixed intervals, e.g. every second and observe the streaming application's output topic(s) using a tool such as `kafkacat`. +Using the dev mode, you'll instantly see messages on the output topic(s) as produced by the latest version of your streaming application when saving. + +For the best development experience, we recommend applying the following configuration settings to your Kafka broker: + +[source, subs=attributes+] +---- +group.min.session.timeout.ms=250 +---- + +Also specify the following settings in your Quarkus `application.properties`: + +[source, subs=attributes+] +---- +kafka-streams.consumer.session.timeout.ms=250 +kafka-streams.consumer.heartbeat.interval.ms=200 +---- + +Together, these settings will ensure that the application can very quickly reconnect to the broker after being restarted in dev mode. +==== + +== Architecture + +In this guide, we are going to generate (random) temperature values in one component (named `generator`). +These values are associated to given weather stations and are written in a Kafka topic (`temperature-values`). +Another topic (`weather-stations`) contains just the master data about the weather stations themselves (id and name). + +A second component (`aggregator`) reads from the two Kafka topics and processes them in a streaming pipeline: + +* the two topics are joined on weather station id +* per weather station the min, max and average temperature is determined +* this aggregated data is written out to a third topic (`temperatures-aggregated`) + +The data can be examined by inspecting the output topic. +By exposing a Kafka Streams https://kafka.apache.org/22/documentation/streams/developer-guide/interactive-queries.html[interactive query], +the latest result for each weather station can alternatively be obtained via a simple REST query. + +The overall architecture looks like so: + +image::kafka-streams-guide-architecture.png[alt=Architecture] + +== Solution + +We recommend that you follow the instructions in the next sections and create the application step by step. +However, you can go right to the completed example. + +Clone the Git repository: `git clone {quickstarts-clone-url}`, or download an {quickstarts-archive-url}[archive]. + +The solution is located in the `kafka-streams-quickstart` {quickstarts-tree-url}/kafka-streams-quickstart[directory]. + +== Creating the Producer Maven Project + +First, we need a new project with the temperature value producer. +Create a new project with the following command: + +[source, subs=attributes+] +---- +mkdir producer && cd producer && \ +mvn io.quarkus:quarkus-maven-plugin:{quarkus-version}:create \ + -DprojectGroupId=org.acme \ + -DprojectArtifactId=kafka-streams-quickstart-producer \ + -Dextensions="kafka" \ + && cd .. +---- + +This command generates a Maven project, importing the Reactive Messaging and Kafka connector extensions. + +=== The Temperature Value Producer + +Create the `producer/src/main/java/org/acme/kafka/streams/producer/generator/ValuesGenerator.java` file, +with the following content: + +[source, java] +---- +package org.acme.kafka.streams.producer.generator; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.time.Instant; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Random; +import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; + +import javax.enterprise.context.ApplicationScoped; + +import org.eclipse.microprofile.reactive.messaging.Outgoing; +import org.jboss.logging.Logger; + +import io.reactivex.Flowable; +import io.smallrye.reactive.messaging.kafka.KafkaRecord; + +/** + * A bean producing random temperature data every second. + * The values are written to a Kafka topic (temperature-values). + * Another topic contains the name of weather stations (weather-stations). + * The Kafka configuration is specified in the application configuration. + */ +@ApplicationScoped +public class ValuesGenerator { + + private static final Logger LOG = Logger.getLogger(ValuesGenerator.class); + + private Random random = new Random(); + + private List stations = Collections.unmodifiableList( + Arrays.asList( + new WeatherStation(1, "Hamburg", 13), + new WeatherStation(2, "Snowdonia", 5), + new WeatherStation(3, "Boston", 11), + new WeatherStation(4, "Tokio", 16), + new WeatherStation(5, "Cusco", 12), + new WeatherStation(6, "Svalbard", -7), + new WeatherStation(7, "Porthsmouth", 11), + new WeatherStation(8, "Oslo", 7), + new WeatherStation(9, "Marrakesh", 20) + )); + + + @Outgoing("temperature-values") // <1> + public Flowable> generate() { + + return Flowable.interval(500, TimeUnit.MILLISECONDS) // <2> + .onBackpressureDrop() + .map(tick -> { + WeatherStation station = stations.get(random.nextInt(stations.size())); + double temperature = BigDecimal.valueOf(random.nextGaussian() * 15 + station.averageTemperature) + .setScale(1, RoundingMode.HALF_UP) + .doubleValue(); + + LOG.infov("station: {0}, temperature: {1}", station.name, temperature); + return KafkaRecord.of(station.id, Instant.now() + ";" + temperature); + }); + } + + @Outgoing("weather-stations") // <3> + public Flowable> weatherStations() { + List> stationsAsJson = stations.stream() + .map(s -> KafkaRecord.of( + s.id, + "{ \"id\" : " + s.id + + ", \"name\" : \"" + s.name + "\" }")) + .collect(Collectors.toList()); + + return Flowable.fromIterable(stationsAsJson); + }; + + private static class WeatherStation { + + int id; + String name; + int averageTemperature; + + public WeatherStation(int id, String name, int averageTemperature) { + this.id = id; + this.name = name; + this.averageTemperature = averageTemperature; + } + } +} +---- +<1> Instruct Reactive Messaging to dispatch the items from the returned `Flowable` to `temperature-values`. +<2> The method returns a RX Java 2 _stream_ (`Flowable`) emitting a random temperature value every 0.5 seconds. +<3> Instruct Reactive Messaging to dispatch the items from the returned `Flowable` (static list of weather stations) to `weather-stations`. + +The two methods each return a _reactive stream_ whose items are sent to the streams named `temperature-values` and `weather-stations`, respectively. + +=== Topic Configuration + +The two channels are mapped to Kafka topics using the Quarkus configuration file `application.properties`. +For that, add the following to the file `producer/src/main/resources/application.properties`: + +[source] +---- +# Configure the Kafka broker location +kafka.bootstrap.servers=localhost:9092 + +mp.messaging.outgoing.temperature-values.connector=smallrye-kafka +mp.messaging.outgoing.temperature-values.key.serializer=org.apache.kafka.common.serialization.IntegerSerializer +mp.messaging.outgoing.temperature-values.value.serializer=org.apache.kafka.common.serialization.StringSerializer + +mp.messaging.outgoing.weather-stations.connector=smallrye-kafka +mp.messaging.outgoing.weather-stations.key.serializer=org.apache.kafka.common.serialization.IntegerSerializer +mp.messaging.outgoing.weather-stations.value.serializer=org.apache.kafka.common.serialization.StringSerializer +---- + +This configures the Kafka bootstrap server, the two topics and the corresponding (de-)serializers. +More details about the different configuration options are available on the https://kafka.apache.org/documentation/#producerconfigs[Producer configuration] and https://kafka.apache.org/documentation/#consumerconfigs[Consumer configuration] section from the Kafka documentation. + +== Creating the Aggregator Maven Project + +With the producer application in place, it's time to implement the actual aggregator application, +which will run the Kafka Streams pipeline. +Create another project like so: + +[source, subs=attributes+] +---- +mkdir aggregator && cd aggregator && \ +mvn io.quarkus:quarkus-maven-plugin:{quarkus-version}:create \ + -DprojectGroupId=org.acme \ + -DprojectArtifactId=kafka-streams-quickstart-aggregator \ + -Dextensions="kafka-streams,resteasy-jsonb" \ + && cd .. +---- + +This creates the `aggregator` project with the Quarkus extension for Kafka Streams and with RESTEasy support for JSON-B. + +=== The Pipeline Implementation + +Let's begin the implementation of the stream processing application by creating +a few value objects for representing temperature measurements, weather stations and for keeping track of aggregated values. + +First, create the file `aggregator/src/main/java/org/acme/kafka/streams/aggregator/model/WeatherStation.java`, +representing a weather station, with the following content: + +[source, java] +---- +package org.acme.kafka.streams.aggregator.model; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection // <1> +public class WeatherStation { + + public int id; + public String name; +} +---- +<1> By adding the `@RegisterForReflection` annotation, it is ensured that this type can be instantiated reflectively when running the application in native mode. + +Then the file `aggregator/src/main/java/org/acme/kafka/streams/aggregator/model/TemperatureMeasurement.java`, +representing temperature measurements for a given station: + +[source, java] +---- +package org.acme.kafka.streams.aggregator.model; + +import java.time.Instant; + +public class TemperatureMeasurement { + + public int stationId; + public String stationName; + public Instant timestamp; + public double value; + + public TemperatureMeasurement(int stationId, String stationName, Instant timestamp, + double value) { + this.stationId = stationId; + this.stationName = stationName; + this.timestamp = timestamp; + this.value = value; + } +} +---- + +And finally `aggregator/src/main/java/org/acme/kafka/streams/aggregator/model/Aggregation.java`, +which will be used to keep track of the aggregated values while the events are processed in the streaming pipeline: + +[source, java] +---- +package org.acme.kafka.streams.aggregator.model; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection +public class Aggregation { + + public int stationId; + public String stationName; + public double min = Double.MAX_VALUE; + public double max = Double.MIN_VALUE; + public int count; + public double sum; + public double avg; + + public Aggregation updateFrom(TemperatureMeasurement measurement) { + stationId = measurement.stationId; + stationName = measurement.stationName; + + count++; + sum += measurement.value; + avg = BigDecimal.valueOf(sum / count) + .setScale(1, RoundingMode.HALF_UP).doubleValue(); + + min = Math.min(min, measurement.value); + max = Math.max(max, measurement.value); + + return this; + } +} +---- + +Next, let's create the actual streaming query implementation itself in the `aggregator/src/main/java/org/acme/kafka/streams/aggregator/streams/TopologyProducer.java` file. +All we need to do for that is to declare a CDI producer method which returns the Kafka Streams `Topology`; +the Quarkus extension will take care of configuring, starting and stopping the actual Kafka Streams engine. + +[source, java] +---- +package org.acme.kafka.streams.aggregator.streams; + +import java.time.Instant; + +import javax.enterprise.context.ApplicationScoped; +import javax.enterprise.inject.Produces; + +import org.acme.kafka.streams.aggregator.model.Aggregation; +import org.acme.kafka.streams.aggregator.model.TemperatureMeasurement; +import org.acme.kafka.streams.aggregator.model.WeatherStation; +import org.apache.kafka.common.serialization.Serdes; +import org.apache.kafka.streams.StreamsBuilder; +import org.apache.kafka.streams.Topology; +import org.apache.kafka.streams.kstream.Consumed; +import org.apache.kafka.streams.kstream.GlobalKTable; +import org.apache.kafka.streams.kstream.Materialized; +import org.apache.kafka.streams.kstream.Produced; +import org.apache.kafka.streams.state.KeyValueBytesStoreSupplier; +import org.apache.kafka.streams.state.Stores; + +import io.quarkus.kafka.client.serialization.JsonbSerde; + +@ApplicationScoped +public class TopologyProducer { + + static final String WEATHER_STATIONS_STORE = "weather-stations-store"; + + private static final String WEATHER_STATIONS_TOPIC = "weather-stations"; + private static final String TEMPERATURE_VALUES_TOPIC = "temperature-values"; + private static final String TEMPERATURES_AGGREGATED_TOPIC = "temperatures-aggregated"; + + @Produces + public Topology buildTopology() { + StreamsBuilder builder = new StreamsBuilder(); + + JsonbSerde weatherStationSerde = new JsonbSerde<>( + WeatherStation.class); + JsonbSerde aggregationSerde = new JsonbSerde<>(Aggregation.class); + + KeyValueBytesStoreSupplier storeSupplier = Stores.persistentKeyValueStore( + WEATHER_STATIONS_STORE); + + GlobalKTable stations = builder.globalTable( // <1> + WEATHER_STATIONS_TOPIC, + Consumed.with(Serdes.Integer(), weatherStationSerde)); + + builder.stream( // <2> + TEMPERATURE_VALUES_TOPIC, + Consumed.with(Serdes.Integer(), Serdes.String()) + ) + .join( // <3> + stations, + (stationId, timestampAndValue) -> stationId, + (timestampAndValue, station) -> { + String[] parts = timestampAndValue.split(";"); + return new TemperatureMeasurement(station.id, station.name, + Instant.parse(parts[0]), Double.valueOf(parts[1])); + } + ) + .groupByKey() // <4> + .aggregate( // <5> + Aggregation::new, + (stationId, value, aggregation) -> aggregation.updateFrom(value), + Materialized. as(storeSupplier) + .withKeySerde(Serdes.Integer()) + .withValueSerde(aggregationSerde) + ) + .toStream() + .to( // <6> + TEMPERATURES_AGGREGATED_TOPIC, + Produced.with(Serdes.Integer(), aggregationSerde) + ); + + return builder.build(); + } +} +---- +<1> The `weather-stations` table is read into a `GlobalKTable`, representing the current state of each weather station +<2> The `temperature-values` topic is read into a `KStream`; whenever a new message arrives to this topic, the pipeline will be processed for this measurement +<3> The message from the `temperature-values` topic is joined with the corresponding weather station, using the topic's key (weather station id); the join result contains the data from the measurement and associated weather station message +<4> The values are grouped by message key (the weather station id) +<5> Within each group, all the measurements of that station are aggregated, by keeping track of minimum and maximum values and calculating the average value of all measurements of that station (see the `Aggregation` type) +<6> The results of the pipeline are written out to the `temperatures-aggregated` topic + +The Kafka Streams extension is configured via the Quarkus configuration file `application.properties`. +Create the file `aggregator/src/main/resources/application.properties` with the following contents: + +[source] +---- +quarkus.kafka-streams.bootstrap-servers=localhost:9092 +quarkus.kafka-streams.application-id=temperature-aggregator +quarkus.kafka-streams.application-server=${hostname}:8080 +quarkus.kafka-streams.topics=weather-stations,temperature-values + +# pass-through options +kafka-streams.cache.max.bytes.buffering=10240 +kafka-streams.commit.interval.ms=1000 +kafka-streams.metadata.max.age.ms=500 +kafka-streams.auto.offset.reset=earliest +kafka-streams.metrics.recording.level=DEBUG +---- + +The options with the `quarkus.kafka-streams` prefix can be changed dynamically at application startup, +e.g. via environment variables or system properties. +`bootstrap-servers`, `application-id` and `application-server` are mapped to the Kafka Streams properties `bootstrap.servers`, `application.id` and `application.server`, respectively. +`topics` is specific to Quarkus: the application will wait for all the given topics to exist before launching the Kafka Streams engine. +This is to done to gracefully await the creation of topics that don't yet exist at application startup time. + +All the properties within the `kafka-streams` namespace are passed through as-is to the Kafka Streams engine. +Changing their values requires a rebuild of the application. + +== Building and Running the Applications + +We now can build the `producer` and `aggregator` applications: + +[source, subs=attributes+] +---- +./mvnw clean package -f producer/pom.xml +./mvnw clean package -f aggregator/pom.xml +---- + +Instead of running them directly on the host machine using the Quarkus dev mode, +we're going to package them into container images and launch them via Docker Compose. +This is done in order to demonstrate scaling the `aggregator` aggregation to multiple nodes later on. + +The `Dockerfile` created by Quarkus by default needs one adjustment for the `aggregator` application in order to run the Kafka Streams pipeline. +To do so, edit the file `aggregator/src/main/docker/Dockerfile.jvm` and replace the line `FROM fabric8/java-alpine-openjdk8-jre` with `FROM fabric8/java-centos-openjdk8-jdk`. + +Next create a Docker Compose file (`docker-compose.yaml`) for spinning up the two applications as well as Apache Kafka and ZooKeeper like so: + +[source, yaml] +---- +version: '3.5' + +services: + zookeeper: + image: strimzi/kafka:0.11.3-kafka-2.1.0 + command: [ + "sh", "-c", + "bin/zookeeper-server-start.sh config/zookeeper.properties" + ] + ports: + - "2181:2181" + environment: + LOG_DIR: /tmp/logs + networks: + - kafkastreams-network + kafka: + image: strimzi/kafka:0.11.3-kafka-2.1.0 + command: [ + "sh", "-c", + "bin/kafka-server-start.sh config/server.properties --override listeners=$${KAFKA_LISTENERS} --override advertised.listeners=$${KAFKA_ADVERTISED_LISTENERS} --override zookeeper.connect=$${KAFKA_ZOOKEEPER_CONNECT} --override num.partitions=$${KAFKA_NUM_PARTITIONS}" + ] + depends_on: + - zookeeper + ports: + - "9092:9092" + environment: + LOG_DIR: "/tmp/logs" + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 + KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_NUM_PARTITIONS: 3 + networks: + - kafkastreams-network + + producer: + image: quarkus-quickstarts/kafka-streams-producer:1.0 + build: + context: producer + dockerfile: src/main/docker/Dockerfile.${QUARKUS_MODE:-jvm} + environment: + KAFKA_BOOTSTRAP_SERVERS: kafka:9092 + networks: + - kafkastreams-network + + aggregator: + image: quarkus-quickstarts/kafka-streams-aggregator:1.0 + build: + context: aggregator + dockerfile: src/main/docker/Dockerfile.${QUARKUS_MODE:-jvm} + environment: + QUARKUS_KAFKA_STREAMS_BOOTSTRAP_SERVERS: kafka:9092 + networks: + - kafkastreams-network + +networks: + kafkastreams-network: + name: ks +---- + +To launch all the containers, building the `producer` and `aggregator` container images, +run `docker-compose up --build`. + +You should see log statements from the `producer` application about messages being sent to the "temperature-values" topic. + +Now run an instance of the _debezium/tooling_ image, attaching to the same network all the other containers run in. +This image provides several useful tools such as _kafkacat_ and _httpie_: + +[source, subs=attributes+] +---- +docker run --tty --rm -i --network ks debezium/tooling:1.0 +---- + +Within the tooling container, run _kafkacat_ to examine the results of the streaming pipeline: + +[source, subs=attributes+] +---- +kafkacat -b kafka:9092 -C -o beginning -q -t temperatures-aggregated + +{"avg":34.7,"count":4,"max":49.4,"min":16.8,"stationId":9,"stationName":"Marrakesh","sum":138.8} +{"avg":15.7,"count":1,"max":15.7,"min":15.7,"stationId":2,"stationName":"Snowdonia","sum":15.7} +{"avg":12.8,"count":7,"max":25.5,"min":-13.8,"stationId":7,"stationName":"Porthsmouth","sum":89.7} +... +---- + +You should see new values arrive as the producer continues to emit temperature measurements, +each value on the outbound topic showing the mininum, maxium and average temperature values of the represented weather station. + +== Interactive Queries + +Subscribing to the `temperatures-aggregated` topic is a great way to react to any new temperature values. +It's a bit wasteful though if you're just interested in the latest aggregated value for a given weather station. +This is where Kafka Streams interactive queries shine: +they let you directly query the underlying state store of the pipeline for the value associated to a given key. +By exposing a simple REST endpoint which queries the state store, +the latest aggregation result can be retrieved without having to subscribe to any Kafka topic. + +Let's begin by creating a new class `InteractiveQueries` in the file `aggregator/src/main/java/org/acme/kafka/streams/aggregator/streams/InteractiveQueries.java`: + +one more method to the `KafkaStreamsPipeline` class which obtains the current state for a given key: + +[source, java] +---- +package org.acme.kafka.streams.aggregator.streams; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; + +import org.acme.kafka.streams.aggregator.model.Aggregation; +import org.acme.kafka.streams.aggregator.model.WeatherStationData; +import org.apache.kafka.streams.KafkaStreams; +import org.apache.kafka.streams.errors.InvalidStateStoreException; +import org.apache.kafka.streams.state.QueryableStoreTypes; +import org.apache.kafka.streams.state.ReadOnlyKeyValueStore; + +@ApplicationScoped +public class InteractiveQueries { + + @Inject + KafkaStreams streams; + + public GetWeatherStationDataResult getWeatherStationData(int id) { + Aggregation result = getWeatherStationStore().get(id); + + if (result != null) { + return GetWeatherStationDataResult.found(WeatherStationData.from(result)); // <1> + } + else { + return GetWeatherStationDataResult.notFound(); // <2> + } + } + + private ReadOnlyKeyValueStore getWeatherStationStore() { + while (true) { + try { + return streams.store(TopologyProducer.WEATHER_STATIONS_STORE, QueryableStoreTypes.keyValueStore()); + } catch (InvalidStateStoreException e) { + // ignore, store not ready yet + } + } + } +} +---- +<1> A value for the given station id was found, so that value will be returned +<2> No value was found, either because a non-existing station was queried or no measurement exists yet for the given station + +Also create the method's return type in the file `aggregator/src/main/java/org/acme/kafka/streams/aggregator/streams/GetWeatherStationDataResult.java`: + +[source, java] +---- +package org.acme.kafka.streams.aggregator.streams; + +import java.util.Optional; +import java.util.OptionalInt; + +import org.acme.kafka.streams.aggregator.model.WeatherStationData; + +public class GetWeatherStationDataResult { + + private static GetWeatherStationDataResult NOT_FOUND = + new GetWeatherStationDataResult(null); + + private final WeatherStationData result; + + private GetWeatherStationDataResult(WeatherStationData result) { + this.result = result; + } + + public static GetWeatherStationDataResult found(WeatherStationData data) { + return new GetWeatherStationDataResult(data); + } + + public static GetWeatherStationDataResult notFound() { + return NOT_FOUND; + } + + public Optional getResult() { + return Optional.ofNullable(result); + } +} +---- + +Also create `aggregator/src/main/java/org/acme/kafka/streams/aggregator/model/WeatherStationData.java`, +which represents the actual aggregation result for a weather station: + +[source, java] +---- +package org.acme.kafka.streams.aggregator.model; + +import io.quarkus.runtime.annotations.RegisterForReflection; + +@RegisterForReflection +public class WeatherStationData { + + public int stationId; + public String stationName; + public double min = Double.MAX_VALUE; + public double max = Double.MIN_VALUE; + public int count; + public double avg; + + private WeatherStationData(int stationId, String stationName, double min, double max, + int count, double avg) { + this.stationId = stationId; + this.stationName = stationName; + this.min = min; + this.max = max; + this.count = count; + this.avg = avg; + } + + public static WeatherStationData from(Aggregation aggregation) { + return new WeatherStationData( + aggregation.stationId, + aggregation.stationName, + aggregation.min, + aggregation.max, + aggregation.count, + aggregation.avg); + } +} +---- + +We now can add a simple REST endpoint (`aggregator/src/main/java/org/acme/kafka/streams/aggregator/rest/WeatherStationEndpoint.java`), +which invokes `getWeatherStationData()` and returns the data to the client: + +[source, java] +---- +package org.acme.kafka.streams.aggregator.rest; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; + +import org.acme.kafka.streams.aggregator.streams.GetWeatherStationDataResult; +import org.acme.kafka.streams.aggregator.streams.KafkaStreamsPipeline; + +@ApplicationScoped +@Path("/weather-stations") +public class WeatherStationEndpoint { + + @Inject + InteractiveQueries interactiveQueries; + + @GET + @Path("/data/{id}") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public Response getWeatherStationData(@PathParam("id") int id) { + GetWeatherStationDataResult result = interactiveQueries.getWeatherStationData(id); + + if (result.getResult().isPresent()) { // <1> + return Response.ok(result.getResult().get()).build(); + } + else { + return Response.status(Status.NOT_FOUND.getStatusCode(), + "No data found for weather station " + id).build(); + } + } +} +---- +<1> Depending on whether a value was obtained, either return that value or a 404 response + +With this code in place, it's time to rebuild the application and the `aggregator` service in Docker Compose: + +[source, subs=attributes+] +---- +./mvnw clean package -f aggregator/pom.xml +docker-compose stop aggregator +docker-compose up --build -d +---- + +This will rebuild the `aggregator` container and restart its service. +Once that's done, you can invoke the service's REST API to obtain the temperature data for one of the existing stations. +To do so, you can use `httpie` in the tooling container launched before: + +[source, subs=attributes+] +---- +http aggregator:8080/weather-stations/data/1 + +HTTP/1.1 200 OK +Connection: keep-alive +Content-Length: 85 +Content-Type: application/json +Date: Tue, 18 Jun 2019 19:29:16 GMT + +{ + "avg": 12.9, + "count": 146, + "max": 41.0, + "min": -25.6, + "stationId": 1, + "stationName": "Hamburg" +} +---- + +== Scaling Out + +A very interesting trait of Kafka Streams applications is that they can be scaled out, +i.e. the load and state can be distributed amongst multiple application instances running the same pipeline. +Each node will then contain a subset of the aggregation results, +but Kafka Streams provides you with https://kafka.apache.org/22/documentation/streams/developer-guide/interactive-queries.html#querying-remote-state-stores-for-the-entire-app[an API] to obtain the information which node is hosting a given key. +The application can then either fetch the data directly from the other instance, or simply point the client to the location of that other node. + +Launching multiple instances of the `aggregator` application will make look the overall architecture like so: + +image::kafka-streams-guide-architecture-distributed.png[alt=Architecture with multiple aggregator nodes] + +The `InteractiveQueries` class must be adjusted slightly for this distributed architecture: + +[source, java] +---- +public GetWeatherStationDataResult getWeatherStationData(int id) { + StreamsMetadata metadata = streams.metadataForKey( // <1> + TopologyProducer.WEATHER_STATIONS_STORE, + id, + Serdes.Integer().serializer() + ); + + if (metadata == null || metadata == StreamsMetadata.NOT_AVAILABLE) { + LOG.warn("Found no metadata for key {}", id); + return GetWeatherStationDataResult.notFound(); + } + else if (metadata.host().equals(host)) { // <2> + LOG.info("Found data for key {} locally", id); + Aggregation result = getWeatherStationStore().get(id); + + if (result != null) { + return GetWeatherStationDataResult.found(WeatherStationData.from(result)); + } + else { + return GetWeatherStationDataResult.notFound(); + } + } + else { // <3> + LOG.info( + "Found data for key {} on remote host {}:{}", + id, + metadata.host(), + metadata.port() + ); + return GetWeatherStationDataResult.foundRemotely(metadata.host(), metadata.port()); + } +} + +public List getMetaData() { // <4> + return streams.allMetadataForStore(TopologyProducer.WEATHER_STATIONS_STORE) + .stream() + .map(m -> new PipelineMetadata( + m.hostInfo().host() + ":" + m.hostInfo().port(), + m.topicPartitions() + .stream() + .map(TopicPartition::toString) + .collect(Collectors.toSet())) + ) + .collect(Collectors.toList()); +} +---- +<1> The streams metadata for the given weather station id is obtained +<2> The given key (weather station id) is maintained by the local application node, i.e. it can answer the query itself +<3> The given key is maintained by another application node; in this case the information about that node (host and port) will be returned +<4> The `getMetaData()` method is added to provide callers with a list of all the nodes in the application cluster. + +The `GetWeatherStationDataResult` type must be adjusted accordingly: + +[source, java] +---- +package org.acme.kafka.streams.aggregator.streams; + +import java.util.Optional; +import java.util.OptionalInt; + +import org.acme.kafka.streams.aggregator.model.WeatherStationData; + +public class GetWeatherStationDataResult { + + private static GetWeatherStationDataResult NOT_FOUND = + new GetWeatherStationDataResult(null, null, null); + + private final WeatherStationData result; + private final String host; + private final Integer port; + + private GetWeatherStationDataResult(WeatherStationData result, String host, + Integer port) { + this.result = result; + this.host = host; + this.port = port; + } + + public static GetWeatherStationDataResult found(WeatherStationData data) { + return new GetWeatherStationDataResult(data, null, null); + } + + public static GetWeatherStationDataResult foundRemotely(String host, int port) { + return new GetWeatherStationDataResult(null, host, port); + } + + public static GetWeatherStationDataResult notFound() { + return NOT_FOUND; + } + + public Optional getResult() { + return Optional.ofNullable(result); + } + + public Optional getHost() { + return Optional.ofNullable(host); + } + + public OptionalInt getPort() { + return port != null ? OptionalInt.of(port) : OptionalInt.empty(); + } +} +---- + +Also the return type for `getMetaData()` must be defined +(`aggregator/src/main/java/org/acme/kafka/streams/aggregator/streams/PipelineMetadata.java`): + +[source, java] +---- +package org.acme.kafka.streams.aggregator.streams; + +import java.util.Set; + +public class PipelineMetadata { + + public String host; + public Set partitions; + + public PipelineMetadata(String host, Set partitions) { + this.host = host; + this.partitions = partitions; + } +} +---- + +Lastly, the REST endpoint class must be updated: + +[source, java] +---- +package org.acme.kafka.streams.aggregator.rest; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; + +import javax.enterprise.context.ApplicationScoped; +import javax.inject.Inject; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status; + +import org.acme.kafka.streams.aggregator.streams.GetWeatherStationDataResult; +import org.acme.kafka.streams.aggregator.streams.KafkaStreamsPipeline; +import org.acme.kafka.streams.aggregator.streams.PipelineMetadata; + +@ApplicationScoped +@Path("/weather-stations") +public class WeatherStationEndpoint { + + @Inject + InteractiveQueries interactiveQueries; + + @GET + @Path("/data/{id}") + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public Response getWeatherStationData(@PathParam("id") int id) { + GetWeatherStationDataResult result = interactiveQueries.getWeatherStationData(id); + + if (result.getResult().isPresent()) { // <1> + return Response.ok(result.getResult().get()).build(); + } + else if (result.getHost().isPresent()) { // <2> + URI otherUri = getOtherUri(result.getHost().get(), result.getPort().getAsInt(), + id); + return Response.seeOther(otherUri).build(); + } + else { // <3> + return Response.status(Status.NOT_FOUND.getStatusCode(), + "No data found for weather station " + id).build(); + } + } + + @GET + @Path("/meta-data") + @Produces(MediaType.APPLICATION_JSON) + public List getMetaData() { // <4> + return interactiveQueries.getMetaData(); + } + + private URI getOtherUri(String host, int port, int id) { + try { + return new URI("http://" + host + ":" + port + "/weather-stations/data/" + id); + } + catch (URISyntaxException e) { + throw new RuntimeException(e); + } + } +} +---- +<1> The data was found locally, so return it +<2> The data is maintained by another node, so reply with a redirect (HTTP status code 303) if the data for the given key is stored on one of the other nodes. +<3> No data was found for the given weather station id +<4> Exposes information about all the hosts forming the application cluster + +Now stop the `aggregator` service again and rebuild it. +Then let's spin up three instances of it: + +[source, subs=attributes+] +---- +./mvnw clean package -f aggregator/pom.xml +docker-compose stop aggregator +docker-compose up --build -d --scale aggregator=3 +---- + +When invoking the REST API on any of the three instances, it might either be +that the aggregation for the requested weather station id is stored locally on the node receiving the query, +or it could be stored on one of the other two nodes. + +As the load balancer of Docker Compose will distribute requests to the `aggregator` service in a round-robin fashion, +we'll invoke the actual nodes directly. +The application exposes information about all the host names via REST: + +[source, subs=attributes+] +---- +http aggregator:8080/weather-stations/meta-data + +HTTP/1.1 200 OK +Connection: keep-alive +Content-Length: 202 +Content-Type: application/json +Date: Tue, 18 Jun 2019 20:00:23 GMT + +[ + { + "host": "2af13fe516a9:8080", + "partitions": [ + "temperature-values-2" + ] + }, + { + "host": "32cc8309611b:8080", + "partitions": [ + "temperature-values-1" + ] + }, + { + "host": "1eb39af8d587:8080", + "partitions": [ + "temperature-values-0" + ] + } +] +---- + +Retrieve the data from one of the three hosts shown in the response +(your actual host names will differ): + +[source, subs=attributes+] +---- +http 2af13fe516a9:8080/weather-stations/data/1 +---- + +If that node holds the data for key "1", you'll get a response like this: + +``` +HTTP/1.1 200 OK +Connection: keep-alive +Content-Length: 74 +Content-Type: application/json +Date: Tue, 11 Jun 2019 19:16:31 GMT + +{ + "avg": 11.9, + "count": 259, + "max": 50.0, + "min": -30.1, + "stationId": 1, + "stationName": "Hamburg" +} +``` + +Otherwise, the service will send a redirect: + +``` +HTTP/1.1 303 See Other +Connection: keep-alive +Content-Length: 0 +Date: Tue, 18 Jun 2019 20:01:03 GMT +Location: http://1eb39af8d587:8080/weather-stations/data/1 +``` + +You can also have _httpie_ automatically follow the redirect by passing the `--follow option`: + +```bash +http --follow 2af13fe516a9:8080/weather-stations/data/1 +``` + +== Running Natively + +The Quarkus extension for Kafka Streams enables the execution of stream processing applications +natively via GraalVM without further configuration. + +To run both the `producer` and `aggregator` applications in native mode, +the Maven builds can be executed using the `native` profile: + +[source, shell] +---- +./mvnw clean package -f producer/pom.xml -Pnative -Dnative-image.container-runtime=docker +./mvnw clean package -f aggregator/pom.xml -Pnative -Dnative-image.container-runtime=docker +---- + +Now create an environment variable named `QUARKUS_MODE` and with value set to "native": + +[source, shell] +---- +export QUARKUS_MODE=native +---- + +This is used by the Docker Compose file to use the correct `Dockerfile` when building the `producer` and `aggregator` images. +The Kafka Streams application can work with less than 50 MB RSS in native mode. +To do so, add the `Xmx` option to the program invocation in `aggregator/src/main/docker/Dockerfile.native`: + +[source, shell] +---- +CMD ["./application", "-Dquarkus.http.host=0.0.0.0", "-Xmx32m"] +---- + +Now start Docker Compose as described above +(don't forget to rebuild the container images). + +== Kafka Streams Health Checks + +If you are using the `quarkus-smallrye-health` extension, `quarkus-kafka-streams` will automatically add: + +* a readiness health check to validate that all topics declared in the `quarkus.kafka-streams.topics` property are created, +* a liveness health check based on the Kafka Streams state. + +So when you access the `/health` endpoint of your application you will have information about the state of the Kafka Streams and the available and/or missing topics. + +This is an example of when the status is `DOWN`: +[source, subs=attributes+] +---- +curl -i http://aggregator:8080/health + +HTTP/1.1 503 Service Unavailable +content-type: application/json; charset=UTF-8 +content-length: 454 + +{ + "status": "DOWN", + "checks": [ + { + "name": "Kafka Streams state health check", <1> + "status": "DOWN", + "data": { + "state": "CREATED" + } + }, + { + "name": "Kafka Streams topics health check", <2> + "status": "DOWN", + "data": { + "available_topics": "weather-stations,temperature-values", + "missing_topics": "hygrometry-values" + } + } + ] +} +---- +<1> Liveness health check. Also available at `/health/live` endpoint. +<2> Readiness health check. Also available at `/health/ready` endpoint. + +So as you can see, the status is `DOWN` as soon as one of the `quarkus.kafka-streams.topics` is missing or the Kafka Streams `state` is not `RUNNING`. + +If no topics are available, the `available_topics` key will not be present in the `data` field of the `Kafka Streams topics health check`. +As well as if no topics are missing, the `missing_topics` key will not be present in the `data` field of the `Kafka Streams topics health check`. + +You can of course disable the health check of the `quarkus-kafka-streams` extension by setting the `quarkus.kafka-streams.health.enabled` property to `false` in your `application.properties`. + +Obviously you can create your liveness and readiness probes based on the respective endpoints `/health/live` and `/health/ready`. + +=== Liveness health check + +Here is an example of the liveness check: +``` +curl -i http://aggregator:8080/health/live + +HTTP/1.1 503 Service Unavailable +content-type: application/json; charset=UTF-8 +content-length: 225 + +{ + "status": "DOWN", + "checks": [ + { + "name": "Kafka Streams state health check", + "status": "DOWN", + "data": { + "state": "CREATED" + } + } + ] +} +``` +The `state` is coming from the `KafkaStreams.State` enum. + +=== Readiness health check + +Here is an example of the readiness check: +``` +curl -i http://aggregator:8080/health/ready + +HTTP/1.1 503 Service Unavailable +content-type: application/json; charset=UTF-8 +content-length: 265 + +{ + "status": "DOWN", + "checks": [ + { + "name": "Kafka Streams topics health check", + "status": "DOWN", + "data": { + "missing_topics": "weather-stations,temperature-values" + } + } + ] +} + +``` + +== Going Further + +This guide has shown how you can build stream processing applications using Quarkus and the Kafka Streams APIs, +both in JVM and native modes. +For running your KStreams application in production, you could also add health checks and metrics for the data pipeline. +Refer to the Quarkus guides on link:microprofile-metrics[metrics] and link:microprofile-health[health checks] to learn more. + +== Configuration Reference + +include::{generated-dir}/config/quarkus-kafka-streams.adoc[opts=optional, leveloffset=+1]